Commit 86c1b36c authored by axet's avatar axet 🍄

Merge branch 'smsgate-1.8.13'

parents 943a2590 59cddbe6
Pipeline #14865882 passed with stage
in 20 seconds
......@@ -8,8 +8,8 @@ android {
applicationId "com.github.axet.smsgate"
minSdkVersion 9
targetSdkVersion 23
versionCode 196
versionName "1.8.12"
versionCode 197
versionName "1.8.13"
}
packagingOptions {
exclude 'META-INF/LICENSE'
......@@ -40,7 +40,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.github.axet:android-library:1.17.0' // compile project(':android-library')
compile 'com.github.axet:android-library:1.17.1' // compile project(':android-library')
compile 'com.android.support:design:25.3.1'
compile 'com.intellij:annotations:12.0'
compile 'com.beetstra.jutf7:jutf7:1.0.0'
......@@ -52,7 +52,7 @@ dependencies {
}
compile 'org.apache.james:apache-mime4j-core:0.7.2'
compile 'jp.wasabeef:recyclerview-animators:2.2.3'
// compile project(':android-firebase-fake')
// compile project(':android-firebase-fake') // compile 'com.github.axet:firebase-fake:0.0.4'
compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.google.firebase:firebase-auth:9.8.0'
......
......@@ -33,6 +33,9 @@ import com.github.axet.smsgate.services.DeviceAdmin;
import com.github.axet.smsgate.services.FirebaseService;
import com.github.axet.smsgate.services.NotificationService;
import com.github.axet.smsgate.widgets.ApplicationsPreference;
import com.google.firebase.FirebaseApp;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Logger;
import com.zegoggles.smssync.App;
import com.zegoggles.smssync.mail.Headers;
import com.zegoggles.smssync.preferences.AuthPreferences;
......@@ -117,14 +120,20 @@ public class MainApplication extends App {
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
// firebase.10.2+ has min sdk 14+
if (Build.VERSION.SDK_INT < 14) { // disable firebase API14<
// ComponentName name = new ComponentName(base, "com.google.firebase.provider.FirebaseInitProvider");
// PackageManager pm = getPackageManager();
// pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
} else {
// FirebaseApp.initializeApp(this);
// FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG);
boolean debug = false;
boolean detectedFirebase_10_2 = false;
try {
FirebaseDatabase.class.getMethod("getInstance", String.class); // new method added FirebaseDatabase.getInstance(String url)
detectedFirebase_10_2 = true;
} catch (NoSuchMethodException e) {
}
if (Build.VERSION.SDK_INT < 14 && detectedFirebase_10_2) { // disable firebase for API14< and firebase10.2+
ComponentName name = new ComponentName(base, "com.google.firebase.provider.FirebaseInitProvider");
PackageManager pm = getPackageManager();
pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
} else if (debug) {
FirebaseApp.initializeApp(this); // to make logger call works
FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment