yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9500 Original Android Development] supercurio:
Current Galaxy S 4 latest updates status:

A mechanism is implemented in Samsung kernel sources and binaries to prevent a setuid binary to receive additional privileges.

What StupidSU does:

Via an extremely simple method, bypass the mechanism described as "anti-root" by my Samsung contact.

It shows how to use root on on an unmodified Samsung kernel and standard but only rooted /system, precisely what this "anti-root" Samsung feature is supposed to prevent.

Little story.

Carriers asked Samsung to implement this mechanism mainly tailored on bootloader-locked devices in order to prevent their customers to use root, like in order to activate tethering and other cool stuff by, for instance flashing a pre-rooted /system image.

This method defeat this restriction by using a vulnerability.

Feel free to not believe one word I say and find my the work I share for free here stupid.

It's under WTFPL for a reason, you know... WTF.

As usual, I needed it so I wrote it and shared it, I don't really care about your opinion.
[Galaxy S 4 i9500 Original Android Development] AndreiLux:
If that's the case the go please read the kernel source code and/for the configuration options I mentioned above and the obvious lack of implementation of CONFIG_SEC_RESTRICT_ROOTING. Isn't it also a contradiction it's for bootloader locked devices when the workaround for it needs to have a unlocked bootlater.

You're claiming to defeat something which never even existed. But I see you're hard-headed, so I'll let others continue on.
[Galaxy S 4 i9500 Original Android Development] supercurio:
I didn't read any S4 source code yet.

Found something that was intentionally not working, breaking all my apps in the process, fixed it (temporarily, see README), end of story.

You're welcome arguing elsewhere or talk about something else, your whole contribution is entirely useless so far.
[Galaxy S 4 i9500 Original Android Development] AndreiLux:
Oh wow. And this is how news websites spread nonsense based on overdramatic claims which I'll be sure will be the result of this topic. End of story here.
[Galaxy S 4 i9500 Original Android Development] supercurio:
I must say however it's interesting how this Samsung change can divide the dev community into two sides with opposite interests.

Root app developers

Application developers rely on the the fact rooting is accessible, easy, reliable and is not broken by an update.

If rooting is not easy enough, people won't be able to use their application.

If rooting is not reliable, users will complain about apps malfunctions

If rooting is broken by updates, users or customers will complain it's not working anymore, and will possibly request refunds in case of paid root apps.

Root app developers prefer official kernels and firmwares because custom kernels or firmware can make so many changes that maintenance becomes extremely difficult. Typically, most of the compatibility and maintenance issues comes from users who flashed custom kernel or firmwares, which come in very varying quality, often removing basic "standard" features the application will rely on.

Custom kernel hackers / providers

Custom kernel developers (example here: AndreiLux) will welcome a change that make flashing a custom kernel a requirement.

It means that that they become the gatekeepers of every other root development, giving them leverage and precedent over other mods.

I'm a root app/drivers developer so obviously I'm against Samsung move which is to prevent proper root function on official kernels and firmwares, it makes me rely on custom kernels that come with any reliability issue you an imagine, and often break the APIs my developments depend on.

I also believe (in general) restricting users's freedom on how they use the device they bought is wrong, especially when it's for misguided security purpose that doesn't work as demonstrated here.

I'm all for security, take it always very seriously but thing is you won't secure a system by breaking it's standard APIs and features.

You'll get security by improving the quality of code and pushing very updates in a timely fashion.
[Galaxy S 4 i9500 Original Android Development] supercurio:
You sir just reminded me it was sadly impossible to post something here without being attacked for any random unfair reason.
[Galaxy S 4 i9500 Original Android Development] Phil3759:
Go ahead

The silent majority appreciated your contribution and share spirit to bypass the new code by Samsung

At least, it opens door to keep using a pure stock kernel, without uncertain binary patching, by just repacking the ramdisk

Terminology interpretation can be debated, but the target was achieved :good:

If I'd owned a S4 or had time, it would helped me providing custom stock kernels like the old CF-root work

This will probably motivate more people to revive it for the S4, like I am doing for the S2
[Galaxy S 4 i9500 Original Android Development] supercurio:
Hey Chainfire :)

You know very well there's never any bug in my software! :angel:

Thanks for the explanation, I'm preparing an update that does what SuperSU requires: a copy of su "binary" in /system/bin/.ext/.su makes your app happy again.

