MCPcopy
hub / github.com/ionic-team/capacitor / signWithJarSigner

Function signWithJarSigner

cli/src/android/build.ts:105–143  ·  view source on GitHub ↗
(
  config: Config,
  buildOptions: BuildCommandOptions,
  releasePath: string,
  signedReleaseName: string,
  unsignedReleaseName: string,
)

Source from the content-addressed store, hash-verified

103}
104
105async function signWithJarSigner(
106 config: Config,
107 buildOptions: BuildCommandOptions,
108 releasePath: string,
109 signedReleaseName: string,
110 unsignedReleaseName: string,
111) {
112 if (
113 !buildOptions.keystorepath ||
114 !buildOptions.keystorealias ||
115 !buildOptions.keystorealiaspass ||
116 !buildOptions.keystorepass
117 ) {
118 throw 'Missing options. Please supply all options for android signing. (Keystore Path, Keystore Password, Keystore Key Alias, Keystore Key Password)';
119 }
120
121 const signingArgs = [
122 '-sigalg',
123 'SHA1withRSA',
124 '-digestalg',
125 'SHA1',
126 '-keystore',
127 buildOptions.keystorepath,
128 '-keypass',
129 buildOptions.keystorealiaspass,
130 '-storepass',
131 buildOptions.keystorepass,
132 `-signedjar`,
133 `${join(releasePath, signedReleaseName)}`,
134 `${join(releasePath, unsignedReleaseName)}`,
135 buildOptions.keystorealias,
136 ];
137
138 await runTask('Signing Release', async () => {
139 await runCommand('jarsigner', signingArgs, {
140 cwd: config.android.platformDirAbs,
141 });
142 });
143}

Callers 1

buildAndroidFunction · 0.85

Calls 2

runTaskFunction · 0.90
runCommandFunction · 0.90

Tested by

no test coverage detected