yashsingh1/xdaforums huggingface dataset:
[Verizon Samsung Galaxy S 4] kalestew:
problem with adb and safe root

I have goten adb installed and configured, used it on multiple occasions, but I still get these errors when trying to run the script.

Last login: Thu Dec 26 10:29:48 on ttys000

new-host-5:~ Jim$ cd /android\ /saferoot

new-host-5:saferoot Jim$ sh ./install.sh

--- Samsung i545 VRUEMJ7 Root ---

--- Based on the CVE-2013-6282 exploit by cubeundcube ---

Waiting for device...

Watch your phone. Unlock it and give permission for the install to run.

./install.sh: line 33: adb: command not found

Sending files to your device...

./install.sh: line 35: adb: command not found

./install.sh: line 36: adb: command not found

./install.sh: line 37: adb: command not found

./install.sh: line 38: adb: command not found

./install.sh: line 39: adb: command not found

./install.sh: line 40: adb: command not found

./install.sh: line 41: adb: command not found

./install.sh: line 42: adb: command not found

Starting rooting program.

./install.sh: line 45: adb: command not found

Removing temporary files...

./install.sh: line 48: adb: command not found

./install.sh: line 49: adb: command not found

./install.sh: line 50: adb: command not found

./install.sh: line 51: adb: command not found

./install.sh: line 52: adb: command not found

Rebooting...Please wait.

./install.sh: line 55: adb: command not found

Waiting for device to re-appear...

./install.sh: line 57: adb: command not found

Unlock your phone, and when prompted, give SuperSU permission for

'ADB shell' to run.

./install.sh: line 60: adb: command not found

./install.sh: line 61: adb: command not found

./install.sh: line 62: adb: command not found

./install.sh: line 63: adb: command not found

./install.sh: line 64: adb: command not found

./install.sh: line 65: adb: command not found

./install.sh: line 66: adb: command not found

./install.sh: line 67: adb: command not found

./install.sh: line 68: adb: command not found

./install.sh: line 69: adb: command not found

./install.sh: line 70: adb: command not found

./install.sh: line 71: adb: command not found

./install.sh: line 72: adb: command not found

./install.sh: line 73: adb: command not found

./install.sh: line 74: adb: command not found

Installing busybox

./install.sh: line 76: adb: command not found

./install.sh: line 77: adb: command not found

./install.sh: line 78: adb: command not found

./install.sh: line 79: adb: command not found

./install.sh: line 80: adb: command not found

./install.sh: line 81: adb: command not found

./install.sh: line 82: adb: command not found

./install.sh: line 83: adb: command not found

--- All Finished ---

new-host-5:saferoot Jim$

---------- Post added at 03:40 PM ---------- Previous post was at 03:33 PM ----------

sorry buddy we are stuck with the stock recovery for right now, but you can check out safestrap to install some TW roms.
[Verizon Samsung Galaxy S 4] Drayk:
I'm cool w/the "custom" padlock startup screen.

I'm sorry for the redundant questions but...how exactly do you get/use safestrap? Is it a stand alone program? Is it part of the root that's loaded?

I've been reading "The beginner's info thread (aka. the noob helper)" thread. I'm not totally "Android Modding" illiterate, but d*mn close. :eek:

Any assistance is greatly appreciated!!! :D
[Verizon Samsung Galaxy S 4] kalestew:
there should be a great vid in the main root, mod, rom thread
[Verizon Samsung Galaxy S 4] k1mu:
You've got to have adb on your path or in a directory on your path.

In other words, from your shell, just typing "adb" should run the adb program and give you usage info,

On my Mac, I have a symlink in /usr/local/bin/adb pointing to $HOME/Development/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb

since that's where I installed it.
[Verizon Samsung Galaxy S 4] decaturbob:
a great many youtube videos and information here in XDA....modding is not for the faint of heart or those who don't spend a few days in educating themselves on on it.
[Verizon Samsung Galaxy S 4] Drayk:
Yeah, right!!!

