public static void onOpenDexFileNative(String[] params) { String dexOrJarPath = params[0]; String outputPath = params[1]; VLog.d(TAG, "DexOrJarPath = %s, OutputPath = %s.", dexOrJarPath, outputPath); try { String canonical = new File(dexOrJarPath).getCanonicalPath(); InstalledAppInfo info = sDexOverrideMap.get(canonical); if (info != null && !info.dependSystem || info != null && DeviceUtil.isMeizuBelowN() && params[1] == null) { outputPath = info.getOdexFile().getPath(); params[1] = outputPath; } } catch (IOException e) { e.printStackTrace(); } }
private static boolean isOreo() { return BuildCompat.isOreo() && !DeviceUtil.isSamsung() || ClipboardManager.getService == null; } }
public static void onOpenDexFileNative(String[] params) { String dexOrJarPath = params[0]; String outputPath = params[1]; VLog.d(TAG, "DexOrJarPath = %s, OutputPath = %s.", dexOrJarPath, outputPath); try { String canonical = new File(dexOrJarPath).getCanonicalPath(); InstalledAppInfo info = sDexOverrideMap.get(canonical); if (info != null && !info.dependSystem || info != null && DeviceUtil.isMeizuBelowN() && params[1] == null) { outputPath = info.getOdexFile().getPath(); params[1] = outputPath; } } catch (IOException e) { e.printStackTrace(); } }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("enqueueToast")); addMethodProxy(new ReplaceCallingPkgMethodProxy("cancelToast")); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { addMethodProxy(new ReplaceCallingPkgMethodProxy("removeAutomaticZenRules")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getImportance")); addMethodProxy(new ReplaceCallingPkgMethodProxy("areNotificationsEnabled")); addMethodProxy(new ReplaceCallingPkgMethodProxy("setNotificationPolicy")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationPolicy")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isNotificationPolicyAccessGrantedForPackage")); } // http://androidxref.com/8.0.0_r4/xref/frameworks/base/core/java/android/app/INotificationManager.aidl if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { addMethodProxy(new ReplaceCallingPkgMethodProxy("createNotificationChannelGroups")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationChannelGroups")); addMethodProxy(new ReplaceCallingPkgMethodProxy("deleteNotificationChannelGroup")); addMethodProxy(new ReplaceCallingPkgMethodProxy("createNotificationChannels")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationChannels")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationChannel")); addMethodProxy(new ReplaceCallingPkgMethodProxy("deleteNotificationChannel")); } if (DeviceUtil.isSamsung()) { addMethodProxy(new ReplaceCallingPkgMethodProxy("removeEdgeNotification")); } }
public static InstallResult addVirtualApp(AppInfoLite info) { int flags = InstallStrategy.COMPARE_VERSION | InstallStrategy.SKIP_DEX_OPT; info.fastOpen = DeviceUtil.isMeizuBelowN(); if (info.fastOpen) { flags |= InstallStrategy.DEPEND_SYSTEM_IF_EXIST; } if (info.disableMultiVersion) { flags |= InstallStrategy.UPDATE_IF_EXIST; } return VirtualCore.get().installPackage(info.path, flags); }
private static boolean isOreo() { return BuildCompat.isOreo() && !DeviceUtil.isSamsung() || ClipboardManager.getService == null; } }
@Override public InstallResult addVirtualApp(AppInfoLite info) { int flags = InstallStrategy.COMPARE_VERSION; info.fastOpen = false; // disable fast open for compile. if (DeviceUtil.isMeizuBelowN()) { info.fastOpen = true; } if (info.fastOpen) { flags |= InstallStrategy.DEPEND_SYSTEM_IF_EXIST; } if (info.disableMultiVersion) { flags |= InstallStrategy.UPDATE_IF_EXIST; } return VirtualCore.get().installPackage(info.path, flags); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("enqueueToast")); addMethodProxy(new ReplaceCallingPkgMethodProxy("cancelToast")); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { addMethodProxy(new ReplaceCallingPkgMethodProxy("removeAutomaticZenRules")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getImportance")); addMethodProxy(new ReplaceCallingPkgMethodProxy("areNotificationsEnabled")); addMethodProxy(new ReplaceCallingPkgMethodProxy("setNotificationPolicy")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationPolicy")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isNotificationPolicyAccessGrantedForPackage")); } // http://androidxref.com/8.0.0_r4/xref/frameworks/base/core/java/android/app/INotificationManager.aidl if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { addMethodProxy(new ReplaceCallingPkgMethodProxy("createNotificationChannelGroups")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationChannelGroups")); addMethodProxy(new ReplaceCallingPkgMethodProxy("deleteNotificationChannelGroup")); addMethodProxy(new ReplaceCallingPkgMethodProxy("createNotificationChannels")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationChannels")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getNotificationChannel")); addMethodProxy(new ReplaceCallingPkgMethodProxy("deleteNotificationChannel")); } if (DeviceUtil.isSamsung()) { addMethodProxy(new ReplaceCallingPkgMethodProxy("removeEdgeNotification")); } }
public AppPagerAdapter(FragmentManager fm) { super(fm); titles.add(VApp.getApp().getResources().getString(R.string.clone_apps)); dirs.add(null); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { Context ctx = VApp.getApp(); StorageManager storage = (StorageManager) ctx.getSystemService(Context.STORAGE_SERVICE); for (StorageVolume volume : storage.getStorageVolumes()) { //Why the fuck are getPathFile and getUserLabel hidden?! //StorageVolume is kinda useless without those... File dir = Reflect.on(volume).call("getPathFile").get(); String label = Reflect.on(volume).call("getUserLabel").get(); if (dir.listFiles() != null) { titles.add(label); dirs.add(dir); } } } else { // Fallback: only support the default storage sources if (!DeviceUtil.isMeizuBelowN()) { File storageFir = Environment.getExternalStorageDirectory(); if (storageFir != null && storageFir.isDirectory()) { titles.add(VApp.getApp().getResources().getString(R.string.external_storage)); dirs.add(storageFir); } } } }
private void alertForMeizu() { if (!DeviceUtil.isMeizuBelowN()) { return; } boolean isXposedInstalled = VirtualCore.get().isAppInstalled(VApp.XPOSED_INSTALLER_PACKAGE); if (isXposedInstalled) { return; } mUiHandler.postDelayed(() -> { AlertDialog alertDialog = new AlertDialog.Builder(getContext()) .setTitle(R.string.meizu_device_tips_title) .setMessage(R.string.meizu_device_tips_content) .setPositiveButton(android.R.string.yes, (dialog, which) -> { }) .create(); try { alertDialog.show(); } catch (Throwable ignored) {} }, 2000); }