Fix AppCenter SDK
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package org.joinmastodon.android;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
|
||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||
import org.joinmastodon.android.fragments.HomeFragment;
|
||||
import org.joinmastodon.android.fragments.SplashFragment;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import me.grishka.appkit.FragmentStackActivity;
|
||||
|
||||
@@ -26,5 +29,12 @@ public class MainActivity extends FragmentStackActivity{
|
||||
showFragmentClearingBackStack(fragment);
|
||||
}
|
||||
}
|
||||
|
||||
if(BuildConfig.BUILD_TYPE.startsWith("appcenter")){
|
||||
// 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){}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,5 @@ public class MastodonApp extends Application{
|
||||
ImageCache.setParams(params);
|
||||
NetworkUtils.setUserAgent("MastodonAndroid/"+BuildConfig.VERSION_NAME);
|
||||
context=getApplicationContext();
|
||||
|
||||
// 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, this);
|
||||
}catch(ClassNotFoundException|NoSuchMethodException|IllegalAccessException|InvocationTargetException ignore){}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user