I wonder if you'll use this "setuid loader" method for S4s or instead implement the same thing in a single binary.

Basically, the first binary executed still has initial uid/gid but has enough permissions to spawn another binary that will get root uid.

As I didn't found the time to read the kernel source code so far I cannot explain why yet but there must be a shortcoming somewhere allowing just that.

Just looking forward seeing both Superuser implementations finding a way on the stock Samsung S4, regardless on how stupid the workaround is today and might be later.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Thanks, appreciated :)

Yes for years I find the CF-Root or CF-Auto-Root an option that's as reliable as useful (as user and developer) so I had to share anything that might help Chainfire and other root solution provider, how sh!tty it is −hence the name choice.
[Galaxy S 4 i9500 Original Android Development] aslak89:
thanks mate;)

I ve tried to repack by using dsixda's AK too.

checked the script works in /sbin,

and /system/xbin messed up.

Booooooo..

I wish to find out to be worked this method in cygwin

*Edit : su binary works! I misunderstood to see not working SuperSu;)
[Galaxy S 4 i9500 Original Android Development] supercurio:
Sorry using a Linux dev environment was sort of implied, I must admit I didn't thought at all about Windows users when it's about kernel hacking.

I would suggest using a little VM for this kind of stuff if your machine doesn't run under Linux already like me, it should be well worth the time investment as you seem curious :)
[Galaxy S 4 i9500 Original Android Development] aslak89:
No sorry mate!

I know it's a natural thing in Dev.

I've modified apk and smali but noob in kernel and linux,

so I tried this in cygwin (it's accustomed to me yet :D)

And made it works!

I am going to learn about linux as your advice:)

I would like to ask you just this:

SuperSu setting is inaccessible, Right?

Worlds always appreciate and love your devs.

the contributions are so hard to say!
[Galaxy S 4 i9500 Original Android Development] supercurio:
Thanks you're so kind.

I just updated StupidSU code on GitHub to v3., and also kernel downloads on the first post, adding ME1 in the process.

SuperSU work fully now as it the installer follows Chainfire's requirements.

By the way would you have any suggestion on kernel version naming?

MDE, MDK, ME1.. I'm not sure I'm doing that correctly.
[Galaxy S 4 i9500 Original Android Development] _deleted_:
Thread cleaned.

Let's keep all discussions respectful and relevant. Nothing wrong with debating, but there's a thick line between debating, and arguing in a public forum.

If anybody wishes to discuss this further with me, feel free to PM me.

Thanks a lot,

Kind regards,

Lady Android

Forum Moderator & XDA News Writer
[Galaxy S 4 i9500 Original Android Development] grgsiocl:
ME1 link downloads MDK kernel
[Galaxy S 4 i9500 Original Android Development] avetny:
oh true :p
[Galaxy S 4 i9500 Original Android Development] supercurio:
Oops, copy paste fail, thanks for your vigilance − fixed.
[Galaxy S 4 i9500 Original Android Development] Odia:
I think the point here; is that once the initramfs has been modified, the kernel becomes custom e.g. the sign is broken, so the end result is the same as any other method at the moment, ok you can flash back a stock kernel, but your system status has already become modified.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Remember kernels I distribute in this post are just here for demo purposes (even if they can be useful until CF-Auto-Root or CF-Root appear)

The point is to share with other devs how to implement root in a simple way while running a Samsung kernel supposed to block that.
[Galaxy S 4 i9500 Original Android Development] Odia:
So explain another method to install it without a custom kernel?
[Galaxy S 4 i9500 Original Android Development] supercurio:
Sorry I cannot answer this, I didn't study install methods.

Instead I only looked for the simplest and fastest way to make my point by publishing source code and a working demo that just works.
[Galaxy S 4 i9500 Original Android Development] Odia:
Therefore your POC demo has no merit and relies on an initial custom kernel.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Seriously? Give me a break.
[Galaxy S 4 i9500 Original Android Development] Odia:
Do not get me wrong, I am not arguing with you, but the bla bla bla in the readme is just laughable.
[Galaxy S 4 i9500 Original Android Development] walda:
Why don't you stop the hick hack?

Each one of you is a good dev so why... ?

Anyone who think that it's useless, don't use it. Simple.

Thank you for sharing your work.

