[Android] Use custom keystore for debug apk

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.

posted on 2017-05-15 17:50  ZhYQ_note  阅读(225)  评论(0编辑  收藏  举报

导航