-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Building
You need the following prerequisites to build GmsCore:
- Due to the use of symlinks, a unix-based operating system is required to build the application. Please notice, that building with other operating systems is not supported.
- Your Android-ROM should integrate the
FAKE_PACKAGE_SIGNATURE-patch, which is required to fully use the features of GmsCore. See "Signature Spoofing" for details. - The build process requires a full-working Android SDK and Java installation.
Prebuilt libraries of vtm are included within ./libs. It is possible to build the microG version of Google's GmsCore in many different ways:
You can use this small bash script, which automates all required steps to build GmsCore:
#!/bin/bash
mkdir microg
cd microg
mkdir outputs
mkdir keystores
ANDROID_SDK_PATH="/opt/android-sdk-update-manager"
KEYSTORES_PATH="keystores"
# Generate keystore
echo "We need to create a keystore for GmsCore:"
keytool -genkey -v -keystore $KEYSTORES_PATH/playservices.jks -alias playservices -keyalg RSA -keysize 4096 -validity 10000
# GMSCore
git clone https://github.com/microg/android_packages_apps_GmsCore.git
cd android_packages_apps_GmsCore
git submodule update --init --recursive
echo "sdk.dir=$ANDROID_SDK_PATH" > local.properties
echo "sdk-location=$ANDROID_SDK_PATH" >> local.properties
./gradlew build
cp play-services-core/build/outputs/apk/play-services-core-release-unsigned.apk ../outputs/play-services-core-release.apk
# Sign APK
cd ../outputs
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $KEYSTORES_PATH/playservices.jks play-services-core-release.apk playservices
$ANDROID_SDK_PATH/build-tools/22.0.1/zipalign -v 4 play-services-core-release.apk com.google.android.gms.apkFirst of all, one should get the source code and all required dependencies:
git clone [email protected]:microg/android_packages_apps_GmsCore.git
git submodule update --recursive --initThe cloned repository contains all required build scripts for gradle and the wrapper, which is needed to start the build process. Firstly, create a new local.properties, which contains a sdk.dir=<path to sdk> directive. After executing ./gradlew in the repository directory, the debug and release apks can be found in the directory play-services-core/build/outputs/apk/.
In case you want to sign the apk, execute the following commands in the apk directory with your specific configuration:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <keystore> play-services-core-release-unsigned.apk <key name>
<sdk directory>/build-tools/22.0.1/zipalign -v 4 play-services-core-release-unsigned.apk play-services-core-release.apkIn case, you want to integrate GmsCore into an AOSP-based ROM build, you can sync the GmsCore project in the subdirectory /external of the repo synced android sources:
git clone [email protected]:microg/android_packages_apps_GmsCore.git
git submodule update --recursive --initIt is recommended to patch the android distribution to support the "faking" of the original Google Play Services apk signatures. The default android build process will respect GmsCore and automatically create an APK on the /system partition image.