• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Soooo trying to re-root my phone

So... Just an FYI, that's not the same script that I linked... quite awhile ago.

I'm willing to bet that it's horribly outdated.


I'd highly recommend using the one that I linked the other day, as it uses a slightly different method to obtain root than what you've posted here.

Ok... tried that one too. I will deconstruct it and report back
 
Ok... tried that one too. I will deconstruct it and report back

Code:
rich@rich ~ $ cd Spectrum-Freedom/
rich@rich ~/Spectrum-Freedom $ adb kill-server
rich@rich ~/Spectrum-Freedom $ adb wait-for-device
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
rich@rich ~/Spectrum-Freedom $ adb shell "rm /data/vpnch/vpnc_starter_lock && ln -s /data/local.prop /data/vpnch/vpnc_starter_lock"
rm failed for /data/vpnch/vpnc_starter_lock, No such file or directory

Here is the script:
Code:
#!/bin/bash
##########################################################################
##
##  LG Spectrum ICS root and unlocked bootloader
##  Linux/OSX version
##
##  ICS root by jcase
##
##  One-Click & CWM by PlayfulGod 
##
##  bootloader by Neph, jcase, death2all110
##
##  kernel by tdm
##
##  Copyright (c) 2012 Spectrumhackers
##
##########################################################################
echo off
clear
platform=`uname`
if [ $(uname -p) = 'powerpc' ]; then
        echo "[-] PowerPC is not supported."
        exit 1
fi

if [ "$platform" = 'Darwin' ]; then
        adb="Files/./adb.osx"
        version="OSX"
else
        adb="Files/./adb"
        version="Linux"
fi
chmod +x $adb

which adb > /dev/null 2>&1
if [ $? -eq 0 ]; then
        adb="Files/./adb"
fi

echo "[*] Unlocked Bootloader, root, and CWM"
echo "[*] for the LG Spectrum 4G ($version version)"        
echo "[*] One click and CWM by PlayfulGod"           
echo "[*] Exploit found by jcase"             
echo "[*] Unlock method discovered by Neph,"                  
echo "[*] jcase, and death2all110" 
echo "[*]"
echo "[*] Before continuing, ensure USB debugging is enabled,"
echo "[*] that your phone is connected via USB,"
echo "[*] and in Internet Connection mode."
echo "[*]"
echo "[*] Press enter to begin..."

read -n 1 -s

echo "[*]"
echo "[*] Waiting for device..."
$adb kill-server
$adb wait-for-device

echo "[*] Device found"

$adb shell "rm /data/vpnch/vpnc_starter_lock && ln -s /data/local.prop /data/vpnch/vpnc_starter_lock"

echo "[*] Rebooting..."
$adb reboot
echo "[*] Waiting for reboot..."
$adb wait-for-device

$adb shell "rm /data/vpnch/vpnc_starter_lock"
$adb shell "echo 'ro.kernel.qemu=1' > /data/local.prop"

echo "[*] Rebooting again..."
$adb reboot
echo "[*] Waiting for reboot..."
$adb wait-for-device

# Install the goods
echo "[*] Installing root tools... "
$adb shell "mount -o remount,rw /system"
$adb push Files/su /system/xbin/su
$adb shell "chmod 6755 /system/xbin/su"
$adb shell "ln -s /system/xbin/su /system/bin/su"
$adb push Files/Superuser.apk /system/app/Superuser.apk
$adb push Files/busybox /system/xbin/busybox
$adb shell "chmod 755 /system/xbin/busybox"
$adb shell "/system/xbin/busybox --install /system/xbin"

# Push files
echo "[*] Installing Bootloader and CWM"
$adb push images/cwmrecovery.img /data/local/tmp/cwmrecovery.img
$adb push images/mmcblk0p2.img /data/local/tmp/mmcblk0p2.img
$adb push images/mmcblk0p3.img /data/local/tmp/mmcblk0p3.img
$adb push images/mmcblk0p5.img /data/local/tmp/mmcblk0p5.img
$adb push images/mmcblk0p6.img /data/local/tmp/mmcblk0p6.img
$adb push images/mmcblk0p7.img /data/local/tmp/mmcblk0p7.img
$adb push images/mmcblk0p9.img /data/local/tmp/mmcblk0p9.img
$adb push images/boot_nowallpaper.img /data/local/tmp/boot_nowallpaper.img

## Flash boot chain

