Skip to content

Commit

Permalink
[VXP]: fix for anti-virus: CAT-QuickHeal Android.Banker.GEN17312.
Browse files Browse the repository at this point in the history
Every modification is necessary:
1. rename VApp -> XApp.
2. NativeEngine.java's log
3. VClientImpl's log.

It is really metaphysics, fuck !!!!
  • Loading branch information
weishu.tws committed Mar 29, 2018
1 parent 83b12ae commit 5e07a70
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 35 deletions.
2 changes: 1 addition & 1 deletion VirtualApp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<uses-sdk tools:overrideLibrary="com.android.launcher3,android.support.dynamicanimation" />

<application
android:name=".VApp"
android:name=".XApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
import io.virtualapp.delegate.MyComponentDelegate;
import io.virtualapp.delegate.MyCrashHandler;
import io.virtualapp.delegate.MyPhoneInfoDelegate;
import io.virtualapp.delegate.MyTaskDescriptionDelegate;
import io.virtualapp.delegate.MyTaskDescDelegate;
import jonathanfinerty.once.Once;
import me.weishu.exposed.LogcatService;

/**
* @author Lody
*/
public class VApp extends Application {
public class XApp extends Application {

private static final String TAG = "VApp";
private static final String TAG = "XApp";

public static final String XPOSED_INSTALLER_PACKAGE = "de.robv.android.xposed.installer";

private static VApp gApp;
private static XApp gApp;
private SharedPreferences mPreferences;

public static VApp getApp() {
public static XApp getApp() {
return gApp;
}

Expand Down Expand Up @@ -71,9 +71,9 @@ public void onCreate() {

@Override
public void onMainProcess() {
Once.initialise(VApp.this);
Once.initialise(XApp.this);

Fabric.with(VApp.this, new Crashlytics());
Fabric.with(XApp.this, new Crashlytics());

boolean isXposedInstalled = false;
try {
Expand Down Expand Up @@ -121,23 +121,23 @@ public void onMainProcess() {

@Override
public void onVirtualProcess() {
Fabric.with(VApp.this, new Crashlytics());
Fabric.with(XApp.this, new Crashlytics());

//listener components
virtualCore.setComponentDelegate(new MyComponentDelegate());
//fake phone imei,macAddress,BluetoothAddress
virtualCore.setPhoneInfoDelegate(new MyPhoneInfoDelegate());
//fake task description's icon and title
virtualCore.setTaskDescriptionDelegate(new MyTaskDescriptionDelegate());
virtualCore.setTaskDescriptionDelegate(new MyTaskDescDelegate());
virtualCore.setCrashHandler(new MyCrashHandler());

// ensure the logcat service alive when every virtual process start.
LogcatService.start(VApp.this, VEnvironment.getDataUserPackageDirectory(0, XPOSED_INSTALLER_PACKAGE));
LogcatService.start(XApp.this, VEnvironment.getDataUserPackageDirectory(0, XPOSED_INSTALLER_PACKAGE));
}

@Override
public void onServerProcess() {
virtualCore.setAppRequestListener(new MyAppRequestListener(VApp.this));
virtualCore.setAppRequestListener(new MyAppRequestListener(XApp.this));
virtualCore.addVisibleOutsidePackage("com.tencent.mobileqq");
virtualCore.addVisibleOutsidePackage("com.tencent.mobileqqi");
virtualCore.addVisibleOutsidePackage("com.tencent.minihd.qq");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
public class MyCrashHandler implements CrashHandler {

private static final String TAG = "VApp";
private static final String TAG = "XApp";

@Override
public void handleUncaughtException(Thread t, Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Patch the task description with the (Virtual) user name
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class MyTaskDescriptionDelegate implements TaskDescriptionDelegate {
public class MyTaskDescDelegate implements TaskDescriptionDelegate {
@Override
public ActivityManager.TaskDescription getTaskDescription(ActivityManager.TaskDescription oldTaskDescription) {
if (oldTaskDescription == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Locale;

import io.virtualapp.R;
import io.virtualapp.VApp;
import io.virtualapp.XApp;
import io.virtualapp.abs.ui.VFragment;
import io.virtualapp.home.adapters.CloneAppListAdapter;
import io.virtualapp.home.models.AppInfo;
Expand Down Expand Up @@ -110,7 +110,7 @@ public boolean isSelectable(int position) {
});
mAdapter.setSelectionListener(count -> {
mInstallButton.setEnabled(count > 0);
mInstallButton.setText(String.format(Locale.ENGLISH, VApp.getApp().getResources().getString(R.string.install_d), count));
mInstallButton.setText(String.format(Locale.ENGLISH, XApp.getApp().getResources().getString(R.string.install_d), count));
});
mInstallButton.setOnClickListener(v -> {
Integer[] selectedIndices = mAdapter.getSelectedIndices();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import java.io.File;
import java.lang.reflect.Method;

import io.virtualapp.XApp;
import io.virtualapp.R;
import io.virtualapp.VApp;
import io.virtualapp.settings.SettingsActivity;
import io.virtualapp.update.VAVersionService;

Expand Down Expand Up @@ -146,7 +146,7 @@ private void alertForMeizu() {
if (!DeviceUtil.isMeizuBelowN()) {
return;
}
boolean isXposedInstalled = VirtualCore.get().isAppInstalled(VApp.XPOSED_INSTALLER_PACKAGE);
boolean isXposedInstalled = VirtualCore.get().isAppInstalled(XApp.XPOSED_INSTALLER_PACKAGE);
if (isXposedInstalled) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import java.util.ArrayList;
import java.util.List;

import io.virtualapp.XApp;
import io.virtualapp.R;
import io.virtualapp.VApp;
import io.virtualapp.home.ListAppFragment;

/**
Expand All @@ -29,10 +29,10 @@ public class AppPagerAdapter extends FragmentPagerAdapter {

public AppPagerAdapter(FragmentManager fm) {
super(fm);
titles.add(VApp.getApp().getResources().getString(R.string.clone_apps));
titles.add(XApp.getApp().getResources().getString(R.string.clone_apps));
dirs.add(null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Context ctx = VApp.getApp();
Context ctx = XApp.getApp();
StorageManager storage = (StorageManager) ctx.getSystemService(Context.STORAGE_SERVICE);
for (StorageVolume volume : storage.getStorageVolumes()) {
//Why the fuck are getPathFile and getUserLabel hidden?!
Expand All @@ -49,7 +49,7 @@ public AppPagerAdapter(FragmentManager fm) {
if (!DeviceUtil.isMeizuBelowN()) {
File storageFir = Environment.getExternalStorageDirectory();
if (storageFir != null && storageFir.isDirectory()) {
titles.add(VApp.getApp().getResources().getString(R.string.external_storage));
titles.add(XApp.getApp().getResources().getString(R.string.external_storage));
dirs.add(storageFir);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import com.lody.virtual.remote.InstalledAppInfo;

import io.virtualapp.VApp;

/**
* @author Lody
*/
Expand Down Expand Up @@ -76,9 +74,6 @@ public String getName() {

@Override
public boolean canReorder() {
if (VApp.XPOSED_INSTALLER_PACKAGE.equals(packageName)) {
return false;
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.HashMap;
import java.util.Map;

import io.virtualapp.VApp;
import io.virtualapp.XApp;
import io.virtualapp.abs.Callback;
import io.virtualapp.abs.ui.VUiKit;
import io.virtualapp.home.models.PackageAppData;
Expand Down Expand Up @@ -47,7 +47,7 @@ public void acquire(String packageName, Callback<PackageAppData> callback) {
private PackageAppData loadAppData(String packageName) {
InstalledAppInfo setting = VirtualCore.get().getInstalledAppInfo(packageName, 0);
if (setting != null) {
PackageAppData data = new PackageAppData(VApp.getApp(), setting);
PackageAppData data = new PackageAppData(XApp.getApp(), setting);
synchronized (packageDataMap) {
packageDataMap.put(packageName, data);
}
Expand All @@ -74,7 +74,7 @@ public void acquire(ApplicationInfo appInfo, Callback<PackageAppData> callback)
}

private PackageAppData loadAppData(ApplicationInfo appInfo) {
PackageAppData data = new PackageAppData(VApp.getApp(), appInfo);
PackageAppData data = new PackageAppData(XApp.getApp(), appInfo);
synchronized (packageDataMap) {
packageDataMap.put(appInfo.packageName, data);
}
Expand Down
4 changes: 2 additions & 2 deletions VirtualApp/app/src/main/java/io/virtualapp/sys/Installd.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.io.IOException;
import java.util.ArrayList;

import io.virtualapp.VApp;
import io.virtualapp.XApp;
import io.virtualapp.VCommends;
import io.virtualapp.abs.ui.VUiKit;
import io.virtualapp.home.models.AppData;
Expand Down Expand Up @@ -78,7 +78,7 @@ class AddResult {
} else {
PackageInfo pkgInfo = null;
try {
pkgInfo = VApp.getApp().getPackageManager().getPackageArchiveInfo(info.path, 0);
pkgInfo = XApp.getApp().getPackageManager().getPackageArchiveInfo(info.path, 0);
pkgInfo.applicationInfo.sourceDir = info.path;
pkgInfo.applicationInfo.publicSourceDir = info.path;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static void enableIORedirect() {
try {
String soPath = String.format("/data/data/%s/lib/libva++.so", VirtualCore.get().getHostPkg());
if (!new File(soPath).exists()) {
throw new RuntimeException("Unable to find the so.");
throw new RuntimeException("io redirect failed.");
}
nativeEnableIORedirect(soPath, Build.VERSION.SDK_INT, BuildCompat.getPreviewSDKInt());
} catch (Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import android.os.RemoteException;
import android.os.StrictMode;
import android.util.Base64;
import android.util.Log;

import com.lody.virtual.client.core.CrashHandler;
import com.lody.virtual.client.core.InvocationStubManager;
Expand Down Expand Up @@ -258,7 +257,7 @@ private void bindApplicationNoCheck(String packageName, String processName, Cond
data.processName = processName;
data.appInfo.processName = processName;
data.providers = VPackageManager.get().queryContentProviders(processName, getVUid(), PackageManager.GET_META_DATA);
Log.i(TAG, "Binding application " + data.appInfo.packageName + " (" + data.processName + ")");
VLog.i(TAG, String.format("Binding application %s, (%s)", data.appInfo.packageName, data.processName));
mBoundApplication = data;
VirtualRuntime.setupRuntime(data.processName, data.appInfo);
int targetSdkVersion = data.appInfo.targetSdkVersion;
Expand Down

0 comments on commit 5e07a70

Please sign in to comment.