diff --git a/extern/GmsApi b/extern/GmsApi index b9cb95d3..e057a9da 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit b9cb95d39bdb4bbac6dd0d2b0405e4d5a23717c2 +Subproject commit e057a9daaea26ea80d15b1e6f795425a7b21e9cf diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteLoaderImpl.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteLoaderImpl.java new file mode 100644 index 00000000..97e00f24 --- /dev/null +++ b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteLoaderImpl.java @@ -0,0 +1,65 @@ +/* + * Copyright 2013-2016 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.chimera.container; + +import android.content.Context; +import android.content.ContextWrapper; +import android.content.pm.PackageManager; +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.dynamic.ObjectWrapper; +import com.google.android.gms.dynamite.IDynamiteLoader; + +import org.microg.gms.common.Constants; + +public class DynamiteLoaderImpl extends IDynamiteLoader.Stub { + private static final String TAG = "GmsDynamiteLoaderImpl"; + + @Override + public IObjectWrapper createModuleContext(IObjectWrapper wrappedContext, String moduleId, int minVersion) throws RemoteException { + Log.d(TAG, "unimplemented Method: createModuleContext for " + moduleId + " at version " + minVersion + ", returning gms context"); + final Context context = (Context) ObjectWrapper.unwrap(wrappedContext); + try { + return ObjectWrapper.wrap(new ContextWrapper(context.createPackageContext(Constants.GMS_PACKAGE_NAME, Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY)) { + @Override + public Context getApplicationContext() { + return context; + } + }); + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, "returning null instead", e); + return null; + } + } + + @Override + public int getModuleVersion(IObjectWrapper context, String moduleId) throws RemoteException { + return getModuleVersion2(context, moduleId, true); + } + + @Override + public int getModuleVersion2(IObjectWrapper context, String moduleId, boolean updateConfigIfRequired) throws RemoteException { + if (moduleId.equals("com.google.android.gms.firebase_database")) { + Log.d(TAG, "returning temp fix module version for " + moduleId + ". Firebase Database will not be functional!"); + return com.google.android.gms.dynamite.descriptors.com.google.android.gms.firebase_database.ModuleDescriptor.MODULE_VERSION; + } + Log.d(TAG, "unimplemented Method: getModuleVersion for " + moduleId); + return 0; + } +} diff --git a/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/firebase_database/ModuleDescriptor.java b/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/firebase_database/ModuleDescriptor.java new file mode 100644 index 00000000..992edbaf --- /dev/null +++ b/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/firebase_database/ModuleDescriptor.java @@ -0,0 +1,22 @@ +/* + * Copyright 2013-2016 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.dynamite.descriptors.com.google.android.gms.firebase_database; + +public class ModuleDescriptor { + public static final String MODULE_ID = "com.google.android.gms.firebase_database"; + public static final int MODULE_VERSION = 3; +} diff --git a/play-services-core/src/main/java/com/google/firebase/database/connection/idl/IPersistentConnectionImpl.java b/play-services-core/src/main/java/com/google/firebase/database/connection/idl/IPersistentConnectionImpl.java new file mode 100644 index 00000000..d9215ab0 --- /dev/null +++ b/play-services-core/src/main/java/com/google/firebase/database/connection/idl/IPersistentConnectionImpl.java @@ -0,0 +1,124 @@ +/* + * Copyright 2013-2016 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.database.connection.idl; + +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.dynamic.IObjectWrapper; + +import java.util.List; + +public class IPersistentConnectionImpl extends IPersistentConnection.Stub { + private static final String TAG = "GmsFirebaseDbConImpl"; + + @Override + public void setup(ConnectionConfig var1, IConnectionAuthTokenProvider var2, IObjectWrapper var3, IPersistentConnectionDelegate var4) throws RemoteException { + Log.d(TAG, "unimplemented Method: setup"); + + } + + @Override + public void initialize() throws RemoteException { + Log.d(TAG, "unimplemented Method: initialize"); + + } + + @Override + public void shutdown() throws RemoteException { + Log.d(TAG, "unimplemented Method: shutdown"); + + } + + @Override + public void refreshAuthToken() throws RemoteException { + Log.d(TAG, "unimplemented Method: refreshAuthToken"); + + } + + @Override + public void listen(List var1, IObjectWrapper var2, IListenHashProvider var3, long var4, IRequestResultCallback var6) throws RemoteException { + Log.d(TAG, "unimplemented Method: listen"); + + } + + @Override + public void unlisten(List var1, IObjectWrapper var2) throws RemoteException { + Log.d(TAG, "unimplemented Method: unlisten"); + + } + + @Override + public void purgeOutstandingWrites() throws RemoteException { + Log.d(TAG, "unimplemented Method: purgeOutstandingWrites"); + + } + + @Override + public void put(List var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException { + Log.d(TAG, "unimplemented Method: put"); + + } + + @Override + public void compareAndPut(List var1, IObjectWrapper var2, String var3, IRequestResultCallback var4) throws RemoteException { + Log.d(TAG, "unimplemented Method: compareAndPut"); + + } + + @Override + public void merge(List var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException { + Log.d(TAG, "unimplemented Method: merge"); + + } + + @Override + public void onDisconnectPut(List var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException { + Log.d(TAG, "unimplemented Method: onDisconnectPut"); + + } + + @Override + public void onDisconnectMerge(List var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException { + Log.d(TAG, "unimplemented Method: onDisconnectMerge"); + + } + + @Override + public void onDisconnectCancel(List var1, IRequestResultCallback var2) throws RemoteException { + Log.d(TAG, "unimplemented Method: onDisconnectCancel"); + + } + + @Override + public void interrupt(String var1) throws RemoteException { + Log.d(TAG, "unimplemented Method: interrupt"); + + } + + @Override + public void resume(String var1) throws RemoteException { + Log.d(TAG, "unimplemented Method: resume"); + + } + + @Override + public boolean isInterrupted(String var1) throws RemoteException { + Log.d(TAG, "unimplemented Method: isInterrupted"); + return false; + } +} diff --git a/proguard.flags b/proguard.flags index 0aa6b0e4..67c504c3 100644 --- a/proguard.flags +++ b/proguard.flags @@ -21,6 +21,8 @@ -keep public class com.google.android.gms.common.security.ProviderInstallerImpl { public *; } -keep public class com.google.android.gms.plus.plusone.PlusOneButtonCreatorImpl { public *; } -keep public class com.google.android.gms.dynamic.IObjectWrapper { public *; } +-keep public class com.google.android.gms.chimera.container.DynamiteLoaderImpl { public *; } +-keep public class com.google.android.gms.dynamite.descriptors.** { public *; } # Keep AutoSafeParcelables -keep public class * extends org.microg.safeparcel.AutoSafeParcelable {