I've read till my eye's are bleeding. It's tough for a noob to get the terminology correct. I rooted a GS3 and used TWRP to back it up. Then I zigged when I should have zagged & jacked it up. Luckily I was able to recover with the backup I had. Now that TWRP isn't part of the equation, I'm looking for an alternative. I do searches for things but I'm never sure when it applies to a rooted MK2 or not.... Thnx man....Happy Holidays!
[Verizon Samsung Galaxy S 4] decaturbob:
if it applies to MK2, usually says so...when you get in a thread with a specific question whether its MK2 or not, usually pretty easy to get an answer.

like I said there's many youtube videos that go thru the processes on everything we do. May not be specific to a particular firmware base but the concepts and procedures usually are the same.
[Verizon Samsung Galaxy S 4] ajarmeh104:
should I re-root a again? ?

First: thanks a lot for the great effort.

I followed your method and successfully rooted me phone 2 weeks ago... and now I see all the edits In the op especially regarding SElinux thing.... should I re-root using the new scripts?

One more question: any link to a good thread for removing the bloaware?? I searched and found threads that suggests removing important applications such as gmail and email... etc... any safe-to-remove thread/list??

Thanks....

---------- Post added at 08:13 PM ---------- Previous post was at 08:09 PM ----------

Sorry. .. forgot to mention that I am on MK2 and this is the first time I root this phone.
[Verizon Samsung Galaxy S 4] roote223:
Confirmed working on the T-Mobile Galaxy S4 on 4.3 MK2!
[Verizon Samsung Galaxy S 4] decaturbob:
rerunning saferoot wont really buy you anything as for bloatware removal, there are some threads out there that are a bit dated
[Verizon Samsung Galaxy S 4] k1mu:
I agree. If at some point something important is found to be blocked by SELinux enforcing mode, you can go ahead and re-root. At the moment, there's no compelling reason to spend the time to do that.
[Verizon Samsung Galaxy S 4] ajarmeh104:
Thank you..
[Verizon Samsung Galaxy S 4] nujackk:
Already rooted is there a way to set the SELinux to permissive without going thru the entire process?
[Verizon Samsung Galaxy S 4] ojusrane:
Hi, this link you gave me to unroot my s4 says "SCH-I545" in the name of the zip file. I have a GT I9505, would that file still work?
[Verizon Samsung Galaxy S 4] Swimboy46163:
It says it's for verizon but you are welcome to try it. I'm not sure if it will work.
[Verizon Samsung Galaxy S 4] lalec:
Have you already looked in your device specific thread and in Chainfire's CF-AUTO-ROOT thread?
[Verizon Samsung Galaxy S 4] ojusrane:
no i havent heard of the chainfire cf auto root
[Verizon Samsung Galaxy S 4] k1mu:
Most likely not. As suggested, you should look in a forum for YOUR device. Flashing Verizon (CDMA/LTE) firmware onto a non-CDMA device will at best give you a broken device and may brick it.
[Verizon Samsung Galaxy S 4] ojusrane:
Sorry this might be a very silly question to you, but does flashing a stock firmware via odin on the s4 trip knox warranty status to 0x1, because I have still got 0x0 and i still need my warranty
[Verizon Samsung Galaxy S 4] k1mu:
Flashing stock firmware will not trip the Knox Warranty Void flag. "Stock" means "released by Samsung, unaltered". Some people here think "Stock" means anything based on the Samsung firmware, even if it's modified. Once you change the contents, the signature no longer matches.

