<permission
android:name="android.permission.REPORT_SUPERUSER"
android:protectionLevel="signatureOrSystem" />
- <permission android:name="android.permission.ACCESS_SUPERUSER" />
+ <permission
+ android:protectionLevel="dangerous"
+ android:name="android.permission.ACCESS_SUPERUSER"
+ android:description="@string/superuser_description_more"
+ android:logo="@drawable/ic_action_permission"
+ android:icon="@drawable/ic_action_permission"
+ android:label="@string/superuser_description" />
+ <uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
+
<application
android:name=".SuApplication"
android:allowBackup="false"
+++ /dev/null
-<merge xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <include
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- layout="@layout/app_info" />
-
- <include
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- layout="@layout/app_icons" />
-</merge>
\ No newline at end of file
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<include
- android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- layout="@layout/app_info" />
+ layout="@layout/app_info"
+ android:visibility="gone" />
<include
android:layout_width="fill_parent"
android:layout_height="wrap_content"
layout="@layout/app_icons" />
+
+ <TextView
+ android:paddingBottom="4dp"
+ android:gravity="center"
+ android:id="@+id/developer_warning"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/developer_warning"
+ android:textColor="@color/holo_red_dark"
+ android:visibility="gone" />
+
</merge>
\ No newline at end of file
<string name="toast">Toast</string>
<string name="notification">Notification</string>
<string name="none">None</string>
+ <string name="developer_warning">Developer Warning:\nandroid.permission.ACCESS_SUPERUSER\nnot declared in manifest.</string>
+ <string name="superuser_description">full permissions to all device features and storage</string>
+ <string name="superuser_description_more">Superuser grants full access to all device features and storage, including the secure and sensitive hardware elements of your device. This permission is potentially dangerous.</string>
</resources>
\ No newline at end of file
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
+import android.content.pm.PermissionInfo;
import android.content.res.Configuration;
import android.net.LocalSocket;
import android.net.LocalSocketAddress;
}
};
+
+ boolean superuserDeclared = false;
list.setAdapter(mAdapter);
if (pkgs != null) {
for (String pkg: pkgs) {
try {
- PackageInfo pi = pm.getPackageInfo(pkg, 0);
+ PackageInfo pi = pm.getPackageInfo(pkg, PackageManager.GET_PERMISSIONS);
((TextView)findViewById(R.id.request)).setText(getString(R.string.application_request, pi.applicationInfo.loadLabel(pm)));
mAdapter.add(pi);
((TextView)findViewById(R.id.app_header)).setText(pi.applicationInfo.loadLabel(pm));
((TextView)findViewById(R.id.package_header)).setText(pi.packageName);
+ if (pi.requestedPermissions != null) {
+ for (String perm: pi.requestedPermissions) {
+ if ("android.permission.ACCESS_SUPERUSER".equals(perm)) {
+ superuserDeclared = true;
+ break;
+ }
+ }
+ }
+
// could display them all, but screw it...
// maybe a better ux for this later
break;
}
}
+ if (!superuserDeclared) {
+ findViewById(R.id.developer_warning).setVisibility(View.VISIBLE);
+ }
+
new Runnable() {
public void run() {
mAllow.setText(getString(R.string.allow) + " (" + mTimeLeft + ")");