From 5e07a70ffd589ff353617047d604181c5cb76791 Mon Sep 17 00:00:00 2001 From: "weishu.tws" Date: Thu, 29 Mar 2018 18:35:52 +0800 Subject: [PATCH] [VXP]: fix for anti-virus: CAT-QuickHeal Android.Banker.GEN17312. Every modification is necessary: 1. rename VApp -> XApp. 2. NativeEngine.java's log 3. VClientImpl's log. It is really metaphysics, fuck !!!! --- VirtualApp/app/src/main/AndroidManifest.xml | 2 +- .../io/virtualapp/{VApp.java => XApp.java} | 22 +++++++++---------- .../virtualapp/delegate/MyCrashHandler.java | 2 +- ...nDelegate.java => MyTaskDescDelegate.java} | 2 +- .../io/virtualapp/home/ListAppFragment.java | 4 ++-- .../io/virtualapp/home/NewHomeActivity.java | 4 ++-- .../home/adapters/AppPagerAdapter.java | 8 +++---- .../home/models/PackageAppData.java | 5 ----- .../home/repo/PackageAppDataStorage.java | 6 ++--- .../main/java/io/virtualapp/sys/Installd.java | 4 ++-- .../com/lody/virtual/client/NativeEngine.java | 2 +- .../com/lody/virtual/client/VClientImpl.java | 3 +-- 12 files changed, 29 insertions(+), 35 deletions(-) rename VirtualApp/app/src/main/java/io/virtualapp/{VApp.java => XApp.java} (92%) rename VirtualApp/app/src/main/java/io/virtualapp/delegate/{MyTaskDescriptionDelegate.java => MyTaskDescDelegate.java} (93%) diff --git a/VirtualApp/app/src/main/AndroidManifest.xml b/VirtualApp/app/src/main/AndroidManifest.xml index a8b3c9526..eb8ea358b 100644 --- a/VirtualApp/app/src/main/AndroidManifest.xml +++ b/VirtualApp/app/src/main/AndroidManifest.xml @@ -9,7 +9,7 @@ { 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(); diff --git a/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java b/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java index 199c0d5d3..836757b14 100644 --- a/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java +++ b/VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java @@ -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; @@ -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; } diff --git a/VirtualApp/app/src/main/java/io/virtualapp/home/adapters/AppPagerAdapter.java b/VirtualApp/app/src/main/java/io/virtualapp/home/adapters/AppPagerAdapter.java index 16f99cb95..ad152d634 100644 --- a/VirtualApp/app/src/main/java/io/virtualapp/home/adapters/AppPagerAdapter.java +++ b/VirtualApp/app/src/main/java/io/virtualapp/home/adapters/AppPagerAdapter.java @@ -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; /** @@ -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?! @@ -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); } } diff --git a/VirtualApp/app/src/main/java/io/virtualapp/home/models/PackageAppData.java b/VirtualApp/app/src/main/java/io/virtualapp/home/models/PackageAppData.java index 359a02995..fa06ad426 100644 --- a/VirtualApp/app/src/main/java/io/virtualapp/home/models/PackageAppData.java +++ b/VirtualApp/app/src/main/java/io/virtualapp/home/models/PackageAppData.java @@ -7,8 +7,6 @@ import com.lody.virtual.remote.InstalledAppInfo; -import io.virtualapp.VApp; - /** * @author Lody */ @@ -76,9 +74,6 @@ public String getName() { @Override public boolean canReorder() { - if (VApp.XPOSED_INSTALLER_PACKAGE.equals(packageName)) { - return false; - } return true; } diff --git a/VirtualApp/app/src/main/java/io/virtualapp/home/repo/PackageAppDataStorage.java b/VirtualApp/app/src/main/java/io/virtualapp/home/repo/PackageAppDataStorage.java index 7c6fc4a30..b5f105044 100644 --- a/VirtualApp/app/src/main/java/io/virtualapp/home/repo/PackageAppDataStorage.java +++ b/VirtualApp/app/src/main/java/io/virtualapp/home/repo/PackageAppDataStorage.java @@ -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; @@ -47,7 +47,7 @@ public void acquire(String packageName, Callback 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); } @@ -74,7 +74,7 @@ public void acquire(ApplicationInfo appInfo, Callback 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); } diff --git a/VirtualApp/app/src/main/java/io/virtualapp/sys/Installd.java b/VirtualApp/app/src/main/java/io/virtualapp/sys/Installd.java index 07eb7b1a2..2cf428b86 100644 --- a/VirtualApp/app/src/main/java/io/virtualapp/sys/Installd.java +++ b/VirtualApp/app/src/main/java/io/virtualapp/sys/Installd.java @@ -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; @@ -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) { diff --git a/VirtualApp/lib/src/main/java/com/lody/virtual/client/NativeEngine.java b/VirtualApp/lib/src/main/java/com/lody/virtual/client/NativeEngine.java index 0e162a654..74dc1914a 100644 --- a/VirtualApp/lib/src/main/java/com/lody/virtual/client/NativeEngine.java +++ b/VirtualApp/lib/src/main/java/com/lody/virtual/client/NativeEngine.java @@ -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) { diff --git a/VirtualApp/lib/src/main/java/com/lody/virtual/client/VClientImpl.java b/VirtualApp/lib/src/main/java/com/lody/virtual/client/VClientImpl.java index b9dbe25af..89f69125e 100644 --- a/VirtualApp/lib/src/main/java/com/lody/virtual/client/VClientImpl.java +++ b/VirtualApp/lib/src/main/java/com/lody/virtual/client/VClientImpl.java @@ -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; @@ -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;