5,595,964 Members 31,498 Now Online
XDA Developers Android and Mobile Development Forum

Stupid SU: Galaxy S 4 stock+root helper

Tip us?
 
supercurio
Old
(Last edited by supercurio; 20th May 2013 at 08:36 PM.)
#1  
supercurio's Avatar
Senior Recognized Developer - OP
Thanks Meter 5063
Posts: 3,528
Join Date: May 2010
Location: Chambéry

 
DONATE TO ME
Thumbs down Stupid SU: Galaxy S 4 stock+root helper

Hi guys!

As some of you must have noticed, latest Samsung GT-I9500 firmwares carry a kernel configuration supposed to prevent SETUID privilege elevation.
Stock unmodified firmware with root is my preferred setup but also a strong dependency for all my development, for me this change is a massive setback if not a dealbreaker.

While poking around I found in about an hour something weird that reveled being a vulnerability, so I created a little thing to make it useful for now.

README:
Quote:
Stupid SU: Galaxy S4 root helper by François SIMOND aka @supercurio

Circumvent an extremely weak false-security "Anti Root" mechanism implemented
on latest Samsung Galaxy S4 devices (on both Exynos and Qualcomm versions)

Preventing proper root function on official firmware breaks all my Voodoo apps
requiring stock+root and is a move that's hostile to both users and developers.

Samsung security might be embarassed by this proof of concept, as it defeats
their mechanism in a single line... not even with complex ARM assembler
but *one* line of shell script.
However, the goal here is to show Superuser solutions developers how to
deal with those devices for now, and provide a working solution to people who
bought a Galaxy S4 expecting to root it cleanly and easily but cannot.

This proof of concept is slightly slowing down Superuser calls, but its
"plain text" implementation has the merit of showing how stupid this exploit is.

SELinux configuration stays unmodified and active.

Features:
- Detect and supports both SuperSU and Koush's Superuser
- Installs Super SU binary by default

Make sure you have one of those Superuser apps installed:
- https://play.google.com/store/apps/d...utta.superuser
- https://play.google.com/store/apps/d...infire.supersu

Root feature doesn't rely on a "StupidSU kernel" which is only an installer.
Feel free to flash back Samsung's original boot.img from their official firmware
after booting at least once.

Important Note:
This "exploit" is so lame that it will be fixed in no time, making updated S4
a pain to root again.

I wish Samsung will reconsider their "Anti Root" approach, which is damageable
in every regard and defective by design as demonstrated here.
Also, I'm simply not interested developing for and promoting devices from
manufacturers hostile to developers: It's just a waste of valuable time.
INSTALL
Quote:
1/ copy rooting/ directory in your initramfs

Make sure "root.sh" file is has an executable permission (chmod 744 recommended)


2/ Add those lines at init.universal5410.rc end:

# Stupid SU
service rooting /stupidsu/root.sh
class main
user root
group root
oneshot

3/ Assemble your initramfs with the associated Samsung official kernel binary
of choice in a regular boot image

4/ flash as boot.img

5/ At each boot, Superuser app are detected automatically and su binary adjusted
accordingly.

Source code

On GitHub


License


Kernels downloads, only for demo purposes of the concept, you can flash back original Samsung boot.img once rooted

GT-I9500 Stock + root StupidSU v4 UBUAMDE
GT-I9500 Stock + root StupidSU v4 XXUAMDK
GT-I9500 Stock + root StupidSU v4 XXUAME1

What's next

Owners of Qualcomm Galaxy S 4 devices experiencing the same dificulties with Samsung the anti root strategy might want to try this method, please let me know if you're ready for some experimentations.
The Following 42 Users Say Thank You to supercurio For This Useful Post: [ Click to Expand ]
 
muhamet
Old
#2  
muhamet's Avatar
Senior Member
Thanks Meter 102
Posts: 695
Join Date: Feb 2011
Location: Skopje
Supercurio pleas add thraed t General section i think ther well bee lots of testers for i9505.thx for suport

