Update bunch of things

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-02-19 02:14:21 +01:00
parent ac96dd8540
commit 5d1bef8f85
12 changed files with 156 additions and 130 deletions

View file

@ -1,6 +1,9 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
if (getGradle().getStartParameter().getTaskRequests().toString().contains("GPlay")){
apply from: 'gplay.gradle'
}
android {
compileSdkVersion 27
@ -12,9 +15,16 @@ android {
targetSdkVersion 27
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 26
versionName "1.1.0beta1"
versionCode 27
versionName "1.1.0beta2"
flavorDimensions "default"
productFlavors {
// used for f-droid
Generic
GPlay
}
// Enabling multidex support.
multiDexEnabled true
@ -48,7 +58,6 @@ android {
ext {
supportLibraryVersion = '27.0.2'
googleLibraryVersion = '11.8.0'
}
@ -125,9 +134,6 @@ dependencies {
implementation 'com.evernote:android-job:1.2.4'
implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
implementation 'com.yarolegovich:lovely-dialog:1.1.0'
implementation 'com.yarolegovich:lovelyinput:1.0.9'
implementation 'com.yarolegovich:mp:1.0.9'
@ -143,4 +149,3 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
//apply plugin: 'com.google.gms.google-services'

View file

@ -1,93 +0,0 @@
{
"project_info": {
"project_number": "",
"firebase_url": "",
"project_id": "",
"storage_bucket": ""
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "",
"android_client_info": {
"package_name": "com.nextcloud.client"
}
},
"oauth_client": [
{
"client_id": "",
"client_type": 1,
"android_info": {
"package_name": "com.nextcloud.client",
"certificate_hash": ""
}
},
{
"client_id": "",
"client_type": 3
}
],
"api_key": [
{
"current_key": ""
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "",
"client_type": 3
},
{
"client_id": "",
"client_type": 2,
"ios_info": {
"bundle_id": "com.nextcloud.talk2"
}
}
]
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:111111111111:android:111a1a1a11111111",
"android_client_info": {
"package_name": "com.nextcloud.talk2"
}
},
"oauth_client": [
{
"client_id": "",
"client_type": 3
}
],
"api_key": [
{
"current_key": ""
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

8
app/gplay.gradle Normal file
View file

@ -0,0 +1,8 @@
ext {
googleLibraryVersion = '11.8.0'
}
dependencies {
implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
}

View file

@ -0,0 +1,32 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.nextcloud.talk">
<application
android:name=".application.NextcloudTalkApplication"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_config"
android:icon="@mipmap/ic_launcher"
android:label="@string/nc_app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="label, icon, roundIcon, theme, name, allowBackup">
<service
android:name=".services.firebase.MagicFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
android:name=".services.firebase.MagicFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
</application>
</manifest>

View file

@ -0,0 +1,47 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.utils;
import android.content.Intent;
import com.google.android.gms.security.ProviderInstaller;
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener;
import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.interfaces.ClosedInterface;
public class MagicProviderInstaller implements ClosedInterface, ProviderInstallListener {
@Override
public void ProviderInstallerInstallIfNeededAsync() {
ProviderInstaller.installIfNeededAsync(NextcloudTalkApplication.getSharedApplication().getApplicationContext(),
this);
}
@Override
public void onProviderInstalled() {
}
@Override
public void onProviderInstallFailed(int i, Intent intent) {
}
}

View file

@ -0,0 +1,31 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.utils;
import com.nextcloud.talk.interfaces.ClosedInterface;
public class MagicProviderInstaller implements ClosedInterface {
@Override
public void ProviderInstallerInstallIfNeededAsync() {
// does absolutely nothing :)
}
}

View file

@ -62,19 +62,5 @@
android:launchMode="singleTask"
/>
<service
android:name=".services.firebase.MagicFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
android:name=".services.firebase.MagicFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
</application>
</manifest>

View file

@ -21,7 +21,6 @@
package com.nextcloud.talk.application;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
@ -29,7 +28,6 @@ import android.util.Log;
import com.evernote.android.job.JobManager;
import com.evernote.android.job.JobRequest;
import com.google.android.gms.security.ProviderInstaller;
import com.nextcloud.talk.BuildConfig;
import com.nextcloud.talk.dagger.modules.BusModule;
import com.nextcloud.talk.dagger.modules.ContextModule;
@ -70,7 +68,7 @@ import autodagger.AutoInjector;
@Singleton
@AutoInjector(NextcloudTalkApplication.class)
public class NextcloudTalkApplication extends MultiDexApplication implements ProviderInstaller.ProviderInstallListener {
public class NextcloudTalkApplication extends MultiDexApplication {
private static final String TAG = NextcloudTalkApplication.class.getSimpleName();
//region Public variables
@ -113,7 +111,6 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Pro
@Override
public void onCreate() {
super.onCreate();
ProviderInstaller.installIfNeededAsync(this, this);
JobManager.create(this).addJobCreator(new MagicJobCreator());
@ -184,15 +181,5 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Pro
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
public void onProviderInstalled() {
}
@Override
public void onProviderInstallFailed(int i, Intent intent) {
}
//endregion
}

View file

@ -0,0 +1,25 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.interfaces;
public interface ClosedInterface {
void ProviderInstallerInstallIfNeededAsync();
}

View file

@ -1,5 +1,4 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
@ -13,7 +12,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
//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