Post Reply

[TOOL] SimpleSU v0.7

7th November 2012, 01:11 PM   |  #1  
_n0p_'s Avatar
OP Senior Member
Flag Kiev
Thanks Meter: 1,827
 
2,557 posts
Join Date:Joined: Apr 2009
More
So.
As i was slowly preparing DSC v2.0 i met a hard decision: what root tool to include
Both Superuser and SuperSU are nice, but quite heavy

I decided to take my own way - rewrite su executable itself to suit my vision:

I've aknowledged that i have not modified my root access list for half a year. I don't need and don't want a separate Java process to control root access. I want a simple way to allow root access for application (via whitelist), but block unwanted (i.e. all not in list). Still, it should allow end-user to install either SuperSU or Superuser.
In short - ideal su solution for myself that should also work good for depersonalized custom ROM (with predefined access list), leaving it to end-user to decide which app he will install for superuser access.
And i didn't find a ready solution, so decided to write my own.

Here it is (attached):

SimpleSU
Simplest and lightest superuser solution (with access control)

How it's done:
Same as usual SU for Linux with control access list read from /system/etc/dsc.su_list
dsc.su_list structure is very simple:
One line per android app (case sensitive), windows and unix line breaks should be supported fine.
Current proposed list for DSC 2.0 (and an example):
 

dsc.SimpleSU.acl
dsc.settings
dsc.uv
dsc.levels
dsc.mugen
jackpal.androidterm
ru.org.amip.ClockSync
eu.chainfire.supersu
eu.chainfire.supersu.pro
com.ryosoftware.adbw
com.googlecode.droidwall.free
com.noshufou.android.su
de.schaeuffelhut.android.openvpn
de.schaeuffelhut.android.openvpn.installer
com.elsdoerfer.android.autostarts
com.speedsoftware.rootexplorer
com.geeksoft.screenshot
com.rerware.android.MyBackupPro
com.ghostsq.commander
ws.plattner.cifsmanager
mobi.pruss.superdim
com.force.timezonefixer
com.bigtincan.android.adfree

Caller process tree is walked till init, if match is found, access is granted.

How to install?
Via adb shell:
Code:
adb push su /system/xbin/
adb shell chmod 6755 /system/xbin/su
adb push dsc.su_list /system/etc
adb shell chown root.root /system/etc/dsc.su_list
adb shell chmod 644 /system/etc/dsc.su_list
Note that you have to manually add entries to white list (/system/etc/dsc.su_list) to grant root access in form of app full Java class name. For example, it's com.keramidas.TitaniumBackup for Titanium Backup.

As pointed by dr911, works in multiuser environment (being a linux binary).

Currenly SimpleSU supports two command formats:

Usual: su -c 'make me a sandwich'. Note that only "-c" works now. Seems to be enough though. Command simply passed to the shell.

Legacy (as seen in Google/Android su source): su username make me a sandwich. Shell is not executed in this case, so no environment variables right now in this format.

Have fun,
Sergei.

Changelog:
02.04.2013: v0.7. ":service" suffix granted root access for already granted app, more logging on reject. (0.6 had only more logging)
27.11.2012: GUI updated - forgot about remounting /system in rw mode. Attached to this post.
21.11.2012: GUI done. http://forum.xda-developers.com/show...5&postcount=41
14.11.2012: v0.5. LD_LIBRARY_PATH fixup (taken from ChainsDD), pointed by Rupert Rawnsley. Also some legacy format command-line handling changed. Also, insecure version added (no checks made, asked=granted).
11.11.2012: v0.4. Code cleanup, no longer beta, revised and fixed code with potential string overflows.
09.11.2012: v0.3b. Code changed to allow legacy format command execution.
09.11.2012: v0.2b. Fixed call with multiply parameters. OpenVPN installer works. Dynamic linking, so very small binary. Logging to system log.
07.11.2012: Fixed segmentation fault on reject, added version and build date, removed debug info.
Attached Files
File Type: zip SimpleSUv0.1b.zip - [Click for QR Code] (51.8 KB, 175 views)
File Type: zip SimpleSUv0.2b.zip - [Click for QR Code] (3.0 KB, 47 views)
File Type: zip SimpleSUv0.3b.zip - [Click for QR Code] (3.2 KB, 215 views)
File Type: zip SimpleSUv0.4.zip - [Click for QR Code] (3.2 KB, 98 views)
File Type: zip SimpleSUv0.5.zip - [Click for QR Code] (3.4 KB, 396 views)
File Type: apk DSC_SimpleSU_ACL.apk - [Click for QR Code] (29.5 KB, 417 views)
File Type: zip SimpleSUv0.7.zip - [Click for QR Code] (3.7 KB, 320 views)
File Type: zip SimpleSU.Insecure.v0.7.zip - [Click for QR Code] (2.1 KB, 259 views)
Last edited by _n0p_; 2nd April 2013 at 10:44 AM. Reason: 0.7
The Following 46 Users Say Thank You to _n0p_ For This Useful Post: [ View ]
8th November 2012, 11:54 AM   |  #2  
_n0p_'s Avatar
OP Senior Member
Flag Kiev
Thanks Meter: 1,827
 
