-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XAPK Support #682
Comments
I'm able to install this with no issue. Could you try installing it manually without Obtainium? |
Actually try it with this new release first: https://github.com/ImranR98/Obtainium/releases/tag/v0.13.18-beta |
Installing using https://f-droid.org/en/packages/com.smartpack.packagemanager/ worked fine: Not sure how else to install XAPKs. |
I wonder if that config apk is actually being installed by that app |
It lets me select what to install. I have no idea how all that xapk stuff works, though. |
Not sure if this helps but:
(Without moving to the temp dir, |
When I'm using the link without subdomain m, I get not found message when I want to add the app |
What's the full link you're trying to add? |
That's the link. https://apkpure.com/pl/douyin/com.ss.android.ugc.aweme I found out that, when I tried to add call of duty warzone mobile, it worked, but download process was stuck at 0% |
It's the |
This got a lot better with recent releases BTW. I don't get errors anymore but every now and then an update renders an app useless. It's still installed but apparently missing some of its split apks. It's still installed but usually doesn't get past its splash screen. Most of the time updates work fine now though. |
https://apkpure.com/discord-talk-chat-hang-out/com.discord 210.10 broke my app again. Fixed by manually downloading apk from https://www.apkmirror.com/apk/discord-inc/discord-chat-for-gamers/discord-chat-for-gamers-210-10-stable-release/discord-talk-chat-hang-out-210-10-stable-android-apk-download/ (apkpure.com seems to be down) to :/data/local/tmp # unzip /sdcard/Download/com.discord_210.10_-_Stable-210010_4arch_4dpi_20lang_4dd1f8eb07d9593d231c151823f28841_apk>
Archive: /sdcard/Download/com.discord_210.10_-_Stable-210010_4arch_4dpi_20lang_4dd1f8eb07d9593d231c151823f28841_apkmirror.com.apkm
inflating: split_config.en.apk
[...]
inflating: split_config.arm64_v8a.apk
:/data/local/tmp # ls -l
total 295916
-rw-r--r-- 1 root root 58 2024-01-05 13:56 APKM_installer.url
drwxr-xr-x 2 root root 4096 2024-01-05 13:56 META-INF
-rw-r--r-- 1 root root 63800600 2024-01-05 13:56 base.apk
-rw-r--r-- 1 root root 7656 2024-01-05 13:54 discord
-rw-r--r-- 1 root root 8976 2024-01-05 13:56 icon.png
-rw-r--r-- 1 root root 1107 2024-01-05 13:56 info.json
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.ar.apk
-rw-r--r-- 1 root root 48818414 2024-01-05 13:56 split_config.arm64_v8a.apk
-rw-r--r-- 1 root root 34359684 2024-01-05 13:56 split_config.armeabi_v7a.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.bn.apk
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.de.apk
-rw-r--r-- 1 root root 49561 2024-01-05 13:56 split_config.en.apk
-rw-r--r-- 1 root root 37273 2024-01-05 13:56 split_config.es.apk
-rw-r--r-- 1 root root 37273 2024-01-05 13:56 split_config.fr.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.gu.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.hi.apk
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.in.apk
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.it.apk
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.ja.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.kn.apk
-rw-r--r-- 1 root root 9052915 2024-01-05 13:56 split_config.mdpi.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.mr.apk
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.ms.apk
-rw-r--r-- 1 root root 29081 2024-01-05 13:56 split_config.nl.apk
-rw-r--r-- 1 root root 37273 2024-01-05 13:56 split_config.pt.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.ru.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.ta.apk
-rw-r--r-- 1 root root 33177 2024-01-05 13:56 split_config.te.apk
-rw-r--r-- 1 root root 51832620 2024-01-05 13:56 split_config.x86.apk
-rw-r--r-- 1 root root 54024205 2024-01-05 13:56 split_config.x86_64.apk
-rw-r--r-- 1 root root 10245096 2024-01-05 13:56 split_config.xhdpi.apk
-rw-r--r-- 1 root root 14907795 2024-01-05 13:56 split_config.xxhdpi.apk
-rw-r--r-- 1 root root 15034840 2024-01-05 13:56 split_config.xxxhdpi.apk
-rw-r--r-- 1 root root 45465 2024-01-05 13:56 split_config.zh.apk
:/data/local/tmp # rm split_config.armeabi_v7a.apk split_config.x86.apk split_config.x86_64.apk
:/data/local/tmp # pm install *apk
Success |
Can confirm, trying to install the MediaMarkt Deutschland and Saturn apps, crash immediately on start.. |
I tried with a few apps with apks format and even on different devices and it doesn't work for any such app. It always says "unable to parse apk (incompatible or partial download)". For example, https://apkpure.net/de/netflix/com.netflix.mediaclient . |
And when installing APKs from uptodown for example, the same happens. So i think Obtainium has generally a problem with installing APKs / XAPK. |
https://apkpure.com/how-to/how-to-install-xapk-apk I think XAPKs don't currently work in Obtainium, as the APKPure app I was using changed from APK to XAPK in the latest version (https://apkpure.com/エイリアンのたまご-放置系バトル育成rpgゲームアプリ/com.paondp.game2.padp.etg/download/1.35.4 vs https://apkpure.com/エイリアンのたまご-放置系バトル育成rpgゲームアプリ/com.paondp.game2.padp.etg/download/1.35.3), and gives me this error when attempting to update to it |
@ImranR98 So far the only "working" solution I found is almost 2yrs old which could be irrelevant now. Still be worth checking out: https://stackoverflow.com/a/75118149. Another option could be to add a selector within Obtainium's Settings for users to choose a different APK/XAPK installer instead of the default installer. There would be plenty to choose from if this is possible. |
https://github.com/SmartPack/PackageManager handles xapks apparently, that may also be a good reference, or maybe the dev @sunilpaulmathew may be willing to help? Edit: looks like package manager has you manually select the apk files within the xapk before installing, instead of automatically selecting the right ones for your device architecture, language, and dpi. The stackoverflow one doesn't seem to try to filter anything out of the xapk, it just installs everything in it. But, it looks like it'd be relatively easy to add filtering as long as the device dpi architecture, and enabled languages can be retrieved |
Obtainium/lib/providers/apps_provider.dart Line 511 in 4caae51
|
https://garmin-explore.en.uptodown.com/android/download latest version updated with no problem |
The latest version is an APK. So far I've tried 6 different apps that can install XAPKs. APKPure, Apktool M, App Manager, MiXplorer, Package Manager, and Uptodown. APKPure, MiXplorer, and Uptodown installs the entire XAPK. (No selection provided) Apktool M and App Manager automatically selects the device architecture, language, and dpi. Package Manager requires manual selection of the device architecture, language, and dpi as stated above. (The app also doesn't show up when selecting the XAPK to install from file manager) *I'm not sure how difficult it is to cross reference Dart and Java but App Manager is probably the best option. App Manager is also where I got the idea for users to choose a different APK/XAPK installer instead of the default installer. |
I just noticed there's multiple issues requesting a different APK installer, mostly for App Manager. Discussions about this should be moved to issue #517. This issue also explains that this was possible in previous versions of Obtainium and why it's not now. |
The issue here seems to be that Obtainium does not support split apks, android_package_installer does not have any method to do so. The native PackageInstaller will likely have to be used to properly stage the installation. |
Minor update: Took some time to look into this. Apparently it's not enough to just unzip an XAPK and try to install each APK you find inside (which is what Obtainium tries to do). Instead you have to figure out which APKs to install by reading the JSON that's included in the XAPK, then somehow "commit" them to the installer session, then tell it to install (you can't install each one separately). The PackageManager app does something similar here: SmartPack/PackageManager@18db3ec#diff-342421a6cbed575b8f99405be8654a345981d7aa0a5231a8645bcd62ca3a3047R322 Obtainium currently uses a fork of the |
The original implementation I saw that tipped me off was from SAI: Staging the APK's like that does not seem too difficult, but I can't find much about the JSON files you are refering too. |
Yes, I'm referring to Edit: I was wrong - the Garmin XAPK doesn't have a manifest JSON either. It looks like files from Uptodown don't have it but files from APKPure do. |
In the absence of a manifest.json, it may make sense to try to filter the architecture, dpi, and language by filename, or have an option to do so |
I have updated the plugin to support multiple APKs in one session. The latest release of Obtainium uses this to just install everything inside the XAPK. This is a very quick and dirty approach which is not very efficient and will probably fail in many cases (so I'm leaving this issue open), but it does work for Discord (from APKPure) and Garmin Explore (from Uptodown) at least on my device. |
Improvements to make:
Please report any cases where installation still fails. |
For https://discord-chat-for-gamers.en.uptodown.com/android the last version Obtanium was able to install was 244.13. Not sure if I had to fix that one afterwards but since then it didn't even try. It says:
That test was with Obtainium 1.1.32. LineageOS 19 (Android 12) on OnePlus 5T without Play services. |
Hmm, the Discord XAPK from Uptodown has no manifest JSON, nor a base |
When in doubt, just install all the things? I don't know. It's pretty wild to me how inconsistent all of this is (Android packaging, not Obtanium)... |
Weird change: https://symfonium.en.uptodown.com/android/download has a |
I've partially reversed engineered how SAI handles these XAPK's. The split APKs from uptodown have to be parsed by their For example, discords
Unfortunately when working with flutter plugins, every single of my IDE's has an issue providing even the most basic of language support. So I'm not sure when or even if I could provide a PR |
@1xFF I use VSCodium with the Flutter/Dart plugins from 'Dart Code' if that helps. |
What details do you need?
The text was updated successfully, but these errors were encountered: