From a62d49f076cb781d37783ce45ae31c4c1d3844af Mon Sep 17 00:00:00 2001 From: Dr-TSNG Date: Sat, 1 May 2021 17:41:40 +0800 Subject: [PATCH] 1.5 release & add hide system apps --- app/build.gradle | 5 +- .../tsng/hidemyapplist/ui/AboutActivity.kt | 1 + .../hidemyapplist/ui/ScopeManageActivity.kt | 66 ++++++++-- .../ui/TemplateSettingsActivity.kt | 66 ++++++++-- .../tsng/hidemyapplist/xposed/XposedEntry.kt | 2 +- .../tsng/hidemyapplist/xposed/XposedUtils.kt | 120 +++++++++--------- .../xposed/hooks/IndividualHooks.kt | 8 +- .../xposed/hooks/PackageManagerService.kt | 18 +-- .../main/res/layout/activity_detection.xml | 2 +- .../main/res/layout/activity_scope_manage.xml | 12 -- .../res/layout/activity_template_settings.xml | 12 -- app/src/main/res/layout/appselect.xml | 23 ++++ app/src/main/res/menu/toolbar_appselect.xml | 12 ++ app/src/main/res/values-zh-rCN/strings.xml | 4 +- .../res/values-zh-rCN/strings_toolbar.xml | 4 + app/src/main/res/values/strings.xml | 4 +- app/src/main/res/values/strings_toolbar.xml | 4 + ..._preferences.xml => empty_preferences.xml} | 0 .../res/xml/template_hideapps_preference.xml | 4 - 19 files changed, 237 insertions(+), 130 deletions(-) delete mode 100644 app/src/main/res/layout/activity_scope_manage.xml delete mode 100644 app/src/main/res/layout/activity_template_settings.xml create mode 100644 app/src/main/res/layout/appselect.xml create mode 100644 app/src/main/res/menu/toolbar_appselect.xml create mode 100644 app/src/main/res/values-zh-rCN/strings_toolbar.xml create mode 100644 app/src/main/res/values/strings_toolbar.xml rename app/src/main/res/xml/{scope_preferences.xml => empty_preferences.xml} (100%) delete mode 100644 app/src/main/res/xml/template_hideapps_preference.xml diff --git a/app/build.gradle b/app/build.gradle index 31659b95..00b273b9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,12 +44,13 @@ dependencies { implementation 'com.google.code.gson:gson:2.8.6' implementation 'com.drakeet.about:about:2.4.1' implementation 'com.drakeet.multitype:multitype:4.2.0' + implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' + implementation 'com.scwang.smart:refresh-header-material:2.0.3' + implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'org.jetbrains:annotations:15.0' implementation 'androidx.preference:preference-ktx:1.1.1' implementation 'com.google.android.material:material:1.3.0' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.legacy:legacy-support-v4:1.0.0' compileOnly 'de.robv.android.xposed:api:82' compileOnly 'de.robv.android.xposed:api:82:sources' } \ No newline at end of file diff --git a/app/src/main/java/com/tsng/hidemyapplist/ui/AboutActivity.kt b/app/src/main/java/com/tsng/hidemyapplist/ui/AboutActivity.kt index d4d3f226..95d8edf6 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/ui/AboutActivity.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/ui/AboutActivity.kt @@ -43,6 +43,7 @@ class AboutActivity : AbsAboutActivity() { items.add(License("Gson", "Google", License.APACHE_2, "https://github.com/google/gson")) items.add(License("MultiType", "drakeet", License.APACHE_2, "https://github.com/drakeet/MultiType")) items.add(License("about-page", "drakeet", License.APACHE_2, "https://github.com/drakeet/about-page")) + items.add(License("SmartRefreshLayout", "scwang90", License.APACHE_2, "https://github.com/scwang90/SmartRefreshLayout")) items.add(License("Dobby", "jmpews", License.APACHE_2, "https://github.com/jmpews/Dobby")) } } \ No newline at end of file diff --git a/app/src/main/java/com/tsng/hidemyapplist/ui/ScopeManageActivity.kt b/app/src/main/java/com/tsng/hidemyapplist/ui/ScopeManageActivity.kt index eee6b8da..c7bdba23 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/ui/ScopeManageActivity.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/ui/ScopeManageActivity.kt @@ -2,24 +2,32 @@ package com.tsng.hidemyapplist.ui import android.content.pm.ApplicationInfo import android.os.Bundle +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.SearchView import androidx.preference.ListPreference import androidx.preference.PreferenceFragmentCompat +import androidx.preference.iterator import com.tsng.hidemyapplist.R +import kotlinx.android.synthetic.main.appselect.* import kotlinx.android.synthetic.main.toolbar.* +import java.text.Collator +import java.util.* import kotlin.collections.set +import kotlin.concurrent.thread class ScopeManageActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_scope_manage) + setContentView(R.layout.appselect) setSupportActionBar(toolbar) supportActionBar?.setDisplayHomeAsUpEnabled(true) if (savedInstanceState == null) { supportFragmentManager .beginTransaction() - .replace(R.id.xposed_score_container, SettingsFragment()) + .replace(R.id.appselect_container, SelectAppsFragment()) .commit() } } @@ -29,23 +37,59 @@ class ScopeManageActivity : AppCompatActivity() { return true } - class SettingsFragment : PreferenceFragmentCompat() { - + class SelectAppsFragment : PreferenceFragmentCompat() { private lateinit var map: MutableMap private lateinit var templates: Set + private var showSystemApps = false + + override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { + inflater.inflate(R.menu.toolbar_appselect, menu) + val searchView = menu.findItem(R.id.toolbar_search).actionView as SearchView + searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { + override fun onQueryTextSubmit(query: String): Boolean { + return true + } + + override fun onQueryTextChange(newText: String): Boolean { + for (pref in preferenceScreen) + pref.isVisible = pref.title.contains(newText) + return false + } + }) + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + return when (item.itemId) { + R.id.toolbar_show_system_apps -> { + item.isChecked = !item.isChecked + showSystemApps = item.isChecked + requireActivity().refresh_layout.autoRefresh() + true + } + else -> super.onOptionsItemSelected(item) + } + } + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setHasOptionsMenu(true) preferenceManager.sharedPreferencesName = "Scope" - setPreferencesFromResource(R.xml.scope_preferences, rootKey) + setPreferencesFromResource(R.xml.empty_preferences, rootKey) map = preferenceManager.sharedPreferences.all as MutableMap templates = setOf("") + requireActivity().getSharedPreferences("Templates", MODE_PRIVATE).getStringSet("List", setOf())!! - refresh() + requireActivity().refresh_layout.apply { + setOnRefreshListener { + thread { refresh() } + } + autoRefresh() + } } private fun refresh() { val packages = requireActivity().packageManager.getInstalledPackages(0) - packages.removeAll { it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0 } + if (!showSystemApps) + packages.removeAll { it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0 && !map.contains(it.packageName) } packages.sortWith { o1, o2 -> val l1 = o1.applicationInfo.loadLabel(requireActivity().packageManager) as String val l2 = o2.applicationInfo.loadLabel(requireActivity().packageManager) as String @@ -53,10 +97,10 @@ class ScopeManageActivity : AppCompatActivity() { if (map.containsKey(o2.packageName)) 1 else -1 else - l1.compareTo(l2) + Collator.getInstance(Locale.getDefault()).compare(l1, l2) } preferenceScreen.removeAll() - for (pkg in packages) + for (pkg in packages) { preferenceScreen.addPreference(ListPreference(context).apply { dialogTitle = getString(R.string.template_select) title = pkg.applicationInfo.loadLabel(requireActivity().packageManager) @@ -80,6 +124,8 @@ class ScopeManageActivity : AppCompatActivity() { } } }) + } + requireActivity().refresh_layout.finishRefresh() } } } \ No newline at end of file diff --git a/app/src/main/java/com/tsng/hidemyapplist/ui/TemplateSettingsActivity.kt b/app/src/main/java/com/tsng/hidemyapplist/ui/TemplateSettingsActivity.kt index 3dd66786..5d46feec 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/ui/TemplateSettingsActivity.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/ui/TemplateSettingsActivity.kt @@ -2,28 +2,36 @@ package com.tsng.hidemyapplist.ui import android.content.pm.ApplicationInfo import android.os.Bundle +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.SearchView import androidx.preference.CheckBoxPreference import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat +import androidx.preference.iterator import com.tsng.hidemyapplist.R +import kotlinx.android.synthetic.main.appselect.* import kotlinx.android.synthetic.main.toolbar.* +import java.text.Collator +import java.util.* +import kotlin.concurrent.thread class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPreferenceStartFragmentCallback { - private var template: String? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_template_settings) + setContentView(R.layout.appselect) setSupportActionBar(toolbar) supportActionBar?.setDisplayHomeAsUpEnabled(true) template = intent.getStringExtra("template") if (savedInstanceState == null) { supportFragmentManager .beginTransaction() - .replace(R.id.xposed_template_container, SettingsFragment().apply { + .replace(R.id.appselect_container, SettingsFragment().apply { arguments = Bundle().apply { putString("template", template) } }) .commit() @@ -35,7 +43,7 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O fragment.arguments = Bundle().apply { putString("template", template) } supportFragmentManager .beginTransaction() - .replace(R.id.xposed_template_container, fragment) + .replace(R.id.appselect_container, fragment) .addToBackStack(null) .commit() return true @@ -54,19 +62,55 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O } class HideAppsFragment : PreferenceFragmentCompat() { - private lateinit var list: MutableSet + private var showSystemApps = false + + override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { + inflater.inflate(R.menu.toolbar_appselect, menu) + val searchView = menu.findItem(R.id.toolbar_search).actionView as SearchView + searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { + override fun onQueryTextSubmit(query: String): Boolean { + return true + } + + override fun onQueryTextChange(newText: String): Boolean { + for (pref in preferenceScreen) + pref.isVisible = pref.title.contains(newText) + return false + } + }) + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + return when (item.itemId) { + R.id.toolbar_show_system_apps -> { + item.isChecked = !item.isChecked + showSystemApps = item.isChecked + requireActivity().refresh_layout.autoRefresh() + true + } + else -> super.onOptionsItemSelected(item) + } + } + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setHasOptionsMenu(true) preferenceManager.sharedPreferencesName = "tpl_" + arguments?.getString("template") - setPreferencesFromResource(R.xml.template_hideapps_preference, rootKey) + setPreferencesFromResource(R.xml.empty_preferences, rootKey) list = preferenceManager.sharedPreferences.getStringSet("HideApps", setOf())!!.toMutableSet() - refresh() + requireActivity().refresh_layout.apply { + setOnRefreshListener { + thread { refresh() } + } + autoRefresh() + } } private fun refresh() { val packages = requireActivity().packageManager.getInstalledPackages(0) - packages.removeAll { it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0 } + if (!showSystemApps) + packages.removeAll { it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0 && !list.contains(it.packageName) } packages.sortWith { o1, o2 -> val l1 = o1.applicationInfo.loadLabel(requireActivity().packageManager) as String val l2 = o2.applicationInfo.loadLabel(requireActivity().packageManager) as String @@ -74,10 +118,10 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O if (list.contains(o2.packageName)) 1 else -1 else - l1.compareTo(l2) + Collator.getInstance(Locale.getDefault()).compare(l1, l2) } preferenceScreen.removeAll() - for (pkg in packages) + for (pkg in packages) { preferenceScreen.addPreference(CheckBoxPreference(context).apply { title = pkg.applicationInfo.loadLabel(requireActivity().packageManager) icon = pkg.applicationInfo.loadIcon(requireActivity().packageManager) @@ -91,6 +135,8 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O true } }) + } + requireActivity().refresh_layout.finishRefresh() } } } \ No newline at end of file diff --git a/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedEntry.kt b/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedEntry.kt index ec6f81b5..d91f4dc2 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedEntry.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedEntry.kt @@ -1,6 +1,6 @@ package com.tsng.hidemyapplist.xposed -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.APPNAME +import com.tsng.hidemyapplist.xposed.XposedUtils.APPNAME import com.tsng.hidemyapplist.xposed.hooks.IndividualHooks import com.tsng.hidemyapplist.xposed.hooks.PackageManagerService import de.robv.android.xposed.IXposedHookLoadPackage diff --git a/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedUtils.kt b/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedUtils.kt index 3f01822a..a14c824f 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedUtils.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/xposed/XposedUtils.kt @@ -5,80 +5,78 @@ import com.tsng.hidemyapplist.BuildConfig import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.XposedHelpers -class XposedUtils { - companion object { - const val LOG = "hma_log" - const val resultNo = "HMA No" - const val resultYes = "HMA Yes" - const val resultIllegal = "HMA Illegal" - const val APPNAME = BuildConfig.APPLICATION_ID +object XposedUtils { + const val LOG = "hma_log" + const val resultNo = "HMA No" + const val resultYes = "HMA Yes" + const val resultIllegal = "HMA Illegal" + const val APPNAME = BuildConfig.APPLICATION_ID - @JvmStatic - fun getServiceVersion(context: Context): Int { - return try { - context.packageManager.getInstallerPackageName("checkHMAServiceVersion").toInt() - } catch (e: IllegalArgumentException) { 0 } - } + @JvmStatic + fun getServiceVersion(context: Context): Int { + return try { + context.packageManager.getInstallerPackageName("checkHMAServiceVersion").toInt() + } catch (e: IllegalArgumentException) { 0 } + } - @JvmStatic - fun getServicePreference(context: Context): String? { - return try { - context.packageManager.getInstallerPackageName("getPreference") - } catch (e: java.lang.IllegalArgumentException) { null } - } + @JvmStatic + fun getServicePreference(context: Context): String? { + return try { + context.packageManager.getInstallerPackageName("getPreference") + } catch (e: java.lang.IllegalArgumentException) { null } + } - @JvmStatic - fun callServiceIsUseHook(context: Context, callerName: String?, hookMethod: String): Boolean { - try { - val res = context.packageManager.getInstallerPackageName("callIsUseHook#$callerName#$hookMethod") - if (res == resultIllegal) { - le("callServiceIsUseHook: Illegal param callIsUseHook#$callerName#$hookMethod") - return false - } - return res == resultYes - } catch (e: IllegalArgumentException) { - le("callServiceIsUseHook: Service not found") + @JvmStatic + fun callServiceIsUseHook(context: Context, callerName: String?, hookMethod: String): Boolean { + try { + val res = context.packageManager.getInstallerPackageName("callIsUseHook#$callerName#$hookMethod") + if (res == resultIllegal) { + le("callServiceIsUseHook: Illegal param callIsUseHook#$callerName#$hookMethod") return false } + return res == resultYes + } catch (e: IllegalArgumentException) { + le("callServiceIsUseHook: Service not found") + return false } + } - @JvmStatic - fun callServiceIsToHide(context: Context, callerName: String?, pkgstr: String?, fileHook: Boolean): Boolean { - try { - val res = if (fileHook) context.packageManager.getInstallerPackageName("callIsHideFile#$callerName#$pkgstr") - else context.packageManager.getInstallerPackageName("callIsToHide#$callerName#$pkgstr") - if (res == resultIllegal) { - le("callServiceIsToHide: Illegal param callIsUseHook#$callerName#$pkgstr") - return false - } - return res == resultYes - } catch (e: IllegalArgumentException) { - le("callServiceIsToHide: Service not found") + @JvmStatic + fun callServiceIsToHide(context: Context, callerName: String?, pkgstr: String?, fileHook: Boolean): Boolean { + try { + val res = if (fileHook) context.packageManager.getInstallerPackageName("callIsHideFile#$callerName#$pkgstr") + else context.packageManager.getInstallerPackageName("callIsToHide#$callerName#$pkgstr") + if (res == resultIllegal) { + le("callServiceIsToHide: Illegal param callIsUseHook#$callerName#$pkgstr") return false } + return res == resultYes + } catch (e: IllegalArgumentException) { + le("callServiceIsToHide: Service not found") + return false } + } - @JvmStatic - fun getRecursiveField(entry: Any, list: List): Any? { - var field: Any? = entry - for (it in list) - field = XposedHelpers.getObjectField(field, it) ?: return null - return field - } + @JvmStatic + fun getRecursiveField(entry: Any, list: List): Any? { + var field: Any? = entry + for (it in list) + field = XposedHelpers.getObjectField(field, it) ?: return null + return field + } - @JvmStatic - fun ld(log: String) { - XposedBridge.log("[HMA LOG] [DEBUG] $log") - } + @JvmStatic + fun ld(log: String) { + XposedBridge.log("[HMA LOG] [DEBUG] $log") + } - @JvmStatic - fun li(log: String) { - XposedBridge.log("[HMA LOG] [INFO] $log") - } + @JvmStatic + fun li(log: String) { + XposedBridge.log("[HMA LOG] [INFO] $log") + } - @JvmStatic - fun le(log: String) { - XposedBridge.log("[HMA LOG] [ERROR] $log") - } + @JvmStatic + fun le(log: String) { + XposedBridge.log("[HMA LOG] [ERROR] $log") } } \ No newline at end of file diff --git a/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/IndividualHooks.kt b/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/IndividualHooks.kt index 89f37417..bf780c09 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/IndividualHooks.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/IndividualHooks.kt @@ -4,9 +4,9 @@ import android.app.Application import android.content.Context import com.tsng.hidemyapplist.xposed.XposedEntry.Companion.modulePath import com.tsng.hidemyapplist.xposed.XposedUtils -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.ld -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.le -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.li +import com.tsng.hidemyapplist.xposed.XposedUtils.ld +import com.tsng.hidemyapplist.xposed.XposedUtils.le +import com.tsng.hidemyapplist.xposed.XposedUtils.li import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XposedHelpers @@ -16,7 +16,7 @@ import kotlin.concurrent.thread class IndividualHooks : IXposedHookLoadPackage { override fun handleLoadPackage(lpp: LoadPackageParam) { - if (lpp.appInfo == null || lpp.appInfo.isSystemApp) return + if (lpp.appInfo == null) return var loadedNativeLib = false try { System.load(modulePath.substring(0, modulePath.lastIndexOf('/')) diff --git a/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/PackageManagerService.kt b/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/PackageManagerService.kt index 56d086a0..f61397c6 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/PackageManagerService.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/xposed/hooks/PackageManagerService.kt @@ -5,13 +5,13 @@ import android.os.Binder import android.os.Process import com.tsng.hidemyapplist.BuildConfig import com.tsng.hidemyapplist.JsonConfig -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.APPNAME -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.getRecursiveField -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.ld -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.li -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.resultIllegal -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.resultNo -import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.resultYes +import com.tsng.hidemyapplist.xposed.XposedUtils.APPNAME +import com.tsng.hidemyapplist.xposed.XposedUtils.getRecursiveField +import com.tsng.hidemyapplist.xposed.XposedUtils.ld +import com.tsng.hidemyapplist.xposed.XposedUtils.li +import com.tsng.hidemyapplist.xposed.XposedUtils.resultIllegal +import com.tsng.hidemyapplist.xposed.XposedUtils.resultNo +import com.tsng.hidemyapplist.xposed.XposedUtils.resultYes import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XposedBridge @@ -77,7 +77,6 @@ class PackageManagerService : IXposedHookLoadPackage { XposedBridge.hookMethod(method, object : XC_MethodHook() { override fun afterHookedMethod(param: MethodHookParam) { val callerUid = Binder.getCallingUid() - if (callerUid < Process.FIRST_APPLICATION_UID) return val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String? if (!isUseHook(callerName, hookName)) return var isHidden = false @@ -101,7 +100,6 @@ class PackageManagerService : IXposedHookLoadPackage { XposedBridge.hookMethod(method, object : XC_MethodHook() { override fun beforeHookedMethod(param: MethodHookParam) { val callerUid = Binder.getCallingUid() - if (callerUid < Process.FIRST_APPLICATION_UID) return val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String? if (!isUseHook(callerName, hookName)) return if (isToHide(callerName, param.args[0] as String?)) { @@ -116,7 +114,6 @@ class PackageManagerService : IXposedHookLoadPackage { class HMAService : XC_MethodHook() { override fun beforeHookedMethod(param: MethodHookParam) { val callerUid = Binder.getCallingUid() - if (callerUid < Process.FIRST_APPLICATION_UID) return val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String? val arg = param.args[0] as String? ?: return when { @@ -187,7 +184,6 @@ class PackageManagerService : IXposedHookLoadPackage { "getPackagesForUid" -> XposedBridge.hookMethod(method, object : XC_MethodHook() { override fun afterHookedMethod(param: MethodHookParam) { val callerUid = Binder.getCallingUid() - if (callerUid < Process.FIRST_APPLICATION_UID) return val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String? if (!isUseHook(callerName, "ID detections")) return if (param.result != null) { diff --git a/app/src/main/res/layout/activity_detection.xml b/app/src/main/res/layout/activity_detection.xml index 07155e5b..5ff29fee 100644 --- a/app/src/main/res/layout/activity_detection.xml +++ b/app/src/main/res/layout/activity_detection.xml @@ -8,7 +8,7 @@ diff --git a/app/src/main/res/layout/activity_scope_manage.xml b/app/src/main/res/layout/activity_scope_manage.xml deleted file mode 100644 index f8b1b940..00000000 --- a/app/src/main/res/layout/activity_scope_manage.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_template_settings.xml b/app/src/main/res/layout/activity_template_settings.xml deleted file mode 100644 index df5acb7d..00000000 --- a/app/src/main/res/layout/activity_template_settings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/appselect.xml b/app/src/main/res/layout/appselect.xml new file mode 100644 index 00000000..0a0a32fa --- /dev/null +++ b/app/src/main/res/layout/appselect.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/toolbar_appselect.xml b/app/src/main/res/menu/toolbar_appselect.xml new file mode 100644 index 00000000..fe202b2c --- /dev/null +++ b/app/src/main/res/menu/toolbar_appselect.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index a9c59c80..0a6005aa 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -16,7 +16,9 @@ 请仔细阅读关于页面的使用帮助!\n 请允许模块开机自启以使系统服务读取配置文件(之后无需保持后台)\n 提示:除了拦截文件检测外,不需要在EdXposed/LSPosed作用域中勾选目标APP\n - V1.4.3\n + V1.5\n + [+] 美化界面,添加搜索框\n + [+] 支持隐藏系统app\n [+] 修复一些卡开机/崩溃问题\n V1.4.2\n [+] 已初步实现native hooks (如果闪退请使用无native hooks版本)\n diff --git a/app/src/main/res/values-zh-rCN/strings_toolbar.xml b/app/src/main/res/values-zh-rCN/strings_toolbar.xml new file mode 100644 index 00000000..d2cd93b2 --- /dev/null +++ b/app/src/main/res/values-zh-rCN/strings_toolbar.xml @@ -0,0 +1,4 @@ + + + 显示系统应用 + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b560419b..06adb82f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -16,7 +16,9 @@ Please read the about page carefully!\n Please allow boot autostart to ensure system receives module config (No need to keep in background afterwards)\n Tint: Except for intercepting file detections, there is no need to check target apps in Xposed module scope\n - V1.4.3\n + V1.5\n + [+] UI redesign and add search bar\n + [+] Add hide system apps\n [+] Fix crashes on some devices\n V1.4.2\n [+] Elementarily realizes Native hook (If the native hooks version crashes, please use no native hooks version instead) diff --git a/app/src/main/res/values/strings_toolbar.xml b/app/src/main/res/values/strings_toolbar.xml new file mode 100644 index 00000000..b7e6c32c --- /dev/null +++ b/app/src/main/res/values/strings_toolbar.xml @@ -0,0 +1,4 @@ + + + Show system apps + \ No newline at end of file diff --git a/app/src/main/res/xml/scope_preferences.xml b/app/src/main/res/xml/empty_preferences.xml similarity index 100% rename from app/src/main/res/xml/scope_preferences.xml rename to app/src/main/res/xml/empty_preferences.xml diff --git a/app/src/main/res/xml/template_hideapps_preference.xml b/app/src/main/res/xml/template_hideapps_preference.xml deleted file mode 100644 index 6f1e916f..00000000 --- a/app/src/main/res/xml/template_hideapps_preference.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file