OSDN Git Service

Run the Superuser app in system uid android-x86-4.4-r1
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 20 May 2014 10:08:47 +0000 (18:08 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 4 Aug 2014 14:08:23 +0000 (22:08 +0800)
The app needs system uid to change the property persist.sys.root_access.

Always install init.superuser.rc no matter it's embedded or not.

Android.mk
Superuser/Android.mk
Superuser/AndroidManifest.xml

index 0b9d268..3bd11de 100644 (file)
@@ -50,8 +50,6 @@ ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
 ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
     $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
 
-ifdef SUPERUSER_EMBEDDED
-
 # make sure init.superuser.rc is imported from
 # init.rc or similar
 
@@ -59,13 +57,16 @@ SUPERUSER_RC := $(TARGET_ROOT_OUT)/init.superuser.rc
 $(SUPERUSER_RC): $(LOCAL_PATH)/init.superuser.rc | $(ACP)
        $(copy-file-to-new-target)
 
+ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(SUPERUSER_RC)
+
+ifdef SUPERUSER_EMBEDDED
+
 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)
+ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(SUPERUSER_MARKER)
 
 endif
index e2215ba..814288b 100644 (file)
@@ -3,6 +3,8 @@ include $(CLEAR_VARS)
 
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
 LOCAL_PACKAGE_NAME := Superuser
+LOCAL_CERTIFICATE := platform
+LOCAL_PRIVILEGED_MODULE := true
 LOCAL_SRC_FILES := $(call all-java-files-under,src) $(call all-java-files-under,../../Widgets/Widgets/src)
 
 LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
index d4ad73b..b1dd15b 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.koushikdutta.superuser"
+    android:sharedUserId="android.uid.system"
     android:versionCode="1030"
     android:versionName="1.0.3.0" >