|
10 | 10 | import com.lody.virtual.client.core.VirtualCore; |
11 | 11 | import com.lody.virtual.client.stub.VASettings; |
12 | 12 | import com.lody.virtual.helper.utils.FileUtils; |
| 13 | +import com.lody.virtual.os.VEnvironment; |
13 | 14 |
|
14 | 15 | import java.io.File; |
15 | 16 | import java.io.FileOutputStream; |
|
22 | 23 | import io.virtualapp.delegate.MyTaskDescriptionDelegate; |
23 | 24 | import io.virtualapp.update.VAVersionService; |
24 | 25 | import jonathanfinerty.once.Once; |
| 26 | +import me.weishu.exposed.LogcatService; |
25 | 27 |
|
26 | 28 | /** |
27 | 29 | * @author Lody |
28 | 30 | */ |
29 | 31 | public class VApp extends MultiDexApplication { |
30 | 32 |
|
| 33 | + private static final String XPOSED_INSTALLER_PACKAGE = "de.robv.android.xposed.installer"; |
| 34 | + |
31 | 35 | private static VApp gApp; |
32 | 36 | private SharedPreferences mPreferences; |
33 | 37 |
|
@@ -64,9 +68,8 @@ public void onMainProcess() { |
64 | 68 | // nothing |
65 | 69 | }) |
66 | 70 | .build(VApp.this, "48RJJP7ZCZZBB6KMMWW5"); |
67 | | - final String xposedPackageName = "de.robv.android.xposed.installer"; |
68 | 71 |
|
69 | | - boolean isXposedInstalled = VirtualCore.get().isAppInstalled(xposedPackageName); |
| 72 | + boolean isXposedInstalled = VirtualCore.get().isAppInstalled(XPOSED_INSTALLER_PACKAGE); |
70 | 73 | if (!isXposedInstalled) { |
71 | 74 | File xposedInstallerApk = getFileStreamPath("XposedInstaller.apk"); |
72 | 75 | if (!xposedInstallerApk.exists()) { |
@@ -106,6 +109,8 @@ public void onVirtualProcess() { |
106 | 109 | virtualCore.setPhoneInfoDelegate(new MyPhoneInfoDelegate()); |
107 | 110 | //fake task description's icon and title |
108 | 111 | virtualCore.setTaskDescriptionDelegate(new MyTaskDescriptionDelegate()); |
| 112 | + // ensure the logcat service alive when every virtual process start. |
| 113 | + LogcatService.start(VApp.this, VEnvironment.getDataUserPackageDirectory(0, XPOSED_INSTALLER_PACKAGE)); |
109 | 114 | } |
110 | 115 |
|
111 | 116 | @Override |
|
0 commit comments