├── .gitignore
├── Android.mk
├── LICENSE
├── README.md
├── Superuser
├── .classpath
├── .project
├── Android.mk
├── AndroidManifest.xml
├── Superuser-Superuser.iml
├── Superuser.iml
├── assets
│ ├── armeabi
│ ├── install-recovery.sh
│ ├── mips
│ ├── update-binary
│ └── x86
├── build.gradle
├── build.xml
├── jni
│ ├── Android.mk
│ ├── Application.mk
│ ├── reboot
│ │ └── reboot.c
│ ├── sqlite3
│ │ ├── shell.c
│ │ ├── sqlite3.c
│ │ ├── sqlite3.h
│ │ └── sqlite3ext.h
│ └── su
│ │ ├── activity.c
│ │ ├── daemon.c
│ │ ├── db.c
│ │ ├── pts.c
│ │ ├── pts.h
│ │ ├── su.c
│ │ ├── su.h
│ │ ├── utils.c
│ │ └── utils.h
├── lint.xml
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-hdpi-v11
│ │ └── ic_stat_notification.png
│ ├── drawable-hdpi-v9
│ │ └── ic_stat_notification.png
│ ├── drawable-hdpi
│ │ ├── ic_action_about.png
│ │ ├── ic_action_logs.png
│ │ ├── ic_action_permission.png
│ │ ├── ic_action_settings.png
│ │ ├── ic_action_trash.png
│ │ ├── ic_alert.png
│ │ ├── ic_alert_dark.png
│ │ ├── ic_allow.png
│ │ ├── ic_declare.png
│ │ ├── ic_declare_dark.png
│ │ ├── ic_delete.png
│ │ ├── ic_deny.png
│ │ ├── ic_launcher.png
│ │ ├── ic_logging.png
│ │ ├── ic_logging_dark.png
│ │ ├── ic_menu_about.png
│ │ ├── ic_menu_logs.png
│ │ ├── ic_menu_settings.png
│ │ ├── ic_menu_trash.png
│ │ ├── ic_notifications.png
│ │ ├── ic_notifications_dark.png
│ │ ├── ic_protected.png
│ │ ├── ic_protected_dark.png
│ │ ├── ic_stat_notification.png
│ │ ├── ic_theme.png
│ │ ├── ic_theme_dark.png
│ │ ├── ic_timeout.png
│ │ ├── ic_timeout_dark.png
│ │ ├── ic_toggle.png
│ │ ├── ic_toggle_dark.png
│ │ ├── ic_users.png
│ │ └── ic_users_dark.png
│ ├── drawable-ldpi-v11
│ │ └── ic_stat_notification.png
│ ├── drawable-ldpi-v9
│ │ └── ic_stat_notification.png
│ ├── drawable-mdpi-v11
│ │ └── ic_stat_notification.png
│ ├── drawable-mdpi-v9
│ │ └── ic_stat_notification.png
│ ├── drawable-mdpi
│ │ ├── ic_action_about.png
│ │ ├── ic_action_logs.png
│ │ ├── ic_action_permission.png
│ │ ├── ic_action_settings.png
│ │ ├── ic_action_trash.png
│ │ ├── ic_alert.png
│ │ ├── ic_alert_dark.png
│ │ ├── ic_allow.png
│ │ ├── ic_declare.png
│ │ ├── ic_declare_dark.png
│ │ ├── ic_delete.png
│ │ ├── ic_deny.png
│ │ ├── ic_launcher.png
│ │ ├── ic_logging.png
│ │ ├── ic_logging_dark.png
│ │ ├── ic_menu_about.png
│ │ ├── ic_menu_logs.png
│ │ ├── ic_menu_settings.png
│ │ ├── ic_menu_trash.png
│ │ ├── ic_notifications.png
│ │ ├── ic_notifications_dark.png
│ │ ├── ic_protected.png
│ │ ├── ic_protected_dark.png
│ │ ├── ic_stat_notification.png
│ │ ├── ic_theme.png
│ │ ├── ic_theme_dark.png
│ │ ├── ic_timeout.png
│ │ ├── ic_timeout_dark.png
│ │ ├── ic_toggle.png
│ │ ├── ic_toggle_dark.png
│ │ ├── ic_users.png
│ │ └── ic_users_dark.png
│ ├── drawable-xhdpi-v11
│ │ └── ic_stat_notification.png
│ ├── drawable-xhdpi-v9
│ │ └── ic_stat_notification.png
│ ├── drawable-xhdpi
│ │ ├── ic_action_about.png
│ │ ├── ic_action_logs.png
│ │ ├── ic_action_permission.png
│ │ ├── ic_action_settings.png
│ │ ├── ic_action_trash.png
│ │ ├── ic_alert.png
│ │ ├── ic_alert_dark.png
│ │ ├── ic_allow.png
│ │ ├── ic_declare.png
│ │ ├── ic_declare_dark.png
│ │ ├── ic_delete.png
│ │ ├── ic_deny.png
│ │ ├── ic_launcher.png
│ │ ├── ic_logging.png
│ │ ├── ic_logging_dark.png
│ │ ├── ic_menu_about.png
│ │ ├── ic_menu_logs.png
│ │ ├── ic_menu_settings.png
│ │ ├── ic_menu_trash.png
│ │ ├── ic_notifications.png
│ │ ├── ic_notifications_dark.png
│ │ ├── ic_protected.png
│ │ ├── ic_protected_dark.png
│ │ ├── ic_stat_notification.png
│ │ ├── ic_theme.png
│ │ ├── ic_theme_dark.png
│ │ ├── ic_timeout.png
│ │ ├── ic_timeout_dark.png
│ │ ├── ic_toggle.png
│ │ ├── ic_toggle_dark.png
│ │ ├── ic_users.png
│ │ └── ic_users_dark.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable
│ │ ├── carbon.png
│ │ ├── clockwork512.png
│ │ ├── desksms.png
│ │ ├── github.png
│ │ ├── koush.png
│ │ └── tether.png
│ ├── layout-land
│ │ ├── app_info.xml
│ │ ├── app_request.xml
│ │ └── log_item.xml
│ ├── layout-large-land
│ │ └── policy_list_content.xml
│ ├── layout-large
│ │ ├── app_info.xml
│ │ ├── app_request.xml
│ │ ├── policy_info.xml
│ │ └── policy_list_content.xml
│ ├── layout-normal-land
│ │ └── policy_info.xml
│ ├── layout-v14
│ │ ├── log_toggle.xml
│ │ └── notification_toggle.xml
│ ├── layout
│ │ ├── app_info.xml
│ │ ├── app_layout.xml
│ │ ├── app_request.xml
│ │ ├── empty.xml
│ │ ├── log_item.xml
│ │ ├── log_item_base.xml
│ │ ├── log_toggle.xml
│ │ ├── notification_toggle.xml
│ │ ├── notify.xml
│ │ ├── packageinfo.xml
│ │ ├── pin.xml
│ │ ├── policy_header.xml
│ │ ├── policy_info.xml
│ │ ├── policy_list_content.xml
│ │ ├── request.xml
│ │ ├── request_choices.xml
│ │ ├── request_spinner.xml
│ │ ├── request_spinner_choice.xml
│ │ ├── settings.xml
│ │ └── unknown_app.xml
│ ├── menu-v11
│ │ ├── app.xml
│ │ ├── main.xml
│ │ └── policy.xml
│ ├── menu
│ │ ├── app.xml
│ │ ├── main.xml
│ │ └── policy.xml
│ ├── values-af
│ │ └── strings.xml
│ ├── values-ar
│ │ └── strings.xml
│ ├── values-ca
│ │ └── strings.xml
│ ├── values-cs
│ │ └── strings.xml
│ ├── values-da
│ │ └── strings.xml
│ ├── values-de
│ │ └── strings.xml
│ ├── values-el
│ │ └── strings.xml
│ ├── values-es-rXA
│ │ └── strings.xml
│ ├── values-es
│ │ └── strings.xml
│ ├── values-fi
│ │ └── strings.xml
│ ├── values-fr
│ │ └── strings.xml
│ ├── values-gl
│ │ └── strings.xml
│ ├── values-hr
│ │ └── strings.xml
│ ├── values-hu
│ │ └── strings.xml
│ ├── values-it
│ │ └── strings.xml
│ ├── values-iw
│ │ └── strings.xml
│ ├── values-ja
│ │ └── strings.xml
│ ├── values-large-v14
│ │ └── styles.xml
│ ├── values-lt
│ │ └── strings.xml
│ ├── values-nl
│ │ └── strings.xml
│ ├── values-pl
│ │ └── strings.xml
│ ├── values-pt-rBR
│ │ └── strings.xml
│ ├── values-pt-rPT
│ │ └── strings.xml
│ ├── values-pt
│ │ └── strings.xml
│ ├── values-ro
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values-sk
│ │ └── strings.xml
│ ├── values-sr
│ │ └── strings.xml
│ ├── values-sv
│ │ └── strings.xml
│ ├── values-sw600dp
│ │ └── dimens.xml
│ ├── values-sw720dp-land
│ │ └── dimens.xml
│ ├── values-tr
│ │ └── strings.xml
│ ├── values-v14
│ │ └── styles.xml
│ ├── values-zh-rCN
│ │ └── strings.xml
│ ├── values-zh-rHK
│ │ └── strings.xml
│ ├── values-zh-rSG
│ │ └── strings.xml
│ ├── values-zh-rTW
│ │ └── strings.xml
│ ├── values-zh
│ │ └── strings.xml
│ └── values
│ │ ├── attrs.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ └── com
│ └── koushikdutta
│ └── superuser
│ ├── AboutFragment.java
│ ├── Helper.java
│ ├── LogFragment.java
│ ├── MainActivity.java
│ ├── MultitaskSuRequestActivity.java
│ ├── NotifyActivity.java
│ ├── PackageChangeReceiver.java
│ ├── PinViewHelper.java
│ ├── PolicyFragment.java
│ ├── RequestActivity.java
│ ├── SettingsFragment.java
│ ├── SuApplication.java
│ ├── SuCheckerReceiver.java
│ ├── SuReceiver.java
│ ├── db
│ ├── LogEntry.java
│ ├── SuDatabaseHelper.java
│ ├── SuperuserDatabaseHelper.java
│ ├── UidCommand.java
│ └── UidPolicy.java
│ └── util
│ ├── ImageCache.java
│ ├── Settings.java
│ ├── SoftReferenceHashTable.java
│ ├── StreamUtility.java
│ └── SuHelper.java
├── init.superuser.rc
└── local_manifest.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | armeabi
3 | x86
4 | obj
5 | local.properties
6 | gen
7 | .DS_Store
8 | .settings
9 | libs
10 | build
11 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | # Root AOSP source makefile
2 | # su is built here, and
3 |
4 | my_path := $(call my-dir)
5 |
6 | ifdef SUPERUSER_EMBEDDED
7 | SUPERUSER_PACKAGE := com.android.settings
8 | else
9 | ifeq ($(SUPERUSER_PACKAGE),)
10 | SUPERUSER_PACKAGE := com.thirdparty.superuser
11 | endif
12 | include $(my_path)/Superuser/Android.mk
13 | endif
14 |
15 |
16 | LOCAL_PATH := $(my_path)
17 | include $(CLEAR_VARS)
18 |
19 | LOCAL_MODULE := su
20 | LOCAL_MODULE_TAGS := eng debug optional
21 | LOCAL_FORCE_STATIC_EXECUTABLE := true
22 | LOCAL_STATIC_LIBRARIES := libc libcutils
23 | LOCAL_C_INCLUDES := external/sqlite/dist
24 | 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
25 | LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION -DREQUESTOR=\"$(SUPERUSER_PACKAGE)\"
26 |
27 | ifdef SUPERUSER_PACKAGE_PREFIX
28 | LOCAL_CFLAGS += -DREQUESTOR_PREFIX=\"$(SUPERUSER_PACKAGE_PREFIX)\"
29 | endif
30 |
31 | ifdef SUPERUSER_EMBEDDED
32 | LOCAL_CFLAGS += -DSUPERUSER_EMBEDDED
33 | endif
34 |
35 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
36 | include $(BUILD_EXECUTABLE)
37 |
38 |
39 | SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,su)
40 | $(SYMLINKS):
41 | @echo "Symlink: $@ -> /system/xbin/su"
42 | @mkdir -p $(dir $@)
43 | @rm -rf $@
44 | $(hide) ln -sf ../xbin/su $@
45 |
46 | ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
47 |
48 | # We need this so that the installed files could be picked up based on the
49 | # local module name
50 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
51 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
52 |
53 | ifdef SUPERUSER_EMBEDDED
54 |
55 | # make sure init.superuser.rc is imported from
56 | # init.rc or similar
57 |
58 | SUPERUSER_RC := $(TARGET_ROOT_OUT)/init.superuser.rc
59 | $(SUPERUSER_RC): $(LOCAL_PATH)/init.superuser.rc | $(ACP)
60 | $(copy-file-to-new-target)
61 |
62 | SUPERUSER_MARKER := $(TARGET_OUT_ETC)/.has_su_daemon
63 | $(SUPERUSER_MARKER): $(LOCAL_INSTALLED_MODULE)
64 | @mkdir -p $(dir $@)
65 | @rm -rf $@
66 | $(hide) touch $@
67 |
68 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
69 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SUPERUSER_RC) $(SUPERUSER_MARKER)
70 |
71 | endif
72 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2013 Koushik Dutta (2013)
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Why another Superuser?
2 | * Superuser should be open source. It's the gateway to root on your device. It must be open for independent security analysis. Obscurity (closed source) is not security.
3 | * Superuser should be NDK buildable. No internal Android references.
4 | * Superuser should also be AOSP buildable for those that want to embed it in their ROM.
5 | * Superuser should also be AOSP _embeddable_, meaning a ROM can easily embed it into their Settings app.
6 | * Maintenance and updates on both the market and source repositories should be timely.
7 | * 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.
8 | * Handle multiuser (4.2+) properly
9 | * Handle concurrent su requests properly
10 |
11 | ## Translations
12 |
13 | 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).
14 |
15 |
16 |
17 | ## Checking out the source
18 |
19 | You'll need the "Widgets" dependency.
20 |
21 | * $ mkdir /path/to/src
22 | * $ cd /path/to/src
23 | * $ git clone git://github.com/koush/Superuser
24 | * $ git clone git://github.com/koush/Widgets
25 |
26 | These repositories do not keep the actual projects in the top level directory.
27 | This is because they contain tests, libs, and samples.
28 |
29 | 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).
30 |
31 | ## Eclipse
32 |
33 | In Eclipse, import Widgets/Widgets and Superuser/Superuser. It should Just Work (TM).
34 |
35 | ## Ant
36 |
37 | * $ mkdir /path/to/src
38 | * $ cd /path/to/src
39 | * $ cd Superuser/Superuser
40 |
41 | 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:
42 |
43 | ```
44 | ndk.dir=/Users/koush/src/android-ndk
45 | key.store=/Users/koush/.keystore
46 | key.alias=mykey
47 | ```
48 |
49 | If you do not have a release key yet, [create one using keytool](http://developer.android.com/tools/publishing/app-signing.html).
50 |
51 | Set up your SDK path (this is the directory containing platform-tools/, tools/, etc.):
52 |
53 | * $ export ANDROID_HOME=/Users/koush/src/sdk
54 |
55 | Then you can build:
56 |
57 | * $ ant release
58 |
59 | Outputs:
60 | * bin/update.zip - Recovery installable zip
61 | * bin/Superuser-release.apk - Superuser Android app
62 | * libs/armeabi/su - ARM su binary
63 | * libs/x86/su - x86 su binary
64 | * libs/mips/su - MIPS su binary
65 |
66 | ## Building the su binary
67 |
68 | You can use ant as shown above, to build the binary, but it can also be built without building the APK.
69 |
70 | Make sure you have the android-ndk downloaded with the tool "ndk-build" in your path.
71 |
72 | * $ cd /path/to/src/
73 | * $ cd Superuser/Superuser
74 | * $ ndk-build
75 |
76 | The su binary will built into Superuser/Superuser/libs/armeabi/su.
77 |
78 |
79 |
80 | ## Building with AOSP, CyanogenMod, etc
81 |
82 | ROM developers are welcome to distribute the official Superuser APK and binary that I publish. That will
83 | allow them to receive updates with Google Play. However, you can also build Superuser as part of your
84 | build, if you choose to.
85 |
86 | There are two ways to include Superuser in your build. The easiest is to build the APK as a separate app.
87 | To do that, simply add the local_manifest.xml as described below. The second way is by embedding it
88 | into the native Android System Settings.
89 |
90 | #### Repo Setup
91 | Add the [local_manifest.xml](https://github.com/koush/Superuser/blob/master/local_manifest.xml) to your .repo/local_manifests
92 |
93 | #### Configuring the Package Name
94 | The Superuser distributed on Google Play is in the package name com.koushikdutta.superuser.
95 | To prevent conflicts with the Play store version, the build process changes the package
96 | name to com.thirdparty.superuser. You can configure this value by setting the following
97 | in your vendor makefile or BoardConfig:
98 |
99 | ```
100 | SUPERUSER_PACKAGE := com.mypackagename.superuser
101 | ```
102 |
103 | #### Advanced - Embedding Superuser into System Settings
104 |
105 | You will not need to change the package name as described above. Superuser will simply go
106 | into the com.android.settings package.
107 |
108 | First, in a product makefile (like vendor/cm/config/common.mk), specify the following:
109 |
110 | ```
111 | SUPERUSER_EMBEDDED := true
112 | ```
113 |
114 | To modify packages/apps/Settings, you will need this [patch](http://review.cyanogenmod.org/#/c/32957/2//COMMIT_MSG,unified).
115 | The patch simply references the sources checked out to external/koush and makes changes
116 | to XML preference files and the AndroidManifest.xml. It is a very minimal change.
117 |
118 |
--------------------------------------------------------------------------------
/Superuser/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Superuser/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Superuser
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Superuser/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | include $(CLEAR_VARS)
3 |
4 | LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
5 | LOCAL_PACKAGE_NAME := Superuser
6 | LOCAL_SRC_FILES := $(call all-java-files-under,src) $(call all-java-files-under,../../Widgets/Widgets/src)
7 |
8 | LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
9 | LOCAL_AAPT_FLAGS := --extra-packages com.koushikdutta.widgets -S $(LOCAL_PATH)/../../Widgets/Widgets/res --auto-add-overlay --rename-manifest-package $(SUPERUSER_PACKAGE)
10 |
11 | include $(BUILD_PACKAGE)
12 |
--------------------------------------------------------------------------------
/Superuser/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
13 |
14 |
20 |
21 |
29 |
30 |
31 |
32 |
33 |
40 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
62 |
63 |
64 |
65 |
75 |
76 |
77 |
86 |
87 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/Superuser/Superuser.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Superuser/assets/armeabi:
--------------------------------------------------------------------------------
1 | ../libs/armeabi/
--------------------------------------------------------------------------------
/Superuser/assets/install-recovery.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 | /system/xbin/su --daemon &
3 |
--------------------------------------------------------------------------------
/Superuser/assets/mips:
--------------------------------------------------------------------------------
1 | ../libs/mips
--------------------------------------------------------------------------------
/Superuser/assets/update-binary:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 | # arg 1 is recovery api version, generally 3.
3 | # arg 2 is the pipe fd, to the recovery binary.
4 | # communicate with it using the recovery api.
5 | # arg 3 is the zip file
6 | echo -n -e 'ui_print Installing Superuser...\n' > /proc/self/fd/$2
7 | echo -n -e 'ui_print\n' > /proc/self/fd/$2
8 |
9 | # detect binary versions to install
10 | ARCH=$(uname -m)
11 |
12 | # x86 needs to match: i486, i686, x86_64, ...
13 | if echo "$ARCH" | grep -q 86; then
14 | PLATFORM=x86
15 | elif [ "$ARCH" = "mips" -o "$ARCH" = "mips64" ]; then
16 | PLATFORM=mips
17 | else
18 | PLATFORM=armeabi
19 | fi
20 |
21 | cd /tmp
22 | mkdir superuser
23 | cd superuser
24 | unzip -o "$3"
25 | if [ "$?" -ne "0" ]
26 | then
27 | mkdir -p $PLATFORM
28 | cp /cache/su $PLATFORM/su
29 | cp /cache/Superuser.apk .
30 | cp /cache/install-recovery.sh .
31 | fi
32 |
33 |
34 | echo -n -e 'ui_print Installing '$PLATFORM' binaries...\n' > /proc/self/fd/$2
35 | echo -n -e 'ui_print\n' > /proc/self/fd/$2
36 |
37 | mount /system
38 | chattr -i /system/bin/su
39 | chattr -i /system/xbin/su
40 | rm -f /system/bin/su
41 | rm -f /system/xbin/su
42 | rm -f /system/app/Superuser.*
43 | rm -f /system/app/Supersu.*
44 | rm -f /system/app/superuser.*
45 | rm -f /system/app/supersu.*
46 | rm -f /system/app/SuperUser.*
47 | rm -f /system/app/SuperSU.*
48 |
49 | cp $PLATFORM/su /system/xbin/su
50 | chown 0:0 /system/xbin/su
51 | chmod 6755 /system/xbin/su
52 | ln -s /system/xbin/su /system/bin/su
53 |
54 | cp Superuser.apk /system/app
55 | chmod 644 /system/app/Superuser.apk
56 |
57 | # if the system is at least 4.3, and there is no su daemon built in,
58 | # let's try to install it using install-recovery.sh
59 | BUILD_VERSION_SDK="$(grep 'ro\.build\.version\.sdk' /system/build.prop)"
60 | BUILD_VERSION_SDK="${BUILD_VERSION_SDK##*=}"
61 |
62 | if [ "$BUILD_VERSION_SDK" -ge 18 ]
63 | then
64 | # check for rom su daemon before clobbering install-recovery.sh
65 | if [ ! -f "/system/etc/.has_su_daemon" ]
66 | then
67 | echo -n -e 'ui_print Installing Superuser daemon...\n' > /proc/self/fd/$2
68 | echo -n -e 'ui_print\n' > /proc/self/fd/$2
69 | chattr -i /system/etc/install-recovery.sh
70 | chattr -i /system/bin/install-recovery.sh
71 | cp install-recovery.sh /system/etc/install-recovery.sh
72 | cp install-recovery.sh /system/bin/install-recovery.sh
73 | chmod 755 /system/etc/install-recovery.sh
74 | chmod 755 /system/bin/install-recovery.sh
75 | # note that an post install su daemon was installed
76 | # so recovery doesn't freak out and recommend you disable
77 | # the install-recovery.sh execute bit.
78 | touch /system/etc/.installed_su_daemon
79 | fi
80 | fi
81 |
82 | umount /system
--------------------------------------------------------------------------------
/Superuser/assets/x86:
--------------------------------------------------------------------------------
1 | ../libs/x86/
--------------------------------------------------------------------------------
/Superuser/build.gradle:
--------------------------------------------------------------------------------
1 | task wrapper(type: Wrapper) {
2 | gradleVersion = '1.6'
3 | }
4 |
5 | buildscript {
6 | repositories {
7 | mavenCentral()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:0.12.+'
11 | }
12 | }
13 | apply plugin: 'com.android.application'
14 |
15 | repositories {
16 | mavenCentral()
17 | }
18 |
19 | dependencies {
20 | compile project(':Widgets:Widgets')
21 | }
22 |
23 | android {
24 | packagingOptions {
25 | exclude 'META-INF/beans.xml'
26 | }
27 |
28 | sourceSets {
29 | main {
30 | manifest.srcFile 'AndroidManifest.xml'
31 | jniLibs.srcDirs = ['libs']
32 | assets.srcDirs = ['assets/']
33 | res.srcDirs = ['res/']
34 | java.srcDirs = ['src/']
35 | aidl.srcDirs = ['src/']
36 | }
37 | }
38 |
39 | compileSdkVersion 21
40 | buildToolsVersion '20.0.0'
41 |
42 | defaultConfig {
43 | minSdkVersion 14
44 | targetSdkVersion 21
45 | }
46 | }
47 |
48 | // upload to maven task
49 | //if (System.getenv().I_AM_KOUSH == 'true') {
50 | // apply from: 'https://raw.github.com/koush/mvn-repo/master/maven.gradle'
51 | //}
52 |
--------------------------------------------------------------------------------
/Superuser/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
49 |
50 |
51 |
52 |
56 |
57 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/Superuser/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := su
6 | LOCAL_FORCE_STATIC_EXECUTABLE := true
7 | LOCAL_STATIC_LIBRARIES := sqlite3 libcutils libc
8 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/sqlite3
9 | LOCAL_SRC_FILES := su/su.c su/activity.c su/db.c su/utils.c su/daemon.c su/pts.c
10 | include $(BUILD_EXECUTABLE)
11 |
12 |
13 | include $(CLEAR_VARS)
14 |
15 | LOCAL_MODULE := reboot
16 | LOCAL_LDFLAGS := -llog
17 | LOCAL_STATIC_LIBRARIES := sqlite3
18 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/sqlite3
19 | LOCAL_SRC_FILES := reboot/reboot.c
20 | include $(BUILD_EXECUTABLE)
21 |
22 |
23 | include $(CLEAR_VARS)
24 |
25 | LOCAL_MODULE := sqlite3
26 | LOCAL_SRC_FILES := sqlite3/sqlite3.c
27 | LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION
28 | include $(BUILD_STATIC_LIBRARY)
29 |
--------------------------------------------------------------------------------
/Superuser/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_ABI := x86 armeabi mips
2 | # NDK_TOOLCHAIN_VERSION=4.8
3 | APP_PIE = true
--------------------------------------------------------------------------------
/Superuser/jni/reboot/reboot.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright 2013, Kevin Cernekee
3 | **
4 | ** This was reverse engineered from an HTC "reboot" binary and is an attempt
5 | ** to remain bug-compatible with the original.
6 | **
7 | ** Licensed under the Apache License, Version 2.0 (the "License");
8 | ** you may not use this file except in compliance with the License.
9 | ** You may obtain a copy of the License at
10 | **
11 | ** http://www.apache.org/licenses/LICENSE-2.0
12 | **
13 | ** Unless required by applicable law or agreed to in writing, software
14 | ** distributed under the License is distributed on an "AS IS" BASIS,
15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | ** See the License for the specific language governing permissions and
17 | ** limitations under the License.
18 | */
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include
25 | #include
26 | #include
27 |
28 | #define SETTINGS_DB "/data/data/com.android.providers.settings/databases/settings.db"
29 | #define SCREEN_LOCK_STATUS "/data/misc/screen_lock_status"
30 |
31 | int pattern_lock;
32 |
33 | int sqlcallback(void *private, int n_columns, char **col_values, char **col_names)
34 | {
35 | pattern_lock = 0;
36 |
37 | if (n_columns == 0 || !col_values[0])
38 | return 0;
39 |
40 | if (!strcmp(col_values[0], "1"))
41 | pattern_lock = 1;
42 |
43 | __android_log_print(ANDROID_LOG_INFO, NULL,
44 | "sqlcallback %s = %s, pattern_locks= %d\n",
45 | col_names[0], col_values[0], pattern_lock);
46 | return 0;
47 | }
48 |
49 | int checkPatternLock(void)
50 | {
51 | sqlite3 *pDb = NULL;
52 | char *errmsg = NULL;
53 |
54 | if (sqlite3_open(SETTINGS_DB, &pDb) != 0) {
55 | __android_log_print(ANDROID_LOG_ERROR, NULL,
56 | "sqlite3_open error");
57 | /* BUG? probably shouldn't call sqlite3_close() if open failed */
58 | goto out;
59 | }
60 |
61 | if (sqlite3_exec(pDb,
62 | "select value from system where name= \"lock_pattern_autolock\"",
63 | sqlcallback, "checkPatternLock", &errmsg) != 0) {
64 | __android_log_print(ANDROID_LOG_ERROR, NULL,
65 | "SQL error: %s\n", errmsg);
66 | sqlite3_free(errmsg);
67 | goto out;
68 | }
69 |
70 | out:
71 | sqlite3_close(pDb);
72 | return 0;
73 | }
74 |
75 | int main(int argc, char **argv)
76 | {
77 | int no_sync = 0, power_off = 0;
78 | int ret;
79 |
80 | opterr = 0;
81 | while ((ret = getopt(argc, argv, "np")) != -1) {
82 | switch (ret) {
83 | case 'n':
84 | no_sync = 1;
85 | break;
86 | case 'p':
87 | power_off = 1;
88 | break;
89 | case '?':
90 | fprintf(stderr, "usage: %s [-n] [-p] [rebootcommand]\n",
91 | argv[0]);
92 | exit(1);
93 | break;
94 | }
95 | }
96 |
97 | if (argc > (optind + 1)) {
98 | fprintf(stderr, "%s: too many arguments\n", argv[0]);
99 | exit(1);
100 | }
101 |
102 | /* BUG: this should use optind */
103 | if (argc > 1 && !strcmp(argv[1], "oem-78")) {
104 | /* HTC RUU mode: "reboot oem-78" */
105 |
106 | FILE *f;
107 | char buf[5];
108 |
109 | checkPatternLock();
110 | f = fopen(SCREEN_LOCK_STATUS, "r");
111 | if (!f) {
112 | fputs("5\n", stderr);
113 | exit(0);
114 | }
115 | fgets(buf, 5, f);
116 | if (atoi(buf) == 1) {
117 | if (pattern_lock != 0) {
118 | fputs("1\n", stderr);
119 | exit(0);
120 | }
121 | }
122 | fputs("0\n", stderr);
123 | }
124 |
125 | if (!no_sync)
126 | sync();
127 |
128 | if (power_off) {
129 | ret = __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
130 | LINUX_REBOOT_CMD_POWER_OFF, 0);
131 | } else if (optind >= argc) {
132 | ret = reboot(LINUX_REBOOT_CMD_RESTART);
133 | } else {
134 | ret = __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
135 | LINUX_REBOOT_CMD_RESTART2, argv[optind]);
136 | }
137 |
138 | if (ret < 0) {
139 | perror("reboot");
140 | exit(1);
141 | } else {
142 | fputs("reboot returned\n", stderr);
143 | exit(0);
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/Superuser/jni/su/db.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright 2013, Koushik Dutta (@koush)
3 | **
4 | ** Licensed under the Apache License, Version 2.0 (the "License");
5 | ** you may not use this file except in compliance with the License.
6 | ** You may obtain a copy of the License at
7 | **
8 | ** http://www.apache.org/licenses/LICENSE-2.0
9 | **
10 | ** Unless required by applicable law or agreed to in writing, software
11 | ** distributed under the License is distributed on an "AS IS" BASIS,
12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ** See the License for the specific language governing permissions and
14 | ** limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include "su.h"
24 |
25 | struct callback_data_t {
26 | struct su_context *ctx;
27 | policy_t policy;
28 | };
29 |
30 | static int database_callback(void *v, int argc, char **argv, char **azColName){
31 | struct callback_data_t *data = (struct callback_data_t *)v;
32 | int command_match = 0;
33 | policy_t policy = DENY;
34 | int i;
35 | time_t until = 0;
36 | for(i = 0; i < argc; i++) {
37 | if (strcmp(azColName[i], "policy") == 0) {
38 | if (argv[i] == NULL) {
39 | policy = DENY;
40 | }
41 | if (strcmp(argv[i], "allow") == 0) {
42 | policy = ALLOW;
43 | }
44 | else if (strcmp(argv[i], "interactive") == 0) {
45 | policy = INTERACTIVE;
46 | }
47 | else {
48 | policy = DENY;
49 | }
50 | }
51 | else if (strcmp(azColName[i], "command") == 0) {
52 | // null or empty command means to match all commands (whitelist all from uid)
53 | command_match = argv[i] == NULL || strlen(argv[i]) == 0 || strcmp(argv[i], get_command(&(data->ctx->to))) == 0;
54 | }
55 | else if (strcmp(azColName[i], "until") == 0) {
56 | if (argv[i] != NULL) {
57 | until = atoi(argv[i]);
58 | }
59 | }
60 | }
61 |
62 | // check for command match
63 | if (command_match) {
64 | // also make sure this policy has not expired
65 | if (until == 0 || until > time(NULL)) {
66 | if (policy == DENY) {
67 | data->policy = DENY;
68 | return -1;
69 | }
70 |
71 | data->policy = ALLOW;
72 | // even though we allow, continue, so we can see if there's another policy
73 | // that denies...
74 | }
75 | }
76 |
77 | return 0;
78 | }
79 |
80 | policy_t database_check(struct su_context *ctx) {
81 | sqlite3 *db = NULL;
82 |
83 | char query[512];
84 | snprintf(query, sizeof(query), "select policy, until, command from uid_policy where uid=%d", ctx->from.uid);
85 | int ret = sqlite3_open_v2(ctx->user.database_path, &db, SQLITE_OPEN_READONLY, NULL);
86 | if (ret) {
87 | LOGE("sqlite3 open failure: %d", ret);
88 | sqlite3_close(db);
89 | return INTERACTIVE;
90 | }
91 |
92 | int result;
93 | char *err = NULL;
94 | struct callback_data_t data;
95 | data.ctx = ctx;
96 | data.policy = INTERACTIVE;
97 | ret = sqlite3_exec(db, query, database_callback, &data, &err);
98 | sqlite3_close(db);
99 | if (err != NULL) {
100 | LOGE("sqlite3_exec: %s", err);
101 | return DENY;
102 | }
103 |
104 | return data.policy;
105 | }
106 |
--------------------------------------------------------------------------------
/Superuser/jni/su/pts.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013, Tan Chee Eng (@tan-ce)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /*
18 | * pts.h
19 | *
20 | * Manages the pseudo-terminal driver on Linux/Android and provides some
21 | * helper functions to handle raw input mode and terminal window resizing
22 | */
23 |
24 | #ifndef _PTS_H_
25 | #define _PTS_H_
26 |
27 | /**
28 | * pts_open
29 | *
30 | * Opens a pts device and returns the name of the slave tty device.
31 | *
32 | * Arguments
33 | * slave_name the name of the slave device
34 | * slave_name_size the size of the buffer passed via slave_name
35 | *
36 | * Return Values
37 | * on failure either -2 or -1 (errno set) is returned.
38 | * on success, the file descriptor of the master device is returned.
39 | */
40 | int pts_open(char *slave_name, size_t slave_name_size);
41 |
42 | /**
43 | * set_stdin_raw
44 | *
45 | * Changes stdin to raw unbuffered mode, disables echo,
46 | * auto carriage return, etc.
47 | *
48 | * Return Value
49 | * on failure -1, and errno is set
50 | * on success 0
51 | */
52 | int set_stdin_raw(void);
53 |
54 | /**
55 | * restore_stdin
56 | *
57 | * Restore termios on stdin to the state it was before
58 | * set_stdin_raw() was called. If set_stdin_raw() was
59 | * never called, does nothing and doesn't return an error.
60 | *
61 | * This function is async-safe.
62 | *
63 | * Return Value
64 | * on failure, -1 and errno is set
65 | * on success, 0
66 | */
67 | int restore_stdin(void);
68 |
69 | /**
70 | * watch_sigwinch_async
71 | *
72 | * After calling this function, if the application receives
73 | * SIGWINCH, the terminal window size will be read from
74 | * "input" and set on "output".
75 | *
76 | * NOTE: This function blocks SIGWINCH and spawns a thread.
77 | *
78 | * Arguments
79 | * master A file descriptor of the TTY window size to follow
80 | * slave A file descriptor of the TTY window size which is
81 | * to be set on SIGWINCH
82 | *
83 | * Return Value
84 | * on failure, -1 and errno will be set. In this case, no
85 | * thread has been spawned and SIGWINCH will not be
86 | * blocked.
87 | * on success, 0
88 | */
89 | int watch_sigwinch_async(int master, int slave);
90 |
91 | /**
92 | * watch_sigwinch_cleanup
93 | *
94 | * Cause the SIGWINCH watcher thread to terminate
95 | */
96 | void watch_sigwinch_cleanup(void);
97 |
98 | /**
99 | * pump_stdin_async
100 | *
101 | * Forward data from STDIN to the given FD
102 | * in a seperate thread
103 | */
104 | void pump_stdin_async(int outfd);
105 |
106 | /**
107 | * pump_stdout_blocking
108 | *
109 | * Forward data from the FD to STDOUT.
110 | * Returns when the remote end of the FD closes.
111 | *
112 | * Before returning, restores stdin settings.
113 | */
114 | void pump_stdout_blocking(int infd);
115 |
116 | #endif
117 |
--------------------------------------------------------------------------------
/Superuser/jni/su/utils.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright 2012, The CyanogenMod Project
3 | **
4 | ** Licensed under the Apache License, Version 2.0 (the "License");
5 | ** you may not use this file except in compliance with the License.
6 | ** You may obtain a copy of the License at
7 | **
8 | ** http://www.apache.org/licenses/LICENSE-2.0
9 | **
10 | ** Unless required by applicable law or agreed to in writing, software
11 | ** distributed under the License is distributed on an "AS IS" BASIS,
12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ** See the License for the specific language governing permissions and
14 | ** limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 |
28 | #include "utils.h"
29 |
30 | /* reads a file, making sure it is terminated with \n \0 */
31 | char* read_file(const char *fn)
32 | {
33 | struct stat st;
34 | char *data = NULL;
35 |
36 | int fd = open(fn, O_RDONLY);
37 | if (fd < 0) return data;
38 |
39 | if (fstat(fd, &st)) goto oops;
40 |
41 | data = malloc(st.st_size + 2);
42 | if (!data) goto oops;
43 |
44 | if (read(fd, data, st.st_size) != st.st_size) goto oops;
45 | close(fd);
46 | data[st.st_size] = '\n';
47 | data[st.st_size + 1] = 0;
48 | return data;
49 |
50 | oops:
51 | close(fd);
52 | if (data) free(data);
53 | return NULL;
54 | }
55 |
56 | int get_property(const char *data, char *found, const char *searchkey, const char *not_found)
57 | {
58 | char *key, *value, *eol, *sol, *tmp;
59 | if (data == NULL) goto defval;
60 | int matched = 0;
61 | sol = strdup(data);
62 | while((eol = strchr(sol, '\n'))) {
63 | key = sol;
64 | *eol++ = 0;
65 | sol = eol;
66 |
67 | value = strchr(key, '=');
68 | if(value == 0) continue;
69 | *value++ = 0;
70 |
71 | while(isspace(*key)) key++;
72 | if(*key == '#') continue;
73 | tmp = value - 2;
74 | while((tmp > key) && isspace(*tmp)) *tmp-- = 0;
75 |
76 | while(isspace(*value)) value++;
77 | tmp = eol - 2;
78 | while((tmp > value) && isspace(*tmp)) *tmp-- = 0;
79 |
80 | if (strncmp(searchkey, key, strlen(searchkey)) == 0) {
81 | matched = 1;
82 | break;
83 | }
84 | }
85 | int len;
86 | if (matched) {
87 | len = strlen(value);
88 | if (len >= PROPERTY_VALUE_MAX)
89 | return -1;
90 | memcpy(found, value, len + 1);
91 | } else goto defval;
92 | return len;
93 |
94 | defval:
95 | len = strlen(not_found);
96 | memcpy(found, not_found, len + 1);
97 | return len;
98 | }
99 |
100 | /*
101 | * Fast version of get_property which purpose is to check
102 | * whether the property with given prefix exists.
103 | *
104 | * Assume nobody is stupid enough to put a propery with prefix ro.cm.version
105 | * in his build.prop on a non-CM ROM and comment it out.
106 | */
107 | int check_property(const char *data, const char *prefix)
108 | {
109 | if (!data)
110 | return 0;
111 | return strstr(data, prefix) != NULL;
112 | }
113 |
--------------------------------------------------------------------------------
/Superuser/jni/su/utils.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright 2012, The CyanogenMod Project
3 | **
4 | ** Licensed under the Apache License, Version 2.0 (the "License");
5 | ** you may not use this file except in compliance with the License.
6 | ** You may obtain a copy of the License at
7 | **
8 | ** http://www.apache.org/licenses/LICENSE-2.0
9 | **
10 | ** Unless required by applicable law or agreed to in writing, software
11 | ** distributed under the License is distributed on an "AS IS" BASIS,
12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | ** See the License for the specific language governing permissions and
14 | ** limitations under the License.
15 | */
16 |
17 | #ifndef _UTILS_H_
18 | #define _UTILS_H_
19 |
20 | #ifndef PROPERTY_VALUE_MAX
21 | #define PROPERTY_VALUE_MAX 92
22 | #endif
23 |
24 | /* reads a file, making sure it is terminated with \n \0 */
25 | extern char* read_file(const char *fn);
26 |
27 | extern int get_property(const char *data, char *found, const char *searchkey,
28 | const char *not_found);
29 | extern int check_property(const char *data, const char *prefix);
30 | #endif
31 |
--------------------------------------------------------------------------------
/Superuser/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Superuser/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/Superuser/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-21
15 | android.library.reference.1=../../Widgets/Widgets
16 | ndk.executable=ndk-build
17 |
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi-v11/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi-v11/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi-v9/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi-v9/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_action_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_action_about.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_action_logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_action_logs.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_action_permission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_action_permission.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_alert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_alert.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_alert_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_alert_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_allow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_allow.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_declare.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_declare.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_declare_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_declare_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_delete.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_deny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_deny.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_logging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_logging.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_logging_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_logging_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_menu_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_menu_about.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_menu_logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_menu_logs.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_menu_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_menu_settings.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_menu_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_menu_trash.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_notifications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_notifications.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_notifications_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_notifications_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_protected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_protected.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_protected_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_protected_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_theme.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_theme_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_theme_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_timeout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_timeout.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_timeout_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_timeout_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_toggle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_toggle.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_toggle_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_toggle_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_users.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-hdpi/ic_users_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-hdpi/ic_users_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-ldpi-v11/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-ldpi-v11/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-ldpi-v9/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-ldpi-v9/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi-v11/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi-v11/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi-v9/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi-v9/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_action_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_action_about.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_action_logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_action_logs.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_action_permission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_action_permission.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_alert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_alert.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_alert_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_alert_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_allow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_allow.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_declare.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_declare.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_declare_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_declare_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_delete.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_deny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_deny.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_logging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_logging.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_logging_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_logging_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_menu_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_menu_about.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_menu_logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_menu_logs.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_menu_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_menu_settings.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_menu_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_menu_trash.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_notifications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_notifications.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_notifications_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_notifications_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_protected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_protected.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_protected_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_protected_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_theme.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_theme_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_theme_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_timeout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_timeout.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_timeout_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_timeout_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_toggle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_toggle.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_toggle_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_toggle_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_users.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-mdpi/ic_users_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-mdpi/ic_users_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi-v11/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi-v11/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi-v9/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi-v9/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_action_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_action_about.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_action_logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_action_logs.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_action_permission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_action_permission.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_alert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_alert.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_alert_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_alert_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_allow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_allow.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_declare.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_declare.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_declare_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_declare_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_delete.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_deny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_deny.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_logging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_logging.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_logging_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_logging_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_menu_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_menu_about.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_menu_logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_menu_logs.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_menu_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_menu_settings.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_menu_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_menu_trash.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_notifications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_notifications.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_notifications_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_notifications_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_protected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_protected.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_protected_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_protected_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_stat_notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_stat_notification.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_theme.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_theme_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_theme_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_timeout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_timeout.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_timeout_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_timeout_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_toggle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_toggle.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_toggle_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_toggle_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_users.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xhdpi/ic_users_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xhdpi/ic_users_dark.png
--------------------------------------------------------------------------------
/Superuser/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Superuser/res/drawable/carbon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable/carbon.png
--------------------------------------------------------------------------------
/Superuser/res/drawable/clockwork512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable/clockwork512.png
--------------------------------------------------------------------------------
/Superuser/res/drawable/desksms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable/desksms.png
--------------------------------------------------------------------------------
/Superuser/res/drawable/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable/github.png
--------------------------------------------------------------------------------
/Superuser/res/drawable/koush.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable/koush.png
--------------------------------------------------------------------------------
/Superuser/res/drawable/tether.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koush/Superuser/2e5cf1978193997806df583285f6660702a8af79/Superuser/res/drawable/tether.png
--------------------------------------------------------------------------------
/Superuser/res/layout-land/app_info.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
25 |
26 |
33 |
34 |
35 |
39 |
40 |
47 |
48 |
55 |
56 |
57 |
58 |
63 |
64 |
68 |
69 |
76 |
77 |
84 |
85 |
86 |
90 |
91 |
98 |
99 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/Superuser/res/layout-land/app_request.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Superuser/res/layout-land/log_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Superuser/res/layout-large-land/policy_list_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Superuser/res/layout-large/app_info.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
20 |
21 |
28 |
29 |
30 |
34 |
35 |
42 |
43 |
50 |
51 |
52 |
56 |
57 |
64 |
65 |
72 |
73 |
74 |
78 |
79 |
86 |
87 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/Superuser/res/layout-large/app_request.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Superuser/res/layout-large/policy_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
15 |
16 |
23 |
24 |
25 |
29 |
30 |
35 |
36 |
42 |
43 |
50 |
51 |
52 |
56 |
57 |
62 |
63 |
69 |
70 |
77 |
78 |
79 |
83 |
84 |
89 |
90 |
96 |
97 |
105 |
106 |
107 |
111 |
112 |
--------------------------------------------------------------------------------
/Superuser/res/layout-large/policy_list_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Superuser/res/layout-normal-land/policy_info.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
25 |
26 |
32 |
33 |
34 |
38 |
39 |
46 |
47 |
53 |
54 |
55 |
56 |
61 |
62 |
66 |
67 |
74 |
75 |
81 |
82 |
83 |
87 |
88 |
95 |
96 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/Superuser/res/layout-v14/log_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Superuser/res/layout-v14/notification_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Superuser/res/layout/app_info.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
19 |
20 |
27 |
28 |
29 |
33 |
34 |
41 |
42 |
49 |
50 |
51 |
55 |
56 |
63 |
64 |
71 |
72 |
73 |
77 |
78 |
85 |
86 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/Superuser/res/layout/app_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
23 |
24 |
--------------------------------------------------------------------------------
/Superuser/res/layout/app_request.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Superuser/res/layout/empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/Superuser/res/layout/log_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Superuser/res/layout/log_item_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
17 |
18 |
24 |
25 |
32 |
33 |
40 |
41 |
42 |
51 |
52 |
--------------------------------------------------------------------------------
/Superuser/res/layout/log_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Superuser/res/layout/notification_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Superuser/res/layout/notify.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
18 |
19 |
26 |
27 |
35 |
36 |
45 |
46 |
53 |
54 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
69 |
70 |
75 |
76 |
77 |
78 |
82 |
83 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Superuser/res/layout/packageinfo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
25 |
26 |
27 |
33 |
34 |
41 |
42 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Superuser/res/layout/pin.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
10 |
23 |
24 |
29 |
30 |
35 |
36 |
39 |
40 |
43 |
44 |
47 |
48 |
51 |
52 |
53 |
56 |
57 |
60 |
61 |
64 |
65 |
68 |
69 |
70 |
73 |
74 |
77 |
78 |
81 |
82 |
85 |
86 |
87 |
90 |
91 |
94 |
95 |
98 |
99 |
104 |
105 |
106 |
107 |
108 |
112 |
113 |
120 |
121 |
126 |
127 |
131 |
132 |
133 |
134 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/Superuser/res/layout/policy_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
26 |
27 |
33 |
34 |
35 |
39 |
40 |
45 |
46 |
47 |
48 |
49 |
54 |
55 |
56 |
61 |
62 |
70 |
71 |
74 |
75 |
76 |
80 |
81 |
89 |
90 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/Superuser/res/layout/policy_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
15 |
16 |
23 |
24 |
25 |
29 |
30 |
35 |
36 |
42 |
43 |
50 |
51 |
52 |
56 |
57 |
62 |
63 |
69 |
70 |
77 |
78 |
79 |
83 |
84 |
89 |
90 |
96 |
97 |
105 |
106 |
107 |
111 |
112 |
--------------------------------------------------------------------------------
/Superuser/res/layout/policy_list_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Superuser/res/layout/request.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
18 |
19 |
27 |
28 |
36 |
37 |
45 |
46 |
55 |
56 |
63 |
64 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
80 |
81 |
86 |
87 |
88 |
89 |
93 |
94 |
101 |
102 |
107 |
108 |
112 |
113 |
114 |
115 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/Superuser/res/layout/request_choices.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Superuser/res/layout/request_spinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/Superuser/res/layout/request_spinner_choice.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/Superuser/res/layout/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
21 |
22 |
34 |
35 |
40 |
41 |
--------------------------------------------------------------------------------
/Superuser/res/layout/unknown_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
--------------------------------------------------------------------------------
/Superuser/res/menu-v11/app.xml:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/Superuser/res/menu-v11/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/Superuser/res/menu-v11/policy.xml:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/Superuser/res/menu/app.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Superuser/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Superuser/res/menu/policy.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/Superuser/res/values-hr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 | Superuser
20 | Dopusti
21 | Odbij
22 | Dolazni Superuser Zahtjev\u2026
23 | Nepoznati UID: %s
24 | %s zahtjeva Superuser pristup.
25 | Upozorenje: Ako ne znate što je ovo, trebali biste odbiti ovaj zahtjev.
26 | Superuser Zahtjev
27 | Paket:
28 | Aplikacija:
29 | Zahtijevani UID:
30 | Naredba:
31 | Samo ovaj put
32 | Zapamti odabir sljedećih %s minuta
33 | Zapamti odabir zauvijek
34 | Interaktivno
35 | Izvještaji
36 | Postavke
37 | Obriši
38 | Nema Izvještaja
39 | Izvještavanje
40 | Dopusti sve zahtjeve Superuser izvještavanja
41 | Zaštita PIN-om
42 | Zahtjevaj unos PIN-a za potvrdu Superuser zahtjeva
43 | Istek Zahtjeva
44 | Superuser zahtjevi će isteći i biti će odbijeni nakon %s sekundi
45 | Obavijesti
46 | Ništa
47 | %s će biti prikazane kada je aplikacija odobrila ili odbila Superuser dozvolu
48 | Unesite PIN
49 | Unesite Nov PIN
50 | Pogrešan PIN
51 | Potvrdite PIN
52 | PIN se ne podudara
53 | Superuser zaštita PIN-om omogućena
54 | %s sekundi
55 | Superuser odobren aplikaciji %s
56 | Tost
57 | Obavijest
58 | Obavijesti neće biti prikazane
59 | potpuna dozvola svim značajkama uređaja i pohranjivanju
60 | Superuser odobrava potpuni pristup svim značajkama uređaja i pohranjivanju, uključujući sigurnosne i osjetljive hardverske elemente vašeg uređaja. Ova je dozvola potencijalno opasna.
61 | Odobrite samo zahtjeve aplikacija koje imaju android.permission.ACCESS_SUPERUSER
62 | Automatski Odgovor
63 | Automatski dopusti nove zahtjeve
64 | Automatski odbij nove zahtjeve
65 | Prikaži prozor za potvrdu za nove zahtjeve
66 | Sigurnost
67 | Samo vlasnik uređaja može zahtijevati Superuser
68 | Vlasnik uređaja biti će obaviješten kada drugi korisnik zahtjeva Superuser
69 | Svi korisnici mogu zahtijevati Superuser
70 | Samo Vlasnik
71 | Upravljano Vlasnikom
72 | Svi Korisnici
73 | Sve Naredbe
74 | O
75 | Aplikacije
76 | Instaliranje
77 | Instaliranje Superuser-a\u2026
78 | Instaliraj Superuser
79 | Instalacija Načina Oporavka
80 | Instaliraj
81 | Provjeravanje Superuser-a\u2026
82 | Su binary datoteka je zastarjela.
83 | Superuser Pristup
84 | Samo aplikacije
85 | Samo ADB
86 |
87 |
--------------------------------------------------------------------------------
/Superuser/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 | スーパーユーザー
20 | 許可
21 | 拒否
22 | スーパーユーザーリクエストがありました\u2026
23 | 不明なUID: %s
24 | %sがスーパーユーザーアクセスをリクエストしています。
25 | 警告: 心当たりのないリクエストは拒否した方がよいでしょう。
26 | スーパーユーザーリクエスト
27 | パッケージ:
28 | アプリ:
29 | リクエストUID:
30 | コマンド:
31 | 1回のみ
32 | %s分間のみ
33 | 選択を記憶する
34 | インタラクティブ
35 | ログ
36 | 設定
37 | 削除
38 | ログはありません
39 | スーパーユーザーアプリのポリシーはありません。
40 | ログを記録
41 | すべてのスーパーユーザーリクエストのログを有効にする
42 | PINによる保護
43 | スーパーユーザーリクエストの承認にPINの入力を要求する
44 | リクエストのタイムアウト
45 | スーパーユーザーリクエストは%s秒でタイムアウトして拒否されます
46 | 通知
47 | なし
48 | アプリにスーパーユーザー権限が許可または拒否された際に%sを表示する
49 | PINを入力
50 | 新しいPINを入力
51 | PINが正しくありません
52 | PINの確認
53 | PINが一致しません
54 | スーパーユーザーのPINによる保護が有効
55 | %s秒
56 | スーパーユーザーは%sを許可しました
57 | スーパーユーザーは%sを拒否しました
58 | トースト
59 | 通知
60 | 通知を表示しない
61 | 開発者警告:\nandroid.permission.ACCESS_SUPERUSER\nがマニフェストで宣言されていません。
62 | すべてのデバイスの機能とストレージへの完全なアクセス許可
63 | スーパーユーザーはセキュリティーで保護されている繊細なハードウェア要素を含めた端末のすべての機能とストレージへの完全なアクセスを許可します。この権限は潜在的に危険です。
64 | 宣言された権限
65 | android.permission.ACCESS_SUPERUSERを宣言しているアプリからのリクエストのみを許可する
66 | 自動応答
67 | プロンプト
68 | 新しいリクエストを自動的に許可する
69 | 新しいリクエストを自動的に拒否する
70 | 新しいリクエストをダイアログで確認する
71 | セキュリティ
72 | マルチユーザーポリシー
73 | 端末の所有者のみスーパーユーザーをリクエストできます
74 | 他のユーザーがスーパーユーザーをリクエストした際に端末の所有者にプロンプトで確認する
75 | すべてのユーザーがスーパーユーザーをリクエストできます
76 | 所有者のみ
77 | 所有者が管理しています
78 | すべてのユーザー
79 | マルチユーザーポリシーは端末の所有者のみが管理できます。
80 | このリクエストを許可または拒否するには、所有者アカウントに切り替えてください。
81 | すべてのコマンド
82 | 情報
83 | アプリ
84 | インストールしています
85 | スーパーユーザーをインストールしています\u2026
86 | スーパーユーザーをインストール
87 | スーパーユーザーバイナリ(su)を更新する必要があります。\n\nインストール方法を選んでください。\nHTC端末ではリカバリーインストールが推奨されます。
88 | リカバリーインストール
89 | インストール
90 | スーパーユーザーを確認しています\u2026
91 | スーパーユーザーのインストール中にエラーが発生しました。エラーログを開発者に送信してください。
92 | スーパーユーザーのインストールに成功しました。
93 | suバイナリが古いようです。
94 | スーパーユーザーアクセス
95 | 無効
96 | アプリのみ
97 | ADBのみ
98 | アプリとADB
99 | 更新情報
100 | 評価する
101 | テーマ
102 | ライト
103 | ダーク
104 | スーパーユーザーのPINによる保護は無効
105 | スーパーユーザー権限を取り消す
106 | 詳細情報
107 | このアプリからスーパーユーザー権限を取り消すことができませんでした。\nスーパーユーザーアプリを再起動して、もう一度やり直してください。
108 |
109 |
--------------------------------------------------------------------------------
/Superuser/res/values-large-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/Superuser/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/Superuser/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/Superuser/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
12 |
--------------------------------------------------------------------------------
/Superuser/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 | 超级用户
20 | 允许
21 | 拒绝
22 | 收到超级用户请求\u2026
23 | 未知 UID:%s
24 | “%s”正在请求超级用户访问权限。
25 | 警告:如果你对此不了解,你应该选拒绝。
26 | 超级用户请求
27 | 软件包:
28 | 应用程序:
29 | 请求的 UID:
30 | 命令:
31 | 仅此次
32 | 记住选择 %s 分钟
33 | 永久记住选择
34 | 交互式
35 | 日志
36 | 设置
37 | 删除
38 | 无日志
39 | 当前没有超级用户应用程序策略。
40 | 日志
41 | 启用/禁用超级用户请求日志
42 | 密码保护
43 | 授权超级用户请求时要求输入密码
44 | 请求超时
45 | %s 秒后超级用户请求将超时并被拒绝
46 | 通知
47 | 无
48 | 当应用程序被允许或拒绝时将显示一个%s
49 | 输入密码
50 | 输入新的密码
51 | 密码不正确
52 | 确认密码
53 | 密码不一致
54 | 超级用户密码保护已启用
55 | %s 秒
56 | 已授予“%s”超级用户权限
57 | 已拒绝“%s”获取超级用户权限
58 | 提示
59 | 通知
60 | 不显示通知
61 | \"开发人员警告:\nandroid.permission.ACCESS_SUPERUSER
62 | 在 manifest 中未定义。
63 | 对所有设备功能和存储的完整权限
64 | 超级用户授予访问你的设备的所有功能和存储设备的完整权限,包括加密和敏感硬件设备。此权限有潜在的风险。
65 | 权限申明
66 | 仅允许来自申明了 android.permission.ACCESS_SUPERUSER 权限的应用程序的请求
67 | 自动响应
68 | 提示
69 | 自动允许新请求
70 | 自动拒绝新请求
71 | 对新请求显示确认对话框
72 | 安全
73 | 多用户策略
74 | 仅机主可以请求超级用户权限
75 | 其他用户请求超级用户权限时,机主将被提示
76 | 所有用户都可以请求超级用户权限
77 | 仅机主
78 | 机主控制
79 | 所有用户
80 | 多用户策略仅可以由机主管理
81 | 请切换到机主帐户允许或拒绝此请求。
82 | 所有命令
83 | 关于
84 | 应用程序
85 | 正在安装
86 | 正在安装超级用户\u2026
87 | 安装超级用户
88 | 超级用户二进制可执行文件 (su) 需要更新。\n\n请选择安装方式。\n对 HTC 设备建议选择恢复模式安装。
89 | 恢复模式安装
90 | 常规安装
91 | 正在检查超级用户\u2026
92 | 安装超级用户时出错。请将错误日志发送给开发人员。
93 | 超级用户安装成功。
94 | su 二进制可执行文件已过旧。
95 | 超级用户访问权限
96 | 禁用
97 | 仅限于应用程序
98 | 仅限于 ADB
99 | 应用程序和 ADB
100 | 更新说明
101 | 评价
102 | 界面主题
103 | 亮色调
104 | 暗色调
105 | 超级用户密码保护已禁用
106 | 撤消超级用户权限
107 | 详细信息
108 | 无法撤销此应用的超级用户权限。\n请重启超级用户并再试一次。
109 |
110 |
--------------------------------------------------------------------------------
/Superuser/res/values-zh-rHK/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 | 允許
20 | 記住選擇 %s 分鐘
21 | 永遠記住選擇
22 | 刪除
23 | 通知
24 | %s 秒
25 | 通知
26 | 主題
27 | 深色
28 |
29 |
--------------------------------------------------------------------------------
/Superuser/res/values-zh-rSG/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 超级用户
4 | 允许
5 | 拒绝
6 | 收到超级用户请求…
7 | 未知 UID:%s
8 | %s 正在请求超级用户访问权限。
9 | 警告:如果你对此不了解,你应该选拒绝。
10 | 超级用户请求
11 | 软件包:
12 | 应用程序:
13 | 请求的 UID:
14 | 命令:
15 | 仅此次
16 | 记住选择 %s 分钟
17 | 永久记住选择
18 | 交互式
19 | 日志
20 | 设置
21 | 删除
22 | 无日志
23 | 当前没有超级用户应用程序策略
24 | 日志
25 | 启用/禁用超级用户请求日志
26 | 密码保护
27 | 授权超级用户请求时要求输入密码
28 | 请求超时
29 | %s 秒后超级用户请求将超时并被拒绝
30 | 通知
31 | 无
32 | 当应用程序被允许或拒绝时将显示一个%s
33 | 输入密码
34 | 输入新密码
35 | 密码不正确
36 | 确认密码
37 | 密码不一致
38 | 超级用户密码保护已启用
39 | %s 秒
40 | 已授予 %s 超级用户权限
41 | 已拒绝 %s 获取超级用户权限
42 | 提示
43 | 通知
44 | 不显示通知
45 | "开发人员警告:
46 | android.permission.ACCESS_SUPERUSER
47 | 在 manifest 中未定义。"
48 | 对所有设备功能和存储的完整权限
49 | 超级用户授予访问你的设备的所有功能和存储设备的完整权限,包括加密和敏感硬件设备。此许可有潜在的风险。
50 | 权限申明
51 | 仅允许来自申明了 android.permission.ACCESS_SUPERUSER 权限的应用程序的请求
52 | 自动响应
53 | 提示
54 | 自动允许新请求
55 | 自动拒绝新请求
56 | 对新请求显示确认对话框
57 | 安全
58 | 多用户策略
59 | 仅机主可以请求超级用户权限
60 | 其他用户请求超级用户权限时,机主将被提示
61 | 所有用户都可以请求超级用户权限
62 | 仅机主
63 | 机主控制
64 | 所有用户
65 | 多用户策略仅可以由机主管理
66 | 请切换到机主帐户允许或拒绝此请求。
67 | 所有命令
68 | 关于
69 | 应用程序
70 | 正在安装
71 | 正在安装超级用户…
72 | 安装超级用户
73 | "超级用户二进制可执行文件 (su) 需要更新。
74 |
75 | 请选择安装方式。
76 | 对 HTC 设备建议选择 recovery 模式安装。"
77 | recovery 模式安装
78 | 常规安装
79 | 正在检查超级用户…
80 | 安装超级用户时出错。请将错误日志发送给开发人员。
81 | 超级用户安装成功。
82 | su 二进制可执行文件已过期。
83 | 超级用户访问权限
84 | 禁用
85 | 仅应用程序
86 | 仅 ADB
87 | 应用程序和 ADB
88 | 更新说明
89 | 评价
90 | 界面主题
91 | 亮色调
92 | 暗色调
93 | 超级用户密码保护已禁用
94 |
95 |
--------------------------------------------------------------------------------
/Superuser/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 | 超級使用者
20 | 允許
21 | 拒絕
22 | 收到超級使用者要求\u2026
23 | 未知的 UID:%s
24 | 「%s」正在要求超級使用者存取權。
25 | 警告:如果您不知道這是什麼,您應該拒絕此要求。
26 | 超級使用者要求
27 | 套件:
28 | 應用程式:
29 | 要求的 UID:
30 | 命令:
31 | 只有這次
32 | 記住選擇 %s 分鐘
33 | 永遠記住選擇
34 | 互動式
35 | 紀錄
36 | 設定
37 | 刪除
38 | 沒有紀錄
39 | 目前沒有任何超級使用者應用程式的規則。
40 | 紀錄
41 | 啟用所有超級使用者要求的紀錄。
42 | PIN 保護
43 | 要求輸入 PIN 以同意超級使用者要求
44 | 要求逾時
45 | 超級使用者要求會在 %s 秒後逾時並被拒絕
46 | 通知
47 | 無
48 | 應用程式被授予或拒絕超級使用者權限時會顯示%s
49 | 輸入 PIN
50 | 輸入新的 PIN
51 | PIN 錯誤
52 | 確認 PIN
53 | PIN 不符
54 | 超級使用者 PIN 保護已啟用
55 | %s 秒
56 | 超級使用者授予了「%s」
57 | 超級使用者拒絕了「%s」
58 | 彈出訊息 (Toast)
59 | 通知
60 | 不顯示通知
61 | 開發人員警告:\n還沒有在 manifest 宣告\nandroid.permission.ACCESS_SUPERUSER。
62 | 對所有裝置功能和儲存空間的完全權限
63 | 超級使用者授予對所有裝置功能和儲存空間的完全存取權,包括您裝置安全與機密的硬體元件。這個權限有潛在的風險。
64 | 宣告權限
65 | 只允許已宣告 android.permission.ACCESS_SUPERUSER 的應用程式的要求
66 | 自動回應
67 | 詢問
68 | 自動允許新要求
69 | 自動拒絕新要求
70 | 對新要求顯示確認對話框
71 | 安全性
72 | 多使用者規則
73 | 只有裝置擁有者可以要求超級使用者權限
74 | 當其他使用者要求超級使用者權限時,裝置擁有者將會被詢問
75 | 所有使用者都能夠要求超級使用者權限
76 | 僅限擁有者
77 | 擁有者管理
78 | 所有使用者
79 | 多使用者規則只能由裝置擁有者管理。
80 | 請切換到擁有者帳戶以同意或拒絕這個要求。
81 | 所有命令
82 | 關於
83 | 應用程式
84 | 正在安裝
85 | 正在安裝超級使用者\u2026
86 | 安裝超級使用者
87 | 超級使用者二進位檔 (su) 必須更新。\n\n請選擇安裝方法。\nHTC 裝置建議 recovery 模式安裝。
88 | Recovery 安裝
89 | 安裝
90 | 正在檢查超級使用者\u2026
91 | 安裝超級使用者時發生錯誤。請傳送錯誤紀錄給開發人員。
92 | 超級使用者安裝成功。
93 | su 二進位檔已過時。
94 | 超級使用者存取權
95 | 停用
96 | 僅限應用程式
97 | 僅限 ADB
98 | 應用程式和 ADB
99 | 更新說明
100 | 評分
101 | 主題
102 | 淺色
103 | 深色
104 | 超級使用者 PIN 保護已停用
105 | 撤銷超級使用者權限
106 | 詳細資訊
107 | 無法撤銷這個應用程式的超級使用者權限。\n請重新啟動超級使用者應用程式並再試一次。
108 |
109 |
--------------------------------------------------------------------------------
/Superuser/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 超級使用者
5 | 允許
6 | 拒絕
7 | 傳入超級使用者的請求...
8 | 未知 UID: %s
9 | 「%s」正要求超級使用者權限
10 | 警告:如果你不清楚這是什麼,你應該拒絕這個請求。
11 | 超級使用者請求
12 | 套件:
13 | 應用程式:
14 | 請求的 UID:
15 | 指令:
16 | 只有這次
17 | 記住選擇 %s 分鐘
18 | 永遠記住你的選擇
19 | 互動
20 | 記錄
21 | 設定
22 | 刪除
23 | 沒有記錄
24 | 沒有任何超級使用者應用程式的規則。
25 | 記錄
26 | 啟用或停用所有超級使用者的請求記錄。
27 | 密碼保護
28 | 要求輸入密碼以批准超級使用者的請求。
29 | 請求逾時
30 | 超級使用者請求會在 %s 秒後逾時並拒。
31 | 通知
32 | 不通知
33 | 當應用程式獲得或被拒絕超級使用者權限後,會顯示%s。
34 | 輸入密碼
35 | 輸入新的密碼
36 | 密碼錯誤
37 | 確定密碼
38 | 密碼不相符
39 | 啟動了超級使用者的密碼保護
40 | %s 秒
41 | 超級使用者授予了「%s」
42 | 超級使用者拒絕了「%s」
43 | 彈出訊息(Toast)
44 | 通知(Notification)
45 | 不會顯示通知
46 | 開發者警告:\n還沒有在 manifest 宣告\nandroid.permission.ACCESS_SUPERUSER
47 | 所有裝置功能和儲存空間的全部權限
48 | 超級使用者獲得所有裝置功能和儲存空間的訪問權限,包括裝置安全和敏感的硬件元素。這個權限是有潛在風險。
49 | 宣告權限
50 | 只允許已宣告 android.permission.ACCESS_SUPERUSER 權限的應用程序。
51 | 自動回應
52 | 詢問
53 | 自動允許新請求。
54 | 自動拒絕新請求。
55 | 對新請求顯示確認對話框。
56 | 安全性
57 | 多用戶規則
58 | 只允許裝置擁有者請求超級使用者。
59 | 當其他使用者請求超級使用者時,裝置擁有者會被提示。
60 | 所有使用者都能夠請求超級使用者。
61 | 僅擁有者
62 | 擁有者管理
63 | 所有使用者
64 | 多用戶規則只能由擁有者管理
65 | 請切換到擁有者帳戶以批准或拒絕這個請求
66 | 所有指令
67 | 關於
68 | 應用程式
69 | 正在安裝
70 | 正在安裝超級使用者...
71 | 安裝超級使用者
72 | 超級使用者的二進制檔案(su)一定要更新。\n\n請選擇安裝方法。\nHTC 裝置建議選擇回復模式(Recovery)的安裝方法。
73 | 回復模式
74 | 安裝
75 | 正在檢查超級使用者...
76 | 安裝超級使用者時發生了一個錯誤。請將錯誤記錄傳送至開發者。
77 | 超級使用者安裝成功。
78 | 二進制檔案(su)已經過期。
79 | 訪問權限
80 | 禁用
81 | 僅應用程式
82 | 僅 ADB
83 | 應用程式和 ADB
84 | 新功能
85 | 評分
86 | 主題
87 | 淺色
88 | 深色
89 | 停用了超級使用者的密碼保護
90 |
91 |
--------------------------------------------------------------------------------
/Superuser/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Superuser/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 4dp
6 |
--------------------------------------------------------------------------------
/Superuser/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | #1F1F1F
8 |
9 |
14 |
15 |
19 |
20 |
36 |
37 |
57 |
58 |
61 |
62 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/AboutFragment.java:
--------------------------------------------------------------------------------
1 | package com.koushikdutta.superuser;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.pm.PackageInfo;
6 | import android.content.pm.PackageManager;
7 | import android.content.pm.PackageManager.NameNotFoundException;
8 | import android.net.Uri;
9 | import android.os.Bundle;
10 | import android.util.TypedValue;
11 | import android.view.ContextThemeWrapper;
12 | import android.view.View;
13 |
14 | import com.koushikdutta.widgets.BetterListFragment;
15 | import com.koushikdutta.widgets.ListItem;
16 |
17 | public class AboutFragment extends BetterListFragment {
18 | ContextThemeWrapper mWrapper;
19 | @Override
20 | public Context getContext() {
21 | if (mWrapper != null)
22 | return mWrapper;
23 | TypedValue value = new TypedValue();
24 | super.getContext().getTheme().resolveAttribute(R.attr.largeIconTheme, value, true);
25 | mWrapper = new ContextThemeWrapper(super.getContext(), value.resourceId);
26 | return mWrapper;
27 | }
28 |
29 | @Override
30 | protected void onCreate(Bundle savedInstanceState, View view) {
31 | super.onCreate(savedInstanceState, view);
32 |
33 | PackageManager manager = getContext().getPackageManager();
34 | String version = "unknown";
35 | try {
36 | PackageInfo info = manager.getPackageInfo(getContext().getPackageName(), 0);
37 | version = info.versionName;
38 | }
39 | catch (NameNotFoundException e) {
40 | }
41 |
42 | addItem(R.string.about, new ListItem(this, getString(R.string.superuser), version, R.drawable.ic_launcher) {
43 | @Override
44 | public void onClick(View view) {
45 | super.onClick(view);
46 | Intent i = new Intent();
47 | i.setData(Uri.parse("market://details?id=com.koushikdutta.superuser"));
48 | startActivity(i);
49 | }
50 | });
51 |
52 | addItem(R.string.about, new ListItem(this, "Koushik Dutta", "@koush", R.drawable.koush) {
53 | @Override
54 | public void onClick(View view) {
55 | super.onClick(view);
56 | Intent i = new Intent();
57 | i.setClassName("com.twitter.android", "com.twitter.android.ProfileActivity");
58 | i.putExtra("screen_name", "koush");
59 | try {
60 | startActivity(i);
61 | }
62 | catch (Exception ex) {
63 | ex.printStackTrace();
64 | }
65 |
66 | }
67 | });
68 |
69 | final String uri = "http://github.com/koush/Superuser";
70 | addItem(R.string.about, new ListItem(this, "Github", uri, R.drawable.github) {
71 | @Override
72 | public void onClick(View view) {
73 | super.onClick(view);
74 | Intent i = new Intent();
75 | i.setAction(Intent.ACTION_VIEW);
76 | i.setData(Uri.parse(uri));
77 | startActivity(i);
78 | }
79 | });
80 |
81 | addItem(R.string.apps, new ListItem(this, "ROM Manager", "The ultimate backup, restore, and ROM installation tool", R.drawable.clockwork512) {
82 | @Override
83 | public void onClick(View view) {
84 | super.onClick(view);
85 | Intent i = new Intent();
86 | i.setData(Uri.parse("market://details?id=com.koushikdutta.rommanager"));
87 | startActivity(i);
88 | }
89 | });
90 | addItem(R.string.apps, new ListItem(this, "Helium", "Android's missing backup solution", R.drawable.carbon) {
91 | @Override
92 | public void onClick(View view) {
93 | super.onClick(view);
94 | Intent i = new Intent();
95 | i.setData(Uri.parse("market://details?id=com.koushikdutta.backup"));
96 | startActivity(i);
97 | }
98 | });
99 | addItem(R.string.apps, new ListItem(this, "DeskSMS", "Seamlessly text message from your email, browser, or instant messenger", R.drawable.desksms) {
100 | @Override
101 | public void onClick(View view) {
102 | super.onClick(view);
103 | Intent i = new Intent();
104 | i.setData(Uri.parse("market://details?id=com.koushikdutta.desktopsms"));
105 | startActivity(i);
106 | }
107 | });
108 | addItem(R.string.apps, new ListItem(this, "Tether", "Use your phone's web connection on a laptop or PC", R.drawable.tether) {
109 | @Override
110 | public void onClick(View view) {
111 | super.onClick(view);
112 | Intent i = new Intent();
113 | i.setData(Uri.parse("market://details?id=com.koushikdutta.tether"));
114 | startActivity(i);
115 | }
116 | });
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/Helper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser;
18 |
19 | import java.lang.reflect.Method;
20 |
21 | import android.annotation.SuppressLint;
22 | import android.content.Context;
23 | import android.content.pm.PackageInfo;
24 | import android.content.pm.PackageManager;
25 | import android.graphics.drawable.Drawable;
26 | import android.os.UserManager;
27 |
28 | import com.koushikdutta.superuser.util.ImageCache;
29 |
30 | public class Helper {
31 | public static Drawable loadPackageIcon(Context context, String pn) {
32 | try {
33 | PackageManager pm = context.getPackageManager();
34 | PackageInfo pi = context.getPackageManager().getPackageInfo(pn, 0);
35 | Drawable ret = ImageCache.getInstance().get(pn);
36 | if (ret != null)
37 | return ret;
38 | ImageCache.getInstance().put(pn, ret = pi.applicationInfo.loadIcon(pm));
39 | return ret;
40 | }
41 | catch (Exception ex) {
42 | }
43 | return null;
44 | }
45 |
46 | @SuppressLint("NewApi")
47 | public static boolean supportsMultipleUsers(Context context) {
48 | final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
49 | try {
50 | Method supportsMultipleUsers = UserManager.class.getMethod("supportsMultipleUsers");
51 | return (Boolean)supportsMultipleUsers.invoke(um);
52 | }
53 | catch (Exception ex) {
54 | return false;
55 | }
56 | }
57 |
58 | @SuppressLint("NewApi")
59 | public static boolean isAdminUser(Context context) {
60 | final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
61 | try {
62 | Method getUserHandle = UserManager.class.getMethod("getUserHandle");
63 | int userHandle = (Integer)getUserHandle.invoke(um);
64 | return userHandle == 0;
65 | }
66 | catch (Exception ex) {
67 | return true;
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/NotifyActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser;
18 |
19 | import com.koushikdutta.superuser.util.Settings;
20 |
21 | import android.app.Activity;
22 | import android.content.Intent;
23 | import android.content.pm.PackageInfo;
24 | import android.content.pm.PackageManager;
25 | import android.os.Bundle;
26 | import android.view.View;
27 | import android.view.View.OnClickListener;
28 | import android.widget.ImageView;
29 | import android.widget.TextView;
30 |
31 | public class NotifyActivity extends Activity {
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | Settings.applyDarkThemeSetting(this, R.style.RequestThemeDark);
35 | super.onCreate(savedInstanceState);
36 |
37 | setContentView(R.layout.notify);
38 |
39 | Intent intent = getIntent();
40 | if (intent == null) {
41 | finish();
42 | return;
43 | }
44 | int callerUid = intent.getIntExtra("caller_uid", -1);
45 | if (callerUid == -1) {
46 | finish();
47 | return;
48 | }
49 |
50 | final View packageInfo = findViewById(R.id.packageinfo);
51 | final PackageManager pm = getPackageManager();
52 | String[] pkgs = pm.getPackagesForUid(callerUid);
53 | TextView unknown = (TextView)findViewById(R.id.unknown);
54 | unknown.setText(getString(R.string.unknown_uid, callerUid));
55 |
56 | if (pkgs != null && pkgs.length > 0) {
57 | for (String pkg: pkgs) {
58 | try {
59 | PackageInfo pi = pm.getPackageInfo(pkg, PackageManager.GET_PERMISSIONS);
60 | ((TextView)findViewById(R.id.request)).setText(getString(R.string.application_request, pi.applicationInfo.loadLabel(pm)));
61 | ImageView icon = (ImageView)packageInfo.findViewById(R.id.image);
62 | icon.setImageDrawable(pi.applicationInfo.loadIcon(pm));
63 | ((TextView)packageInfo.findViewById(R.id.title)).setText(pi.applicationInfo.loadLabel(pm));
64 |
65 | ((TextView)findViewById(R.id.app_header)).setText(pi.applicationInfo.loadLabel(pm));
66 | ((TextView)findViewById(R.id.package_header)).setText(pi.packageName);
67 |
68 | // could display them all, but screw it...
69 | // maybe a better ux for this later
70 | break;
71 | }
72 | catch (Exception ex) {
73 | }
74 | }
75 | findViewById(R.id.unknown).setVisibility(View.GONE);
76 | }
77 |
78 | findViewById(R.id.ok).setOnClickListener(new OnClickListener() {
79 | @Override
80 | public void onClick(View v) {
81 | finish();
82 | }
83 | });
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/PackageChangeReceiver.java:
--------------------------------------------------------------------------------
1 | package com.koushikdutta.superuser;
2 |
3 | import java.util.ArrayList;
4 |
5 | import android.content.BroadcastReceiver;
6 | import android.content.Context;
7 | import android.content.Intent;
8 | import android.content.pm.PackageManager;
9 | import android.text.TextUtils;
10 |
11 | import com.koushikdutta.superuser.db.SuDatabaseHelper;
12 | import com.koushikdutta.superuser.db.UidPolicy;
13 |
14 | public class PackageChangeReceiver extends BroadcastReceiver {
15 | @Override
16 | public void onReceive(final Context context, Intent intent) {
17 | new Thread() {
18 | public void run() {
19 | ArrayList policies = SuDatabaseHelper.getPolicies(context);
20 |
21 | if (policies == null)
22 | return;
23 |
24 | final PackageManager pm = context.getPackageManager();
25 | for (UidPolicy policy: policies) {
26 | // if the uid did not have a package name at creation time,
27 | // it may be a nameless or unresolveable uid...
28 | // ie, I can do something like:
29 | // su - 5050
30 | // # 5050 has no name, so the following su will be an empty package name
31 | // su
32 | //
33 | // ignore this null package name as valid.
34 | if (TextUtils.isEmpty(policy.packageName))
35 | continue;
36 | try {
37 | boolean found = false;
38 | String[] names = pm.getPackagesForUid(policy.uid);
39 | if (names == null)
40 | throw new Exception("no packages for uid");
41 | for (String name: names) {
42 | if (name.equals(policy.packageName))
43 | found = true;
44 | }
45 | if (!found)
46 | throw new Exception("no package name match");
47 | }
48 | catch (Exception e) {
49 | SuDatabaseHelper.delete(context, policy);
50 | }
51 | }
52 | };
53 | }.start();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/PinViewHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.View.OnClickListener;
23 | import android.view.ViewGroup;
24 | import android.widget.Button;
25 | import android.widget.EditText;
26 |
27 | public class PinViewHelper {
28 | public PinViewHelper(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
29 | View ret = inflater.inflate(R.layout.pin, container, false);
30 |
31 | final EditText password = (EditText)ret.findViewById(R.id.password);
32 | int[] ids = new int[] { R.id.p0, R.id.p1, R.id.p2, R.id.p3, R.id.p4, R.id.p5, R.id.p6, R.id.p7, R.id.p8, R.id.p9, };
33 | for (int i = 0; i < ids.length; i++) {
34 | int id = ids[i];
35 | Button b = (Button)ret.findViewById(id);
36 | final String text = String.valueOf(i);
37 | b.setText(text);
38 | b.setOnClickListener(new OnClickListener() {
39 | @Override
40 | public void onClick(View v) {
41 | password.setText(password.getText().toString() + text);
42 | }
43 | });
44 | }
45 |
46 | ret.findViewById(R.id.pd).setOnClickListener(new OnClickListener() {
47 | @Override
48 | public void onClick(View v) {
49 | String curPass = password.getText().toString();
50 | if (curPass.length() > 0) {
51 | curPass = curPass.substring(0, curPass.length() - 1);
52 | password.setText(curPass);
53 | }
54 | }
55 | });
56 |
57 | ret.findViewById(R.id.cancel).setOnClickListener(new OnClickListener() {
58 | @Override
59 | public void onClick(View v) {
60 | onCancel();
61 | }
62 | });
63 |
64 | ret.findViewById(R.id.ok).setOnClickListener(new OnClickListener() {
65 | @Override
66 | public void onClick(View v) {
67 | onEnter(password.getText().toString());
68 | password.setText("");
69 | }
70 | });
71 |
72 | mView = ret;
73 | }
74 |
75 | View mView;
76 | public View getView() {
77 | return mView;
78 | }
79 |
80 | public void onEnter(String password) {
81 | }
82 |
83 | public void onCancel() {
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/RequestActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser;
18 |
19 | import android.app.Activity;
20 | import android.content.Intent;
21 | import android.os.Bundle;
22 |
23 | public class RequestActivity extends Activity {
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 |
28 | Intent intent = getIntent();
29 | if (intent == null) {
30 | finish();
31 | return;
32 | }
33 |
34 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
35 | String name = getClass().getPackage().getName() + "." + MultitaskSuRequestActivity.class.getSimpleName();
36 | intent.setClassName(this, name);
37 | startActivity(intent);
38 | finish();
39 | return;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/SuApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser;
18 |
19 | import com.koushikdutta.superuser.db.SuDatabaseHelper;
20 |
21 | import android.app.Application;
22 |
23 | public class SuApplication extends Application {
24 | @Override
25 | public void onCreate() {
26 | super.onCreate();
27 |
28 | new SuDatabaseHelper(this).getWritableDatabase().close();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/SuCheckerReceiver.java:
--------------------------------------------------------------------------------
1 | package com.koushikdutta.superuser;
2 |
3 | import android.app.Notification;
4 | import android.app.NotificationManager;
5 | import android.app.PendingIntent;
6 | import android.content.BroadcastReceiver;
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.os.Handler;
10 | import android.util.Log;
11 |
12 | import com.koushikdutta.superuser.util.Settings;
13 | import com.koushikdutta.superuser.util.SuHelper;
14 |
15 | public class SuCheckerReceiver extends BroadcastReceiver {
16 | public static void doNotification(Context context) {
17 | Notification.Builder builder = new Notification.Builder(context);
18 | builder.setTicker(context.getString(R.string.install_superuser));
19 | builder.setContentTitle(context.getString(R.string.install_superuser));
20 | builder.setSmallIcon(R.drawable.ic_stat_notification);
21 | builder.setWhen(0);
22 | builder.setContentText(context.getString(R.string.su_binary_outdated));
23 | builder.setAutoCancel(true);
24 | PendingIntent launch = PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
25 | Intent delIntent = new Intent(context, SuCheckerReceiver.class);
26 | delIntent.setAction(ACTION_DELETED);
27 | PendingIntent delete = PendingIntent.getBroadcast(context, 0, delIntent, 0);
28 | builder.setDeleteIntent(delete);
29 | builder.setContentIntent(launch);
30 | NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
31 | nm.notify(10000, builder.build());
32 | }
33 |
34 | private static final String ACTION_DELETED = "internal.superuser.ACTION_CHECK_DELETED";
35 |
36 | @Override
37 | public void onReceive(final Context context, Intent intent) {
38 | if (intent == null)
39 | return;
40 |
41 |
42 | if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) || "internal.superuser.BOOT_TEST".equals(intent.getAction())) {
43 | // if the user deleted the notification in the past, don't bother them again for a while
44 | int counter = Settings.getCheckSuQuietCounter(context);
45 | if (counter > 0) {
46 | Log.i("Superuser", "Not bothering user... su counter set.");
47 | counter--;
48 | Settings.setCheckSuQuietCounter(context, counter);
49 | return;
50 | }
51 |
52 | final Handler handler = new Handler();
53 | new Thread() {
54 | public void run() {
55 | try {
56 | SuHelper.checkSu(context);
57 | }
58 | catch (Exception ex) {
59 | handler.post(new Runnable() {
60 | @Override
61 | public void run() {
62 | doNotification(context);
63 | }
64 | });
65 | }
66 | };
67 | }.start();
68 | }
69 | else if (ACTION_DELETED.equals(intent.getAction())) {
70 | // notification deleted? bother the user in 3 reboots.
71 | Log.i("Superuser", "Will not bother the user in the future... su counter set.");
72 | Settings.setCheckSuQuietCounter(context, 3);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/SuReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser;
18 |
19 | import android.app.Notification;
20 | import android.app.NotificationManager;
21 | import android.app.PendingIntent;
22 | import android.content.BroadcastReceiver;
23 | import android.content.Context;
24 | import android.content.Intent;
25 | import android.widget.Toast;
26 |
27 | import com.koushikdutta.superuser.db.LogEntry;
28 | import com.koushikdutta.superuser.db.SuperuserDatabaseHelper;
29 | import com.koushikdutta.superuser.db.UidPolicy;
30 | import com.koushikdutta.superuser.util.Settings;
31 |
32 | public class SuReceiver extends BroadcastReceiver {
33 | @Override
34 | public void onReceive(final Context context, Intent intent) {
35 | if (intent == null)
36 | return;
37 |
38 | String command = intent.getStringExtra("command");
39 | if (command == null)
40 | return;
41 | int uid = intent.getIntExtra("uid", -1);
42 | if (uid == -1)
43 | return;
44 | int desiredUid = intent.getIntExtra("desired_uid", -1);
45 | if (desiredUid == -1)
46 | return;
47 | String action = intent.getStringExtra("action");
48 | if (action == null)
49 | return;
50 | String fromName = intent.getStringExtra("from_name");
51 | String desiredName = intent.getStringExtra("desired_name");
52 |
53 | final LogEntry le = new LogEntry();
54 | le.uid = uid;
55 | le.command = command;
56 | le.action = action;
57 | le.desiredUid = desiredUid;
58 | le.desiredName = desiredName;
59 | le.username = fromName;
60 | le.date = (int)(System.currentTimeMillis() / 1000);
61 | le.getPackageInfo(context);
62 |
63 | UidPolicy u = SuperuserDatabaseHelper.addLog(context, le);
64 |
65 | String toast;
66 | if (UidPolicy.ALLOW.equals(action)) {
67 | toast = context.getString(R.string.superuser_granted, le.getName());
68 | }
69 | else {
70 | toast = context.getString(R.string.superuser_denied, le.getName());
71 | }
72 |
73 | if (u != null && !u.notification)
74 | return;
75 |
76 | switch (Settings.getNotificationType(context)) {
77 | case Settings.NOTIFICATION_TYPE_NOTIFICATION:
78 | Notification.Builder builder = new Notification.Builder(context);
79 | builder.setTicker(toast)
80 | .setAutoCancel(true)
81 | .setContentIntent(PendingIntent.getActivity(context, 0, new Intent(), 0))
82 | .setContentTitle(context.getString(R.string.superuser))
83 | .setContentText(toast)
84 | .setSmallIcon(R.drawable.ic_stat_notification);
85 |
86 | NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
87 | nm.notify(NOTIFICATION_ID, builder.build());
88 | break;
89 | case Settings.NOTIFICATION_TYPE_TOAST:
90 | Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();
91 | break;
92 | }
93 | }
94 |
95 | private static final int NOTIFICATION_ID = 4545;
96 | }
97 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/db/LogEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser.db;
18 |
19 | import java.util.Date;
20 |
21 | import com.koushikdutta.superuser.R;
22 |
23 | public class LogEntry extends UidCommand {
24 | public long id;
25 | public String action;
26 | public int date;
27 |
28 | public Date getDate() {
29 | return new Date((long)date * 1000);
30 | }
31 |
32 | public int getActionResource() {
33 | if (UidPolicy.ALLOW.equals(action))
34 | return R.string.allow;
35 | else if (UidPolicy.INTERACTIVE.equals(action))
36 | return R.string.interactive;
37 | return R.string.deny;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/db/UidCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser.db;
18 |
19 | import android.content.Context;
20 | import android.content.pm.PackageInfo;
21 | import android.content.pm.PackageManager;
22 | import android.database.Cursor;
23 |
24 |
25 | public class UidCommand {
26 | public String username;
27 | public String name;
28 | public String packageName;
29 | public int uid;
30 | public String command;
31 | public int desiredUid;
32 | public String desiredName;
33 |
34 | public String getName() {
35 | if (name != null)
36 | return name;
37 | if (packageName != null)
38 | return packageName;
39 | if (username != null && username.length() > 0)
40 | return username;
41 | return String.valueOf(uid);
42 | }
43 |
44 |
45 | public void getPackageInfo(Context context) {
46 | try {
47 | PackageManager pm = context.getPackageManager();
48 | PackageInfo pi = context.getPackageManager().getPackageInfo(pm.getPackagesForUid(uid)[0], 0);
49 | name = pi.applicationInfo.loadLabel(pm).toString();
50 | packageName = pi.packageName;
51 | }
52 | catch (Exception ex) {
53 | }
54 | }
55 |
56 | public void getUidCommand(Cursor c) {
57 | uid = c.getInt(c.getColumnIndex("uid"));
58 | command = c.getString(c.getColumnIndex("command"));
59 | name = c.getString(c.getColumnIndex("name"));
60 | packageName = c.getString(c.getColumnIndex("package_name"));
61 | desiredUid = c.getInt(c.getColumnIndex("desired_uid"));
62 | desiredName = c.getString(c.getColumnIndex("desired_name"));
63 | username = c.getString(c.getColumnIndex("username"));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/db/UidPolicy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser.db;
18 |
19 | import java.util.Date;
20 |
21 | import com.koushikdutta.superuser.R;
22 |
23 | public class UidPolicy extends UidCommand {
24 | public static final String ALLOW = "allow";
25 | public static final String DENY = "deny";
26 | public static final String INTERACTIVE = "interactive";
27 |
28 | public String policy;
29 | public int until;
30 | public boolean logging = true;
31 | public boolean notification = true;
32 | public Date getUntilDate() {
33 | return new Date((long)until * 1000);
34 | }
35 |
36 | public int getPolicyResource() {
37 | if (ALLOW.equals(policy))
38 | return R.string.allow;
39 | else if (INTERACTIVE.equals(policy))
40 | return R.string.interactive;
41 | return R.string.deny;
42 | }
43 |
44 | public String getPolicy() {
45 | return policy;
46 | }
47 |
48 | public void setPolicy(String policy){
49 | this.policy = policy;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/util/ImageCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser.util;
18 |
19 | import android.graphics.drawable.Drawable;
20 |
21 | public final class ImageCache extends SoftReferenceHashTable {
22 | private static ImageCache mInstance = new ImageCache();
23 |
24 | public static ImageCache getInstance() {
25 | return mInstance;
26 | }
27 |
28 | private ImageCache() {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/util/SoftReferenceHashTable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Koushik Dutta (@koush)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.koushikdutta.superuser.util;
18 |
19 | import java.lang.ref.SoftReference;
20 | import java.util.Hashtable;
21 |
22 | public class SoftReferenceHashTable {
23 | Hashtable> mTable = new Hashtable>();
24 |
25 | public V put(K key, V value) {
26 | SoftReference old = mTable.put(key, new SoftReference(value));
27 | if (old == null)
28 | return null;
29 | return old.get();
30 | }
31 |
32 | public V get(K key) {
33 | SoftReference val = mTable.get(key);
34 | if (val == null)
35 | return null;
36 | V ret = val.get();
37 | if (ret == null)
38 | mTable.remove(key);
39 | return ret;
40 | }
41 |
42 | public V remove(K k) {
43 | SoftReference v = mTable.remove(k);
44 | if (v == null)
45 | return null;
46 | return v.get();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/util/StreamUtility.java:
--------------------------------------------------------------------------------
1 | package com.koushikdutta.superuser.util;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.DataInputStream;
5 | import java.io.DataOutputStream;
6 | import java.io.File;
7 | import java.io.FileInputStream;
8 | import java.io.FileOutputStream;
9 | import java.io.IOException;
10 | import java.io.InputStream;
11 | import java.io.OutputStream;
12 | import java.nio.ByteBuffer;
13 | import java.nio.channels.Channels;
14 | import java.nio.channels.ReadableByteChannel;
15 | import java.nio.channels.WritableByteChannel;
16 |
17 | import org.apache.http.HttpResponse;
18 | import org.apache.http.client.methods.HttpGet;
19 | import org.apache.http.client.methods.HttpUriRequest;
20 | import org.json.JSONException;
21 | import org.json.JSONObject;
22 |
23 | import android.net.http.AndroidHttpClient;
24 |
25 | public class StreamUtility {
26 | //private static final String LOGTAG = StreamUtility.class.getSimpleName();
27 | public static void fastChannelCopy(final ReadableByteChannel src, final WritableByteChannel dest) throws IOException {
28 | final ByteBuffer buffer = ByteBuffer.allocateDirect(1 << 17);
29 | while (src.read(buffer) != -1) {
30 | // prepare the buffer to be drained
31 | buffer.flip();
32 | // write to the channel, may block
33 | dest.write(buffer);
34 | // If partial transfer, shift remainder down
35 | // If buffer is empty, same as doing clear()
36 | buffer.compact();
37 | }
38 | // EOF will leave buffer in fill state
39 | buffer.flip();
40 | // make sure the buffer is fully drained.
41 | while (buffer.hasRemaining()) {
42 | dest.write(buffer);
43 | }
44 | }
45 |
46 | public static void copyStream(InputStream input, OutputStream output) throws IOException
47 | {
48 | final ReadableByteChannel inputChannel = Channels.newChannel(input);
49 | final WritableByteChannel outputChannel = Channels.newChannel(output);
50 | // copy the channels
51 | fastChannelCopy(inputChannel, outputChannel);
52 | }
53 |
54 | public static String downloadUriAsString(String uri) throws IOException {
55 | HttpGet get = new HttpGet(uri);
56 | return downloadUriAsString(get);
57 | }
58 |
59 |
60 | public static String downloadUriAsString(final HttpUriRequest req) throws IOException {
61 | AndroidHttpClient client = AndroidHttpClient.newInstance("Android");
62 | try {
63 | HttpResponse res = client.execute(req);
64 | return readToEnd(res.getEntity().getContent());
65 | }
66 | finally {
67 | client.close();
68 | }
69 | }
70 |
71 | public static JSONObject downloadUriAsJSONObject(String uri) throws IOException, JSONException {
72 | return new JSONObject(downloadUriAsString(uri));
73 | }
74 |
75 | public static JSONObject downloadUriAsJSONObject(HttpUriRequest req) throws IOException, JSONException {
76 | return new JSONObject(downloadUriAsString(req));
77 | }
78 |
79 | public static byte[] readToEndAsArray(InputStream input) throws IOException
80 | {
81 | DataInputStream dis = new DataInputStream(input);
82 | byte[] stuff = new byte[1024];
83 | ByteArrayOutputStream buff = new ByteArrayOutputStream();
84 | int read = 0;
85 | while ((read = dis.read(stuff)) != -1)
86 | {
87 | buff.write(stuff, 0, read);
88 | }
89 | input.close();
90 | return buff.toByteArray();
91 | }
92 |
93 | public static void eat(InputStream input) throws IOException {
94 | byte[] stuff = new byte[1024];
95 | while (input.read(stuff) != -1);
96 | }
97 |
98 | public static String readToEnd(InputStream input) throws IOException
99 | {
100 | return new String(readToEndAsArray(input));
101 | }
102 |
103 | static public String readFile(String filename) throws IOException {
104 | return readFile(new File(filename));
105 | }
106 |
107 | static public String readFile(File file) throws IOException {
108 | byte[] buffer = new byte[(int) file.length()];
109 | DataInputStream input = new DataInputStream(new FileInputStream(file));
110 | input.readFully(buffer);
111 | input.close();
112 | return new String(buffer);
113 | }
114 |
115 | public static void writeFile(File file, String string) throws IOException {
116 | writeFile(file.getAbsolutePath(), string);
117 | }
118 |
119 | public static void writeFile(String file, String string) throws IOException {
120 | File f = new File(file);
121 | f.getParentFile().mkdirs();
122 | DataOutputStream dout = new DataOutputStream(new FileOutputStream(f));
123 | dout.write(string.getBytes());
124 | dout.close();
125 | }
126 | }
127 |
128 |
--------------------------------------------------------------------------------
/Superuser/src/com/koushikdutta/superuser/util/SuHelper.java:
--------------------------------------------------------------------------------
1 | package com.koushikdutta.superuser.util;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | public class SuHelper {
7 | public static String CURRENT_VERSION = "16";
8 | public static void checkSu(Context context) throws Exception {
9 | Process p = Runtime.getRuntime().exec("su -v");
10 | String result = Settings.readToEnd(p.getInputStream());
11 | Log.i("Superuser", "Result: " + result);
12 | if (0 != p.waitFor())
13 | throw new Exception("non zero result");
14 | if (result == null)
15 | throw new Exception("no data");
16 | if (!result.contains(context.getPackageName()))
17 | throw new Exception("unknown su");
18 |
19 | String[] parts = result.split(" ");
20 | if (!CURRENT_VERSION.equals(parts[0]))
21 | throw new Exception("binary is old");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/init.superuser.rc:
--------------------------------------------------------------------------------
1 | # su daemon
2 | service su_daemon /system/xbin/su --daemon
3 | oneshot
4 |
5 | on property:persist.sys.root_access=0
6 | stop su_daemon
7 |
8 | on property:persist.sys.root_access=2
9 | stop su_daemon
10 |
11 | on property:persist.sys.root_access=1
12 | start su_daemon
13 |
14 | on property:persist.sys.root_access=3
15 | start su_daemon
16 |
--------------------------------------------------------------------------------
/local_manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------