... tapat*lked
[Galaxy S 4 i9500 Original Android Development] supercurio:
Therefore your point is moot as my demo had one merit: giving you a laugh this month. This doesn't seem to happen to you very often.
[Galaxy S 4 i9500 Original Android Development] Phil3759:
LoL

Many forget that the majority would stick to a stock kernel and do not care about custom ones

Being able to root a stock UNMODIFIED kernel is the most important thing that this method brings

He is the first to share it. Yes, it needs a modified boot.img, yes it is not a major backdoor break, but why do not focus on content and usefulness of this method instead of debating the presentation form?
[Galaxy S 4 i9500 Original Android Development] Jonny:
Why are respected developers arguing over this, why is this method being attacked.... it does what its designed to do, nothing more, nothing less.

Unless you have something useful to add, drop the arguments please. As with Lady Android, my PM inbox is always open if you feel the need to discuss this further.

Thread cleaned

Couldn't have said it better myself :good:

Back on topic if you wouldn't mind.
[Galaxy S 4 i9500 Original Android Development] romeo26222:
Thanks for your great work

Removed Adam kernel and using yours, love to have a stock kernel with the latest build instead of the other auto-root kernels that using older build numbers.

keep up the great work..
[Galaxy S 4 i9500 Original Android Development] aslak89:
No saying would be great...

I am really hopeless at naming:D:D

V3 perfectly works:good:

Now I just uploaded root kernel on forum in korea,

you are saving the superusers who use korean galaxy s4;)
[Galaxy S 4 i9500 Original Android Development] supercurio:
Great: very happy to hear that, please say hello to Korea for me ;)

BTW I'm interested by a Voodoo Report from a SHV-E300S, to discover more about the hardware inside and compare with the GT-I9500 and others.
[Galaxy S 4 i9500 Original Android Development] DjeMBeY:
Could you make a test file for I9505?

I've tried your method but we have different files inside... I've modified init.rc but it doesn't work...

I'm rubbish with kernels so there's a chance that I'm doing something wrong.... ;)
[Galaxy S 4 i9500 Original Android Development] Entropy512:
Except it does NOT root a stock UNMODIFIED kernel.

The moment you modify the initramfs, the kernel image is modified, which means it fails signature checks, you pop triangle, SysScope sees that you popped triangle and starts disabling things, etc... At that point, you may as well just build the kernel from source. About the only case where this approach is useful (as opposed to compiling from source and getting rid of that stupid "feature" the proper way) is in a proven case of GPL noncompliance by Samsung. (Which, sadly, does happen pretty often...)

It's also of no use for those with locked bootloaders - who were the ones affected the most by Samsung's anti-rooting feature in the first place.
[Galaxy S 4 i9500 Original Android Development] marbulas:
+1
[Galaxy S 4 i9500 Original Android Development] twisted_mind:
Dumb question...

I have adam kernel 1.2 on xxuamdk. So if i flash the stock firmware again via odin and then flash this as well via odin, do i get root? Or have i missed anything? This works with 64gb exfat cards, right?
[Galaxy S 4 i9500 Original Android Development] jlevy73:
Only problem I encountered with the MDE kernel posted in the OP was that it broke the camera (which is known issues for custom kernels on newer FW's). So I had to flash the stock MDE kernel back to fix it.
[Galaxy S 4 i9500 Original Android Development] twisted_mind:
Just flashed back to the stock mdk rom and flashed this... Root works perfect !!! exfat working fine too on my 64gig card...

[MENTION=2617206]supercurio[/MENTION] You Rock mate !!! :D
[Galaxy S 4 i9500 Original Android Development] cmd512:
Confused, you posted earlier saying MDK worked. Did you downgrade to an older FW MDE to just test the MDE kernel?
[Galaxy S 4 i9500 Original Android Development] jlevy73:
My bad I meant ME1. I actually didn't check the camera on MDK so can't say for sure if it worked or not. The camera didn't on ME1. Apologies about the confusion.
[Galaxy S 4 i9500 Original Android Development] cmd512:
No worries, did you try the version posted by grgsiocl in post #6?
[Galaxy S 4 i9500 Original Android Development] jlevy73:
No, just the one in the OP.
[Galaxy S 4 i9500 Original Android Development] cmd512:
That's where the confusion may be. The one in the op just says ME1, but there was also an older ZSUAME1 from Taiwan that had a slightly older changelist #. I suspect the kernel posted there may be from this slightly older ROM instead of the newer Indonesian XXUAME1.

I'm currently downloading the latest XXUAME1 as I've been wanting to upgrade to that for quite some time. Of course, I've been holding off as there hasn't been a good root option until today it seems. BTW, you upgraded from UBUAMDK given you're probably using a Latin America bound 9500 like me... did the upgrade to the Indonesian version trigger a wipe?
[Galaxy S 4 i9500 Original Android Development] rizalh75:
Dear all,

I,m only a android and Samsung user. Can anyone tell how to install this method in GT I9500? I mean via Odin others else. Thank you
[Galaxy S 4 i9500 Original Android Development] aslak89:
Thank you again,

I will in if it could be support for your project.

I know well Voodoo is awesome and really expected one:)