Trying to flash a kernel not signed by Samsung will trip the flag. I think that flashing a modified bootloader will do it as well.
[Verizon Samsung Galaxy S 4] ojusrane:
Sorry for my paranoia, what do you mean by modified bootloader, I hope I haven't done anything wrong with it. Basically since I used this method to root my s4, all ive done was use titanium backup to restore my apps and use wanam exposed, I haven't used any other rooted apps.
[Verizon Samsung Galaxy S 4] k1mu:
You're OK, nothing to worry about. The bootloader on the I545 is locked and can't be modified. Just don't try to install a custom recovery or custom kernel if you're not running the MDK bootloader.
[Verizon Samsung Galaxy S 4] ojusrane:
Sweet, im downloading the stock rom now. Only problem we have is that hotfile has been shutdown by the US, so I have to cope with the rapidgator download at 50kb/s.
[Verizon Samsung Galaxy S 4] Kit_Kat:
Okay now that I am rooted and I have safestrap installed is there only certain roms I can install? or they all fair game? How do I make a backup of my factory ROM so I dont loose it? MK2 ATT 4.3 with knox. I googled how to install custom roms with safestrap but found procedures for the s4 active not sure if the procedure is the same between active and non active.

Thanks guys!!
[Verizon Samsung Galaxy S 4] Swimboy46163:
1. You can only install TW (touchwiz) ROMs. (Hyperdrive, Eclipse, etc) I('m also up to other suggestions.)

2. You can find factory ROMs around the XDA forums so you don't have to back it up. Let me know if you need a link.
[Verizon Samsung Galaxy S 4] mrhost:
I can't get ADB to pick up my device. I have developer mode on and USB debugging enabled. KIES 3 picks up my device without an issue. I have MK2. When plugged in it detects and loads to install mode and then after 30-45 seconds it loads again but in MTP or PTP mode and I have switched back and forth to each and neither of them are getting picked up.

I had several device admins so I removed all them and they are all gone now. KNOX was never enabled on my phone and now it is turned off.

Any suggestions? It just sits there waiting. When I run ADB on it says no device found. ADB devices and tried ADB usb, and I get nothing good back.

I have rooted ALL my past phones without issue. Typically a driver issue. As mentioned in this thread, "If KIES finds it the script should too" I hope I quoted that correctly.

Any suggestions, welcome.
[Verizon Samsung Galaxy S 4] Swimboy46163:
Have you tried flicking it from MTP to camera? I had to do that a couple of times to get it to work.
[Verizon Samsung Galaxy S 4] Kit_Kat:
Thank you for your help!! Is there a touchwiz android 4.4 rom out? I am assuming now i download rom boot phone in bootloader mode and flash rom using the safestrap. :cowboy:
[Verizon Samsung Galaxy S 4] Swimboy46163:
Yup flash the zip file (or download using your phone) to your phone. And then use SS from there. I don't know of one right now. Let me know if you find one and message me, I'm on vacation otherwise if look for you.
[Verizon Samsung Galaxy S 4] mrhost:
I noticed the download link for Samsung drivers on page 55. I DL and installed and it picked it right up on ADB and it is now going.

ES File Explorer working in Root mode now as well.. Confirmed. Thanks for the suggestion. I was doing that but yet again it turns out to be the driver.. I could have sworn I installed that version an hour ago though. O well.. DONE!
[Verizon Samsung Galaxy S 4] roote223:
I unrooted my phone through SuperSU and I still have the custom status. Can I use odin to flash the stock MK2 without tripping the Knox counter?
[Verizon Samsung Galaxy S 4] Swimboy46163:
Yes. It worked fine for me!
[Verizon Samsung Galaxy S 4] HAVOK83:
Thanks
[Verizon Samsung Galaxy S 4] joNz.:
Hey guys, so i have been looking around alot and i want to root my SGS4 but keep the stock firmware.

My SGS4 got android 4.3 MKF and KNOX, swedish phone, will this method work for me and not mess with KNOX?
[Verizon Samsung Galaxy S 4] k1mu:
While I haven't any direct experience with the Swedish phone, MKF may have the defect that this technique uses already patched.

However, it's worth a try. It will NOT trigger the "Knox Warranty Void" flag regardless of success or failure.

If you get "this device is not supported", then the kernel is patched.
[Verizon Samsung Galaxy S 4] joNz.:
Sorry if you think its a stupid question but how can you be so sure it wont trigger KNOX? just curious :)
[Verizon Samsung Galaxy S 4] James L:
Worked perfectly ! Sprint Galaxy S3 4.3

