diff options
author | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-11 02:53:44 +0000 |
---|---|---|
committer | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-11 02:53:44 +0000 |
commit | ab729d1f26d0e3f3b86cdc0b771e76af3d8f1ad9 (patch) | |
tree | d3b3cc354c30d12acfa1b942e103bde1bc597ca4 /build/android | |
parent | 8926a4aa4d463260dfedfd38282259dc51feea7d (diff) | |
download | chromium_src-ab729d1f26d0e3f3b86cdc0b771e76af3d8f1ad9.zip chromium_src-ab729d1f26d0e3f3b86cdc0b771e76af3d8f1ad9.tar.gz chromium_src-ab729d1f26d0e3f3b86cdc0b771e76af3d8f1ad9.tar.bz2 |
Use checked in keystore to sign debug apks
keystore created with command:
keytool -genkey -v -keystore chromium-debug.keystore -alias chromiumdebugkey -keyalg RSA -keysize 2048 -validity 36525
with password "chromium" and alias password "chromium".
Android's SDK tools by default create a debug keystore in ~/.android.
This has caused all kinds of grief. Instead, this change makes us use
the new chrome-debug.keystore.
BUG=145860
Review URL: https://chromiumcodereview.appspot.com/10918149
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android')
-rw-r--r-- | build/android/ant/sdk-targets.xml | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/build/android/ant/sdk-targets.xml b/build/android/ant/sdk-targets.xml index 8f980b4..59913e3 100644 --- a/build/android/ant/sdk-targets.xml +++ b/build/android/ant/sdk-targets.xml @@ -94,4 +94,54 @@ </if> </do-only-if-manifest-hasCode> </target> + + <!-- + For debug builds, the Android SDK tools create a key in ~/.android and sign the build with it. + This has caused all kinds of issues. Instead, the debug build should be signed with a key in + build/android/ant. The SDK tools do not provide any support for overriding that behavior and so + instead one must use the hack below. + --> + + <!-- Disables automatic signing. --> + <property name="build.is.signing.debug" value="false"/> + + <!-- TODO(cjhopman): Remove this property when all gyp files define the CHROMIUM_SRC property. --> + <property name="CHROMIUM_SRC" value="${PRODUCT_DIR}/../.." /> + + <property name="key.store" value="${CHROMIUM_SRC}/build/android/ant/chromium-debug.keystore"/> + <property name="key.store.password" value="chromium"/> + <property name="key.alias" value="chromiumdebugkey"/> + <property name="key.alias.password" value="chromium"/> + + <!-- SDK tools assume that out.packaged.file is signed and name it "...-unaligned" --> + <property name="out.packaged.file" + value="${out.dir}/${ant.project.name}-debug-unsigned.apk" /> + <property name="out.unaligned.file" + value="${out.dir}/${ant.project.name}-debug-unaligned.apk" /> + + <!-- By default, the SDK tools build only aligns the APK in the -do-debug target. --> + <target name="-do-debug" + depends="-set-debug-mode, -debug-obfuscation-check, -package, -post-package"> + <!-- only create apk if *not* a library project --> + <do-only-if-not-library elseText="Library project: do not create apk..." > + <sequential> + <!-- Signs the APK --> + <echo level="info">Signing final apk...</echo> + <signapk + input="${out.packaged.file}" + output="${out.unaligned.file}" + keystore="${key.store}" + storepass="${key.store.password}" + alias="${key.alias}" + keypass="${key.alias.password}"/> + + <!-- Zip aligns the APK --> + <zipalign-helper + in.package="${out.unaligned.file}" + out.package="${out.final.file}" /> + <echo level="info">Release Package: ${out.final.file}</echo> + </sequential> + </do-only-if-not-library> + <record-build-info /> + </target> </project> |