Skip to content

Commit 6b73a34

Browse files
author
tiann
committed
[VA]: use base64 encode some sensitive strings to bypass the stupid anti-virus engine.
1 parent 4f60248 commit 6b73a34

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.lody.virtual.helper.utils;
2+
3+
import android.util.Base64;
4+
5+
/**
6+
* @author weishu
7+
* @date 18/3/20.
8+
*/
9+
public class EncodeUtils {
10+
11+
public static String decode(String base64) {
12+
return new String(Base64.decode(base64, 0));
13+
}
14+
}

VirtualApp/lib/src/main/java/com/lody/virtual/os/VEnvironment.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.os.Environment;
66

77
import com.lody.virtual.client.core.VirtualCore;
8+
import com.lody.virtual.helper.utils.EncodeUtils;
89
import com.lody.virtual.helper.utils.FileUtils;
910
import com.lody.virtual.helper.utils.VLog;
1011

@@ -67,7 +68,8 @@ public static File getDataUserPackageDirectory(int userId,
6768
}
6869

6970
public static File getPackageResourcePath(String packgeName) {
70-
return new File(getDataAppPackageDirectory(packgeName), "base.apk");
71+
return new File(getDataAppPackageDirectory(packgeName),
72+
EncodeUtils.decode("YmFzZS5hcGs=")); // base.apk
7173
}
7274

7375
public static File getDataAppDirectory() {
@@ -123,9 +125,12 @@ public static File getOdexFile(String packageName) {
123125
// in Android O, the oatfile is relate with classloader, we must ensure the correct location to avoid repeated load dex.
124126
String instructionSet = VMRuntime.getCurrentInstructionSet.call();
125127
File oatDir = ensureCreated(new File(getDataAppPackageDirectory(packageName), "oat" + File.separator + instructionSet));
126-
return new File(oatDir, "base.odex");
128+
return new File(oatDir, EncodeUtils.decode("YmFzZS5vZGV4")); // base.odex
127129
} else {
128-
return new File(DALVIK_CACHE_DIRECTORY, "data@app@" + packageName + "[email protected]@classes.dex");
130+
// return new File(DALVIK_CACHE_DIRECTORY, "data@app@" + packageName + "[email protected]@classes.dex");
131+
return new File(DALVIK_CACHE_DIRECTORY, EncodeUtils.decode("ZGF0YUBhcHBA") +
132+
packageName +
133+
EncodeUtils.decode("LTFAYmFzZS5hcGtAY2xhc3Nlcy5kZXg="));
129134
}
130135
}
131136

@@ -174,7 +179,8 @@ public static File getVirtualStorageDir(String packageName, int userId) {
174179
}
175180

176181
public static File getWifiMacFile(int userId) {
177-
return new File(getUserSystemDirectory(userId), "wifiMacAddress");
182+
// return new File(getUserSystemDirectory(userId), "wifiMacAddress");
183+
return new File(getUserSystemDirectory(userId), EncodeUtils.decode("d2lmaU1hY0FkZHJlc3M="));
178184
}
179185

180186
public static File getDataDirectory() {

0 commit comments

Comments
 (0)