diff --git a/Android.mk b/Android.mk index 175f3f27..0d6ad646 100644 --- a/Android.mk +++ b/Android.mk @@ -17,19 +17,34 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional unified_dir := ../UnifiedNlp -res_dir := res $(unified_dir)/res +appcompat_dir := ../../../prebuilts/sdk/current/support/v7/appcompat +res_dir := res $(unified_dir)/res $(appcompat_dir)/res + +LOCAL_SRC_FILES := $(call all-java-files-under, src) \ + $(call all-Iaidl-files-under, src) \ + $(call all-java-files-under, $(unified_dir)/src) \ -LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_SRC_FILES += $(call all-Iaidl-files-under, src) -LOCAL_SRC_FILES += $(call all-java-files-under, $(unified_dir)/src) LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir)) -LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages org.microg.nlp + +LOCAL_AAPT_FLAGS := --auto-add-overlay \ + --extra-packages android.support.v7.appcompat \ + --extra-packages org.microg.nlp \ # For some reason framework has to be added here else GeocoderParams is not found, # this way everything else is duplicated, but atleast compiles... -LOCAL_JAVA_LIBRARIES := com.google.android.maps framework com.android.location.provider +LOCAL_JAVA_LIBRARIES := com.google.android.maps \ + framework \ + com.android.location.provider + +# Include compat v9 files if necassary +ifeq ($(shell [ $(PLATFORM_SDK_VERSION) -ge 17 ] && echo true), true) +LOCAL_JAVA_LIBRARIES += UnifiedNlpCompatV9 +endif + +LOCAL_STATIC_JAVA_LIBRARIES := UnifiedNlpApi \ + android-support-v4 \ + android-support-v7-appcompat \ -LOCAL_STATIC_JAVA_LIBRARIES := UnifiedNlpApi LOCAL_PACKAGE_NAME := GmsCore LOCAL_SDK_VERSION := current LOCAL_PRIVILEGED_MODULE := true diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 029c566e..f4c902ba 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -17,7 +17,7 @@ + android:versionCode="6111030"> @@ -31,6 +31,7 @@ + android:name="org.microg.nlp.ui.SettingsActivity" + android:label="@string/nlp_settings_label"> diff --git a/src/org/microg/gms/auth/AuthManagerServiceImpl.java b/src/org/microg/gms/auth/AuthManagerServiceImpl.java index 6810a1bc..60475059 100644 --- a/src/org/microg/gms/auth/AuthManagerServiceImpl.java +++ b/src/org/microg/gms/auth/AuthManagerServiceImpl.java @@ -87,12 +87,12 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub { } private void checkPackage(String packageName, int callerUid, int callingUid) { - if (callerUid != callingUid) { + if (callerUid != 0 && callerUid != callingUid) { throw new SecurityException("callerUid [" + callerUid + "] and real calling uid [" + callingUid + "] mismatch!"); } - String[] packagesForUid = context.getPackageManager().getPackagesForUid(callerUid); - if (!Arrays.asList(packagesForUid).contains(packageName)) { - throw new SecurityException("callerUid [" + callerUid + "] is not related to packageName [" + packageName + "]"); + String[] packagesForUid = context.getPackageManager().getPackagesForUid(callingUid); + if (packagesForUid != null && !Arrays.asList(packagesForUid).contains(packageName)) { + throw new SecurityException("callingUid [" + callingUid + "] is not related to packageName [" + packageName + "]"); } }