Zangetsu
Zangetsu copied to clipboard
[Bug] Mihon extensions fail to load on Android 7.0 (API 24) due to getPackageArchiveInfo rejecting minSdk 26
What happened?
Description
On devices running Android 7.0 / 7.1 (API 24/25), installing/loading modern Mihon/Aniyomi extensions fails with:
Exception: no source loaded. The extension may be incompatible or the download failed.
Logcat
E MihonLoad: java.lang.IllegalStateException: Not an APK or could not parse manifest: eu.kanade.tachiyomi.extension.all.ahottie.apk
at com.spyou.watch_app.mihon.MihonExtensionLoader.load (MihonExtensionLoader.kt:157)
via MihonExtensionService.installFromRepo (mihon_extension_service.dart:359)
Root Cause
MihonExtensionLoader.ktcallscontext.packageManager.getPackageArchiveInfo(apkPath, ...).- The Keiyoushi/Mihon extension ecosystem has bumped their
minSdkVersionto 26 (Android 8.0). - On API 24 devices, Android framework's internal
PackageParser.javaenforcesminVers > mSdkVersionand returnsnullwithINSTALL_FAILED_OLDER_SDK. MihonExtensionLoadertreats thenullreturn as a corrupted/unparseable manifest.
Suggestions / Recommendations
- Friendly Error Message: If
getPackageArchiveInforeturnsnullandBuild.VERSION.SDK_INT < 26, surface a message explaining that modern Mihon extensions require Android 8.0+ rather than reporting a broken download. - Bypass
getPackageArchiveInfofor Extension Metadata: If the app only usesgetPackageArchiveInfoto read the package name and extension entrypoint class (<meta-data android:name="class">), consider parsing the binaryAndroidManifest.xmldirectly from the APK zip. Because the dex file is loaded dynamically viaDexClassLoader, bypassing the platformPackageParsercheck would allow many extensions to run on Android 7.0 devices without issues.
App version
2.3.5
Device type
Phone / tablet
Device and Android version
Samsung Galaxy Note 4 (SM-N910K / N7FE ROM), Android Version: 7.0 (SDK 24)
Which APK did you install?
armeabi-v7a
Where is the problem?
Sources / extensions
Which source?
Mihon
Did you try another source?
- [x] Yes — the same thing happens with a different source
- [ ] No / not applicable
Logs
Screenshots or anything else
No response
Thanks for digging into this. Worth knowing Mihon itself needs Android 8.0+, so this phone couldn't run real Mihon either.