Zangetsu icon indicating copy to clipboard operation
Zangetsu copied to clipboard

[Bug] Mihon extensions fail to load on Android 7.0 (API 24) due to getPackageArchiveInfo rejecting minSdk 26

Open wilfredochala opened this issue 4 weeks ago • 1 comments

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

  1. MihonExtensionLoader.kt calls context.packageManager.getPackageArchiveInfo(apkPath, ...).
  2. The Keiyoushi/Mihon extension ecosystem has bumped their minSdkVersion to 26 (Android 8.0).
  3. On API 24 devices, Android framework's internal PackageParser.java enforces minVers > mSdkVersion and returns null with INSTALL_FAILED_OLDER_SDK.
  4. MihonExtensionLoader treats the null return as a corrupted/unparseable manifest.

Suggestions / Recommendations

  1. Friendly Error Message: If getPackageArchiveInfo returns null and Build.VERSION.SDK_INT < 26, surface a message explaining that modern Mihon extensions require Android 8.0+ rather than reporting a broken download.
  2. Bypass getPackageArchiveInfo for Extension Metadata: If the app only uses getPackageArchiveInfo to read the package name and extension entrypoint class (<meta-data android:name="class">), consider parsing the binary AndroidManifest.xml directly from the APK zip. Because the dex file is loaded dynamically via DexClassLoader, bypassing the platform PackageParser check 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

wilfredochala avatar Nov 05 '26 08:11 wilfredochala

Thanks for digging into this. Worth knowing Mihon itself needs Android 8.0+, so this phone couldn't run real Mihon either.

Spyou avatar Nov 23 '26 14:11 Spyou