From 35912dcfe4c0fc2be94d56c1de72e640fafecb8d Mon Sep 17 00:00:00 2001 From: kaicity <1830170041@qq.com> Date: Sun, 4 Jul 2021 20:48:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=AE=BE=E7=BD=AE=E6=96=B0=E5=A2=9EHook?= =?UTF-8?q?=E8=84=B1=E5=A3=B3=E7=9A=84=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- .../top/niunaijun/blackdex/app/BlackDexLoader.kt | 15 +++++++++++++++ .../blackdex/view/setting/SettingFragment.kt | 11 +++++++++++ app/src/main/res/values-zh/string.xml | 3 ++- app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/setting.xml | 7 +++++++ 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cf6a82d..e247e77 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "top.niunaijun.blackdex" minSdkVersion 21 targetSdkVersion 30 - versionCode 4 - versionName "3.0.0" + versionCode 5 + versionName "3.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/top/niunaijun/blackdex/app/BlackDexLoader.kt b/app/src/main/java/top/niunaijun/blackdex/app/BlackDexLoader.kt index 2eae60a..d95e80c 100644 --- a/app/src/main/java/top/niunaijun/blackdex/app/BlackDexLoader.kt +++ b/app/src/main/java/top/niunaijun/blackdex/app/BlackDexLoader.kt @@ -23,6 +23,8 @@ class BlackDexLoader { private var mFixCodeItem by AppSharedPreferenceDelegate(App.getContext(),false) + private var mHookDump by AppSharedPreferenceDelegate(App.getContext(),true) + private var mDir = if (mSaveEnable) { getDexDumpDir(App.getContext()) } else { @@ -46,6 +48,10 @@ class BlackDexLoader { override fun isFixCodeItem(): Boolean { return mFixCodeItem } + + override fun isEnableHookDump(): Boolean { + return mHookDump + } }) } @@ -77,6 +83,15 @@ class BlackDexLoader { return this.mFixCodeItem } + fun setHookDump(enable: Boolean){ + this.mHookDump = enable + } + + fun isHookDump(): Boolean { + + return this.mHookDump + } + companion object { diff --git a/app/src/main/java/top/niunaijun/blackdex/view/setting/SettingFragment.kt b/app/src/main/java/top/niunaijun/blackdex/view/setting/SettingFragment.kt index 1233fe4..e393107 100644 --- a/app/src/main/java/top/niunaijun/blackdex/view/setting/SettingFragment.kt +++ b/app/src/main/java/top/niunaijun/blackdex/view/setting/SettingFragment.kt @@ -28,6 +28,8 @@ class SettingFragment : PreferenceFragmentCompat() { private lateinit var fixCodeItemPreference: SwitchPreferenceCompat + private lateinit var hookDumpPreference: SwitchPreferenceCompat + private val initialDirectory = AppManager.mBlackBoxLoader.getSavePath() override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { @@ -44,6 +46,10 @@ class SettingFragment : PreferenceFragmentCompat() { fixCodeItemPreference.onPreferenceChangeListener = mFixCodeItemChange fixCodeItemPreference.isChecked = AppManager.mBlackBoxLoader.isFixCodeItem() + hookDumpPreference = findPreference("hook_dump")!! + hookDumpPreference.onPreferenceChangeListener = mHookDumpChange + hookDumpPreference.isChecked = AppManager.mBlackBoxLoader.isHookDump() + } private val mSavedPathClick = Preference.OnPreferenceClickListener { @@ -79,6 +85,11 @@ class SettingFragment : PreferenceFragmentCompat() { return@OnPreferenceChangeListener true } + private val mHookDumpChange = Preference.OnPreferenceChangeListener { _, newValue -> + AppManager.mBlackBoxLoader.saveEnable(newValue as Boolean) + return@OnPreferenceChangeListener true + } + private val mFixCodeItemChange = Preference.OnPreferenceChangeListener { _, newValue -> if (newValue as Boolean) { diff --git a/app/src/main/res/values-zh/string.xml b/app/src/main/res/values-zh/string.xml index c4cf813..4ebf552 100644 --- a/app/src/main/res/values-zh/string.xml +++ b/app/src/main/res/values-zh/string.xml @@ -30,7 +30,8 @@ 开启后将进行深度脱壳,深度脱壳会自主修复被抽取的指令,开启后请注意以下变化。\n\n1.脱壳时间会大幅度上升,预计几分钟都十几分钟不等\n2.脱壳期间有可能会出现应用闪退(遇到反检测等)\n3.会增加脱壳失败几率\n4.不一定能够100%还原 - + Hook脱壳 + 使用Hook提高脱壳成功率 正在脱壳… \ 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 2ae70c2..50e0123 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,4 +32,6 @@ classes.dex (%1d/%1d) Unpacking… + Use hook to improve the success rate of shelling + Hook Dump \ No newline at end of file diff --git a/app/src/main/res/xml/setting.xml b/app/src/main/res/xml/setting.xml index d536006..c20720d 100644 --- a/app/src/main/res/xml/setting.xml +++ b/app/src/main/res/xml/setting.xml @@ -14,10 +14,17 @@ + + + + \ No newline at end of file