Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #329

Draft
wants to merge 225 commits into
base: cm-10.1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
db5ff67
remove arm mode
koush Mar 11, 2013
5b98240
remove arm mode
koush Mar 11, 2013
db9c81d
Merge remote-tracking branch 'cmremote/cm-10.1' into cm-10.1
koush Mar 11, 2013
2319587
disable market open
koush Mar 11, 2013
62843e1
autogrant radio/system as appropriate (prevent crashing on stock roms)
koush Mar 11, 2013
f8a942d
su binary v8
koush Mar 11, 2013
7bce4c3
fixup platform detection in update-binary
koush Mar 11, 2013
379371b
Allow su to execute binary directly if -c is not supplied.
koush Mar 12, 2013
a4a9c0f
rev version
koush Mar 12, 2013
4ac5aa1
Superuser: Update German translation
jacobmllr95 Mar 11, 2013
064277e
Superuser: Update italian translation
rheeze Mar 12, 2013
a430163
Superuser: Simplified Chinese Translations + Chinese Locale Cleanup
Jiangyi Mar 11, 2013
d1d6273
es_ES: Fix spanish translations
Mar 11, 2013
d9738ea
PT-BR: Update translations
Whitexp Mar 10, 2013
e2505a9
Superuser : French translation correction
DelphinPETER Mar 11, 2013
4f4c8bb
Superuser: Initial Greek translation
mikeNG Mar 12, 2013
17df638
Superuser: Add Czech translation
mikeNG Mar 12, 2013
6398fa9
Added Hungarian translations
tothtamassyman Mar 12, 2013
b73fad6
Added Polish language
tompopielarczyk Mar 13, 2013
811d07d
Merge "PT-BR: Update translations" into cm-10.1
therbom Mar 13, 2013
e70db36
Merge "Superuser: Add Czech translation" into cm-10.1
therbom Mar 13, 2013
e4ec543
Merge "Added Hungarian translations" into cm-10.1
therbom Mar 13, 2013
768b892
Merge "es_ES: Fix spanish translations" into cm-10.1
therbom Mar 13, 2013
985e195
Merge "Superuser : French translation correction" into cm-10.1
therbom Mar 13, 2013
6fbdbc5
Merge "Superuser: Initial Greek translation" into cm-10.1
therbom Mar 13, 2013
ac6ed69
Merge "Added Polish language" into cm-10.1
therbom Mar 13, 2013
446bb5b
Merge "Superuser: Update German translation" into cm-10.1
maniac103 Mar 14, 2013
2c1a38b
fix up x86 detection during in app system install
koush Mar 15, 2013
d5bba03
rev version;
koush Mar 18, 2013
2be82fa
rev version;
koush Mar 18, 2013
263fb47
The reason for the original commit is flawed:
koush Mar 18, 2013
90c2944
Update strings.xml
pylerSM Mar 18, 2013
e8b4624
Update strings.xml
pylerSM Mar 18, 2013
528b5c5
Merge pull request #143 from pylerSM/master
koush Mar 20, 2013
e160a93
Superuser: Update Polish translation
tompopielarczyk Mar 21, 2013
e608b5d
Add Superuser uk translation
Vavooon Mar 30, 2013
3dcccd3
SECURITY FIX: Fix package uids being reused between uninstall and rei…
koush Mar 30, 2013
2aa2d41
Merge remote-tracking branch 'koush/master' into cm-10.1
koush Mar 30, 2013
acf7528
Merge remote-tracking branch 'github/cm-10.1' into cm-10.1
koush Mar 30, 2013
27c5fb1
Rev version. Null check.
koush Mar 30, 2013
6450d0e
Whats new
koush Mar 30, 2013
0f651e8
Superuser: added Norwegian translation
odinuge Mar 24, 2013
f694b41
Merge "Add Superuser uk translation" into cm-10.1
therbom Apr 5, 2013
e7122ae
Japanese : update Japanese translation.
takuo Mar 18, 2013
74d131a
Merge "Superuser: added Norwegian translation" into cm-10.1
therbom Apr 12, 2013
a8d0305
Superuser: NL translations
therbom Mar 30, 2013
e644b23
Superuser: CS translation
Keltek Apr 22, 2013
d4329a1
add reboot binary
koush May 2, 2013
991f706
1018
koush May 2, 2013
0a99cad
Superuser: Add AF Translations
isimobile Mar 14, 2013
bc52d17
Superuser: ES translations
May 20, 2013
88b8c54
Superuser: TR translations
okrt May 23, 2013
ba3c786
Superuser: Simplified Chinese Translations
Jiangyi Jun 5, 2013
9eaeab2
Added PT-PT language support for Superuser
brisky Jun 10, 2013
d7dac49
Merge "Superuser: Simplified Chinese Translations" into cm-10.1
maniac103 Jun 14, 2013
a7752e9
Superuser: PT-PT translations: minor corrections
brisky Jun 15, 2013
5a9cc29
Superuser: Translation fixes
Jiangyi Jun 5, 2013
6c114af
Merge "Superuser: PT-PT translations: minor corrections" into cm-10.1
therbom Jun 26, 2013
e6e1886
Merge "Superuser: Translation fixes" into cm-10.1
maniac103 Jun 27, 2013
1e6eb3c
Superuser: Fix German translation
jacobmllr95 Jun 27, 2013
1fc34f3
Merge pull request #165 from CyanogenMod/cm-10.1
koush Jul 24, 2013
c200cf7
Superuser 4.3 fixes.
koush Jul 27, 2013
8c918b2
Fix build
koush Jul 28, 2013
5ef9f3a
cleanups and sanity check string length
koush Jul 28, 2013
984ec08
Add missing NULL sentinel.
koush Jul 29, 2013
4f8c024
Add missing NULL sentinel.
koush Jul 29, 2013
a084ab9
Add support for su daemon installation and detection in recovery zip.
koush Jul 30, 2013
ca54630
Superuser 4.3 fixes.
koush Jul 27, 2013
ce4060f
Fix build
koush Jul 28, 2013
9ff3fb4
cleanups and sanity check string length
koush Jul 28, 2013
d0db622
Add support for su daemon installation and detection in recovery zip.
koush Jul 30, 2013
33489f1
install-recovery.sh packaging
koush Jul 30, 2013
e37046f
Merge remote-tracking branch 'github/cm-10.1' into cm-10.2
koush Jul 30, 2013
c7adb38
Rev the su binary version.
koush Jul 30, 2013
0cb0e4c
fix 4.3 check logic
koush Jul 30, 2013
5ba79e6
fix script failure
koush Jul 30, 2013
ff79bcb
For some reason log exec calls from the daemon
koush Jul 30, 2013
5f2c658
Submitting to POSIX C standard: fork_zero_fucks.
koush Jul 30, 2013
69a0436
more cleanups around waitpid
koush Jul 30, 2013
7b7c154
unset immutable bit on install-recovery.sh
koush Jul 31, 2013
70d5169
Fix endif spacing
evan-a-a Jul 31, 2013
6f1029c
unset immutable bit on su
koush Aug 1, 2013
e015fc5
superuser: updated finnish translations
niko0o Jul 31, 2013
45af423
Fix recovery install via app.
koush Aug 5, 2013
c7d759a
v1020
koush Aug 5, 2013
c52767b
Helium
koush Aug 5, 2013
7c66ccb
Superuser: FI translations
niko0o Aug 6, 2013
609f489
Merge "superuser: updated finnish translations" into cm-10.2
therbom Aug 8, 2013
e72d31c
Fix Makefile for non embedded ROMs
koush Aug 8, 2013
f3454b5
Merge remote-tracking branch 'github/cm-10.1' into cm-10.2
koush Aug 8, 2013
f1adc4c
Superuser: fixed FI translations
niko0o Aug 9, 2013
72bebe6
Superuser: fixed FI translations
niko0o Aug 9, 2013
72d5412
sanitize inputs. verify mallocs.
koush Aug 12, 2013
2c92504
Fix potential trust issues by using SO_PEERCRED.
koush Aug 12, 2013
f9cee64
Merge remote-tracking branch 'github/cm-10.1' into cm-10.2
koush Aug 12, 2013
6aba49a
v1021
koush Aug 12, 2013
ed2bc86
Merge remote-tracking branch 'koush/master' into cm-10.2
koush Aug 12, 2013
0fc942f
update WHATS_NEW
koush Aug 12, 2013
fdc28d8
always start daemon, as that is the default behavior.
koush Aug 12, 2013
be9c080
Superuser: SK translation
Keltek Aug 11, 2013
17c92e9
Superuser: CS translation
Keltek Jul 29, 2013
1bf4fbf
Change the root_access property by SystemProperties.set
android-x86 Aug 16, 2013
63485ab
Part 1 of terminal support fix
tan-ce Aug 29, 2013
41ec6ea
Added SIGWINCH handling and better cleanup
tan-ce Aug 30, 2013
1adfb9e
Refactored pseudo-terminal code into pts.c
tan-ce Aug 30, 2013
c12d46f
Undo a change which resulted in dangling FDs
tan-ce Aug 30, 2013
a616c92
Removed a hackish check for stdout in pump()
tan-ce Aug 30, 2013
d558f1d
Made scoket protocol uniform
tan-ce Aug 30, 2013
3a21f0a
Changed when the client sends pts-slave
tan-ce Sep 1, 2013
b31647d
Treat each standard I/O stream separately
tan-ce Sep 2, 2013
0c02064
Superuser: PT-rPT translations
joaopluis Sep 7, 2013
8881f70
Eliminated use of FIFOs, factored PTY proxy code
tan-ce Sep 8, 2013
af18f5a
Make emulated storage available via su.
maniac103 Sep 17, 2013
bd9a459
Change target API from 17 to 18
BILLyTheLiTTle Sep 20, 2013
21a1fa9
Fix several Lint's warnings
BILLyTheLiTTle Sep 20, 2013
c712352
su is an optional component
rmcc Sep 25, 2013
cd953bd
Fix incorrect prerequisites
cwhuang Aug 15, 2013
4bfe963
Make emulated storage mounting consistent to Zygote.
maniac103 Sep 23, 2013
63afa5a
Only use access_disabled if SUPERUSER_EMBEDDED.
koush Oct 6, 2013
91432a2
Merge "Make emulated storage mounting consistent to Zygote." into cm-…
koush Oct 10, 2013
1a0d68c
Superuser: UG translation, added Uyghur translation.
AbduqadirAbliz Oct 26, 2013
2a189d8
Update version check to work with >= 4.3
tmzullinger Nov 6, 2013
f7a13f2
Merge pull request #194 from tmzullinger/kitkat-version-check
koush Nov 6, 2013
787c936
README: Update build information
cernekee Nov 6, 2013
426d394
reboot: Build utility from source
cernekee Nov 7, 2013
80f10e6
MainActivity: Split getArch() into a common function
cernekee Nov 7, 2013
6b54004
Use new assets/<ARCH>/reboot binary
cernekee Nov 7, 2013
14102fc
Add MIPS support
cernekee Nov 7, 2013
e757967
Merge pull request #195 from cernekee/mips-v1
koush Nov 7, 2013
db2065d
Merge remote-tracking branch 'koush/master' into cm-10.2
koush Nov 7, 2013
ac30119
comment out hte multiuser stuff that is breaking regular ndk builds
koush Nov 7, 2013
1a63a88
1022
koush Nov 8, 2013
8ddf9c3
Add Lithuanian translations
Frant1c Nov 8, 2013
6d95bf5
execv invocation fixes
koush Nov 14, 2013
b8d17bf
README: Update required SDK and NDK versions
cernekee Nov 15, 2013
91ceab6
update-binary: Fix 4.3+ version check
cernekee Nov 15, 2013
1a03a36
require that --daemon is uid/gid 0
koush Nov 14, 2013
b6b13f2
Fix superuser when using ART.
koush Nov 15, 2013
d5def08
Merge pull request #198 from cernekee/version-v1
koush Nov 16, 2013
1357863
Revert back to original daemon client usage behavior.
koush Nov 16, 2013
20f61c2
Superuser: CA translations
arnaullv Nov 16, 2013
cbb357f
Merge "Revert back to original daemon client usage behavior. Fix ART …
koush Nov 21, 2013
e45c65c
1024
koush Nov 21, 2013
8829fc3
su daemon fixes:
koush Nov 21, 2013
e4b4e91
fix tab
koush Nov 21, 2013
436f4b2
1026
koush Nov 21, 2013
0135135
wtf
koush Nov 21, 2013
e48e124
Fix typos.
maniac103 Nov 22, 2013
ed55b0e
Improve logging code.
maniac103 Nov 22, 2013
2766f60
Merge "Add Lithuanian translations" into cm-10.2
therbom Nov 22, 2013
b27031e
Add workaround for Samsung set*id restrictions (bug #196)
cernekee Nov 23, 2013
699e4a9
Don't use "am --user" unless multiuser mode is enabled (bug #204)
cernekee Nov 23, 2013
2055ffc
daemon: do not leak resources
Lekensteyn Nov 24, 2013
f88bb10
Merge pull request #206 from Lekensteyn/fix-resource-leaks
koush Nov 24, 2013
2dd3528
Don't use "am --user" unless multiuser mode is enabled (bug #204)
cernekee Nov 23, 2013
95b77e3
Merge remote-tracking branch 'koush/master' into cm-10.2
koush Nov 24, 2013
fd66468
Update activity.c
h1618 Nov 28, 2013
897a880
Merge pull request #208 from h1618/patch-1
koush Nov 29, 2013
a16b468
assign user before use
h1618 Nov 29, 2013
5292088
Merge pull request #211 from h1618/patch-1
koush Nov 29, 2013
81a5d88
Merge remote-tracking branch 'github/cm-10.2' into cm-11.0
koush Nov 29, 2013
efc2142
Merge remote-tracking branch 'koush/master' into cm-11.0
koush Nov 29, 2013
a43f033
Merge remote-tracking branch 'cern/multiuser-regression-v1' into cm-11.0
koush Nov 29, 2013
7ab528e
Version 1.0.2.7
koush Dec 1, 2013
11d1e2c
rev versions
koush Dec 1, 2013
74363ea
assets: Add missing mips/ symlink
cernekee Nov 24, 2013
a5bb68f
Merge pull request #213 from cernekee/mips-missing-symlink-v1
koush Dec 1, 2013
89083a4
Superuser: LT translations
Frant1c Dec 4, 2013
8ddb8f5
Superuser: LT translations
Frant1c Dec 11, 2013
57e6f34
Superuser : TH translation
pureexe Jan 1, 2014
8516028
Merge "Superuser : TH translation" into cm-11.0
therbom Jan 4, 2014
45d0d3f
Minor typo fix in Italian language
GMagician Jan 4, 2014
edfb5a9
Merge pull request #219 from GMagician/master
koush Jan 5, 2014
b31c141
Merge remote-tracking branch 'tance/terminal-support' into cm-11.0
koush Jan 12, 2014
747679e
Merge remote-tracking branch 'koush/master' into cm-11.0
koush Jan 12, 2014
0272c3b
su: pts: Fix mismatched return type
rmcc Jan 12, 2014
3c7d407
su: Add pts as a dependency
rmcc Jan 12, 2014
c6fa96b
Superuser: LT translations
Frant1c Jan 18, 2014
b85253e
daemon: Send TTYs directly when SUPERUSER_SEND_TTY is set.
mkasick Jan 20, 2014
d60d6aa
Superuser: LT translations
Frant1c Jan 19, 2014
dd7824a
Superuser: add copyright notice
therbom Jan 24, 2014
a6cf75c
Fix merge derp: Emulated storage should be mounted in the child, not the
maniac103 Jan 31, 2014
f10f691
Fix bugreport toast spam.
koush Feb 2, 2014
9e683de
1029
koush Feb 2, 2014
f465a0a
Fix bugreport toast spam.
marado Feb 1, 2014
7bf5efd
Merge "Fix merge derp: Emulated storage should be mounted in the chil…
maniac103 Feb 5, 2014
b0bfdbc
v1030
koush Feb 10, 2014
628af70
Merge remote-tracking branch 'koush/master' into cm-11.0
koush Feb 10, 2014
d3707a4
Merge pull request #222 from mkasick/master
koush Feb 12, 2014
215b8e4
Superuser: IW translations
arthurzam Feb 16, 2014
a4b3c46
Superuser: ES translations
Feb 24, 2014
5e1af17
Merge "Superuser: ES translations" into cm-11.0
therbom Feb 24, 2014
b5a0f3c
Fix several compiler warnings
BILLyTheLiTTle Sep 20, 2013
c1a1eca
Fix Trash icon/action bug
BILLyTheLiTTle Sep 21, 2013
de4b6c1
Create pop-up dialog for each application
BILLyTheLiTTle Sep 21, 2013
4157a6a
Greek translation for pop-up dialog
BILLyTheLiTTle Nov 8, 2013
cefff29
Superuser: IT translations
Feb 25, 2014
35cd99c
Superuser: EL translations
mikeNG Feb 25, 2014
c01f6af
Superuser: NL translation
crxed9 Feb 26, 2014
32a415f
Superuser: FR translation
DelphinPETER Feb 27, 2014
c632aa5
Merge "Superuser: NL translation" into cm-11.0
therbom Feb 28, 2014
14aa29b
Merge "Superuser: FR translation" into cm-11.0
therbom Feb 28, 2014
b690d81
Fix for current activity refresh
BILLyTheLiTTle Feb 27, 2014
866fe2c
Superuser: Update DE translation
elektroschmock Mar 6, 2014
ca10fc2
Fix UXD for tablets
BILLyTheLiTTle Mar 11, 2014
4fe2538
Superuser: DA translation
Jacob-DK Mar 9, 2014
77c0e52
Superuser: ES translations
Feb 26, 2014
12a64e1
Superuser: SK translations
pylerCM Mar 10, 2014
b2d75cd
Merge "Superuser: SK translations" into cm-11.0
mikeNG Mar 24, 2014
0f79d4a
Superuser: PT-BR Translations
Gustav0ar Mar 18, 2014
cc4fe14
Superuser: CS translation
Keltek Mar 26, 2014
90143f3
Initial translation import
mikeNG Apr 2, 2014
fa811a3
Automatic translation import
mikeNG Apr 10, 2014
fd2cdfa
Automatic translation import
mikeNG Apr 17, 2014
2c008c6
Automatic translation import
mikeNG Apr 25, 2014
4db1b62
Major refactor: switch to native fragments.
koush Apr 28, 2014
6972532
Merge remote-tracking branch 'koush/master' into cm-11.0
koush Jul 7, 2014
3a25d68
gradle and support widgets
koush Jul 7, 2014
5291f21
WIP
koush Jul 7, 2014
384e0ed
Revert "Improve logging code."
koush Jul 7, 2014
4483aaa
remove need for exe link.
koush Jul 9, 2014
c0fdfc2
Prevent clickjacking of superuser requests
veeti Jul 18, 2014
4d36a1b
Merge pull request #244 from veeti/filter_touches_when_obscured
koush Jul 18, 2014
ff04fa7
Updates for new Widgets
koush Nov 21, 2014
2e5cf19
Merge branch 'master' of ssh://github.com/koush/Superuser
koush Nov 21, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ x86
obj
local.properties
gen
.DS_Store
.DS_Store
.settings
libs
build
41 changes: 33 additions & 8 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,58 @@ endif


LOCAL_PATH := $(my_path)

include $(CLEAR_VARS)

LOCAL_MODULE := su
LOCAL_MODULE_TAGS := eng debug
LOCAL_MODULE_TAGS := eng debug optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := libc
LOCAL_STATIC_LIBRARIES := libc libcutils
LOCAL_C_INCLUDES := external/sqlite/dist
LOCAL_SRC_FILES := Superuser/jni/su/su.c Superuser/jni/su/activity.c Superuser/jni/su/db.c Superuser/jni/su/utils.c ../../sqlite/dist/sqlite3.c
LOCAL_SRC_FILES := Superuser/jni/su/su.c Superuser/jni/su/daemon.c Superuser/jni/su/activity.c Superuser/jni/su/db.c Superuser/jni/su/utils.c Superuser/jni/su/pts.c ../../sqlite/dist/sqlite3.c
LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION -DREQUESTOR=\"$(SUPERUSER_PACKAGE)\"

ifdef SUPERUSER_PACKAGE_PREFIX
LOCAL_CFLAGS += -DREQUESTOR_PREFIX=\"$(SUPERUSER_PACKAGE_PREFIX)\"
endif

ifdef SUPERUSER_EMBEDDED
LOCAL_CFLAGS += -DSUPERUSER_EMBEDDED
endif

LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
include $(BUILD_EXECUTABLE)


SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,su)
$(SYMLINKS): $(LOCAL_MODULE)
$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
$(SYMLINKS):
@echo "Symlink: $@ -> /system/xbin/su"
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) ln -sf /system/xbin/su $@
$(hide) ln -sf ../xbin/su $@

ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)

