mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Evict Firebase Analytics
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
6e0d6b1d8a
commit
726ffa6520
@ -53,6 +53,7 @@ ext {
|
|||||||
|
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
||||||
resolutionStrategy {
|
resolutionStrategy {
|
||||||
force "com.android.support:cardview-v7:${supportLibraryVersion}"
|
force "com.android.support:cardview-v7:${supportLibraryVersion}"
|
||||||
force "com.android.support:preference-v7:${supportLibraryVersion}"
|
force "com.android.support:preference-v7:${supportLibraryVersion}"
|
||||||
@ -124,10 +125,8 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'com.evernote:android-job:1.2.0'
|
implementation 'com.evernote:android-job:1.2.0'
|
||||||
|
|
||||||
implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
|
|
||||||
implementation "com.google.android.gms:play-services-base:${googleLibraryVersion}"
|
|
||||||
implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
|
implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
|
||||||
implementation "com.google.firebase:firebase-core:${googleLibraryVersion}"
|
implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
|
||||||
|
|
||||||
implementation 'com.yarolegovich:lovely-dialog:1.1.0'
|
implementation 'com.yarolegovich:lovely-dialog:1.1.0'
|
||||||
implementation 'com.yarolegovich:lovelyinput:1.0.9'
|
implementation 'com.yarolegovich:lovelyinput:1.0.9'
|
||||||
|
@ -30,7 +30,6 @@ import android.util.Log;
|
|||||||
import com.evernote.android.job.JobManager;
|
import com.evernote.android.job.JobManager;
|
||||||
import com.evernote.android.job.JobRequest;
|
import com.evernote.android.job.JobRequest;
|
||||||
import com.google.android.gms.security.ProviderInstaller;
|
import com.google.android.gms.security.ProviderInstaller;
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
|
||||||
import com.nextcloud.talk.BuildConfig;
|
import com.nextcloud.talk.BuildConfig;
|
||||||
import com.nextcloud.talk.dagger.modules.BusModule;
|
import com.nextcloud.talk.dagger.modules.BusModule;
|
||||||
import com.nextcloud.talk.dagger.modules.ContextModule;
|
import com.nextcloud.talk.dagger.modules.ContextModule;
|
||||||
@ -49,7 +48,11 @@ import org.webrtc.PeerConnectionFactory;
|
|||||||
import org.webrtc.voiceengine.WebRtcAudioManager;
|
import org.webrtc.voiceengine.WebRtcAudioManager;
|
||||||
import org.webrtc.voiceengine.WebRtcAudioUtils;
|
import org.webrtc.voiceengine.WebRtcAudioUtils;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
@ -113,33 +116,7 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Pro
|
|||||||
super.onCreate();
|
super.onCreate();
|
||||||
ProviderInstaller.installIfNeededAsync(this, this);
|
ProviderInstaller.installIfNeededAsync(this, this);
|
||||||
|
|
||||||
/*if (Build.MANUFACTURER.equalsIgnoreCase("huawei")) {
|
|
||||||
try {
|
|
||||||
Class<?> enclosingClass = Class.forName("com.huawei.systemmanager.startupmgr.db.StartupDataMgrHelper");
|
|
||||||
Method method = enclosingClass.getMethod("modifyNormalStartupInfoStatus", Context.class, String.class, boolean.class);
|
|
||||||
method.invoke(null, getApplicationContext(), getPackageName(), true);
|
|
||||||
|
|
||||||
Class<?> secondaryEnclosingClass = Class.forName("com.huawei.systemmanager.optimize.process" +
|
|
||||||
".ProtectAppControl");
|
|
||||||
Method secondaryMethod = secondaryEnclosingClass.getMethod("getInstance", Context.class);
|
|
||||||
Object object = secondaryMethod.invoke(null, getApplicationContext());
|
|
||||||
Method thirdMethod = secondaryEnclosingClass.getMethod("setNoProtect", List.class);
|
|
||||||
List<String> packageNames = new ArrayList<>();
|
|
||||||
packageNames.add(getPackageName());
|
|
||||||
thirdMethod.invoke(object, packageNames);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
Log.e(TAG, "Failed to find the required class on Huawei");
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
Log.e(TAG, "Failed to find the appropriate method");
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
Log.e(TAG, "Illegal access exception");
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
Log.e(TAG, "Invocation target exception");
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
JobManager.create(this).addJobCreator(new MagicJobCreator());
|
JobManager.create(this).addJobCreator(new MagicJobCreator());
|
||||||
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);
|
|
||||||
|
|
||||||
sharedApplication = this;
|
sharedApplication = this;
|
||||||
|
|
||||||
@ -164,7 +141,33 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Pro
|
|||||||
|
|
||||||
|
|
||||||
private void prepareThingsForStrangePhones() {
|
private void prepareThingsForStrangePhones() {
|
||||||
|
if (Build.MANUFACTURER.equalsIgnoreCase("huawei")) {
|
||||||
|
try {
|
||||||
|
Class<?> enclosingClass = Class.forName("com.huawei.systemmanager.startupmgr.db.StartupDataMgrHelper");
|
||||||
|
Method method = enclosingClass.getMethod("modifyNormalStartupInfoStatus",
|
||||||
|
Context.class, String.class, boolean.class);
|
||||||
|
method.invoke(null, getApplicationContext(), getPackageName(), true);
|
||||||
|
|
||||||
|
Class<?> secondaryEnclosingClass = Class.forName("com.huawei.systemmanager.optimize.process" +
|
||||||
|
".ProtectAppControl");
|
||||||
|
Method secondaryMethod = secondaryEnclosingClass.getMethod("getInstance", Context.class);
|
||||||
|
Object object = secondaryMethod.invoke(null, getApplicationContext());
|
||||||
|
Method thirdMethod = secondaryEnclosingClass.getMethod("setNoProtect", List.class);
|
||||||
|
List<String> packageNames = new ArrayList<>();
|
||||||
|
packageNames.add(getPackageName());
|
||||||
|
thirdMethod.invoke(object, packageNames);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
Log.e(TAG, "Failed to find the required class on Huawei");
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
Log.e(TAG, "Failed to find the appropriate method");
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
Log.e(TAG, "Illegal access exception");
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
Log.e(TAG, "Invocation target exception");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTerminate() {
|
public void onTerminate() {
|
||||||
super.onTerminate();
|
super.onTerminate();
|
||||||
|
Loading…
Reference in New Issue
Block a user