# p7
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/mmcblk0p7.img | busybox cut -d ' ' -f 1` != 528f925fcc6cb66d16260a6ac5410dc2 ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/mmcblk0p7.img of=/dev/block/mmcblk0p7 bs=4096"

# CWM Recovery
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/cwmrecovery.img | busybox cut -d ' ' -f 1` != 44a7e770d4decd7a44e6c3c23f1b928d ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/cwmrecovery.img of=/dev/block/mmcblk0p13 bs=4096"

# p2
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/mmcblk0p2.img | busybox cut -d ' ' -f 1` != 8d4575aebfd32c599ef505d9c2d518fb ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/mmcblk0p2.img of=/dev/block/mmcblk0p2 bs=4096"

# p3
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/mmcblk0p3.img | busybox cut -d ' ' -f 1` != db6c453eb6c69d9273daa97ff02a29a2 ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/mmcblk0p3.img of=/dev/block/mmcblk0p3 bs=4096"

# p5
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/mmcblk0p5.img | busybox cut -d ' ' -f 1` != 9b99629290e183c627e46795d352ec87 ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/mmcblk0p5.img of=/dev/block/mmcblk0p5 bs=4096"

# p6
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/mmcblk0p6.img | busybox cut -d ' ' -f 1` != 664cbefd609c8866b35f51f93a5e2d25 ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/mmcblk0p6.img of=/dev/block/mmcblk0p6 bs=4096"

