Skip to content

Commit

Permalink
always allow root/shell, no matter if superuser is not installed
Browse files Browse the repository at this point in the history
Change-Id: I65d4beb8785f1835bb14dfbde8a61749bd167229
koush committed Mar 5, 2013
1 parent 325d48e commit 75c720a
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Superuser/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +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="1008"
android:versionName="1.0.0.8" >
android:versionCode="1009"
android:versionName="1.0.0.9" >

<uses-sdk
android:minSdkVersion="8"
12 changes: 6 additions & 6 deletions Superuser/jni/su/su.c
Original file line number Diff line number Diff line change
@@ -703,6 +703,12 @@ int main(int argc, char *argv[]) {
read_options(&ctx);
user_init(&ctx);

// TODO: customizable behavior for shell? It can currently be toggled via settings.
if (ctx.from.uid == AID_ROOT || ctx.from.uid == AID_SHELL) {
LOGD("Allowing root/shell.");
allow(&ctx);
}

// verify superuser is installed
if (stat(ctx.user.base_path, &st) < 0) {
// send to market
@@ -738,12 +744,6 @@ int main(int argc, char *argv[]) {

ctx.umask = umask(027);

// TODO: customizable behavior for shell? It can currently be toggled via settings.
if (ctx.from.uid == AID_ROOT || ctx.from.uid == AID_SHELL) {
LOGD("Allowing root/shell.");
allow(&ctx);
}

int ret = mkdir(REQUESTOR_CACHE_PATH, 0770);
if (chown(REQUESTOR_CACHE_PATH, st.st_uid, st.st_gid)) {
PLOGE("chown (%s, %ld, %ld)", REQUESTOR_CACHE_PATH, st.st_uid, st.st_gid);
2 changes: 1 addition & 1 deletion Superuser/jni/su/su.h
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@
#define xstr(a) str(a)
#define str(a) #a

#define VERSION_CODE 3
#define VERSION_CODE 4
#define VERSION xstr(VERSION_CODE) " " REQUESTOR

#define PROTO_VERSION 1
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ public static void checkSu(Context context) throws Exception {
throw new Exception("unknown su");

String[] parts = result.split(" ");
if (!"3".equals(parts[0]))
if (!"4".equals(parts[0]))
throw new Exception("binary is old");
}

0 comments on commit 75c720a

Please sign in to comment.