Good luck to you!
[Galaxy S 4 i9500 Original Android Development] jlevy73:
That's very possible, let me know if the kernel posted in #6 breaks the camera.

My device was purchased in Hong Kong. Had the choice between the I9500 and I9505 but since I do most my traveling in non-LTE countries, went with the I9500. I was using Wanam lite Rom before this but was experience a lot of lag so decided to flash the Indonesian XXUAME1 Rom to see what stock was like. Suprisingly, I got better performance with stock Rom and stock kernel than I did with anything custom I have used.

If I remember correctly, the FW that was on the device when I got it was ZSUAMDK.
[Galaxy S 4 i9500 Original Android Development] grgsiocl:
I am uploading new ME1 kernel (MAY 4) with root and with no camera problem! Link will be up in couple of minutes

edit" download link

Please report in this thread regarding camera works or not!
[Galaxy S 4 i9500 Original Android Development] DocRambone:
Camera fine , at least with my rom

Edit: breaks sound tho, no sound i dialer etc
[Galaxy S 4 i9500 Original Android Development] grgsiocl:
sound works fine for me though and i am on my own custom rom XXUAMDK indian FW...Cross checked sound works fine including lockscreen sounds...Could you check once again by increasing the volumes and also if possible try to reflash the kernel again! Cant reproduce myself
[Galaxy S 4 i9500 Original Android Development] hassan89:
Thankyou for making this release for us mate.Was looking for a way to get rooted stock kernel with no other modifications.Will definitely follow this thread :)
[Galaxy S 4 i9500 Original Android Development] DocRambone:
Yes, i run a very experimental aospized rom with CM dialer. Its picky on what kernel it support so this bug report may not be correct.
[Galaxy S 4 i9500 Original Android Development] grgsiocl:
thank you..if everything goes well we can make sticky thread with rooted stock kernels for all the builds!
[Galaxy S 4 i9500 Original Android Development] jlevy73:
Thanks, works great. Sounds and camera are working fine on my device.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Hey Hello Andy :)

Please see the README and my other posts where I address several times the same remark.

Kernels linked are only for demo purposes, as an easy install vector.

All you need to focus on is this single line. Which shows how to make a su chainloader or modify su binaries source code to circumvent broken limitation implemented in latest Samsung kernel binaries.

I have no doubt su authors will use this knowledge to make their su binary work on those restricted kernels yes (until it's broken again).

But that's the whole point.

So yes indeed, once rooted (by any method, could be my demo kernels or through recovery or whatever) you can run a stock UNMODIFIED kernel, this is encouraged.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Hello, nothing dumb here.

Yes a typical usage case is to

flash a complete original firmware

flash one of the kernels listed in my first post or by others. These root the device.

in case there was no kernel matching your exact firmware version, it is recommended to flash Samsung's kernel boot.img from the firmware again. And instead of having a blocked root it will just work.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Yes sure!

Just tell me which boot.img to inject with that (with complete version numbers) and I'll do it and link in the OP.
[Galaxy S 4 i9500 Original Android Development] supercurio:
Oh yep you're right guys, that's why I was looking for advice about naming. Seems ME1 is too short to represent the version number correctly, I will post rename all this to avoid collision.

Thanks for the explanation.

However, remember demo kernels are not the point, it's just an easy way to install the StupidSU'ed root − and I encourage you to look at the source to see how stupid it is.

You may flash back the original kernel once rooted.
[Galaxy S 4 i9500 Original Android Development] DjeMBeY:
Awesome! Please find attached the latest kernel for I9505 (from the XXUAME2)

I'll test it asap :)

Thanks a lot for your hard work!! :)

