Merge pull request #27 from wukaicheng/main

新增Hook脱壳的开关
pull/28/head
Milk 3 years ago committed by GitHub
commit c1d34d3869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/build.gradle
  2. 15
      app/src/main/java/top/niunaijun/blackdex/app/BlackDexLoader.kt
  3. 11
      app/src/main/java/top/niunaijun/blackdex/view/setting/SettingFragment.kt
  4. 3
      app/src/main/res/values-zh/string.xml
  5. 2
      app/src/main/res/values/strings.xml
  6. 7
      app/src/main/res/xml/setting.xml

@ -14,6 +14,7 @@ android {
versionCode 5
versionName "3.1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
flavorDimensions "BlackDex32"

@ -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 {

@ -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) {

@ -30,7 +30,8 @@
<string name="fix_code_item_message">开启后将进行深度脱壳,深度脱壳会自主修复被抽取的指令,开启后请注意以下变化。\n\n1.脱壳时间会大幅度上升,预计几分钟都十几分钟不等\n2.脱壳期间有可能会出现应用闪退(遇到反检测等)\n3.会增加脱壳失败几率\n4.不一定能够100%还原
</string>
<string name="hook_dump">Hook脱壳</string>
<string name="hook_dump_desc">使用Hook提高脱壳成功率</string>
<string name="dumping">正在脱壳…</string>
</resources>

@ -32,4 +32,6 @@
<string name="classes_progress" translatable="false">classes.dex (%1d/%1d)</string>
<string name="dumping">Unpacking…</string>
<string name="hook_dump_desc">Use hook to improve the success rate of shelling</string>
<string name="hook_dump">Hook Dump</string>
</resources>

@ -14,10 +14,17 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/advanced_setting">
<SwitchPreferenceCompat
android:key="hook_dump"
android:summary="@string/hook_dump_desc"
android:title="@string/hook_dump" />
<SwitchPreferenceCompat
android:key="fix_code_item"
android:summary="@string/fix_code_item_desc"
android:title="@string/fix_code_item" />
</PreferenceCategory>
</PreferenceScreen>
Loading…
Cancel
Save