Android APK
ztk bundle -o Name.apk writes and signs an Android app on each host with src/bundle/zipw.zig, src/bundle/axml.zig, src/bundle/apksign.zig, and src/bundle/apk.zig. This page lists the sources of the formats.
| Source | License | Use |
|---|---|---|
| PKWARE, "APPNOTE.TXT: .ZIP File Format Specification" | Documentation | The local file header, the central directory, and the end record |
| RFC 1951, "DEFLATE Compressed Data Format Specification" | IETF Trust | The compressed entries, through std.compress.flate |
| Android Open Source Project, "APK Signature Scheme v2" (source.android.com) | CC BY 2.5 (documentation) | The APK Signing Block, the signer, the chunked digest, and the IDs of the algorithms |
Android Open Source Project, the documentation of zipalign |
CC BY 2.5 (documentation) | The extra field 0xD935 of the alignment of an entry, and the 16 KiB alignment of a stored native library |
Android Open Source Project, the headers ResourceTypes.h of the framework, read for the layout |
Apache 2.0 | The chunk headers, the string pool, the resource map, and the element and attribute chunks of binary XML, the types of a typed value, and the chunks of the resource table of an icon (ResTable_package, ResTable_typeSpec, ResTable_type, ResTable_config, ResTable_entry) |
Android developers, R.attr (developer.android.com) |
CC BY 2.5 (documentation) | The resource IDs of the attributes of the manifest |
| Android developers, "App manifest overview" and "NativeActivity" | CC BY 2.5 (documentation) | The elements of the manifest of a native activity and the meta-data android.app.lib_name |
| Android developers, "Adaptive icons" and "Create app icons" | CC BY 2.5 (documentation) | The layers of 108 dp with the visible part of 72 dp, the densities and the sizes of the legacy icon, and mipmap-anydpi-v26 |
| Android Open Source Project, "Dalvik executable format" and "Dalvik bytecode" (source.android.com) | CC BY 2.5 (documentation) | The header, the id tables and their order, the code items, the class data, the map, and the encoding of the instructions of classes.dex (dex.zig) |
Android developers, the reference of android.view, android.widget, android.text, android.content, and android.window |
CC BY 2.5 (documentation) | The interfaces of the listeners and the signatures of their methods (dexztk.zig), and the resource ID of Theme.DeviceDefault.DayNight (0x010302e3) |
| RFC 5280, "Internet X.509 Public Key Infrastructure Certificate" | IETF Trust | The self-signed certificate of the debug key and its SubjectPublicKeyInfo |
| RFC 5915, "Elliptic Curve Private Key Structure" | IETF Trust | The file of the debug key |
The Zig standard library, std.crypto and std.compress.flate |
MIT | SHA-256, ECDSA on P-256, and DEFLATE |
No code of Android, of aapt2, of apksigner, or of zipalign went into ztk. tests/android-apk.sh installs an APK of ztk bundle with adb install, which checks the v2 signature, and runs it in the emulator.