Skip to content

Commit 83d7cd4

Browse files
committed
feat: android aab signing - removes --new-sdk-version from sign command
1 parent 829f423 commit 83d7cd4

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

packages/platform-android/src/lib/commands/signAndroid/command.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export type SignFlags = {
1212
buildJsbundle?: boolean;
1313
jsbundle?: string;
1414
noHermes?: boolean;
15-
minSdkVersion?: string;
1615
};
1716

1817
const ARGUMENTS = [
@@ -59,10 +58,6 @@ const OPTIONS = [
5958
name: '--no-hermes',
6059
description: 'Do not use Hermes to build the JS bundle.',
6160
},
62-
{
63-
name: '--min-sdk-version',
64-
description: "Override for apksigner's --min-sdk-version.",
65-
},
6661
];
6762

6863
export const registerSignCommand = (api: PluginApi) => {
@@ -82,7 +77,6 @@ export const registerSignCommand = (api: PluginApi) => {
8277
buildJsBundle: flags.buildJsbundle,
8378
jsBundlePath: flags.jsbundle,
8479
useHermes: !flags.noHermes,
85-
minSdkVersion: flags.minSdkVersion,
8680
});
8781
},
8882
});

packages/platform-android/src/lib/commands/signAndroid/signAndroid.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export type SignAndroidOptions = {
2525
buildJsBundle?: boolean;
2626
jsBundlePath?: string;
2727
useHermes?: boolean;
28-
minSdkVersion?: string;
2928
};
3029

3130
export async function signAndroid(options: SignAndroidOptions) {
@@ -111,7 +110,6 @@ export async function signAndroid(options: SignAndroidOptions) {
111110
keystorePassword: options.keystorePassword ?? 'pass:android',
112111
keyAlias: options.keyAlias,
113112
keyPassword: options.keyPassword,
114-
minSdkVersion: options.minSdkVersion,
115113
});
116114
loader.stop(
117115
`Signed the ${extension.toUpperCase()} file with keystore: ${colorLink(keystorePath)}.`,
@@ -204,7 +202,6 @@ type SignOptions = {
204202
keystorePassword: string;
205203
keyAlias?: string;
206204
keyPassword?: string;
207-
minSdkVersion?: string;
208205
};
209206

210207
async function signArchive({
@@ -213,7 +210,6 @@ async function signArchive({
213210
keystorePassword,
214211
keyAlias,
215212
keyPassword,
216-
minSdkVersion,
217213
}: SignOptions) {
218214
if (!fs.existsSync(keystorePath)) {
219215
throw new RockError(
@@ -240,7 +236,7 @@ Please follow instructions at: https://reactnative.dev/docs/set-up-your-environm
240236
formatPassword(keystorePassword),
241237
...(keyAlias ? ['--ks-key-alias', keyAlias] : []),
242238
...(keyPassword ? ['--key-pass', formatPassword(keyPassword)] : []),
243-
...getSdkVersionArgs(isAab(binaryPath), minSdkVersion),
239+
...(isAab(binaryPath) ? ['--min-sdk-version', '36'] : []),
244240
binaryPath,
245241
];
246242

@@ -276,16 +272,6 @@ function getSignOutputPath() {
276272
return path.join(getDotRockPath(), 'android/sign');
277273
}
278274

279-
function getSdkVersionArgs(aab?: boolean, minSdkVersion?: string) {
280-
if (!aab && !minSdkVersion) {
281-
return [];
282-
}
283-
284-
// the default here will only be applied for AABs
285-
// we use a higher value as it is irrelevant for AAB verification, but allows apksigner to use better signing algorithms
286-
return ['--min-sdk-version', minSdkVersion || '36'];
287-
}
288-
289275
function isAab(filePath: string): boolean {
290276
return path.extname(filePath).toLowerCase() === '.aab';
291277
}

website/src/docs/cli/introduction.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ The `sign:android <binaryPath>` command signs your Android app with a keystore,
258258
| `--build-jsbundle` | Build JS bundle before signing |
259259
| `--jsbundle <string>` | Path to JS bundle to apply before signing |
260260
| `--no-hermes` | Don't use Hermes for JS bundle |
261-
| `--min-sdk-version` | API level apksigner will use to determine signing strength. |
262261

263262
## Platform HarmonyOS (experimental)
264263

0 commit comments

Comments
 (0)