-
-
Notifications
You must be signed in to change notification settings - Fork 297
Targeting Android 11 required Signature V2 Signing. #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
After a successfull gradle sync why I cannot this application like simple android application on mobile |
@farhazulMullick Hi, According to what I understand from your comment, Are you trying to build and install 'processing-android' project on an emulator through the Android Studio? If yes then this is not a native android app project which you can run on an emulator. The project builds the Processing Android Mode and related libraries i.e Processing Core, AR, and VR. For more information on building the project, you can refer to this page. |
References for V2 Signing Google Source Code for V2 Signing |
I'd see this is critical because apps built with Processing won't be compatible with Android 11 devices unless V2 signing is supported. |
@rupesh-kumar-lpu So I incorporated the source code in the Android project for V2 signing: The exported signed bundle option now generates the V1 and V2 signed packages without error, however, when I try uploading the V2 signed aab to google play, I get the error "You uploaded a file that is not a well-formed zip archive" even though the aab file seems to be a valid zip file when I unpack it on my computer. So i must be doing something wrong. Mentioning this just in case you can take a look. Thank you! |
Hi Andres, it's strange to get that play console error despite the code for the v2 scheme seems alright. |
I tried running the zipalignPackage() function on the signedPackageV2: but it gave an error, so that's why I only apply zipalignPackage to the V1 package right now. |
Actually the signed_v2.aab was flagged as a corrupted zip file when I tried to upack using the command line tool unzip:
I was mislead because I before used a GUI tool on Mac that was able to unpack it. When I get the file type with |
@rupesh-kumar-lpu I thought this function was returning chunks already in zip format: Since its doing this: but maybe not? I will try zipping the resulting buffer, maybe that's the solution, if you have any other ideas please let me know. |
With this change 67dcfab seems its closer but not quite there yet, because the resulting aab file still not a valid zip file, but the error from unzip is different:
Like it is not properly closed or something (End-of-central-directory signature not found). Any help much appreciated :-) |
Hi @codeanticode, The APKSigner sources link I shared earlier was for signing APK as we did not have support for AAB at that time. I think apkSigner is only for signing APK, and for signing AAB we need to sign it either using Java JarSigner present in the java bin folder along with javac and java binaries or bundletool / bundletool sources "If you want to sign an app bundle from the command line, you can use jarsigner. If instead you want to sign an APK, you need to use zipalign and apksigner as described below." We can also use the java implementation of JarSigner JarSigner.java from open JDK or directly execute the binary by process builder task(Seems a faster option to implement) Let me know your views on implementing @codeanticode @ranaaditya |
Ok I see, aab is actually a different file format from apk, as far as I can tell from Google's official docs and other online resources, is that right? I missed that fact originally. In any case, I think that it could be better just to use the JarSigner & bundletool from the JDK/Android SDK respectively. Sounds like executing their binaries with a process builder task from the Android mode should work, since JarSigner is included in the copy of the OpenJDK bundled with Processing, and I'd imagine that bundletool comes with the Android SDK download as well. |
Yes, it's a different format I also missed the fact, and yes bundle tool is included in SDK as well. Can I start working on it with process builder if you are not working on the same? @codeanticode |
@rupesh-kumar-lpu yes if you could look into it, it would be amazing, thank you! I'm trying to at least push one last update of the Android mode for Processing 3 including this and few other critical updates before switching to support the Android mode only for Processing 4. |
It's great to know Android Mode is moving to Processing 4. I am looking forward to working on the current signing implementation. |
Awesome! Maybe you can start by assembling the command line calls using JarSigner and bundletool needed to generate the signed packages, so then we can figure out how to properly run using the process builder from the mode itself. |
The signing can be done as part of the Gradle build task, see this example: Implemented with this commit 11865cd |
Currently, the packages are being exported with Signature V1 signing. According to the official android documentation here -
Apps that target Android 11 (API level 30) that are currently only signed using APK Signature Scheme v1 must now also be signed using APK Signature Scheme v2 or higher. Users can't install or update apps that are only signed with APK Signature Scheme v1 on devices that run Android 11.
There is a need to provide the functionality to export the packages with V2 Signing, But first, need to make sure that it won't create compatibility issues.
Testings are required to verify the exported packages on Android 11 devices or emulators with build target version 11.
Below is one of the methods to check the Signature Version of the packages:
The text was updated successfully, but these errors were encountered: