Skip to content

Commit

Permalink
support qpr2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
chip44 authored and NextAlone committed Apr 18, 2024
1 parent 2ad7318 commit 51a87ab
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()
Expand Down

0 comments on commit 51a87ab

Please sign in to comment.