Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Default to
apksignerwhen the resolved Android release type is APK. Keepjarsigneras the AAB default and preserve explicit CLI/config signing choices. Update the CLI help and configuration documentation, including the requirement thatapksignerbe on PATH.Fixes #8106. Thanks to the reporters for identifying the APK installation failure and confirming the explicit
apksignerworkaround.Change Type
Rationale / Problems Fixed
buildCommandcurrently defaults tojarsignerfor both output formats. Its JAR signing path can destroy an APK's resource alignment and does not produce the v2-or-newer signature required by modern Android targets. Selecting APK output should also select the APK signing tool unless the user overrides it.This is separate from #8568, which rejects an explicitly incompatible AAB/apksigner combination. This PR does not change that validation or the lower-level signing functions.
Tests or Reproductions
buildCommandthroughbuildAndroid, mocking only platform selection/task logging and the external-process boundary. They cover CLI/config release types, precedence, the unchanged AAB default, and explicit signer overrides. Three APK-default cases fail on current main and all eight pass with this patch.npm run build --workspace @capacitor/clipassed;npm test --workspace @capacitor/clipassed (13 suites, 92 tests).npm run lintpassed, including SwiftLint (existing warnings, zero serious violations).--noEmitpassed.I also built a minimal resource-only APK with Android Build Tools 36.0.0 (
aapt2), min SDK 24 / target SDK 36, and aligned it withzipalign -f 4. Using the CLI's signing arguments with a disposable RSA key and JDK 21:zipalign -c -v 4apksigner verify --verbosejarsignerargumentsresources.arscoffset 2686, alignment remainder 2apksignerargumentsThis was host-side signing/verification, not an Android device/emulator installation test. The test APK was generated with
aapt2; I did not run a full Gradle app build.Platforms Affected
Notes / Comments
APK builds that relied on the old implicit JAR signer now require the Android SDK's
apksigneron PATH. Explicit--signing-type jarsigner/android.buildOptions.signingTyperemains honored. AAB users keep the existing default.