From 51a87ab8882a918691793990206c0b2223538f7c Mon Sep 17 00:00:00 2001 From: chip <86570889+chip44@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:41:43 +0300 Subject: [PATCH] support qpr2 update --- .../ltd/nextalone/pkginstallerplus/hook/InstallerHookQ.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ltd/nextalone/pkginstallerplus/hook/InstallerHookQ.kt b/app/src/main/java/ltd/nextalone/pkginstallerplus/hook/InstallerHookQ.kt index ab2f041..9431a41 100644 --- a/app/src/main/java/ltd/nextalone/pkginstallerplus/hook/InstallerHookQ.kt +++ b/app/src/main/java/ltd/nextalone/pkginstallerplus/hook/InstallerHookQ.kt @@ -60,7 +60,8 @@ object InstallerHookQ { val sb = SpannableStringBuilder() if (oldPkgInfo == null) { - val install: View? = activity.findHostView("install_confirm_question") + val install: View? = activity.findHostView("install_confirm_question") ?: + activity.get("mDialog")?.findHostView("install_confirm_question") // QPR2+ val newVersionStr = (newPkgInfo.versionName ?: "N/A") + "(" + newPkgInfo.longVersionCode + ")" val newSdkStr = newPkgInfo.applicationInfo.targetSdkVersion.toString() @@ -83,7 +84,8 @@ object InstallerHookQ { (install.parent as ViewGroup).addView(layout) } } else { - val update: View? = activity.findHostView("install_confirm_question_update") + val update: View? = activity.findHostView("install_confirm_question_update") ?: + activity.get("mDialog")?.findHostView("install_confirm_question_update") // QPR2+ val oldVersionStr = """${oldPkgInfo.versionName ?: "N/A"}(${oldPkgInfo.longVersionCode})""" val newVersionStr = """${newPkgInfo.versionName ?: "N/A"}(${newPkgInfo.longVersionCode})""" val oldSdkStr = oldPkgInfo.applicationInfo.targetSdkVersion.toString()