Hmmm... are you sure?? When i tried it yesterday, each time I've flashed stock kernel , the new folder "STUPIDSU" was removed...
[Galaxy S 4 i9500 Original Android Development] romeo26222:
I am experiencing a weird issue with your Kernel

I flashed the latest v3 MDK which support the SuperSU binary and the supersu interface now opens fine..

Titanium backup works great and gain root access but ES file explorer can't and gives me error

this show the ES file explore gain root access

and here in the UI of supersu it is listed

and thats the error

this doesn't happens with other rooted kernels like Adam Kernel..

whats the problem and how to fix?

regards
[Galaxy S 4 i9500 Original Android Development] hsupi:
same issue here too , I flashed the latest v3 ME1 , and the ES file explorer also cant gain the ROOT.

Thanks you!
[Galaxy S 4 i9500 Original Android Development] GSeeker:
bug report:

Using OP's "GT-I9500 Stock + root StupidSU v3 ME1" on stock I9500OZSAME1 firmware,

Xposed Framework can't get root access, denied by superuser.:crying:
[Galaxy S 4 i9500 Original Android Development] supercurio:
For ES Explorer I don't know what the error is (only tried with SuperSU, command log came up empty, you might report me if the same issue occurs with Koush's SuperUser)

For Xposed Framework I took a quick look at the installer's source code. But too quick to identify why it fails, source code seems quite clean (sorry I won't test the app itself).

I suppose that apps doing fancy stuff and extra checks during their superuser permissions acquisition might fail because they don't find the regular su binary setup in a single process.

What really occurs with StupidSU is that there's an helper process that spawns the real su binary (SuperSU or Koush's), which leads to two process PID forwarding stdio/stderr instead of one.

So it's indeed not behaving exactly in terms of process management & PID than a single su call.

I remember Chainfire was telling me some root apps are making the weirdest things like killing su process instead of closing an interactive shell via "exit" command.

Apps like that are expected to fail, but I don't worry too much for StupidSU proof of concept.

I don't intend to do crazy stuff trying to work around bugs in this proof of concept that life will be only a couple days short. I really only meant it as a way to share a method with devs, after a few friendly tweets exchanges with Chainfire the day I tried rooting my I9500.

Chainfire published a guide, recommending how to use su commands. Apps following the method described don't encounter issue with StupidSU.

But thanks I will add a mention about some root apps not able to acquire root, even tho it won't be fixed.

In case of ES explorer, I recommend using FX Explorer + root addon that's just a f!king amazing app IMHO −I admire this dev's work very much. That's a more than solid alternative.
[Galaxy S 4 i9500 Original Android Development] romeo26222:
[MENTION=2617206]supercurio[/MENTION]

thanks for your statement here and I'll try your mentioned app too.

I have a small question please

I tried your V3 kernel, get root access with all apps except ES, Now when I flash the stoke kernel back I still get the root access too, is this normal?

how to get the phone to its official status as non rooted phone?

is flashing the whole stoke FW back will remove your code totally?

regards
[Galaxy S 4 i9500 Original Android Development] jlevy73:
Agree, FX Explorer is an excellent app. The root addon used to be paid but the dev decided to make it free some time ago. IMO, it's better than root explorer and ES File manager together.
[Galaxy S 4 i9500 Original Android Development] Phil3759:
Sure, I meant really the kernel, not the boot.img

Many do like a stock kernel even if only option is a modified boot.img and all the trouble you describe

Like old cf-root and my i9100 modified zImage following CF i9100 abandoned project, this method opens the door for that approach

Sure not perfect as it redirects the calls, but a good option

Only other one is binary patching the kernel like jeboo did

Now, people who prefer custom kernels of course are not concerned by this thread at all

Everyone can choose at least
[Galaxy S 4 i9500 Original Android Development] supercurio:
Oh by the way I chose a modified boot.img for the demo for a specific reason.

At first I was trying to flash a CWM by cofface you know but it was ending up not flashed (or original recovery was restored)

If anyone knows how to flash a recovery without special manipulations on latest firmwares I'll gladly use that instead of repacking kernel images ;)

Not touching the kernel at all would be much nicer.