Thank you
[Verizon Samsung Galaxy S 4] k1mu:
The "Knox Warranty Void" flag is triggered when you try to flash a custom kernel or custom recovery. This root technique doesn't do that.

It pushes an application to the phone and executes it, which is what any Android developer would do when writing a new application.

The fact is that this application does some things that gets it root access, allowing it to install a permanent root, but it's doing nothing that any developer wouldn't do frequently. To block this would require setting the Knox Warranty Void flag every time someone sideloaded an app, which would be ridiculous.

A patched device will keep it from gaining root access, which means that nothing was done to your device other than installing SuperSU, which you can do from the Play Store.
[Verizon Samsung Galaxy S 4] joNz.:
Okay so if i root it successfully and want to unroot, is it possible? Can it be detected?

Also if it fails to get root but installs SuperSU like you said, can i just uninstall it or is it complicated? I read somewhere that uninstalling SuperSU can mess up the phone
[Verizon Samsung Galaxy S 4] joNz.:
Okay so i rooted the phone but im wondering about this, look at the picture: http://puu.sh/62aVC.png

what does it mean with "Package com.sec.knox.seandroid new state: disabled" ?

Noticed gamekiller doesent work, anyone know how to get it to work with stock 4.3?
[Verizon Samsung Galaxy S 4] Jiggity Janx:
Still getting permission errors with new upload
[Verizon Samsung Galaxy S 4] Surge1223:
What happens if you type this in terminal

cd /data/local/tmp
./getroot

I should note that in order for this to work you have to adb push "getroot" to /data/local/tmp and chmod 755 /data/local/tmp/getroot. These steps have to be done with adb shell
[Verizon Samsung Galaxy S 4] k1mu:
After thinking about this, that's not the problem. SE Android is keeping you from writing to /data/local/tmp, which is critical for this root technique, when you're using the terminal emulator.

It works when you have adb running and use the adb shell, which has slightly different permissions.

I may have to give up on the sdcard method and just include the "adb" program with the script. That'll bloat it, unfortunately.

I'll consider how to update this to make it more robust tomorrow.
[Verizon Samsung Galaxy S 4] k1mu:
So that means that you'll need to use the adb technique for now. Apparently you can't write to the target from the terminal emulator shell.

