简体   繁体   中英

Are unaligned android APK's the same as unsigned APK? need to generate release apk that is unsigned

I need to generate an APK in android studio that is unsigned. I saw a few other questions about this.

Export unsigned apk from a Gradle Project in Android Studio

The best answer I saw was to go into the gradle tasks an execute assembleRelease. This generates two apks in the /build/output/apk folder one says app-release-unaligned.apk.

Is unaligned the same thing as unsigned ?

Is the debug build type the same thing as unsigned ?

I also tried adding a second build type where I don't specify a signing config but then the IDE just complains that t

No and No.

Unaligned refers to how the data is structured within the APK (zip file). A utility called zipalign modifies the APK to align data in a way that is optimised for readers. Unaligned simply skips the zipalign stage. It has nothing to do with APK signing.

Debug is simply a mode where a flag is set within your App to indicate to Android that your App can be launched with (or attached to by) a debugger. Again, technically, it has nothing to do with signing your App, but it is common practise to use a different signing key for debugging your App and only signing a final/release build with your real App signing key (which should be kept secure).

I need to generate an APK in android studio that is unsigned.

This is not possible. Android requires that all APKs be digitally signed with a certificate before they can be installed. The system will not install an application on an emulator or a device if it is not signed.

You can read the official developer document for more details on the process of how to do the signing of APK, for your app's debug build or release build, but you have to sign APK, then only it can be installed on the Android device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM