LoginSignup
0
0

More than 5 years have passed since last update.

[Android] Use custom keystore for debug apk

Last updated at Posted at 2015-06-24

Custom build rules

Stackoverflow Link

<property name="build.is.signing.debug" value="false"/>
<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>
            <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}-debug-unaligned.apk" />

            <!-- Signs the APK -->
            <echo>Signing final apk...</echo>
            <signjar
                    jar="${out.packaged.file}"
                    signedjar="${out.unaligned.file}"
                    keystore="${key.store}"
                    storepass="${key.store.password}"
                    alias="${key.alias}"
                    keypass="${key.alias.password}"
                    verbose="${verbose}" />

            <!-- Zip aligns the APK -->
            <zipalign-helper
                    in.package="${out.unaligned.file}"
                    out.package="${out.final.file}" />
            <echo>Debug Package: ${out.final.file}</echo>
        </sequential>
    </do-only-if-not-library>
    <record-build-info />
</target>
<import file="${sdk.dir}/tools/ant/build.xml" />

Check which keystone is using

Stackoverflow

Unzip the apk file, in the META_INF folder, there is a RSA file. Use the keytool to print the md5 of the apk keystore.

Print the md5 of apk keystore.

keytool -printcert -file ANDROID_.RSA

Print the keystore md5.

keytool -list -keystore my-signing-key.keystore

One more ways

jarsigner -verify -verbose -keystore some.keystore some.apk

If all the lines start with smk, then ok.
Something like sm is not ok.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0