## Why another Superuser?
* 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.
* Superuser should be NDK buildable. No internal Android references.
* Superuser should also be AOSP buildable for those that want to embed it in their ROM.
* Superuser should also be AOSP _embeddable_, meaning a ROM can easily embed it into their Settings app.
* Maintenance and updates on both the market and source repositories should be timely.
* I want to be able to point users of my app to a Superuser solution that I wrote, that I know works, and that I can fix if something is wrong.
* Handle multiuser (4.2+) properly
* Handle concurrent su requests properly
## Translations
Translations are very much appreciated, but please do not submit translations on Github! Instead, use the review submission process on [CyanogenMod's gerrit instance](http://review.cyanogenmod.org/#/q/status:open,n,z).
## Checking out the source
You'll need the "Widgets" dependency.
* $ mkdir /path/to/src
* $ cd /path/to/src
* $ git clone git://github.com/koush/Superuser
* $ git clone git://github.com/koush/Widgets
These repositories do not keep the actual projects in the top level directory.
This is because they contain tests, libs, and samples.
## Eclipse
In Eclipse, import Widgets/Widgets and Superuser/Superuser. It should Just Work (TM).
## Ant
* $ mkdir /path/to/src
* $ cd /path/to/src
* $ cd Superuser/Superuser
In this directory, create a file called local.properties. This file is used by ant for custom properties. You need to specify the location of the ndk directory:
```
ndk.dir=/Users/koush/src/android-ndk
```
Then you can build:
* $ ant release
Outputs:
* bin/update.zip - Recovery installable zip
* bin/Superuser.apk - Superuser Android app
* libs/armeabi/su - ARM su binary
* libs/x86/su - x86 su binary
## Building the su binary
You can use ant as shown above, to build the binary, but it can also be built without building the APK.
Make sure you have the android-ndk downloaded with the tool "ndk-build" in your path.
* $ cd /path/to/src/
* $ cd Superuser/Superuser
* $ ndk-build
The su binary will built into Superuser/Superuser/libs/armeabi/su.
## Building with AOSP, CyanogenMod, etc
ROM developers are welcome to distribute the official Superuser APK and binary that I publish. That will
allow them to receive updates with Google Play. However, you can also build Superuser as part of your
build, if you choose to.
There are two ways to include Superuser in your build. The easiest is to build the APK as a separate app.
To do that, simply add the local_manifest.xml as described below. The second way is by embedding it
into the native Android System Settings.
#### Repo Setup
Add the [local_manifest.xml](https://github.com/koush/Superuser/blob/master/local_manifest.xml) to your .repo/local_manifests
#### Configuring the Package Name
The Superuser distributed on Google Play is in the package name com.koushikdutta.superuser.
To prevent conflicts with the Play store version, the build process changes the package
name to com.thirdparty.superuser. You can configure this value by setting the following
in your vendor makefile or BoardConfig:
```
SUPERUSER_PACKAGE := com.mypackagename.superuser
```
#### Advanced - Embedding Superuser into System Settings
You will not need to change the package name as described above. Superuser will simply go
into the com.android.settings package.
First, in a product makefile (like vendor/cm/config/common.mk), specify the following:
```
SUPERUSER_EMBEDDED := true
```
To modify packages/apps/Settings, you will need this [patch](http://review.cyanogenmod.org/#/c/32957/2//COMMIT_MSG,unified).
The patch simply references the sources checked out to external/koush and makes changes
to XML preference files and the AndroidManifest.xml. It is a very minimal change.
没有合适的资源?快使用搜索试试~ 我知道了~
Superuser源码
共289个文件
png:111个
xml:77个
class:35个
5星 · 超过95%的资源 需积分: 9 103 下载量 86 浏览量
2016-04-11
21:48:10
上传
评论 2
收藏 2.56MB ZIP 举报
温馨提示
关于su和Superuser进行root权限获取和管理原理分析的那篇 文章的附件http://blog.csdn.net/koozxcv/article/details/51125046
资源推荐
资源详情
资源评论
收起资源包目录
Superuser源码 (289个子文件)
armeabi 16B
sqlite3.c 4.63MB
shell.c 95KB
su.c 28KB
activity.c 5KB
db.c 3KB
utils.c 3KB
jarlist.cache 120B
Settings.class 12KB
SettingsFragmentInternal.class 12KB
PolicyFragmentInternal.class 9KB
MainActivity.class 8KB
SuDatabaseHelper.class 8KB
SuperuserDatabaseHelper.class 8KB
LogFragmentInternal.class 7KB
AboutFragment.class 6KB
MultitaskSuRequestActivity.class 5KB
StreamUtility.class 5KB
LogNativeFragment.class 3KB
PolicyNativeFragment.class 3KB
Helper.class 3KB
SettingsNativeFragment.class 3KB
PolicyNativeFragment$FragmentInternal.class 3KB
PackageChangeReceiver$1.class 3KB
UidCommand.class 2KB
SuCheckerReceiver.class 2KB
LogFragment.class 2KB
SuHelper.class 2KB
SoftReferenceHashTable.class 2KB
RequestActivity.class 2KB
SuCheckerReceiver$1.class 1KB
PinViewHelper.class 1KB
SettingsFragment.class 1KB
PolicyFragment.class 1KB
UidPolicy.class 1KB
LogEntry.class 1KB
NotifyActivity.class 990B
SuCheckerReceiver$1$1.class 901B
PackageChangeReceiver.class 793B
SuReceiver.class 757B
ImageCache.class 712B
SuApplication.class 661B
BuildConfig.class 361B
.classpath 466B
su.c~ 25KB
.DS_Store 15KB
.DS_Store 15KB
.DS_Store 12KB
.gitignore 50B
sqlite3.h 336KB
sqlite3ext.h 24KB
su.h 6KB
utils.h 1010B
android-support-v4.jar 377KB
SettingsFragmentInternal.java 19KB
MultitaskSuRequestActivity.java 19KB
Settings.java 13KB
MainActivity.java 12KB
SuDatabaseHelper.java 8KB
LogFragmentInternal.java 7KB
SuperuserDatabaseHelper.java 7KB
PolicyFragmentInternal.java 7KB
AboutFragment.java 5KB
StreamUtility.java 4KB
SuReceiver.java 3KB
NotifyActivity.java 3KB
SuCheckerReceiver.java 3KB
PinViewHelper.java 3KB
PolicyNativeFragment.java 3KB
LogNativeFragment.java 3KB
Helper.java 2KB
UidCommand.java 2KB
PackageChangeReceiver.java 2KB
SettingsNativeFragment.java 2KB
LogFragment.java 2KB
SoftReferenceHashTable.java 1KB
UidPolicy.java 1KB
RequestActivity.java 1KB
LogEntry.java 1KB
ImageCache.java 961B
SuApplication.java 939B
SettingsFragment.java 920B
PolicyFragment.java 894B
SuHelper.java 824B
BuildConfig.java 168B
LICENSE 587B
README.md 4KB
Android.mk 1KB
Android.mk 480B
Android.mk 424B
Application.mk 64B
Android.mk~ 480B
koush.png 141KB
clockwork512.png 122KB
carbon.png 83KB
tether.png 49KB
github.png 41KB
desksms.png 32KB
ic_launcher.png 8KB
ic_protected.png 7KB
共 289 条
- 1
- 2
- 3
资源评论
- june_mui2017-08-23网上有开源的代码
- 程序员(无名)2018-05-14很好用,谢谢分享。
- DateForensics2018-11-29好用,谢谢分享。
- tgv123456782016-07-07很有用,我已下载
- e_leolee2017-07-11还不错的资源
koozxcv
- 粉丝: 116
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功