# p9
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/mmcblk0p9.img | busybox cut -d ' ' -f 1` != b508eda5aa1eb658b2cf75587276dfda ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/mmcblk0p9.img of=/dev/block/mmcblk0p9 bs=4096"

# boot_nowallpaper
# check md5sum
if [ `$adb shell busybox md5sum /data/local/tmp/boot_nowallpaper.img | busybox cut -d ' ' -f 1` != 5e47b4574a752bfcc497bac660098cf6 ]
then
	echo "PROBLEM! MD5SUM of download and actual file do not match! Danger!"
	exit 3
fi

$adb shell "dd if=/data/local/tmp/boot_nowallpaper.img of=/dev/block/mmcblk0p8 bs=4096"

echo "[*] Removing Trash"
$adb shell "rm /data/local/tmp/cwmrecovery.img"
$adb shell "rm /data/local/tmp/mmcblk0p2.img"
$adb shell "rm /data/local/tmp/mmcblk0p3.img"
$adb shell "rm /data/local/tmp/mmcblk0p5.img"
$adb shell "rm /data/local/tmp/mmcblk0p6.img"
$adb shell "rm /data/local/tmp/mmcblk0p7.img"
$adb shell "rm /data/local/tmp/mmcblk0p9.img"
$adb shell "rm /data/local/tmp/boot_nowallpaper.img"
$adb shell "rm /system/etc/install-recovery.sh"
$adb shell "rm /system/etc/recovery-from-boot.p"
$adb shell "rm /system/etc/fota_post_boot_up.sh"
$adb shell "rm /data/local.prop"
$adb shell "rm /data/gpscfg/*"
$adb shell "chmod 771 /data/"

echo "[*] Finished!!"
echo
echo "[*] Rebooting!!"
$adb reboot
$adb wait-for-device
$adb kill-server

echo "[*] Press any key to exit."
read -n1 -r
exit
 
So... Just an FYI, that's not the same script that I linked... quite awhile ago.

I'm willing to bet that it's horribly outdated.


I'd highly recommend using the one that I linked the other day, as it uses a slightly different method to obtain root than what you've posted here.
Yoinx,

The ICS script won't work on GB as that exploited directory does not exist.

Sosaudio,

Can you open up an ADB shell and do the commands? Doing ADB shell "command" won't show the errors I need it to.
 
Yoinx,

The ICS script won't work on GB as that exploited directory does not exist.

Sosaudio,

Can you open up an ADB shell and do the commands? Doing ADB shell "command" won't show the errors I need it to.

That's part of the problem. What I don't get is if I call adb shell then su I get permission denied every time. If I start the adb session with sudo su and then start working with adb and then call adb shell, I get permission denied. It's as if it just ignores root requests altogether.

That's why I think there is some kind if permissions issue
 
That's part of the problem. What I don't get is if I call adb shell then su I get permission denied every time. If I start the adb session with sudo su and then start working with adb and then call adb shell, I get permission denied. It's as if it just ignores root requests altogether.

That's why I think there is some kind if permissions issue

Do you have to set the mode for usb on the phone to anything for it to work?

Sent from my VS920 4G using Tapatalk 2
 
As in debug mode?

Honestly, I can't recall. I thought it was like Internet mode or something with debugging enabled.

I may do a nandroid on my phone, then cab flash back to V6 and try to root it from linux (ubuntu though) just to see what's going on.
 
Honestly, I can't recall. I thought it was like Internet mode or something with debugging enabled.

I may do a nandroid on my phone, then cab flash back to V6 and try to root it from linux (ubuntu though) just to see what's going on.

That would be fun for you too lol. Yeah, you have to enable debugging, then the USB mode is internet via Ethernet not modem.

The way I did the process was to flash back using CWM since cab flashing was not an option.

Check some of my later posts and you will see where I went
 
Wait.

Now I'm confused as to exactly what you're trying to do....

If you have CWM, why not just flash SuperSU from CWM and be done with it?
 
Wait.

Now I'm confused as to exactly what you're trying to do....

If you have CWM, why not just flash SuperSU from CWM and be done with it?
He did the "return to stock with just CWM method." It replaces CWM recovery with the original stock recovery.
 
That would be fun for you too lol. Yeah, you have to enable debugging, then the USB mode is internet via Ethernet not modem.

The way I did the process was to flash back using CWM since cab flashing was not an option.

Check some of my later posts and you will see where I went
Sosaudio,

I really do need you to go step by step through adb shell. You'll never get SU rights as the stock rom you used does not include the SU file you need. I'm also seeing that your ln -s is failing on you, but I need to know why.

Your prompts should be something along this effect.

Open Terminal:
cd until you get to the directory you extracted spectrum_root_linux_osx into.

./adb.linux shell

"wait for it to find phone and open prompt and notice I did not use SU in the linux terminal"

"inside the shell"
rm /data/gpscfg/gps_env.conf 2>/dev/null

"make sure you get no error"

ln -s /data /data/gpscfg/gps_env.conf

"this is where you errored out last time. Make sure you get no error here as well"

exit
./adb.linux reboot
./adb.linux wait-for-device
./adb.linux shell
echo 'ro.kernel.gemu=1' > /data/local.prop

"make sure you don't get an error on this line from in the shell"

exit
./adb.linux reboot
./adb.linux wait-for-device
adb remount

"If you get no error at this point, you can now finish the rest of the script. If you get any errors up to this point, please post the full terminal log"
 
Sosaudio,

I really do need you to go step by step through adb shell. You'll never get SU rights as the stock rom you used does not include the SU file you need. I'm also seeing that your ln -s is failing on you, but I need to know why.

Your prompts should be something along this effect.

Open Terminal:
cd until you get to the directory you extracted spectrum_root_linux_osx into.

./adb.linux shell

"wait for it to find phone and open prompt and notice I did not use SU in the linux terminal"

"inside the shell"
rm /data/gpscfg/gps_env.conf 2>/dev/null

"make sure you get no error"

ln -s /data /data/gpscfg/gps_env.conf

"this is where you errored out last time. Make sure you get no error here as well"

exit
./adb.linux reboot
./adb.linux wait-for-device
./adb.linux shell
echo 'ro.kernel.gemu=1' > /data/local.prop

"make sure you don't get an error on this line from in the shell"

exit
./adb.linux reboot
./adb.linux wait-for-device
adb remount

"If you get no error at this point, you can now finish the rest of the script. If you get any errors up to this point, please post the full terminal log"

You got it!!

I will try this later today when I get home....

---Rich
 
You got it!!

I will try this later today when I get home....

---Rich
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ rm /data/gpscfg/gps_env.conf 2>/dev/null
$ ln -s /data /data/gpscfg/gps_env.conf
link failed Permission denied
$

OK so here we are grrrrr
 
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ rm /data/gpscfg/gps_env.conf 2>/dev/null
$ ln -s /data /data/gpscfg/gps_env.conf
link failed Permission denied
$
OK so here we are grrrrr
I'm going to ask a really silly question that I should have thought of earlier. You don't by chance have GPS ON when trying this root. It really shouldn't make a difference, but it's the only thing I can think of that would be causing the ln -s issue. That or the link already exists, but that should show a different error.
 
I'm going to ask a really silly question that I should have thought of earlier. You don't by chance have GPS ON when trying this root. It really shouldn't make a difference, but it's the only thing I can think of that would be causing the ln -s issue. That or the link already exists, but that should show a different error.

No GPS isn't on....but....I wonder if that happens to be associated with anything GPS. Lemmie go and turn off all that is GPS, reboot phone and see if that causes anything
 
No GPS isn't on....but....I wonder if that happens to be associated with anything GPS. Lemmie go and turn off all that is GPS, reboot phone and see if that causes anything

Turned off location for I think it was google and this was the result:
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ "rm /data/gpscfg/gps_env.conf 2>/dev/null"
rm /data/gpscfg/gps_env.conf 2>/dev/null: not found
$ "ln -s /data /data/gpscfg/gps_env.conf"
ln -s /data /data/gpscfg/gps_env.conf: not found

Interesting results.

Just went ahead and and did and adb reboot going to try this again and see what happens

OK same result

Rebooting now going to turn standalone GPS on and see what happens
 
Turned off location for I think it was google and this was the result:
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ "rm /data/gpscfg/gps_env.conf 2>/dev/null"
rm /data/gpscfg/gps_env.conf 2>/dev/null: not found
$ "ln -s /data /data/gpscfg/gps_env.conf"
ln -s /data /data/gpscfg/gps_env.conf: not found

Interesting results.

Just went ahead and and did and adb reboot going to try this again and see what happens

OK same result

Rebooting now going to turn standalone GPS on and see what happens

OK What the hell
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ "rm /data/gpscfg/gps_env.conf 2>/dev/null"
rm /data/gpscfg/gps_env.conf 2>/dev/null: not found
$ "ln -s /data /data/gpscfg/gps_env.conf"
ln -s /data /data/gpscfg/gps_env.conf: not found
$

Just in case something is amiss, I am rebooting with adb and standalone GPS
 
OK What the hell
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ "rm /data/gpscfg/gps_env.conf 2>/dev/null"
rm /data/gpscfg/gps_env.conf 2>/dev/null: not found
$ "ln -s /data /data/gpscfg/gps_env.conf"
ln -s /data /data/gpscfg/gps_env.conf: not found
$

Just in case something is amiss, I am rebooting with adb and standalone GPS

Same result, turned off standalone turning on Google Services. Rebooting....
 
OK What the hell
Code:
rich@rich ~/spectrum_root_linux_osx $ ./adb.linux shell
$ "rm /data/gpscfg/gps_env.conf 2>/dev/null"
rm /data/gpscfg/gps_env.conf 2>/dev/null: not found
$ "ln -s /data /data/gpscfg/gps_env.conf"
ln -s /data /data/gpscfg/gps_env.conf: not found
$
Just in case something is amiss, I am rebooting with adb and standalone GPS
If you're in the shell, why are you using " "? Or is that a linux thing I'm not aware of.
 
If you're in the shell, why are you using " "? Or is that a linux thing I'm not aware of.


HA!!!! Hmmmmmmmmmm......Script has it that way.....hmmmmm did not think about that one....but you notice in the shell, it reports back without the quotes. If it was going to be wrong wrong, it should add in the quotes saying it either doesn't recognize " or that it doesn't understand the whole string



But it is curious
 
Neph that has to be the way that the scripting works because in thinking about that cmd and the others before, in the script, it calls adb shell before the "rm..... and the "ln..... so yes, this is needed. Other commands within the folder work correctly without the "" such as ~$ ./adb.linux reboot and ./adb.linux kill-server ./adb.linux start-server
 
Neph that has to be the way that the scripting works because in thinking about that cmd and the others before, in the script, it calls adb shell before the "rm..... and the "ln..... so yes, this is needed. Other commands within the folder work correctly without the "" such as ~$ ./adb.linux reboot and ./adb.linux kill-server ./adb.linux start-server

The Plot thickens
Code:
 ./adb.linux shell
$ "echo 'ro.kernel.qemu=1' > /data/local.prop"
echo 'ro.kernel.qemu=1' > /data/local.prop: not found
$ exit
rich@rich ~/spectrum_root_linux_osx $ adb remount
adb server is out of date.  killing...
* daemon started successfully *
remount failed: Operation not permitted

What if I drag the newest adb from the sdk inside this folder....it means that calling ./adb.linux is null it would just be ./adb then command


hmmmmmmm
 
Back
Top Bottom