Skip to content

Commit

Permalink
fix: AutoSendOriginalPhoto for QQ 8.9.78+
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Sep 10, 2023
1 parent 831ef74 commit 492e41b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/io/github/qauxv/util/QQVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ private QQVersion() {
public static final long QQ_8_9_70 = 4330;
public static final long QQ_8_9_73 = 4416;
public static final long QQ_8_9_75 = 4482;
public static final long QQ_8_9_78 = 4506;
}
16 changes: 15 additions & 1 deletion app/src/main/java/xyz/nextalone/hook/AutoSendOriginalPhoto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@ object AutoSendOriginalPhoto : CommonSwitchFunctionHook(SyncUtils.PROC_MAIN or S
override val uiItemLocation = FunctionEntryRouter.Locations.Auxiliary.CHAT_CATEGORY

override fun initOnce() = throwOrTrue {
if (QAppUtils.isQQnt()) { //截至2023.6.21,仍有一些项目在使用旧版组件(如频道),故保留其他hook
if (requireMinQQVersion(QQVersion.QQ_8_9_78)) {
XposedBridge.hookAllConstructors("Lcom/tencent/mobileqq/aio/b/ad;".clazz!!, HookUtils.afterIfEnabled(this) { param ->
param.thisObject.javaClass.declaredFields.forEach { field ->
if (field.type.name.endsWith("QUICheckBox")) {
field.isAccessible = true
(field.get(param.thisObject) as CheckBox).isChecked = true
}
}
})
//启动参数类-isQualityRaw
"Lcom/tencent/qqnt/qbasealbum/model/Config;->s()Z".method.hookBefore {
it.result = true
}
} else if (QAppUtils.isQQnt()) {
//Lcom/tencent/mobileqq/e/a/ac;->f:Lcom/tencent/mobileqq/widget/QUICheckBox; //普通模式半屏Panel的原图勾选框
//8.9.68 变为 com.tencent.biz.qui.quicheckbox.QUICheckBox
XposedBridge.hookAllConstructors("com.tencent.mobileqq.e.a.ac".clazz!!, HookUtils.afterIfEnabled(this) { param ->
Expand All @@ -68,6 +81,7 @@ object AutoSendOriginalPhoto : CommonSwitchFunctionHook(SyncUtils.PROC_MAIN or S
ctx.intent.putExtra("key_is_quality_raw", true)
}
}
//截至2023.6.21,仍有一些项目在使用旧版组件(如频道),故保留其他hook
val method = when {
requireMinQQVersion(QQVersion.QQ_8_9_33) -> "d0"
requireMinQQVersion(QQVersion.QQ_8_9_18) -> "c0"
Expand Down

0 comments on commit 492e41b

Please sign in to comment.