Common Android Resources
Overview
The common/ module holds Android build inputs that are shared by extension APK modules rather than source code. Its manifest, common/AndroidManifest.xml, is intentionally empty (<manifest />): it gives Android Gradle Plugin manifest merging a valid common manifest without declaring package metadata, components, permissions, or application attributes that would leak into every extension APK. Extension modules should supply their own extension-specific manifest values while inheriting only this neutral base.
The shared shrinker configuration lives in common/proguard-rules.pro. It combines Android/R8 compatibility keeps with project-specific runtime reflection rules used by generated extension code and shared libraries. The file preserves enum helpers, Parcelable.CREATOR fields, and methods annotated with @android.webkit.JavascriptInterface, then adds keeps for the generated source entry point, Injekt type-token metadata, kotlinx-serialization metadata/serializer companions, and Chromium support library boundary interfaces used reflectively by WebView support code.
File responsibilities
- common/AndroidManifest.xml: valid but empty manifest merge input. It should stay free of shared app declarations unless every extension APK must receive them.
common/proguard-rules.pro: shared R8/ProGuard rules for extension APKs. It protects runtime entry points and metadata that extension code expects to resolve through reflection or generated serializers.
How extension modules consume this configuration
Extension APK modules consume common/AndroidManifest.xml as their shared manifest baseline and merge it with each extension's own manifest metadata. Because the common manifest declares nothing, extension modules remain responsible for their own manifest-provided identity and metadata, including the metadata that points to the generated source entry point.
Extension APK modules also consume common/proguard-rules.pro during minification. The rule -keep class keiyoushi.source.Generated { <init>(); } keeps the KSP-generated source entry point that is resolved reflectively from manifest metadata named tachiyomi.extension.class. If an extension changes the generated entry-point package or manifest metadata contract, update this rule at the same time or the class can be removed or renamed by R8 while still being referenced from the manifest.
The Injekt and kotlinx-serialization rules in common/proguard-rules.pro preserve attributes and generated members that are not always visible through direct call graphs. Extension code that adds new FullTypeReference subclasses or @Serializable models relies on these shared keeps rather than per-extension duplicate rules.
Path-routable coverage notes
- Changes under common/AndroidManifest.xml route here when reviewing shared manifest declarations inherited by extension APKs.
- Changes under
common/proguard-rules.proroute here when reviewing shared minification, reflection, serialization, WebView JavaScript bridge, or generated source entry-point behavior.
Coupling
- If the manifest metadata key or generated entry-point class used by extension APKs changes, also update
common/proguard-rules.pro; itskeiyoushi.source.Generatedkeep rule is tied to the manifest-driven reflective lookup described in the file comments. - If shared libraries start relying on additional reflection-visible annotations, generic signatures, serializer companions, or WebView boundary interfaces, verify
common/proguard-rules.prokeeps the needed attributes/members before enabling minification for affected extensions.