OSDN Git Service

Only use access_disabled if SUPERUSER_EMBEDDED.
authorKoushik Dutta <koushd@gmail.com>
Sun, 6 Oct 2013 05:36:53 +0000 (22:36 -0700)
committerKoushik Dutta <koushd@gmail.com>
Sun, 6 Oct 2013 05:36:53 +0000 (22:36 -0700)
It is not possible to reenable Superuser when non embedded. su will reject.

Change-Id: If440d9d758c21c61a2d7c0bef132eb716b494c5d

Android.mk
Superuser/jni/su/su.c

index 8030a7b..89d0260 100644 (file)
@@ -28,6 +28,10 @@ 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)
 
index 6cbe724..5451898 100644 (file)
@@ -559,6 +559,9 @@ static __attribute__ ((noreturn)) void allow(struct su_context *ctx) {
  * Find the properties ourselves.
  */
 int access_disabled(const struct su_initiator *from) {
+#ifndef SUPERUSER_EMBEDDED
+    return 0;
+#else
     char *data;
     char build_type[PROPERTY_VALUE_MAX];
     char debuggable[PROPERTY_VALUE_MAX], enabled[PROPERTY_VALUE_MAX];
@@ -608,6 +611,7 @@ int access_disabled(const struct su_initiator *from) {
 
     }
     return 0;
+#endif
 }
 
 static int is_api_18() {