diff --git a/app/.gitignore b/app/.gitignore index 3ad2e8e..3c24edd 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -2,3 +2,4 @@ /release *.apk src/main/res2 +dict.txt diff --git a/app/build.gradle b/app/build.gradle index f79ecfd..1276867 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,16 +1,4 @@ apply plugin: 'com.android.application' -// apply plugin: 'lazyinject' - -/* -lazyinject { - //是否开启注入 - enable true - //启用编译期间类型匹配,可以减少运行期间反射,建议开启 - optimize true - //包名数组,过滤需要注入的包,加快编译 - includes "virtual" -} -*/ android { compileSdkVersion 30 @@ -19,8 +7,8 @@ android { applicationId "io.virtualapp.sandvxposed" minSdkVersion 21 targetSdkVersion 28 - versionCode 85 - versionName "1.2.5.1.3.1.7.3" + versionCode 88 + versionName "1.2.5.1.3.1.7.6" multiDexEnabled true android { defaultConfig { @@ -71,15 +59,15 @@ android { } dependencies { - implementation 'androidx.constraintlayout:constraintlayout:2.0.1' - api fileTree(include: ['*.jar'], dir: 'libs') + implementation fileTree(include: ['*.jar'], dir: 'libs') api project(':lib') // Update to AndroidX on 2019/06/07 //Android Lib + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.melnykov:floatingactionbutton:1.3.0' implementation 'androidx.percentlayout:percentlayout:1.0.0' - implementation 'com.google.android.material:material:1.2.0' + implementation 'com.google.android.material:material:1.2.1' implementation 'androidx.cardview:cardview:1.0.0' //Promise Support implementation 'org.jdeferred:jdeferred-android-aar:1.2.4' @@ -93,10 +81,6 @@ dependencies { implementation 'androidx.recyclerview:recyclerview:1.1.0' // annotationProcessor 'com.trend.lazyinject:compiler:3.4.0-beta' - // TX移动统计,非必要,大家可在构建的时候删掉 - implementation 'com.qq.mta:mta:3.7.1-release' - implementation 'com.tencent.mid:mid:4.1.5-release' - // ZLoadingView api 'com.zyao89:zloading:1.2.0' diff --git a/app/dict.txt b/app/dict.txt deleted file mode 100644 index 6d661ee..0000000 --- a/app/dict.txt +++ /dev/null @@ -1,41 +0,0 @@ -香港 -记者 -连任 -吼啊 -鸭嘴笔 -董建华 -张宝华 -tooYoung -tooSimple -当然啦 -上海交大 -学习一个 -身经百战 -见得多了 -谈笑风生 -sometimesNaive -朱物华校长 -张钟俊院长 -你们还是要 -有事找大哥 -董先生连任 -搞个大新闻 -applyForProfessor -youMeanImADictator -美国的华莱士 -识得唔识得啊 -跑得比谁都快 -你们呀Naive -苟利国家生死以 -岂因祸福避趋之 -不是我要钦点他 -不知高到哪里去 -一点人生的经验 -闷声大发财 -微电子工业的发展 -他们这里洋文好的人多得很呐 -西方的那一个国家我没有去过 -你们毕竟还TooYoung明白这意思吗 -能源与发展趋势的主要节能措施 -搞来搞去还是图样图森破i上台拿衣服 -将来如果在报道上有偏差i你们要负责 \ No newline at end of file diff --git a/app/libs/Baidu_Mtj_android_4.0.3.6.jar b/app/libs/Baidu_Mtj_android_4.0.3.6.jar new file mode 100644 index 0000000..3564d82 Binary files /dev/null and b/app/libs/Baidu_Mtj_android_4.0.3.6.jar differ diff --git a/app/proguard-baidu-mtj.pro b/app/proguard-baidu-mtj.pro new file mode 100644 index 0000000..46b8f3a --- /dev/null +++ b/app/proguard-baidu-mtj.pro @@ -0,0 +1,2 @@ + +-keep class com.baidu.mobstat.** { *; } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8b64376..507d490 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -14,7 +15,30 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/sknetsec" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + tools:ignore="UnusedAttribute"> + + + + + + + + = Build.VERSION_CODES.Q) + String szEnableRedirectStorage = BanNotificationProvider.getString(VApp.getApp(),"enablePackageScan"); + if(szEnableRedirectStorage != null) { - if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - ActivityCompat.requestPermissions(this, new String[]{ - Manifest.permission.READ_EXTERNAL_STORAGE - }, 0); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) + { + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(this, new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE + }, 0); + } } - } - else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { - if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0); + else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0); + } } } } diff --git a/app/src/main/java/io/virtualapp/home/models/PackageAppData.java b/app/src/main/java/io/virtualapp/home/models/PackageAppData.java index 67b58cd..ab2c78b 100644 --- a/app/src/main/java/io/virtualapp/home/models/PackageAppData.java +++ b/app/src/main/java/io/virtualapp/home/models/PackageAppData.java @@ -26,7 +26,7 @@ public PackageAppData(Context context, InstalledAppInfo installedAppInfo) { this.packageName = installedAppInfo.packageName; this.isFirstOpen = !installedAppInfo.isLaunched(0); this.xposedModule = installedAppInfo.xposedModule; - versionName = installedAppInfo.getPackageInfo(0).versionName; + versionName = installedAppInfo.getPackageInfo(installedAppInfo.getInstalledUsers()[0]).versionName; loadData(context, installedAppInfo.getApplicationInfo(installedAppInfo.getInstalledUsers()[0])); } diff --git a/app/src/main/java/io/virtualapp/splash/SplashActivity.java b/app/src/main/java/io/virtualapp/splash/SplashActivity.java index cc00ff7..38d1608 100644 --- a/app/src/main/java/io/virtualapp/splash/SplashActivity.java +++ b/app/src/main/java/io/virtualapp/splash/SplashActivity.java @@ -9,11 +9,10 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; +import com.baidu.mobstat.StatService; import com.lody.virtual.client.core.VirtualCore; import com.sk.desktop.SKDesktop; import com.sk.verify.msVerify; -import com.tencent.stat.StatConfig; -import com.tencent.stat.StatService; import io.virtualapp.R; import io.virtualapp.VCommends; @@ -158,13 +157,10 @@ private void initMTA() private void bindMTA() { - try - { - // [可选]设置是否打开debug输出,上线时请关闭,Logcat标签为"MtaSDK" - StatConfig.setDebugEnable(false); - // 基础统计API - StatService.registerActivityLifecycleCallbacks(this.getApplication()); - }catch (Throwable e) + try{ + StatService.setAuthorizedState(this, true); + StatService.start(this); + }catch (Exception e) { e.printStackTrace(); } diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 7971e4e..c14ef8a 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -111,7 +111,7 @@ 默认会更新所有克隆的应用(会被更新到与本机安装版本相同),如果需要取消更新,请点击列表里面的项目。点击以后可以取消该应用的更新同步。 删除数据 应用数据管理 - 更新日志:修复大量严重问题。 + 更新日志:修复主要问题。 应用唤醒设置 启用或者禁用程序唤醒(切断唤醒) 分享到SVXP内部的应用 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 61bdd04..0d23da5 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -111,7 +111,7 @@ 默认会更新所有克隆的应用(会被更新到与本机安装版本相同),如果需要取消更新,请点击列表里面的项目。点击以后可以取消该应用的更新同步。 删除数据 应用数据管理 - 更新日志:修复大量严重问题。 + 更新日志:修复主要问题。 应用唤醒设置 启用或者禁用程序唤醒(切断唤醒) 分享到SVXP内部的应用 diff --git a/build.gradle b/build.gradle index bcb239a..c514d58 100644 --- a/build.gradle +++ b/build.gradle @@ -7,14 +7,10 @@ buildscript { url 'https://dl.google.com/dl/android/maven2/' name 'Google' } - maven { - url 'https://maven.fabric.io/public' - } jcenter() - google() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:4.1.1' // classpath 'com.android.tools.build:gradle-experimental:3.3.2' // classpath 'com.trend.lazyinject:aopweave:3.4.0-beta' // NOTE: Do not place your application dependencies here; they belong @@ -33,7 +29,6 @@ allprojects { maven { url "https://jitpack.io" } - google() } } diff --git a/lib/src/main/java/com/lody/virtual/client/VClientImpl.java b/lib/src/main/java/com/lody/virtual/client/VClientImpl.java index 684350b..18edc82 100644 --- a/lib/src/main/java/com/lody/virtual/client/VClientImpl.java +++ b/lib/src/main/java/com/lody/virtual/client/VClientImpl.java @@ -486,7 +486,7 @@ private void startIOUniformer() { .getAbsolutePath(); } } - else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) + else if(BuildCompat.isQ()) { File lpFile = VirtualCore.get().getContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS); if(lpFile!=null) @@ -503,7 +503,7 @@ else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) else szExtStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath(); //新建一个File,传入文件夹目录 - File file = new File(szExtStoragePath + "/skdir"); + File file = new File(szExtStoragePath, "skdir"); //判断文件夹是否存在,如果不存在就创建,否则不创建 if (!file.exists()) { @@ -513,15 +513,35 @@ else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) VLog.d(TAG,"Make directory failed."); } } - NativeEngine.redirectDirectory(Environment. - getExternalStorageDirectory(). - getAbsolutePath(), szExtStoragePath + "/skdir"); + HashSet mps = getMountPoints(); + for(String srtMp : mps) + { + NativeEngine.redirectDirectory(srtMp, file.getAbsolutePath()); + } }catch (Throwable e) { // ignored. e.printStackTrace(); } } + else if(BuildCompat.isR()) + { + HashSet mps = getMountPoints(); + File cacheDir = + new File( + new File(VirtualCore.get().getContext().getCacheDir(),"v_user"), + info.packageName!=null?info.packageName:"shared" + ); + if(!cacheDir.exists())cacheDir.mkdirs(); + for(String theMountPoint : mps) + { + File ksFile = new File(theMountPoint, "Android"); + String newPath = + cacheDir.getAbsolutePath(); + String oldPath = ksFile.getAbsolutePath(); + NativeEngine.redirectDirectory(oldPath, newPath); + } + } NativeEngine.enableIORedirect(); } diff --git a/lib/src/main/java/com/lody/virtual/client/core/VirtualCore.java b/lib/src/main/java/com/lody/virtual/client/core/VirtualCore.java index 11d5788..cfb0de0 100644 --- a/lib/src/main/java/com/lody/virtual/client/core/VirtualCore.java +++ b/lib/src/main/java/com/lody/virtual/client/core/VirtualCore.java @@ -54,6 +54,7 @@ import com.lody.virtual.server.interfaces.IPackageObserver; import com.lody.virtual.server.interfaces.IUiCallback; +import java.io.File; import java.io.IOException; import java.util.List; @@ -661,6 +662,17 @@ public boolean uninstallPackage(String pkgName) { { e.printStackTrace(); } + try{ + File ext = new File(context.getCacheDir(),"v_user"); + ext = new File(ext, pkgName); + if(ext.exists()) + { + if(!ext.delete())ext.deleteOnExit(); + } + }catch (Exception e) + { + e.printStackTrace(); + } getPkgLocation.removeLocFromPkg(pkgName); XposedUtils.clearXposed(pkgName); try { diff --git a/lib/src/main/java/com/lody/virtual/client/hook/proxies/content/MethodProxies.java b/lib/src/main/java/com/lody/virtual/client/hook/proxies/content/MethodProxies.java index bd8bc11..c65b94d 100644 --- a/lib/src/main/java/com/lody/virtual/client/hook/proxies/content/MethodProxies.java +++ b/lib/src/main/java/com/lody/virtual/client/hook/proxies/content/MethodProxies.java @@ -69,7 +69,7 @@ public Object call(Object who, Method method, Object... args) throws Throwable { return super.call(who, method, args); } catch (Throwable se) { if (se.getCause() instanceof SecurityException && OSUtils.getInstance().isAndroidQ()) { - se.printStackTrace(); + // ignored } else { throw se; } diff --git a/lib/src/main/java/com/lody/virtual/client/hook/proxies/notification/MethodProxies.java b/lib/src/main/java/com/lody/virtual/client/hook/proxies/notification/MethodProxies.java index f969a00..990c208 100644 --- a/lib/src/main/java/com/lody/virtual/client/hook/proxies/notification/MethodProxies.java +++ b/lib/src/main/java/com/lody/virtual/client/hook/proxies/notification/MethodProxies.java @@ -9,6 +9,7 @@ import com.lody.virtual.client.hook.base.MethodProxy; import com.lody.virtual.client.hook.utils.MethodParameterUtils; import com.lody.virtual.client.ipc.VNotificationManager; +import com.lody.virtual.helper.compat.BuildCompat; import com.lody.virtual.helper.utils.ArrayUtils; import com.lody.virtual.helper.utils.VLog; @@ -149,8 +150,8 @@ public Object call(Object who, Method method, Object... args) throws Throwable { if (getHostPkg().equals(pkg)) { return method.invoke(who, args); } - String tag = (String) args[1]; - int id = (int) args[2]; + String tag = (String) args[BuildCompat.isR()?2:1]; + int id = (int) args[BuildCompat.isR()?3:2]; SKVPackageNotificationHook hHook = new SKVPackageNotificationHook(); try { diff --git a/lib/src/main/java/com/lody/virtual/sandxposed/EnvironmentSetup.java b/lib/src/main/java/com/lody/virtual/sandxposed/EnvironmentSetup.java index 38ce4a2..95ceeb3 100644 --- a/lib/src/main/java/com/lody/virtual/sandxposed/EnvironmentSetup.java +++ b/lib/src/main/java/com/lody/virtual/sandxposed/EnvironmentSetup.java @@ -23,11 +23,11 @@ import sk.vpkg.sign.SKPackageGuard; public class EnvironmentSetup { - + public static volatile boolean enableEnv = false; public static void init(Context context, String packageName, String processName) { VLog.d("SandHook","Process attach: "+processName+" in package "+packageName); - initSystemProp(context); + if(enableEnv) initSystemProp(context); initForSpecialApps(context, packageName); if(BuildConfig.DEBUG) { @@ -160,8 +160,9 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { try { - XposedHelpers.findAndHookMethod(Process.class, "killProcess", int.class, g_Hook); - XposedHelpers.findAndHookMethod(System.class, "exit", int.class, g_Hook); + // 可以不再钩结束函数。 + //XposedHelpers.findAndHookMethod(Process.class, "killProcess", int.class, g_Hook); + //XposedHelpers.findAndHookMethod(System.class, "exit", int.class, g_Hook); String szEnableRedirectStorage = BanNotificationProvider.getString(context,"disableAdaptApp"); if(szEnableRedirectStorage!=null) SKPackageGuard.antiXposedCheck(packageName);