Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,799 Members 48,139 Now Online
XDA Developers Android and Mobile Development Forum

[TOOL] SimpleSU v0.7

Tip us?
 
_n0p_
Old
(Last edited by _n0p_; 2nd April 2013 at 10:44 AM.) Reason: 0.7
#1  
_n0p_'s Avatar
Senior Member - OP
Thanks Meter 1824
Posts: 2,557
Join Date: Apr 2009
Location: Kiev
Prompt [TOOL] SimpleSU v0.7

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:
Select 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, 170 views)
File Type: zip SimpleSUv0.2b.zip - [Click for QR Code] (3.0 KB, 46 views)
File Type: zip SimpleSUv0.3b.zip - [Click for QR Code] (3.2 KB, 214 views)
File Type: zip SimpleSUv0.4.zip - [Click for QR Code] (3.2 KB, 97 views)
File Type: zip SimpleSUv0.5.zip - [Click for QR Code] (3.4 KB, 393 views)
File Type: apk DSC_SimpleSU_ACL.apk - [Click for QR Code] (29.5 KB, 407 views)
File Type: zip SimpleSUv0.7.zip - [Click for QR Code] (3.7 KB, 285 views)
File Type: zip SimpleSU.Insecure.v0.7.zip - [Click for QR Code] (2.1 KB, 230 views)
The Following 44 Users Say Thank You to _n0p_ For This Useful Post: [ Click to Expand ]
 
_n0p_
Old
#2  
_n0p_'s Avatar
Senior Member - OP
Thanks Meter 1824
Posts: 2,557
Join Date: Apr 2009
Location: Kiev
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: [ Click to Expand ]
 
arryhariyadi
Old
#3  
arryhariyadi's Avatar
Senior Member
Thanks Meter 48
Posts: 253
Join Date: Nov 2011
Location: Balikpapan

 
DONATE TO ME
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: [ Click to Expand ]
 
Androidmarketuser
Old
#4  
Androidmarketuser's Avatar
Senior Member
Thanks Meter 192
Posts: 303
Join Date: 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

If you are also annoyed by advertisments on XDA, please comment in this thread: Intrusive ads? Post here!
My work:
SLIM FACTORY V4.0
SUPERCHARGER V6 GUIDE
 
ItzCrooK2UxD
Old
#5  
ItzCrooK2UxD's Avatar
Senior Member
Thanks Meter 274
Posts: 208
Join Date: Nov 2011
Location: Orlando, FL
com.noshufou.android.su.elite for Superuser Elite
Current Device: LG Nexus 5 (32GB)
ROM: Stock
Recovery: TWRP
Kernel: Stock

Device: HTC EVO 3D *RETIRED*
ROM: SmoothCriminal-v2.x / Anthrax'd CM 10 / Viper3D 1.0.0 r268
Firmware: 2.89 (Freeza's OTA)
HBoot: ENG HBoot 1.04
Recovery: 4EXT v2.4.3
Kernel: AnThaX 3.6.7

The Following User Says Thank You to ItzCrooK2UxD For This Useful Post: [ Click to Expand ]
 
Shree_Jamdar
Old
#6  
Shree_Jamdar's Avatar
Senior Member
Thanks Meter 58
Posts: 250
Join Date: Oct 2010
Default 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 !
 
karandpr
Old
#7  
karandpr's Avatar
Recognized Contributor
Thanks Meter 1233
Posts: 1,130
Join Date: Feb 2011

 
DONATE TO ME
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: [ Click to Expand ]
 
pawan1993
Old
#8  
Senior Member
Thanks Meter 201
Posts: 460
Join Date: Sep 2010
Quote:
Originally Posted by Androidmarketuser View Post
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.
 
_n0p_
Old
#9  
_n0p_'s Avatar
Senior Member - OP
Thanks Meter 1824
Posts: 2,557
Join Date: Apr 2009
Location: Kiev
Oh. Looks SimpleSU got in news

Quote:
Originally Posted by Androidmarketuser View Post
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 View Post
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: [ Click to Expand ]
 
Androidmarketuser
Old
#10  
Androidmarketuser's Avatar
Senior Member
Thanks Meter 192
Posts: 303
Join Date: Oct 2010
Quote:
Originally Posted by _n0p_ View Post
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.

If you are also annoyed by advertisments on XDA, please comment in this thread: Intrusive ads? Post here!
My work:
SLIM FACTORY V4.0
SUPERCHARGER V6 GUIDE

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

Advanced Search
Display Modes