|
22 | 22 | import com.fox2code.mmm.Constants; |
23 | 23 | import com.fox2code.mmm.MainApplication; |
24 | 24 | import com.fox2code.mmm.R; |
| 25 | +import com.fox2code.mmm.XHooks; |
25 | 26 | import com.fox2code.mmm.androidacy.AndroidacyActivity; |
26 | 27 | import com.fox2code.mmm.compat.CompatActivity; |
27 | 28 | import com.fox2code.mmm.installer.InstallerActivity; |
28 | 29 | import com.fox2code.mmm.markdown.MarkdownActivity; |
| 30 | +import com.topjohnwu.superuser.CallbackList; |
| 31 | +import com.topjohnwu.superuser.Shell; |
| 32 | +import com.topjohnwu.superuser.ShellUtils; |
| 33 | +import com.topjohnwu.superuser.internal.Utils; |
29 | 34 | import com.topjohnwu.superuser.io.SuFileInputStream; |
30 | 35 |
|
31 | 36 | import java.io.File; |
32 | 37 | import java.io.FileOutputStream; |
33 | 38 | import java.io.InputStream; |
34 | 39 | import java.io.OutputStream; |
35 | 40 | import java.net.URISyntaxException; |
| 41 | +import java.util.ArrayList; |
| 42 | +import java.util.List; |
36 | 43 |
|
37 | 44 | public class IntentHelper { |
38 | 45 | private static final String TAG = "IntentHelper"; |
@@ -128,9 +135,23 @@ public static String getPackageOfConfig(String config) { |
128 | 135 | public static void openConfig(Context context, String config) { |
129 | 136 | String pkg = getPackageOfConfig(config); |
130 | 137 | try { |
131 | | - Intent intent = context.getPackageManager() |
132 | | - .getLaunchIntentForPackage(pkg); |
| 138 | + Intent intent = XHooks.getConfigIntent(context, pkg, config); |
133 | 139 | if (intent == null) { |
| 140 | + if ("org.lsposed.manager".equals(config) && ( |
| 141 | + XHooks.isModuleActive("riru_lsposed") || |
| 142 | + XHooks.isModuleActive("zygisk_lsposed"))) { |
| 143 | + Shell.getShell().newJob().add( |
| 144 | + "am start -a android.intent.action.MAIN " + |
| 145 | + "-c org.lsposed.manager.LAUNCH_MANAGER " + |
| 146 | + "com.android.shell/.BugreportWarningActivity") |
| 147 | + .to(new CallbackList<String>() { |
| 148 | + @Override |
| 149 | + public void onAddElement(String str) { |
| 150 | + Log.d(TAG, "LSPosed: " + str); |
| 151 | + } |
| 152 | + }).submit(); |
| 153 | + return; |
| 154 | + } |
134 | 155 | intent = new Intent("android.intent.action.APPLICATION_PREFERENCES"); |
135 | 156 | intent.setPackage(pkg); |
136 | 157 | } |
|
0 commit comments