Sent from my LG-P500 using xda app-developers app
 
grgsiocl
Old
(Last edited by grgsiocl; 18th May 2013 at 07:12 AM.)
#3  
Senior Member
Thanks Meter 4293
Posts: 2,561
Join Date: Nov 2009
Location: Kurnool, Andhra Pradesh
Going to try this on latest LE1 stock kernel now .....thread is in correct section

edit: did not work on LE1 kernel. I will try once again. DId any one tried the MDK kernel..I am having again the problem with SU binaries installation..

Edit: Thanks bro. working on ME1 kernel now. Did mistake while doing tar. Appreciate it! Root is working fine but cant update the binaries of Supersu, still the root works fine.
 
Rahulrulez
Old
#4  
Rahulrulez's Avatar
Senior Member
Thanks Meter 1441
Posts: 1,622
Join Date: Oct 2010
Location: India

 
DONATE TO ME
Here comes the master welcome to SGS4 development forum mate.. (rahulzeven from twitter here )
Follow me on Twitter for daily Android related (and some personal) updates @rahulzeven

 
GSeeker
Old
#5  
GSeeker's Avatar
Senior Member
Thanks Meter 88
Posts: 317
Join Date: Aug 2008
Location: Guangzhou
So the BEST thing's just happened?!
Several Android Devices.
 
grgsiocl
Old
(Last edited by grgsiocl; 18th May 2013 at 08:02 AM.)
#6  
Senior Member
Thanks Meter 4293
Posts: 2,561
Join Date: Nov 2009
Location: Kurnool, Andhra Pradesh
i repacked the kernel of Samsung-Updates.com-KERNEL-GT-I9500-XSE-I9500XXUAME1-1367637350 using supercurio method. Root works fine. All we need to is install it from ODIN and dont update the binaries of supersu.

Download Link

Edit: New file uploaded
The Following 4 Users Say Thank You to grgsiocl For This Useful Post: [ Click to Expand ]
 
GSeeker
Old
#7  
GSeeker's Avatar
Senior Member
Thanks Meter 88
Posts: 317
Join Date: Aug 2008
Location: Guangzhou
Quote:
Originally Posted by grgsiocl View Post
i repacked the kernel of Samsung-Updates.com-KERNEL-GT-I9500-XSE-I9500XXUAME1-1367637350 using supercurio method. Root works fine. All we need to is install it from ODIN and dont update the binaries of supersu.

Download Link
Thanks fo much! Will Titanium Backup work on this kernel?
Several Android Devices.
 
walda
Old
#8  
walda's Avatar
Senior Member
Thanks Meter 226
Posts: 1,250
Join Date: Apr 2010
Hope chainfire will start working on mobileOdin soon. So much easier to flash than.

... tapat*lked
Greetings, Walter

Actual:
Samsung Galaxy Note 3 [N9005] - Sweet Rom - XPosed, wanam


Developer of: DrainGuard xda - Homepage
 
grgsiocl
Old
#9  
Senior Member
Thanks Meter 4293
Posts: 2,561
Join Date: Nov 2009
Location: Kurnool, Andhra Pradesh
Quote:
Originally Posted by GSeeker View Post
Thanks fo much! Will Titanium Backup work on this kernel?
wrong file uploaded. Please download the same in 5 minutes. Uploading is on and the kernel date should be MAY 04

---------- Post added at 12:33 PM ---------- Previous post was at 12:28 PM ----------

Quote:
Originally Posted by GSeeker View Post
Thanks fo much! Will Titanium Backup work on this kernel?
it should work as i dont use titanium backup and instead i use gobackup pro and it works fine anyway
The Following User Says Thank You to grgsiocl For This Useful Post: [ Click to Expand ]
 
jlevy73
Old
#10  
jlevy73's Avatar
Senior Member
Thanks Meter 1086
Posts: 8,825
Join Date: Nov 2009
Location: Los Angeles
MDK from OP working good, thanks

THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes