diff --git a/app/build.gradle b/app/build.gradle index 867158573..b011f1e75 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,11 +47,11 @@ repositories { dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.android.support:recyclerview-v7:25.1.0' - compile 'com.android.support:cardview-v7:25.1.0' - compile 'com.android.support:design:25.1.0' - compile 'com.android.support:support-v4:25.1.0' - compile 'com.android.support:support-v13:25.1.0' + compile 'com.android.support:recyclerview-v7:25.1.1' + compile 'com.android.support:cardview-v7:25.1.1' + compile 'com.android.support:design:25.1.1' + compile 'com.android.support:support-v4:25.1.1' + compile 'com.android.support:support-v13:25.1.1' compile 'com.jakewharton:butterknife:8.5.1' compile 'com.google.code.gson:gson:2.8.0' compile 'com.github.clans:fab:1.6.4' diff --git a/app/src/main/java/com/topjohnwu/magisk/superuser/Policy.java b/app/src/main/java/com/topjohnwu/magisk/superuser/Policy.java index 9604aaf3e..54b1080f4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/superuser/Policy.java +++ b/app/src/main/java/com/topjohnwu/magisk/superuser/Policy.java @@ -11,7 +11,6 @@ public class Policy { public static final int DENY = 1; public static final int ALLOW = 2; - public int uid, policy; public long until; public boolean logging = true, notification = true; @@ -22,6 +21,7 @@ public class Policy { String[] pkgs = pm.getPackagesForUid(uid); if (pkgs != null && pkgs.length > 0) { info = pm.getPackageInfo(pkgs[0], 0); + this.uid = uid; packageName = pkgs[0]; appName = info.applicationInfo.loadLabel(pm).toString(); } else throw new PackageManager.NameNotFoundException(); diff --git a/app/src/main/java/com/topjohnwu/magisk/superuser/SuRequestActivity.java b/app/src/main/java/com/topjohnwu/magisk/superuser/SuRequestActivity.java index 4e39c5c4d..61c36cbd7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/superuser/SuRequestActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/superuser/SuRequestActivity.java @@ -87,11 +87,10 @@ public class SuRequestActivity extends AppCompatActivity implements CallbackHand switch (Global.Configs.suResponseType) { case AUTO_DENY: - event.trigger(); + handleAction(Policy.DENY, 0); return; case AUTO_ALLOW: - policy.policy = Policy.ALLOW; - event.trigger(policy); + handleAction(Policy.ALLOW, 0); return; case PROMPT: default: @@ -157,9 +156,12 @@ public class SuRequestActivity extends AppCompatActivity implements CallbackHand } void handleAction(int action) { + handleAction(action, timeoutList[timeout.getSelectedItemPosition()]); + } + + void handleAction(int action, int time) { policy.policy = action; event.trigger(policy); - int time = timeoutList[timeout.getSelectedItemPosition()]; if (time >= 0) { policy.until = time == 0 ? 0 : (System.currentTimeMillis() / 1000 + time * 60); new SuDatabaseHelper(this).addPolicy(policy); diff --git a/app/src/main/res/layout/fragment_install.xml b/app/src/main/res/layout/fragment_install.xml index 11ce7f8ca..e2a930b64 100644 --- a/app/src/main/res/layout/fragment_install.xml +++ b/app/src/main/res/layout/fragment_install.xml @@ -1,213 +1,222 @@ - - - - - - - - - - - - - + android:orientation="vertical"> + app:cardUseCompatPadding="true"> + android:padding="5dp"> + + + + + + + + + + + + + + + + + +