Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   Delphi Android: Native Library Pfad (https://www.delphipraxis.net/209580-android-native-library-pfad.html)

dominikkv 24. Dez 2021 14:48

Android: Native Library Pfad
 
Moin,

ich erstelle in Delphi eine AAB. Aus dieser werden dann vom PlayStore (oder vom bundletool) speziell angepasste APKs für die Geräte erstellt. Bei diesen APKs ist je nach Smartphone im AndroidManifest.xml der Wert extractNativeLibs auf false gesetzt.

-> Das hat zur Folge, dass die native libraries (*.so) Dateien mal im Installationsordner liegen, und mal aus der APK selbst geladen werden müssen.

1) Kann man das beeinflussen? Ich hätte gerne das "alte" verhalten, dass die native libraries bei Installation immer extrahiert werden. Unter Grandle hat man hier folgende Option setzen: android.bundle.enableUncompressedNativeLibs = false
2) Wie bekomme ich den Pfad heraus, wo ich nach den native libraries suchen muss? Folgende Methoden liefern mir immer den extrahierten Installationspfad (auch wenn nix extrahiert wurde):
Delphi-Quellcode:
Androidapi.IOUtils.GetLibraryPath()
Androidapi.Helper.TAndroidHelper.PackagePath
System.IOUtils.TPath.GetLibraryPath()
Mit der Methode TAndroidHelper.ShouldNativeLibrariesBeExtracted kann man prüfen, wo man suchen muss.

Die Pfade unterscheiden sich wie folgt:

In APK: /data/app/~~m7tXXNZbcVGbeOLeRAO_1g==/my.company.app-Ij8J7mxKL6Rsi6hOXrv_dQ==/split_config.arm64_v8a.apk!/lib/arm64-v8a/liblibrary.so
In Installationsordner: /data/app/my.company.app-g_i51KiOH2P6LkTkTqVKDA==/lib/arm64/liblibrary.so

Danke für eure Hilfe!
Dominik


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:35 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz