mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Separate backend logic from frontend UI
This commit is contained in:
@@ -15,8 +15,10 @@ import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.topjohnwu.core.Const;
|
||||
import com.topjohnwu.core.Data;
|
||||
import com.topjohnwu.core.container.Policy;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.utils.FingerprintHelper;
|
||||
import com.topjohnwu.magisk.utils.SuConnector;
|
||||
|
||||
@@ -70,7 +72,7 @@ public class SuRequestActivity extends BaseActivity {
|
||||
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
PackageManager pm = getPackageManager();
|
||||
mm.mDB.clearOutdated();
|
||||
app.mDB.clearOutdated();
|
||||
|
||||
// Get policy
|
||||
Intent intent = getIntent();
|
||||
@@ -84,7 +86,7 @@ public class SuRequestActivity extends BaseActivity {
|
||||
};
|
||||
Bundle bundle = connector.readSocketInput();
|
||||
int uid = Integer.parseInt(bundle.getString("uid"));
|
||||
policy = mm.mDB.getPolicy(uid);
|
||||
policy = app.mDB.getPolicy(uid);
|
||||
if (policy == null) {
|
||||
policy = new Policy(uid, pm);
|
||||
}
|
||||
@@ -212,7 +214,7 @@ public class SuRequestActivity extends BaseActivity {
|
||||
policy.policy = action;
|
||||
if (time >= 0) {
|
||||
policy.until = (time == 0) ? 0 : (System.currentTimeMillis() / 1000 + time * 60);
|
||||
mm.mDB.updatePolicy(policy);
|
||||
app.mDB.updatePolicy(policy);
|
||||
}
|
||||
handleAction();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user