Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/talk-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--app/gplay.gradle2
-rw-r--r--app/src/main/java/com/nextcloud/talk/utils/DeviceUtils.java38
-rw-r--r--app/src/main/res/values/setup.xml10
-rw-r--r--build.gradle3
5 files changed, 17 insertions, 40 deletions
diff --git a/.gitignore b/.gitignore
index aa9a01a6a..2b7ad87b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,8 +47,8 @@ captures/
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
-google-services.json
-app/google-services.json
+#google-services.json
+#app/google-services.json
# Freeline
freeline.py
diff --git a/app/gplay.gradle b/app/gplay.gradle
index 9af8ded79..4f449f644 100644
--- a/app/gplay.gradle
+++ b/app/gplay.gradle
@@ -6,3 +6,5 @@ dependencies {
implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
}
+
+apply plugin: 'com.google.gms.google-services'
diff --git a/app/src/main/java/com/nextcloud/talk/utils/DeviceUtils.java b/app/src/main/java/com/nextcloud/talk/utils/DeviceUtils.java
index c42deb134..d58c3acd9 100644
--- a/app/src/main/java/com/nextcloud/talk/utils/DeviceUtils.java
+++ b/app/src/main/java/com/nextcloud/talk/utils/DeviceUtils.java
@@ -40,21 +40,12 @@ public class DeviceUtils {
try {
@SuppressLint("PrivateApi") Class<?> appOpsUtilsClass = Class.forName("android.miui.AppOpsUtils");
if (appOpsUtilsClass != null) {
- Method getApplicationAutoStart = appOpsUtilsClass.getDeclaredMethod("getApplicationAutoStart", Context.class, String.class);
- if (getApplicationAutoStart != null) {
+ Method setApplicationAutoStartMethod = appOpsUtilsClass.getDeclaredMethod("setApplicationAutoStart", Context.class, String
+ .class, Boolean.TYPE);
+ if (setApplicationAutoStartMethod != null) {
Context applicationContext = NextcloudTalkApplication.getSharedApplication().getApplicationContext();
- Object result = getApplicationAutoStart.invoke(appOpsUtilsClass, applicationContext, applicationContext.getPackageName());
- if (result instanceof Integer) {
- Integer integerResult = (Integer) result;
- if (integerResult == 0) {
- Method setApplicationAutoStartMethod = appOpsUtilsClass.getDeclaredMethod("setApplicationAutoStart",
- Context.class, String.class, Boolean.TYPE);
- if (setApplicationAutoStartMethod != null) {
- setApplicationAutoStartMethod.invoke(appOpsUtilsClass, applicationContext, applicationContext.getPackageName(),
- Boolean.TRUE);
- }
- }
- }
+ setApplicationAutoStartMethod.invoke(appOpsUtilsClass, applicationContext, applicationContext
+ .getPackageName(), Boolean.TRUE);
}
}
} catch (ClassNotFoundException e) {
@@ -78,20 +69,11 @@ public class DeviceUtils {
if (getInstanceMethod != null) {
Object protectAppControlInstance = getInstanceMethod.invoke(null, applicationContext);
- Method isProtectedMethod = protectAppControlClass.getDeclaredMethod("isProtect", String.class);
- if (isProtectedMethod != null) {
- Object result = isProtectedMethod.invoke(protectAppControlInstance, applicationContext.getPackageName());
- if (result instanceof Boolean) {
- boolean booleanResult = (boolean) result;
- if (!booleanResult) {
- Method setProtectMethod = protectAppControlClass.getDeclaredMethod("setProtect", List.class);
- if (setProtectMethod != null) {
- List<String> appsList = new ArrayList<>();
- appsList.add(applicationContext.getPackageName());
- setProtectMethod.invoke(protectAppControlInstance, appsList);
- }
- }
- }
+ Method setProtectMethod = protectAppControlClass.getDeclaredMethod("setProtect", List.class);
+ if (setProtectMethod != null) {
+ List<String> appsList = new ArrayList<>();
+ appsList.add(applicationContext.getPackageName());
+ setProtectMethod.invoke(protectAppControlInstance, appsList);
}
}
}
diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml
index 7d5742111..0b55f7efd 100644
--- a/app/src/main/res/values/setup.xml
+++ b/app/src/main/res/values/setup.xml
@@ -19,14 +19,4 @@
<string name="nc_import_accounts_from" translatable="false">com.nextcloud.client</string>
<string name="nc_import_account_type" translatable="false">nextcloud</string>
- <!-- Push notifications -->
- <string name="default_web_client_id" translatable="false">829118773643-cq33cmhv7mnv7iq8mjv6rt7t15afc70k.apps.googleusercontent.com</string>
- <string name="firebase_database_url" translatable="false">https://nextcloud-a7dea.firebaseio.com</string>
- <string name="gcm_defaultSenderId" translatable="false">829118773643</string>
- <string name="google_api_key" translatable="false">AIzaSyAWIyOcLafaFp8PFL61h64cy1NNZW2cU_s</string>
- <string name="google_app_id" translatable="false">1:829118773643:android:54b65087c544d819</string>
- <string name="google_crash_reporting_api_key" translatable="false">AIzaSyAWIyOcLafaFp8PFL61h64cy1NNZW2cU_s</string>
- <string name="google_storage_bucket" translatable="false">nextcloud-a7dea.appspot.com</string>
- <string name="project_id" translatable="false">nextcloud-a7dea</string>
-
</resources>
diff --git a/build.gradle b/build.gradle
index 126dc410d..b3077052d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -12,6 +12,9 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
+ if (getGradle().getStartParameter().getTaskRequests().toString().contains("GPlay")){
+ classpath 'com.google.gms:google-services:3.1.0'
+ }
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files