Skip to content

0.11.1: dist-apk packs native libraries as the Android Gradle plugin does; dist-appimage takes an SVG icon - #27

Merged
Sunrisepeak merged 3 commits into
mainfrom
feat/0.11.1-default-packaging
Sep 15, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
feat/0.11.1-default-packaging

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

A project packed with dist-apk and with the Android Gradle plugin should give its users the same APK, and an AppImage should carry the icon a project states. Comparing a HuxerUI application built both ways showed three places where they differ:

  • The native libraries kept their symbol tables and debug information. mcpp pack strips the program it builds, but the staged Android tree reached the APK unstripped: libhuxerui.so was 8.1 MB against Gradle's 5.5 MB, and the NDK's libc++_shared.so 9.1 MB against 1.3 MB.
  • The libraries were always compressed. A manifest can ask for them to be loaded from the APK in place (android:extractNativeLibs="false", which the Gradle plugin writes from minSdk 23). The platform can only map an entry stored uncompressed on a page boundary, so such a package fails to install.
  • An AppImage icon had to be a PNG. A project whose icon is an SVG, as HuxerUI's Linux template is, got the 1×1 placeholder.

dist-apk

  • Stripping. Each native library, including one from an AAR, is written into the package by an llvm-strip --strip-unneeded action. This keeps the dynamic symbols the loader reads. The tool is the build's own, beside the compiler mcpp::toolchain_dir() reports, which on this row is the NDK's. Without one, the member warns and packs the libraries as staged.
    • options::keep_debug_symbols = true packs them as staged.
  • Storage follows the manifest. When the final manifest's <application> states android:extractNativeLibs="false", lib/ is added uncompressed and zipalign aligns it to 16 KB pages (-P 16); apksigner sign keeps the same alignment by default.
    • A manifest that states nothing packs as 0.11.0 did, compressed, so check-apk-features.sh (a) still compares the level-0 manifest byte-for-byte.

dist-appimage

  • options::icon may be an SVG. The staged file keeps the supplied extension, because the desktop entry names the icon without one and appimagetool and a desktop's icon lookup find it by the file's.
  • A file of the other format left by an earlier pack is removed, so a PNG cannot shadow the SVG.
  • Any other format is refused by name, through mcpp::warning as well, because the engine discards stderr when the build program exits 0.
  • The payload floor no longer counts the SVG as payload.

Tests

  • tests/apk-consumer, check-apk-features.sh:
    • (k) The packed library has no .symtab and no .debug_* section, and ANativeActivity_onCreate is still in .dynsym. With no manifest statement it is compressed. With manifest-template-in-place.xml it is stored, passes zipalign -c -P 16 4, and the linked manifest states extractNativeLibs=false.
    • (l) keep_debug_symbols keeps the .symtab.
  • tests/appimage-consumer: with APPIMAGE_CONSUMER_ICON set to an SVG, the extracted image carries AppimageConsumer.svg byte-identical to the source, no .png, and Icon=AppimageConsumer. A .jpg is refused with its message.
  • Measured locally with mcpp 2026.9.15.2 on Linux: (a) to (l), and the AppImage checks.

Version 0.11.1 (mcpp.toml, mcpp::plugins::version); README rows for both members.

…does; dist-appimage takes an SVG icon

A HuxerUI application packed by dist-apk and by Gradle differed in its native
libraries: dist-apk shipped them with their symbol tables and debug information
(libhuxerui.so 8.1 MB against 5.5 MB, the NDK's libc++_shared.so 9.1 MB against
1.3 MB), and always compressed, so a manifest stating
android:extractNativeLibs="false" produced a package the platform refuses.

Each native library is now written by an `llvm-strip --strip-unneeded` action
with the build's own tool, beside the compiler mcpp::toolchain_dir() reports;
options::keep_debug_symbols packs them as staged. A manifest stating
extractNativeLibs="false" gets lib/ stored uncompressed and aligned to 16 KB
pages; one stating nothing is packed compressed as before.

dist-appimage's options::icon may be an SVG: the staged icon keeps the supplied
extension, a stale file of the other format is removed, any other format is
refused through mcpp::warning, and the payload floor ignores the SVG.

Tests: check-apk-features.sh (k) stripped, compressed by default, stored and
16 KB-aligned when loaded in place; (l) keep_debug_symbols. appimage-consumer
packs an SVG icon and refuses a .jpg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant