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 | |
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
-rw-r--r-- | android_webview/java/android_webview_apk.xml | 3 | ||||
-rw-r--r-- | android_webview/javatests/android_webview_test_apk.xml | 3 | ||||
-rw-r--r-- | build/android/ant/sdk-targets.xml | 50 | ||||
-rw-r--r-- | content/shell/android/java/content_shell_apk.xml | 3 | ||||
-rw-r--r-- | content/shell/android/javatests/content_shell_test_apk.xml | 3 | ||||
-rw-r--r-- | testing/android/native_test_apk.xml | 2 |
6 files changed, 59 insertions, 5 deletions
diff --git a/android_webview/java/android_webview_apk.xml b/android_webview/java/android_webview_apk.xml index 67ec7b3..f283c19 100644 --- a/android_webview/java/android_webview_apk.xml +++ b/android_webview/java/android_webview_apk.xml @@ -9,7 +9,7 @@ Building AndroidWebView.apk </description> <import file="../../build/android/ant/common.xml"/> - <import file="../../build/android/ant/sdk-targets.xml"/> + <property-value name="target.abi" value="${APP_ABI}"/> <property-location name="out.dir" location="${PRODUCT_DIR}/android_webview" check-exists="false"/> @@ -42,5 +42,6 @@ <path id="javac.custom.classpath"> <path refid="out.dex.jar.input.ref"/> </path> + <import file="../../build/android/ant/sdk-targets.xml"/> <import file="${sdk.dir}/tools/ant/build.xml"/> </project> diff --git a/android_webview/javatests/android_webview_test_apk.xml b/android_webview/javatests/android_webview_test_apk.xml index bee7eac..b50b71a 100644 --- a/android_webview/javatests/android_webview_test_apk.xml +++ b/android_webview/javatests/android_webview_test_apk.xml @@ -11,7 +11,7 @@ </description> <import file="../../build/android/ant/common.xml"/> - <import file="../../build/android/ant/sdk-targets.xml"/> + <property name="target.abi" value="${APP_ABI}"/> <property name="out.dir" location="${PRODUCT_DIR}/android_webview_test"/> <property name="resource.absolute.dir" value="../res"/> @@ -50,6 +50,7 @@ <path id="javac.custom.classpath"> <path refid="out.dex.jar.input.ref"/> </path> + <import file="../../build/android/ant/sdk-targets.xml"/> <import file="${sdk.dir}/tools/ant/build.xml" /> </project> 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> diff --git a/content/shell/android/java/content_shell_apk.xml b/content/shell/android/java/content_shell_apk.xml index a403d6f..9182239 100644 --- a/content/shell/android/java/content_shell_apk.xml +++ b/content/shell/android/java/content_shell_apk.xml @@ -9,7 +9,6 @@ Building ContentShell.apk </description> <import file="../../../../build/android/ant/common.xml"/> - <import file="../../../../build/android/ant/sdk-targets.xml"/> <!-- Convert the buildtype to lowercase. E.g Debug -> debug, Release -> release. --> <script language="javascript"> @@ -69,5 +68,7 @@ <path id="javac.custom.classpath"> <path refid="out.dex.jar.input.ref"/> </path> + + <import file="../../../../build/android/ant/sdk-targets.xml"/> <import file="${sdk.dir}/tools/ant/build.xml"/> </project> diff --git a/content/shell/android/javatests/content_shell_test_apk.xml b/content/shell/android/javatests/content_shell_test_apk.xml index 5126f0e..6d5f6824 100644 --- a/content/shell/android/javatests/content_shell_test_apk.xml +++ b/content/shell/android/javatests/content_shell_test_apk.xml @@ -11,7 +11,7 @@ </description> <import file="../../../../build/android/ant/common.xml"/> - <import file="../../../../build/android/ant/sdk-targets.xml"/> + <property name="target.abi" value="${APP_ABI}"/> <property name="out.dir" location="${PRODUCT_DIR}/content_shell_test"/> <property name="resource.absolute.dir" value="../res"/> @@ -74,6 +74,7 @@ <path id="javac.custom.classpath"> <path refid="out.dex.jar.input.ref"/> </path> + <import file="../../../../build/android/ant/sdk-targets.xml"/> <import file="${sdk.dir}/tools/ant/build.xml" /> </project> diff --git a/testing/android/native_test_apk.xml b/testing/android/native_test_apk.xml index b410bc2..5e63cbc 100644 --- a/testing/android/native_test_apk.xml +++ b/testing/android/native_test_apk.xml @@ -19,7 +19,6 @@ found in the LICENSE file. <property name="CHROMIUM_SRC" value="${PRODUCT_DIR}/../.." /> <import file="${CHROMIUM_SRC}/build/android/ant/common.xml"/> - <import file="${CHROMIUM_SRC}/build/android/ant/sdk-targets.xml"/> <!-- TODO(yfriedman): Remove the need to specify this. We should generate the packages in a way such @@ -88,6 +87,7 @@ found in the LICENSE file. </if> </target> + <import file="${CHROMIUM_SRC}/build/android/ant/sdk-targets.xml"/> <import file="${sdk.dir}/tools/ant/build.xml" /> </project> |