2,557 posts
Join Date:Joined: Apr 2009
More
A request:
If somebody owns Pro/Elite/other commercial Superuser or SuperSU - would you provide it's full Java class name?

For example, it's

eu.chainfire.supersu
com.noshufou.android.su

for free versions.
The Following 5 Users Say Thank You to _n0p_ For This Useful Post: [ View ]
8th November 2012, 12:50 PM   |  #3  
arryhariyadi's Avatar
Senior Member
Flag Balikpapan
Thanks Meter: 48
 
253 posts
Join Date:Joined: Nov 2011
Donate to Me
More
eu.chainfire.supersu.pro

Sent from my Amazon Kindle Fire using Tapatalk 2
The Following User Says Thank You to arryhariyadi For This Useful Post: [ View ]
9th November 2012, 11:32 PM   |  #4  
Androidmarketuser's Avatar
Senior Member
Thanks Meter: 192
 
306 posts
Join Date:Joined: Oct 2010
Can I avoid these little delays (the appearing popup of SuperSU or Superuser) with this alternative?
And if I have Superuser preinstalled can I delete it and are there other files which belongs to it and can be deleted?
Thank you for sharing your work
9th November 2012, 11:39 PM   |  #5  
ItzCrooK2UxD's Avatar
Senior Member
Flag Orlando, FL
Thanks Meter: 274
 
208 posts
Join Date:Joined: Nov 2011
More
com.noshufou.android.su.elite for Superuser Elite
The Following User Says Thank You to ItzCrooK2UxD For This Useful Post: [ View ]
10th November 2012, 01:07 AM   |  #6  
Shree_Jamdar's Avatar
Senior Member
Thanks Meter: 58
 
250 posts
Join Date:Joined: Oct 2010
Hi
Have you noticed any improvement in terms of speed etc? Is superuser really that heavy? How much RAM can i get by using this and ditching the superuser app? We can use this in our Galaxy 3 forum !
10th November 2012, 02:46 AM   |  #7  
karandpr's Avatar
Recognized Contributor
Thanks Meter: 1,341
 
1,546 posts
Join Date:Joined: Feb 2011
Donate to Me
More
Get the list of all android activities from here
http://activities.droidicon.com/
The Following 3 Users Say Thank You to karandpr For This Useful Post: [ View ]
10th November 2012, 05:26 AM   |  #8  
Senior Member
Thanks Meter: 201
 
461 posts
Join Date:Joined: Sep 2010
Quote:
Originally Posted by Androidmarketuser

Can I avoid these little delays (the appearing popup of SuperSU or Superuser) with this alternative?
And if I have Superuser preinstalled can I delete it and are there other files which belongs to it and can be deleted?
Thank you for sharing your work

Delete system/xbin/su and uninstall your superuser app from the system.
10th November 2012, 10:22 AM   |  #9  
_n0p_'s Avatar
OP Senior Member
Flag Kiev
Thanks Meter: 1,827
 
2,557 posts
Join Date:Joined: Apr 2009
More
Oh. Looks SimpleSU got in news

Quote:
Originally Posted by Androidmarketuser

Can I avoid these little delays (the appearing popup of SuperSU or Superuser) with this alternative?
And if I have Superuser preinstalled can I delete it and are there other files which belongs to it and can be deleted?
Thank you for sharing your work

You won't experience any delays - but in cost of manually editing the list. And no popups, it's simply a linux binary. After replacing su binary you may uninstall Java part.

Quote:
Originally Posted by Shree_Jamdar

Have you noticed any improvement in terms of speed etc? Is superuser really that heavy? How much RAM can i get by using this and ditching the superuser app? We can use this in our Galaxy 3 forum !

I did experience lags when using Superuser and SuperSU. I don't think modern device would benefit from SimpleSU. I expect to free 15-20MB. Good for Streak with 512MB.
I may eventually write a list editor, but most probably won't.

Again, this tool would do as preinstalled SU solution in Custom ROM (though i can't test >2.3 compatibility):
Grant predefined (and included in ROM) apps the superuser rights.
Allow end-user to choose and install he's preffered SU solution right from Play Store.

--
Have fun,
Sergei
The Following 3 Users Say Thank You to _n0p_ For This Useful Post: [ View ]
10th November 2012, 12:47 PM   |  #10  
Androidmarketuser's Avatar
Senior Member
Thanks Meter: 192
 
306 posts
Join Date:Joined: Oct 2010
Quote:
Originally Posted by _n0p_

You won't experience any delays - but in cost of manually editing the list. And no popups, it's simply a linux binary. After replacing su binary you may uninstall Java part.

I did experience lags when using Superuser and SuperSU. I don't think modern device would benefit from SimpleSU. I expect to free 15-20MB. Good for Streak with 512MB.
I may eventually write a list editor, but most probably won't.

Again, this tool would do as preinstalled SU solution in Custom ROM (though i can't test >2.3 compatibility):
Grant predefined (and included in ROM) apps the superuser rights.
Allow end-user to choose and install he's preffered SU solution right from Play Store.

--
Have fun,
Sergei

Exactly what I searched, thanks
I will test it on my old Desire with Android 4.1, I can tell you whether it's compatible or not.

Post Reply Subscribe to Thread

Tags
simple su, simplesu, superuser
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Software and Hacking General [Developers Only] by ThreadRank