(unfortunately, my phone can now, so I can't debug this. yea root!).

I'll work on adding adb.exe to the root script and delete the "install.sh" as clearly that's an epic fail and won't work.
[Verizon Samsung Galaxy S 4] tshelby73:
So adb method is confirmed working. Does this install supersu or superuser?
[Verizon Samsung Galaxy S 4] Cdubzz20:
I'm the guy that needs a step by step guide on how to complete this process? When I run the batch file, it says ADB cannot be found? How2FixPlox?
[Verizon Samsung Galaxy S 4] Surge1223:
At least the first part must be done with adb (actually just pushing the files to /data/local/tmp and setting their permissions), after that you can just run getroot. I just fully unrooted and after rebooting (to complete the unrooting process) I just typed a few things in to terminal and bang rooted again. See attached pic.
[Verizon Samsung Galaxy S 4] trueagle:
this just root my phone. make sure java and adb installed properly, move files and two script to adb folder, run and bingo in work after three time of doing it with out proper java. I had to erase adb permissions in android development under adb check and grant permission when running abd devices. thanks man im root on new update you guys rock
[Verizon Samsung Galaxy S 4] DRELUXOID:
So with adb method this works for MK2?
[Verizon Samsung Galaxy S 4] trueagle:
yes
[Verizon Samsung Galaxy S 4] DRELUXOID:
Sweeeet. :)
[Verizon Samsung Galaxy S 4] tyson10:
something weird with mine. I pushed to phone - ran the te script - gave rights to su. rebooted phone. check su app - it shows te w/ permissions, but says binarys not installed
[Verizon Samsung Galaxy S 4] Swimboy46163:
Has anyone gotten it to work with MJ7?
[Verizon Samsung Galaxy S 4] tyson10:
just got MK2 to root. Now i have the samsung custom with unlocked padlock before boot up. Does this mean anything to us?
[Verizon Samsung Galaxy S 4] Ducki07:
I'm on MJ7 and I can verify I have root access! Now for recovery...anyone know how to take care of that?
[Verizon Samsung Galaxy S 4] raed81:
Is there unroot method for this in case we have to take the phone back to Verizon ?
[Verizon Samsung Galaxy S 4] Swimboy46163:
Did you use the SD card method?
[Verizon Samsung Galaxy S 4] Ducki07:
I used ADB
[Verizon Samsung Galaxy S 4] xxxdroidxxx:
Confirmed working on mj7. Adb was not connecting. Make sure you have the latest java and adb. Had to reinstall the sdk tools and move file to adb folder. Run as administrator.
[Verizon Samsung Galaxy S 4] Ducki07:
Yea, I had to update my adb too.
[Verizon Samsung Galaxy S 4] dscatto:
Works!!!

This method works! I hadn't been keeping up with the news about my S3 & I was anxious to get the latest & greatest version of Android that I updated as soon as I was able to do so on my phone. My laptop won't connect to my Universities WiFi for some reason, so I use my phone & the 4G signal to USB Tether. Well, I went to do that one day, like I had been doing for months, & it didn't work. So, I tried to WiFi tether & that didn't work. Well, come to find out it was because of the update & Knox!

Any who, I searched furiously for a method for several weeks & found nothing until this! I was about to get a different phone that didn't have this issue!

Big THANKS!
[Verizon Samsung Galaxy S 4] kwelch08:
need help

--- Samsung Galaxy S4 Android 4.3 Root ---

--- Based on the CVE-2013-6282 exploit by cubeundcube ---

Testing adb usability

Plug in your phone and Press any key to continue . . .

Waiting for your phone to appear

Your phone is detected and ready for rooting.

Sending files to your device...

1788 KB/s (2139595 bytes in 1.168s)

pkg: /data/local/tmp/Superuser.apk

Failure [INSTALL_FAILED_ALREADY_EXISTS]

2897 KB/s (17804 bytes in 0.006s)

1895 KB/s (13592 bytes in 0.007s)

2842 KB/s (104800 bytes in 0.036s)

3025 KB/s (1109128 bytes in 0.358s)

153 KB/s (629 bytes in 0.004s)

Starting rooting program.

ro.build.product=jflteatt

ro.build.id=JSS15J

search kallsyms...

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

(kallsyms_addresses=c0aac160)

(kallsyms_num_syms=00017428)

kernel dump...

1 2 3 4 5 6 7 8 9

prepare_kernel_cred=c0096e9c

commit_creds=c0096964

ptmx_fops=c11693c8

selinux_enforcing=c1153024

Succeeded in getroot!

Remount success!

Copying files..

Setting SELinux to Permissive

remount: Device or resource busy

Done.. reboot to enable root!

Removing temporary files...

Rebooting... Please wait.

Waiting for device to re-appear...

Wait until your phone reboots, then unlock it and Press any key to continue . . .

On your phone, give SuperSU permission for ADB shell to run

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

Installing busybox

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

/system/bin/sh: /system/xbin/su: not found

--- All Finished ---

Press any key to continue . . .

