Commit 56747f4c authored by axet's avatar axet 🍄

Merge branch 'smsgate-1.8.14'

parents 416b9e3c 7b1fbb5a
Pipeline #14876209 passed with stage
in 26 seconds
......@@ -8,8 +8,8 @@ android {
applicationId "com.github.axet.smsgate"
minSdkVersion 9
targetSdkVersion 23
versionCode 197
versionName "1.8.13"
versionCode 198
versionName "1.8.14"
}
packagingOptions {
exclude 'META-INF/LICENSE'
......
......@@ -33,9 +33,7 @@ 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;
......@@ -98,6 +96,8 @@ public class MainApplication extends App {
NotificationService.NotificationsMap<NotificationInfo> lastId = new NotificationService.NotificationsMap<>(handler);
public static boolean firebaseEnabled(Context context) {
if (Build.VERSION.SDK_INT < 11) // WebInterface requires P2P encryption API11+ EC KeyFactory
return false;
ComponentName name = new ComponentName(context, "com.google.firebase.provider.FirebaseInitProvider");
PackageManager pm = context.getPackageManager();
if (pm.getComponentEnabledSetting(name) == PackageManager.COMPONENT_ENABLED_STATE_DISABLED)
......@@ -120,7 +120,6 @@ public class MainApplication extends App {
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
boolean debug = false;
boolean detectedFirebase_10_2 = false;
try {
FirebaseDatabase.class.getMethod("getInstance", String.class); // new method added FirebaseDatabase.getInstance(String url)
......@@ -131,9 +130,6 @@ public class MainApplication extends App {
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);
}
}
......@@ -142,7 +138,7 @@ public class MainApplication extends App {
super.onCreate();
if (Build.VERSION.SDK_INT >= 11) {
keyPair = new Bitcoin();
keyPair = new Bitcoin(); // min API11+ EC KeyFactory
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
String sec = prefs.getString(SEC, "");
String pub = prefs.getString(PUB, "");
......
......@@ -141,7 +141,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements MainAc
preferences = new Preferences(context);
addPreferencesFromResource(R.xml.settings);
if (Build.VERSION.SDK_INT < 11 || !MainApplication.firebaseEnabled(context)) { // Bitcoin need 11+ EC KeyFactory
if (!MainApplication.firebaseEnabled(context)) {
Preference pref = findPreference("firebase_settings");
pref.setVisible(false);
Preference adm = findPreference(MainApplication.ADMIN);
......
......@@ -610,7 +610,7 @@ public class SMSGateFragment extends PreferenceFragmentCompat implements MainAct
CheckBoxPreference connected = (CheckBoxPreference) findPreference(MainApplication.FIREBASE);
if (Build.VERSION.SDK_INT < 11 || !MainApplication.firebaseEnabled(getContext())) { // Bitcoin need 11+ EC KeyFactory
if (!MainApplication.firebaseEnabled(getContext())) {
connected.setVisible(false);
}
......
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