diff options
author | Tinja Paavoseppä <tinja.paavoseppa@qt.io> | 2021-11-18 13:29:56 +0200 |
---|---|---|
committer | Tinja Paavoseppä <tinja.paavoseppa@qt.io> | 2021-12-08 19:22:36 +0200 |
commit | 1e64b58c358adea5b4f237c231b324491e5e898a (patch) | |
tree | 855202415f3cb8d6572ae62c43b66ad8b109d62b /src/android | |
parent | 3bbbd4ae121f9be8c959a42872875eb07b939d43 (diff) |
Recognize system apps also when apk has parent directory
When checking if the apk is being deployed from system partition,
account for possibility of the apk not being installed directly under
/system/app or /system/priv-app, but in a directory of its own.
Otherwise, system applications that are not directly under system app/
priv-app directories will not be recognized as system apps, meaning
they will not use the system library path to load their libraries.
Pick-to: 6.2
Change-Id: I1e778b18cae3c0406e087b8c78fd31d521f7be73
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java index 3724fa28bc..81304e23f6 100644 --- a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java +++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java @@ -259,8 +259,13 @@ public abstract class QtLoader { boolean apkDeployFromSystem = false; String apkPath = m_context.getApplicationInfo().publicSourceDir; File apkFile = new File(apkPath); - if (apkFile.exists() && Arrays.asList(SYSTEM_APP_PATHS).contains(apkFile.getParentFile().getAbsolutePath() + "/")) - apkDeployFromSystem = true; + if (apkFile.exists()) { + for (String systemAppPath : SYSTEM_APP_PATHS) { + apkDeployFromSystem = apkFile.getAbsolutePath().startsWith(systemAppPath); + if (apkDeployFromSystem) + break; + } + } String libsDir = null; String bundledLibsDir = null; |