this is what I get when I try to run saferoot, and then when I try to open superuser it says the custom binary is out of date. what am I doing wrong?
[Verizon Samsung Galaxy S 4] ojusrane:
Anyone that wants stock firmware for there GT- I9505, then use this link because the download links that sammobile give you have incredibly slow download speed, whereas this link uses mega.co.nz has rapid download speed. I going to start flashing this on my MJ7

http://www.androkick.com/joomla/ind...-i9505-lte-samsung-galaxy-s-4-iv-gt-i9505-lte
[Verizon Samsung Galaxy S 4] sharkie405:
Finally got around to re-rooting my phone using this method and I gotta say, just like so many others, damn, that was the easiest root I've ever done on a phone. Thanks again! :)
[Verizon Samsung Galaxy S 4] kude87:
Wow. How easy was this? Simply excellent! Thanks!
[Verizon Samsung Galaxy S 4] k1mu:
If you don't get root, then you just use the application manager to uninstall SuperSU. It's just like any other application at that point.
[Verizon Samsung Galaxy S 4] joNz.:
I rooted successfully and knox is 0x0, thanks for the help. But there was something else that said 0x30, whats that?
[Verizon Samsung Galaxy S 4] k1mu:
That's the install script disabling the Knox notifications on your phone. No, it's not disabling the Knox Warranty Void checks, just stopping Knox popups on your phone. SuperSU will do this for you as well.
[Verizon Samsung Galaxy S 4] k1mu:
When it gets here, wait until it completes booting. Unlock it and open the SuperSU program, then let SuperSU update if it wants.

THEN, press a key to allow the script to proceed.

Let it update the binary. It'll probably also offer to disable Knox, which you should approve. You're rooted.

The only thing you've missed is the busybox install, which you can do separately from the Play Store.
[Verizon Samsung Galaxy S 4] joNz.:
[MENTION=3940199]k1mu[/MENTION] how do you un-root?

Also how can i update the phone, i guess OTA don't work?
[Verizon Samsung Galaxy S 4] kwelch08:
when i let it update is doesn't work, and fails to disable knox. when I check root with root checker it says doesn't have root access...
[Verizon Samsung Galaxy S 4] k1mu:
First, are you running an up-to-date copy of the script in the original post, not somebody else's modified copy?

You say it doesn't work. What do you mean by that ? What doesn't work what error message, etc?

When you start SuperSU what does it say? If it prompts you to update the su binary, and does that without errors, then you're rooted.

Root checker is not entirely reliable. Part of what the script does post-boot is to change the permissions on the su binary to make Root Checker happy. To fix that:

$ adb shell

$ su

# chmod 06755 /system/xbin/su

# chmod 06755 /system/xbin/daemonsu
[Verizon Samsung Galaxy S 4] k1mu:
You un-root by using SuperSU full unroot (Settings, Full unroot). That won't restore anything else that you do to your phone post rooting - that's your responsibility.

Most OTAs require you to restore the device to stock before they'll work, but usually don't require you to unroot.

If you're one of those "de-bloat" people that are rooting to remove "bloat", most de-bloating scripts don't back up what they delete and thus will usually block OTAs.
[Verizon Samsung Galaxy S 4] joNz.:
Okay so say i un-root, how do i get rid of that "custom" thing and change it back to its original state?

If OTA works, will it remove root?

And if OTA dont work, can i just upgrade through Kies?
[Verizon Samsung Galaxy S 4] k1mu:
To get rid of "Custom", don't be custom. (Either un-do what you've changed, or flash a stock ROM). You usually need to be a clean, unmodified build to take an OTA.

OTAs remove root. Using SuperSU pro and Voodoo rootkeeper you may be able to retain root across an OTA.

Upgrades through Kies and ODIN will always work, and will usually remove root.
[Verizon Samsung Galaxy S 4] joNz.:
Not sure what you mean with dont be custom, sorry lol. But i wont be flashing other ROMs, im on stock and still MKF, just that i got root on the phone. If I unroot, will it be traced if i would to send it in to repair?

How would you suggest on upgrading on stock+root?