diff --git a/app/src/main/kotlin/moe/reimu/weiboxposed/GeneralPreferenceFragment.kt b/app/src/main/kotlin/moe/reimu/weiboxposed/GeneralPreferenceFragment.kt index d01cae3..b1daa17 100644 --- a/app/src/main/kotlin/moe/reimu/weiboxposed/GeneralPreferenceFragment.kt +++ b/app/src/main/kotlin/moe/reimu/weiboxposed/GeneralPreferenceFragment.kt @@ -40,9 +40,8 @@ class GeneralPreferenceFragment : PreferenceFragmentCompat(), SharedPreferences. pref_alipay.setOnPreferenceClickListener { val qrcode = URLEncoder.encode("https://qr.alipay.com/a6x04349f12rwyb6webwlb7", "utf-8") val alipayqr = "alipayqr://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=$qrcode" - val intent = Intent() - intent.action = Intent.ACTION_VIEW - intent.data = Uri.parse("$alipayqr&%3F_s%3Dweb-other&_t=${System.currentTimeMillis()}") + val uri = Uri.parse("$alipayqr&%3F_s%3Dweb-other&_t=${System.currentTimeMillis()}") + val intent = Intent(Intent.ACTION_VIEW, uri) try { context.startActivity(intent) } catch (e: Exception) { diff --git a/app/src/main/kotlin/moe/reimu/weiboxposed/Module.kt b/app/src/main/kotlin/moe/reimu/weiboxposed/Module.kt index ea85858..fe12faf 100644 --- a/app/src/main/kotlin/moe/reimu/weiboxposed/Module.kt +++ b/app/src/main/kotlin/moe/reimu/weiboxposed/Module.kt @@ -39,6 +39,7 @@ class Module : IXposedHookInitPackageResources, IXposedHookLoadPackage, IXposedH lateinit private var prefs: XSharedPreferences private var remove_hot = false + private var debug_mode = false private val enabled_feature = arrayListOf("Night_Mode") private val disabled_feature = arrayListOf() private var content_keyword = listOf() @@ -150,7 +151,7 @@ class Module : IXposedHookInitPackageResources, IXposedHookLoadPackage, IXposedH } private fun logd(text: String) { - if (BuildConfig.DEBUG) XposedBridge.log("[WeiboXposed] " + text) + if (debug_mode) XposedBridge.log("[WeiboXposed] " + text) } private val removeAD = object : XC_MethodHook() { @@ -297,7 +298,8 @@ class Module : IXposedHookInitPackageResources, IXposedHookLoadPackage, IXposedH private fun reloadPrefs() { prefs.reload() log("loaded") - if (BuildConfig.DEBUG) { + debug_mode = prefs.getBoolean("debug_mode", false) + if (debug_mode) { dumpPrefs() } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e4eb5f1..031b30f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,6 +13,7 @@ 用户名关键字 捐赠 支付宝 + 调试模式 配置已保存,强行停止微博或重启设备后生效 无法正常调用Xposed框架的功能,请确认Xposed已经加载且此模块已启用。如果问题仍然存在,请尝试禁用并重新启用此模块。 diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index 56d4c9f..3db2c7d 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -19,6 +19,11 @@ android:defaultValue="false" android:key="disable_new_message_flow" android:title="@string/pref_title_disable_new_message_flow"/> + +