-
Notifications
You must be signed in to change notification settings - Fork 31
feat: android aab signing #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: android aab signing #593
Conversation
🦋 Changeset detectedLatest commit: 321b308 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@mlisikbf is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
function isAab(filePath: string): boolean { | ||
return path.extname(filePath).toLowerCase() === '.aab'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opted to switch on path extension rather than adding a separate --aab
flag, as that should be enough to distinguish and the flag seemed superfluous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense 👍🏼
Summary
Introduces aab signing using the existing
yarn sign:android
command, with the same list of arguments, just provide a path to an .aab file.signAndroid
will check file extension to decide on:Includes naming changes, updates to messages and docs where appropriate.
An alternative would be for end-users to invoke jarsigner themselves, extract and modify the bundle as needed.
Test plan
(cd packages/platform-android && npm link)
npm rock create
(select android, skip plugins)npm link @rock-js/platform-android
npm rock create-keystore:android
- use default values, for simplicity usefake-pass
when prompted for passwordnpx rock build:android --aab --local --variant release
(note: using--local
to opt out of cache as it does not seem to catch js changes for release variants)<WelcomeScreen/>
with custom jsx)npx rock bundle --platform android --entry-file index.js --bundle-output output.bundle
npx rock sign:android ./android/app/build/outputs/bundle/release/app-release.aab --keystore ./android/app/release.keystore --keystore-password fake-pass --key-password fake-pass --key-alias rock-alias --jsbundle ./output.bundle
bundletool
--brew install bundletool
thenbundletool build-apks --bundle=./android/app/build/outputs/bundle/release/app-release.aab --output=output/apks.apks --mode=universal --local-testing --ks=./android/app/release.keystore --ks-key-alias=rock-alias --ks-pass=pass:fake-pass --key-pass=pass:fake-pass
unzip output/apks.apks -d output
and install on a connected device withadb install output/universal.apk
revert changes and verify apk signing:
npx rock build:android --local --variant release
closes #588
Note
Generalizes Android signing to handle both APK and AAB, updating args, signing/align flow, bundle replacement paths, and docs.
@rock-js/platform-android
)sign:android
: Now signs bothAPK
andAAB
based on file extension.apksigner
for APK andjarsigner
for AAB; adjusts zipalign order accordingly.assets
(APK) orbase/assets
(AAB).binaryPath
throughout (apk
->binaryPath
/path
) and updates messages.alignArchiveFile
,signAab
,signApk
,isAab
, and password handling forjarsigner
.website/src/docs/cli.md
forsign:android
to acceptAPK
orAAB
and reflect newbinaryPath
argument and output descriptions.@rock-js/platform-android
.Written by Cursor Bugbot for commit 321b308. This will update automatically on new commits. Configure here.