diff --git a/README.md b/README.md index 22bb881b..c9d72921 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,14 @@ In this case, detected apps that use root (such as Fake Location and Storage Iso At the same time, some "smart" apps use various loopholes to acquire your applist, so that it can draw a persona for you. This module provides some methods to test whether you have already hided your applist nicely. Also, it can work as an Xposed module to hide some apps or reject applist requests to protect your privacy. +Attension: Xposed API version lower than 93 is NOT supported due to a permission problem ## 关于该模块 虽然“检测安装的应用是不正确的做法”,而且很蠢,但是并不是所有的插件类应用都提供了随机包名支持。在这种情况下,检测到安装了root类应用(如Fake Location、存储重定向)与检测到了root本身区别不大。(会使用检测手段的app可不会认为你是在“我就蹭蹭不进去”) 与此同时,部分“不安分”的app会使用各种漏洞绕过系统权限来获取你的应用列表,从而对你建立用户画像。(如陈叔叔将安装了V2Ray的用户分为一类) 该模块提供了一些检测方式用于测试您是否成功的隐藏了带有root印记的包名,如Magisk/Edxposed Manager。 -同时可作为Xposed模块用于隐藏应用列表或特定应用,保护你的隐私。 +同时可作为Xposed模块用于隐藏应用列表或特定应用,保护你的隐私。 +注意:由于一个权限问题,XPosed API至少为93才能正常使用该模块 ## TODO + Add native detection \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a73cf310..b995e576 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -44,7 +44,7 @@ android:value="Reject applist detection." /> + android:value="93" /> \ No newline at end of file diff --git a/app/src/main/java/com/tsng/hidemyapplist/HookApplist.java b/app/src/main/java/com/tsng/hidemyapplist/HookApplist.java index c1f68a00..4050ba2b 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/HookApplist.java +++ b/app/src/main/java/com/tsng/hidemyapplist/HookApplist.java @@ -23,7 +23,7 @@ public class HookApplist implements IXposedHookLoadPackage { public static final String LOG = "hma_log"; - public static final String APPNAME = "com.tsng.hidemyapplist"; + public static final String APPNAME = BuildConfig.APPLICATION_ID; @Override public void handleLoadPackage(final LoadPackageParam lpp) { diff --git a/app/src/main/java/com/tsng/hidemyapplist/ScopeManageActivity.kt b/app/src/main/java/com/tsng/hidemyapplist/ScopeManageActivity.kt index b0e85657..b2e93b8d 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/ScopeManageActivity.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/ScopeManageActivity.kt @@ -40,10 +40,11 @@ class ScopeManageActivity : AppCompatActivity() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { preferenceManager.sharedPreferencesName = "Scope" + preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE setPreferencesFromResource(R.xml.scope_preferences, rootKey) map = preferenceManager.sharedPreferences.all as MutableMap templates = setOf("") + - requireActivity().getSharedPreferences("Templates", MODE_PRIVATE).getStringSet("List", setOf())!! + requireActivity().getSharedPreferences("Templates", MODE_WORLD_READABLE).getStringSet("List", setOf())!! refresh() } diff --git a/app/src/main/java/com/tsng/hidemyapplist/TemplateManageActivity.java b/app/src/main/java/com/tsng/hidemyapplist/TemplateManageActivity.java index fa0315a6..369fb15d 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/TemplateManageActivity.java +++ b/app/src/main/java/com/tsng/hidemyapplist/TemplateManageActivity.java @@ -61,7 +61,7 @@ public boolean onSupportNavigateUp() { } private void InitTemplateList() { - list_pref = getSharedPreferences("Templates", Context.MODE_PRIVATE); + list_pref = getSharedPreferences("Templates", Context.MODE_WORLD_READABLE); templates = new HashSet<>(list_pref.getStringSet("List", new HashSet<>())); ListView lv = findViewById(R.id.xposed_lv_template); adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, new ArrayList<>(templates)); @@ -76,7 +76,7 @@ private void InitTemplateList() { .setPositiveButton(getString(R.string.accept), ((dialog, which) -> { templates.remove(s); adapter.remove(s); - new File(getFilesDir().getParent() + "/shared_prefs/tpl_" + s + ".xml").delete(); + getSharedPreferences("tpl_" + s, MODE_WORLD_READABLE).edit().clear().apply(); list_pref.edit().putStringSet("List", new HashSet<>(templates)).apply(); })).show(); return true; diff --git a/app/src/main/java/com/tsng/hidemyapplist/TemplateSettingsActivity.kt b/app/src/main/java/com/tsng/hidemyapplist/TemplateSettingsActivity.kt index e317c5d2..977cee6b 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/TemplateSettingsActivity.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/TemplateSettingsActivity.kt @@ -53,6 +53,7 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O class SettingsFragment : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { preferenceManager.sharedPreferencesName = "tpl_" + arguments?.getString("template") + preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE setPreferencesFromResource(R.xml.template_preferences, rootKey) } } @@ -63,6 +64,7 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { preferenceManager.sharedPreferencesName = "tpl_" + arguments?.getString("template") + preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE setPreferencesFromResource(R.xml.template_hideapps_preference, rootKey) list = preferenceManager.sharedPreferences.getStringSet("HideApps", setOf())!!.toMutableSet() refresh() diff --git a/app/src/main/java/com/tsng/hidemyapplist/ui/about/AboutFragment.kt b/app/src/main/java/com/tsng/hidemyapplist/ui/about/AboutFragment.kt index ec0b3d7b..529a00dd 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/ui/about/AboutFragment.kt +++ b/app/src/main/java/com/tsng/hidemyapplist/ui/about/AboutFragment.kt @@ -6,6 +6,7 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.tsng.hidemyapplist.BuildConfig import com.tsng.hidemyapplist.R import mehdi.sakout.aboutpage.AboutPage import mehdi.sakout.aboutpage.Element @@ -15,7 +16,7 @@ class AboutFragment : Fragment() { return AboutPage(activity) .setDescription(getString(R.string.about_my_description)) .addItem(Element().apply { - title = "Version " + requireContext().packageManager.getPackageInfo(requireContext().packageName, 0).versionName + title = "Version " + BuildConfig.VERSION_NAME iconDrawable = R.drawable.ic_baseline_language_24 }) .addItem(Element().apply { diff --git a/app/src/main/java/com/tsng/hidemyapplist/ui/xposed/XposedFragment.java b/app/src/main/java/com/tsng/hidemyapplist/ui/xposed/XposedFragment.java index 7e767a2b..53da4303 100644 --- a/app/src/main/java/com/tsng/hidemyapplist/ui/xposed/XposedFragment.java +++ b/app/src/main/java/com/tsng/hidemyapplist/ui/xposed/XposedFragment.java @@ -45,7 +45,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Override public void onClick(View v) { - switch (v.getId()) { + if(!getXposedStatus()) + Toast.makeText(getContext(), getString(R.string.xposed_actvate_first), Toast.LENGTH_SHORT).show(); + else switch (v.getId()) { case R.id.hook_self: isHookSelf = !isHookSelf; PreferenceManager.getDefaultSharedPreferences(getContext()).edit().putBoolean("HookSelf", isHookSelf).apply(); diff --git a/app/src/main/res/values-zh-rCN/strings_xposed.xml b/app/src/main/res/values-zh-rCN/strings_xposed.xml index 00906096..b58b49cc 100644 --- a/app/src/main/res/values-zh-rCN/strings_xposed.xml +++ b/app/src/main/res/values-zh-rCN/strings_xposed.xml @@ -5,6 +5,7 @@ Hook模块自身 重启模块以应用更改 重启目标APP以应用更改 + 请先激活模块 请先禁用Hook模块自身并重启模块 模板管理 选择生效应用 diff --git a/app/src/main/res/values/strings_xposed.xml b/app/src/main/res/values/strings_xposed.xml index b1770dcc..c94bfc18 100644 --- a/app/src/main/res/values/strings_xposed.xml +++ b/app/src/main/res/values/strings_xposed.xml @@ -5,6 +5,7 @@ Hook Self Restart the module to apply changes Restart target apps to apply changes + Please activate module first Please disable hook self and restart the module Manage Templates Select Effective Apps