Skip to content

Building

Wenzel Pünter edited this page Aug 9, 2015 · 24 revisions

Dependencies

You need the following prerequisites to build GmsCore:

  1. 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.
  2. Your Android-ROM should integrate the FAKE_PACKAGE_SIGNATURE-patch, which is required to fully use the features of GmsCore.
  3. The build process requires a full-working Android SDK and Java installation.

Building

It is possible to build the µg-version of Google's GmsCore in many different ways. First 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 --init

1. Gradle

The 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.0/zipalign -v 4 play-services-core-release-unsigned.apk play-services-core-release.apk

If you stuck at any step of the building process, take a look at this simple build script for all basic microg components.

2. AOSP

In case, you want to integrate GmsCore into an AOSP-based ROM build, you can place the downloaded directory in the subdirectory /external of the repo synced android sources. It 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.

Installation

The following steps are only required when building GmsCore using gradle. In case you had the Google Play Services previously installed, remove all updates and the packages in /system/priv-app of the Google Services GmsCore, GoogleBackupTransport, GoogleFeedback, GoogleLoginService, GoogleOneTimeInitializer, GooglePartnerSetup, GoogleServicesFramework, Phonesky, SetupWizard and Velvet. In case you forgot to remove the GmsCore updates, you can manually remove these using adb uninstall com.google.android.gms. After that, reboot your android device - all privileged GAPPS should be removed. Eventually, you can install the GmsCore replacement with adb install <path to apk>. In contrast to Google's version, no system privileges are required.

Clone this wiki locally