Add dummy support for firebase database API

This commit is contained in:
Marvin W 2016-08-14 15:03:22 +02:00
parent 72ee3bcd38
commit 5a0c235e3d
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
5 changed files with 214 additions and 1 deletions

2
extern/GmsApi vendored

@ -1 +1 @@
Subproject commit b9cb95d39bdb4bbac6dd0d2b0405e4d5a23717c2
Subproject commit e057a9daaea26ea80d15b1e6f795425a7b21e9cf

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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<String> var1, IObjectWrapper var2, IListenHashProvider var3, long var4, IRequestResultCallback var6) throws RemoteException {
Log.d(TAG, "unimplemented Method: listen");
}
@Override
public void unlisten(List<String> 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<String> var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException {
Log.d(TAG, "unimplemented Method: put");
}
@Override
public void compareAndPut(List<String> var1, IObjectWrapper var2, String var3, IRequestResultCallback var4) throws RemoteException {
Log.d(TAG, "unimplemented Method: compareAndPut");
}
@Override
public void merge(List<String> var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException {
Log.d(TAG, "unimplemented Method: merge");
}
@Override
public void onDisconnectPut(List<String> var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException {
Log.d(TAG, "unimplemented Method: onDisconnectPut");
}
@Override
public void onDisconnectMerge(List<String> var1, IObjectWrapper var2, IRequestResultCallback var3) throws RemoteException {
Log.d(TAG, "unimplemented Method: onDisconnectMerge");
}
@Override
public void onDisconnectCancel(List<String> 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;
}
}

View File

@ -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 {