# We need this so that the installed files could be picked up based on the
# local module name
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)

ifdef SUPERUSER_EMBEDDED

# make sure init.superuser.rc is imported from
# init.rc or similar

SUPERUSER_RC := $(TARGET_ROOT_OUT)/init.superuser.rc
$(SUPERUSER_RC): $(LOCAL_PATH)/init.superuser.rc | $(ACP)
$(copy-file-to-new-target)

SUPERUSER_MARKER := $(TARGET_OUT_ETC)/.has_su_daemon
$(SUPERUSER_MARKER): $(LOCAL_INSTALLED_MODULE)
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) touch $@

ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SUPERUSER_RC) $(SUPERUSER_MARKER)

endif
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ You'll need the "Widgets" dependency.
These repositories do not keep the actual projects in the top level directory.
This is because they contain tests, libs, and samples.

Make sure the SDK Platform for API 19 is installed, through the Android SDK Manager. Install NDK Revision 9b from [here](http://developer.android.com/tools/sdk/ndk/index.html).

## Eclipse

In Eclipse, import Widgets/Widgets and Superuser/Superuser. It should Just Work (TM).
Expand All @@ -36,21 +38,30 @@ In Eclipse, import Widgets/Widgets and Superuser/Superuser. It should Just Work
* $ cd /path/to/src
* $ cd Superuser/Superuser

In this directory, create a file called local.properties. This file is used by ant for custom properties. You need to specify the location of the ndk directory:
In this directory, create a file called local.properties. This file is used by ant for custom properties. You need to specify the location of the ndk directory and your keystore parameters:

```
ndk.dir=/Users/koush/src/android-ndk
key.store=/Users/koush/.keystore
key.alias=mykey
```

If you do not have a release key yet, [create one using keytool](http://developer.android.com/tools/publishing/app-signing.html).

Set up your SDK path (this is the directory containing platform-tools/, tools/, etc.):

* $ export ANDROID_HOME=/Users/koush/src/sdk

Then you can build:

* $ ant release

Outputs:
* bin/update.zip - Recovery installable zip
* bin/Superuser.apk - Superuser Android app
* bin/Superuser-release.apk - Superuser Android app
* libs/armeabi/su - ARM su binary
* libs/x86/su - x86 su binary
* libs/mips/su - MIPS su binary

## Building the su binary

Expand Down
3 changes: 2 additions & 1 deletion Superuser/.classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
27 changes: 19 additions & 8 deletions Superuser/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.koushikdutta.superuser"
android:versionCode="1013"
android:versionName="1.0.1.3" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:versionCode="1030"
android:versionName="1.0.3.0" >

<permission
android:name="android.permission.REQUEST_SUPERUSER"
Expand Down Expand Up @@ -94,9 +90,24 @@
<receiver android:name=".SuCheckerReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<!-- <action android:name="internal.superuser.BOOT_TEST" /> -->
</intent-filter>
</receiver>

<receiver android:name=".PackageChangeReceiver" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<data android:scheme="package" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>

</application>

</manifest>
</manifest>
86 changes: 86 additions & 0 deletions Superuser/Superuser-Superuser.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":Superuser:Superuser" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/res" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-21.0.2" level="project" />
<orderEntry type="module" module-name="Widgets-Widgets" exported="" />
</component>
</module>

20 changes: 20 additions & 0 deletions Superuser/Superuser.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Widgets" />
</component>
</module>

2 changes: 2 additions & 0 deletions Superuser/assets/install-recovery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/system/bin/sh
/system/xbin/su --daemon &
1 change: 1 addition & 0 deletions Superuser/assets/mips
38 changes: 35 additions & 3 deletions Superuser/assets/update-binary
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
echo -n -e 'ui_print Installing Superuser...\n' > /proc/self/fd/$2
echo -n -e 'ui_print\n' > /proc/self/fd/$2

X86=$(uname -a | grep x86)
if [ ! -z "$X86" ]
then
# detect binary versions to install
ARCH=$(uname -m)

# x86 needs to match: i486, i686, x86_64, ...
if echo "$ARCH" | grep -q 86; then
PLATFORM=x86
elif [ "$ARCH" = "mips" -o "$ARCH" = "mips64" ]; then
PLATFORM=mips
else
PLATFORM=armeabi
fi
Expand All @@ -23,13 +27,16 @@ then
mkdir -p $PLATFORM
cp /cache/su $PLATFORM/su
cp /cache/Superuser.apk .
cp /cache/install-recovery.sh .
fi


echo -n -e 'ui_print Installing '$PLATFORM' binaries...\n' > /proc/self/fd/$2
echo -n -e 'ui_print\n' > /proc/self/fd/$2

mount /system
chattr -i /system/bin/su
chattr -i /system/xbin/su
rm -f /system/bin/su
rm -f /system/xbin/su
rm -f /system/app/Superuser.*
Expand All @@ -47,4 +54,29 @@ ln -s /system/xbin/su /system/bin/su
cp Superuser.apk /system/app
chmod 644 /system/app/Superuser.apk

# if the system is at least 4.3, and there is no su daemon built in,
# let's try to install it using install-recovery.sh
BUILD_VERSION_SDK="$(grep 'ro\.build\.version\.sdk' /system/build.prop)"
BUILD_VERSION_SDK="${BUILD_VERSION_SDK##*=}"

if [ "$BUILD_VERSION_SDK" -ge 18 ]
then
# check for rom su daemon before clobbering install-recovery.sh
if [ ! -f "/system/etc/.has_su_daemon" ]
then
echo -n -e 'ui_print Installing Superuser daemon...\n' > /proc/self/fd/$2
echo -n -e 'ui_print\n' > /proc/self/fd/$2
chattr -i /system/etc/install-recovery.sh
chattr -i /system/bin/install-recovery.sh
cp install-recovery.sh /system/etc/install-recovery.sh
cp install-recovery.sh /system/bin/install-recovery.sh
chmod 755 /system/etc/install-recovery.sh
chmod 755 /system/bin/install-recovery.sh
# note that an post install su daemon was installed
# so recovery doesn't freak out and recommend you disable
# the install-recovery.sh execute bit.
touch /system/etc/.installed_su_daemon
fi
fi

umount /system
Loading