Skip to content

Commit 6fa8e28

Browse files
author
维术
committed
[Exposed-core] Xposed log support.
1 parent d4a0261 commit 6fa8e28

File tree

1 file changed

+7
-2
lines changed
  • VirtualApp/app/src/main/java/io/virtualapp

1 file changed

+7
-2
lines changed

VirtualApp/app/src/main/java/io/virtualapp/VApp.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.lody.virtual.client.core.VirtualCore;
1111
import com.lody.virtual.client.stub.VASettings;
1212
import com.lody.virtual.helper.utils.FileUtils;
13+
import com.lody.virtual.os.VEnvironment;
1314

1415
import java.io.File;
1516
import java.io.FileOutputStream;
@@ -22,12 +23,15 @@
2223
import io.virtualapp.delegate.MyTaskDescriptionDelegate;
2324
import io.virtualapp.update.VAVersionService;
2425
import jonathanfinerty.once.Once;
26+
import me.weishu.exposed.LogcatService;
2527

2628
/**
2729
* @author Lody
2830
*/
2931
public class VApp extends MultiDexApplication {
3032

33+
private static final String XPOSED_INSTALLER_PACKAGE = "de.robv.android.xposed.installer";
34+
3135
private static VApp gApp;
3236
private SharedPreferences mPreferences;
3337

@@ -64,9 +68,8 @@ public void onMainProcess() {
6468
// nothing
6569
})
6670
.build(VApp.this, "48RJJP7ZCZZBB6KMMWW5");
67-
final String xposedPackageName = "de.robv.android.xposed.installer";
6871

69-
boolean isXposedInstalled = VirtualCore.get().isAppInstalled(xposedPackageName);
72+
boolean isXposedInstalled = VirtualCore.get().isAppInstalled(XPOSED_INSTALLER_PACKAGE);
7073
if (!isXposedInstalled) {
7174
File xposedInstallerApk = getFileStreamPath("XposedInstaller.apk");
7275
if (!xposedInstallerApk.exists()) {
@@ -106,6 +109,8 @@ public void onVirtualProcess() {
106109
virtualCore.setPhoneInfoDelegate(new MyPhoneInfoDelegate());
107110
//fake task description's icon and title
108111
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));
109114
}
110115

111116
@Override

0 commit comments

Comments
 (0)