X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=README.md;h=6fb87f86984df3949d3c3527dd8f2a8853e91f50;hb=9ace3dcb12428d46cffaf9113e4265c20b96f7e1;hp=70ee9e5458875fd2922c2f225f3bb5c557a1b0bb;hpb=6b5e21995bf791345e260edb34c1f2be6a460a86;p=android-x86%2Fexternal-koush-Superuser.git diff --git a/README.md b/README.md index 70ee9e5..6fb87f8 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,16 @@ * Superuser should also be AOSP buildable for those that want to embed it in their ROM. * Superuser should also be AOSP _embeddable_, meaning a ROM can easily embed it into their Settings app. * Maintenance and updates on both the market and source repositories should be timely. -* I want to be able to point users of my app to a Superuser solution that I wrote, that I know works, and that I can fix if something is wrong. Yes, this is selfish: Carbon does not work with some versions of Chainsdd's Superuser. SuperSU works great, but I am not comfortable pointing a user to a closed source su implementation. +* I want to be able to point users of my app to a Superuser solution that I wrote, that I know works, and that I can fix if something is wrong. * Handle multiuser (4.2+) properly * Handle concurrent su requests properly +## Translations + +Translations are very much appreciated, but please do not submit translations on Github! Instead, use the review submission process on [CyanogenMod's gerrit instance](http://review.cyanogenmod.org/#/q/status:open,n,z). + + + ## Checking out the source You'll need the "Widgets" dependency. @@ -20,27 +26,47 @@ 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). ## Ant -Same old, same old. - * $ mkdir /path/to/src * $ 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 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 +You can use ant as shown above, to build the binary, but it can also be built without building the APK. + Make sure you have the android-ndk downloaded with the tool "ndk-build" in your path. * $ cd /path/to/src/ @@ -77,134 +103,15 @@ SUPERUSER_PACKAGE := com.mypackagename.superuser #### Advanced - Embedding Superuser into System Settings You will not need to change the package name as described above. Superuser will simply go -into the com.android.settings package. To modify the Settings app, you will need this [patch](https://gist.github.com/koush/5059098). -The patch simply references the sources checked out to external/koush and makes changes -to XML preference files and the AndroidManifest.xml. It is a very minimal change: - -```diff - -diff --git a/Android.mk b/Android.mk -index fe8ed2d..6dea5b0 100644 ---- a/Android.mk -+++ b/Android.mk -@@ -13,6 +13,11 @@ LOCAL_CERTIFICATE := platform - - LOCAL_PROGUARD_FLAG_FILES := proguard.flags - -+LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true -+LOCAL_AAPT_FLAGS := --extra-packages com.koushikdutta.superuser:com.koushikdutta.widgets -S $(LOCAL_PATH)/../../../external/koush/Widgets/Widgets/res -S $(LOCAL_PATH)/../../../external/koush/Superuser/Superuser/res --auto-add-overlay -+ -+LOCAL_SRC_FILES += $(call all-java-files-under,../../../external/koush/Superuser/Superuser/src) $(call all-java-files-under,../../../external/koush/Widgets/Widgets/src) -+ - include $(BUILD_PACKAGE) - - # Use the folloing include to make our test apk. -diff --git a/AndroidManifest.xml b/AndroidManifest.xml -index 72be71b..4171800 100644 ---- a/AndroidManifest.xml -+++ b/AndroidManifest.xml -@@ -64,6 +64,29 @@ - - - -+ -+ -+ -+ -+ -+ -+ - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - - -+ -+
-+ - -