Android Developer Verification Guide for Unity Developers

With this new feature comes a lot of issues to face, as being a Unity Developer, and not knowing way around the Android Studio.

This article is to provide a little insight and the solution I have found to avoid wasting time or finding an android developer to help with registering package names.

There are two ways to go through registering a package name.

Method #1:

Before creating the first build for even local testing purposes with the Package Name, Register the Package Name in Play Console when the name is decided, or Create an App. This is the simplest and time saving way to do it.

Method #2:

This comes in play when the Package Name isn't Registered, but created an android build for testing purposes.

In this case, play console / developer verification picks up the SHA-256 sign key as public key Certificate from the Testing Builds even before creating app/registering name, and when we go to console to register the Package Name, it notifies that the Package Name Already exists in Android, then asks us to create an APK with the exact same SHA-256 key (debug/private key) along with "adi-registration.properties" file which includes account's unique identifier to prove ownership.

Here the Problem starts for Unity Developer who is unfamiliar with making builds from Android Studio, as Play Console has only provided Android sample project.


The Following Steps / Guide to register Package Name through Unity apk:


1.. Start the package name registration process and note the SHA-256 sign key (it can either be the debug one or the private key created for the project)


2.. You can take a Look at the SHA- keys using "apksigner".

Creating Environment Variable for it makes it easier with path to <path/sdks/build-tools/versionNumber>. With this, it makes this quicker to check key, by Opening Terminal from the APK folder.

Use the syntax from Terminal:

apksigner verify --print-certs ApkName.apk

3.. Including adi-registration.properties file in Assets folder.

Adding "assets" or "res" files in apk is Obsolete, so we can use this Script: providing a way to Add the file in assets/res folder during the building process of APK from Unity. Follow the Instructions from README.

Make sure this Build Processing File goes in "Editor" folder.

https://github.com/Frismos/UnityUtilsHelpers/tree/main


4.. Create the build, recheck SHA-256 key through appsigner

To be fully sure that the registration file is added in assets folder, rename the .apk file, to .rar extension, and check if the registration file exists in the assets folder.

There you have it, a signed apk which includes the adi-registration.properties file and SHA-265 Public Certificate Key.



Helping Materials

Guide Provided by Play Console Help Center
apksigner guide - Play Console Help Center
Android Sample Project - github for Android Studio
Build Processing Editor Script by Frismos

Comments