Merge branch 'fork' of github.com:sk22/megalodon into fork
This commit is contained in:
commit
f2a0680af0
|
@ -6,7 +6,6 @@ buildscript {
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.3.1'
|
classpath 'com.android.tools.build:gradle:7.3.1'
|
||||||
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -30,16 +29,6 @@ android {
|
||||||
versionNameSuffix '-debug'
|
versionNameSuffix '-debug'
|
||||||
applicationIdSuffix '.debug'
|
applicationIdSuffix '.debug'
|
||||||
}
|
}
|
||||||
appcenterPrivateBeta{
|
|
||||||
initWith release
|
|
||||||
minifyEnabled false
|
|
||||||
shrinkResources false
|
|
||||||
versionNameSuffix "-priv-beta"
|
|
||||||
}
|
|
||||||
appcenterPublicBeta{
|
|
||||||
initWith release
|
|
||||||
versionNameSuffix "-beta"
|
|
||||||
}
|
|
||||||
githubRelease{
|
githubRelease{
|
||||||
initWith release
|
initWith release
|
||||||
}
|
}
|
||||||
|
@ -50,12 +39,6 @@ android {
|
||||||
coreLibraryDesugaringEnabled true
|
coreLibraryDesugaringEnabled true
|
||||||
}
|
}
|
||||||
sourceSets{
|
sourceSets{
|
||||||
appcenterPrivateBeta{
|
|
||||||
setRoot "src/appcenter"
|
|
||||||
}
|
|
||||||
appcenterPublicBeta{
|
|
||||||
setRoot "src/appcenter"
|
|
||||||
}
|
|
||||||
githubRelease{
|
githubRelease{
|
||||||
setRoot "src/github"
|
setRoot "src/github"
|
||||||
}
|
}
|
||||||
|
@ -87,12 +70,6 @@ dependencies {
|
||||||
annotationProcessor 'org.parceler:parceler:1.1.12'
|
annotationProcessor 'org.parceler:parceler:1.1.12'
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
|
||||||
def appCenterSdkVersion = "4.4.2"
|
|
||||||
appcenterPrivateBetaImplementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
|
|
||||||
appcenterPrivateBetaImplementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
|
|
||||||
appcenterPublicBetaImplementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
|
|
||||||
appcenterPublicBetaImplementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
|
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test:core:1.4.1-alpha05'
|
androidTestImplementation 'androidx.test:core:1.4.1-alpha05'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.4-alpha05'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.4-alpha05'
|
||||||
androidTestImplementation 'androidx.test:runner:1.5.0-alpha02'
|
androidTestImplementation 'androidx.test:runner:1.5.0-alpha02'
|
||||||
|
|
|
@ -40,12 +40,6 @@
|
||||||
@com.squareup.otto.Subscribe <methods>;
|
@com.squareup.otto.Subscribe <methods>;
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep class com.microsoft.appcenter.** {
|
|
||||||
*;
|
|
||||||
}
|
|
||||||
|
|
||||||
-keep class org.joinmastodon.android.AppCenterWrapper { *; }
|
|
||||||
|
|
||||||
-keepattributes LineNumberTable
|
-keepattributes LineNumberTable
|
||||||
|
|
||||||
# Parceler library
|
# Parceler library
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package org.joinmastodon.android;
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.microsoft.appcenter.AppCenter;
|
|
||||||
import com.microsoft.appcenter.crashes.Crashes;
|
|
||||||
import com.microsoft.appcenter.distribute.Distribute;
|
|
||||||
import com.microsoft.appcenter.distribute.UpdateTrack;
|
|
||||||
|
|
||||||
public class AppCenterWrapper{
|
|
||||||
private static final String TAG="AppCenterWrapper";
|
|
||||||
|
|
||||||
public static void init(Application app){
|
|
||||||
if(AppCenter.isConfigured())
|
|
||||||
return;
|
|
||||||
Log.i(TAG, "initializing AppCenter SDK, build type is "+BuildConfig.BUILD_TYPE);
|
|
||||||
|
|
||||||
if(BuildConfig.BUILD_TYPE.equals("appcenterPrivateBeta"))
|
|
||||||
Distribute.setUpdateTrack(UpdateTrack.PRIVATE);
|
|
||||||
AppCenter.start(app, BuildConfig.appCenterKey, Distribute.class, Crashes.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +1,8 @@
|
||||||
package org.joinmastodon.android;
|
package org.joinmastodon.android;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Application;
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInstaller;
|
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -24,8 +22,6 @@ import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
||||||
import org.parceler.Parcels;
|
import org.parceler.Parcels;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import me.grishka.appkit.FragmentStackActivity;
|
import me.grishka.appkit.FragmentStackActivity;
|
||||||
|
|
||||||
|
@ -70,12 +66,7 @@ public class MainActivity extends FragmentStackActivity{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(BuildConfig.BUILD_TYPE.startsWith("appcenter")){
|
if(GithubSelfUpdater.needSelfUpdating()){
|
||||||
// Call the appcenter SDK wrapper through reflection because it is only present in beta builds
|
|
||||||
try{
|
|
||||||
Class.forName("org.joinmastodon.android.AppCenterWrapper").getMethod("init", Application.class).invoke(null, getApplication());
|
|
||||||
}catch(ClassNotFoundException|NoSuchMethodException|IllegalAccessException|InvocationTargetException ignore){}
|
|
||||||
}else if(GithubSelfUpdater.needSelfUpdating()){
|
|
||||||
GithubSelfUpdater.getInstance().maybeCheckForUpdates();
|
GithubSelfUpdater.getInstance().maybeCheckForUpdates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import android.content.Context;
|
||||||
|
|
||||||
import org.joinmastodon.android.api.PushSubscriptionManager;
|
import org.joinmastodon.android.api.PushSubscriptionManager;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
import me.grishka.appkit.imageloader.ImageCache;
|
import me.grishka.appkit.imageloader.ImageCache;
|
||||||
import me.grishka.appkit.utils.NetworkUtils;
|
import me.grishka.appkit.utils.NetworkUtils;
|
||||||
import me.grishka.appkit.utils.V;
|
import me.grishka.appkit.utils.V;
|
||||||
|
|
Loading…
Reference in New Issue