From e58dec35c0bcd7c7eff5e3b83f61ede22548db34 Mon Sep 17 00:00:00 2001 From: Alexander Bakker Date: Sat, 14 Sep 2019 15:20:02 +0200 Subject: [PATCH 1/2] Target API 29, update gradle and update the dependencies This also fixes an issue with the use of the Iconics library where it was initialized twice. I also removed the dependency to [AndroidX Preference eXtended](https://github.com/takisoft/preferencex-android), as there don't seem to be any issues with using the vanilla AndroidX preference library anymore. --- .travis.yml | 4 +-- app/build.gradle | 26 +++++++++---------- .../aegis/AegisApplication.java | 5 ++++ .../aegis/ui/AboutActivity.java | 11 +++----- .../aegis/ui/MainActivity.java | 7 ++--- .../aegis/ui/PreferencesFragment.java | 4 +-- app/src/main/res/values-zh/strings.xml | 2 +- app/src/main/res/values/styles.xml | 5 ---- build.gradle | 2 +- 9 files changed, 28 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index a29792ee..af6a0c46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: android android: components: - - android-28 - - build-tools-28.0.3 + - android-29 + - build-tools-29.0.2 script: - ./gradlew build test diff --git a/app/build.gradle b/app/build.gradle index aba2529a..af11b092 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,12 +13,12 @@ def getGitHash = { -> return getCmdOutput(["git", "rev-parse", "--short", "HEAD" def getGitBranch = { -> return getCmdOutput(["git", "rev-parse", "--abbrev-ref", "HEAD"]) } android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "com.beemdevelopment.aegis" minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 21 versionName "1.0.2" buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\"" @@ -63,23 +63,21 @@ android { } dependencies { - def libsuVersion = '2.3.2' + def libsuVersion = '2.5.1' implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.preference:preference:1.0.0' - implementation 'com.takisoft.preferencex:preferencex:1.0.0' + implementation 'androidx.preference:preference:1.1.0' implementation 'com.google.android.material:material:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.getbase:floatingactionbutton:1.10.1' - implementation 'com.github.apl-devs:appintro:v4.2.2' + implementation 'com.github.apl-devs:appintro:5.1.0' implementation 'com.github.avito-tech:krop:0.44' implementation 'com.madgag.spongycastle:core:1.58.0.0' - implementation 'com.mattprecious.swirl:swirl:1.0.0' - implementation 'de.hdodenhof:circleimageview:2.2.0' - implementation 'me.dm7.barcodescanner:zxing:1.9' + implementation 'com.mattprecious.swirl:swirl:1.2.0' + implementation 'de.hdodenhof:circleimageview:3.0.1' + implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation "com.github.topjohnwu.libsu:core:${libsuVersion}" implementation "com.github.topjohnwu.libsu:io:${libsuVersion}" implementation 'com.github.bumptech.glide:annotations:4.9.0' @@ -92,6 +90,6 @@ dependencies { } annotationProcessor 'androidx.annotation:annotation:1.1.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2' -} \ No newline at end of file + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2' +} diff --git a/app/src/main/java/com/beemdevelopment/aegis/AegisApplication.java b/app/src/main/java/com/beemdevelopment/aegis/AegisApplication.java index 351f9d9a..37bed29d 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/AegisApplication.java +++ b/app/src/main/java/com/beemdevelopment/aegis/AegisApplication.java @@ -15,6 +15,8 @@ import android.os.Build; import com.beemdevelopment.aegis.db.DatabaseManager; import com.beemdevelopment.aegis.services.NotificationService; import com.beemdevelopment.aegis.ui.MainActivity; +import com.mikepenz.iconics.Iconics; +import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic; import java.util.ArrayList; import java.util.Collections; @@ -37,6 +39,9 @@ public class AegisApplication extends Application { _prefs = new Preferences(this); _lockListeners = new ArrayList<>(); + Iconics.init(this); + Iconics.registerFont(new MaterialDesignIconic()); + // listen for SCREEN_OFF events ScreenOffReceiver receiver = new ScreenOffReceiver(); IntentFilter intentFilter = new IntentFilter(); diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java index 4966aa4e..1bf34e20 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java @@ -10,17 +10,15 @@ import android.view.View; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.StringRes; +import androidx.core.view.LayoutInflaterCompat; + import com.beemdevelopment.aegis.BuildConfig; import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.Theme; import com.beemdevelopment.aegis.helpers.ThemeHelper; import com.beemdevelopment.aegis.ui.glide.GlideLicense; -import com.mikepenz.iconics.Iconics; import com.mikepenz.iconics.context.IconicsLayoutInflater2; -import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic; - -import androidx.annotation.StringRes; -import androidx.core.view.LayoutInflaterCompat; import de.psdev.licensesdialog.LicenseResolver; import de.psdev.licensesdialog.LicensesDialog; @@ -42,9 +40,6 @@ public class AboutActivity extends AegisActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); - Iconics.init(getApplicationContext()); - Iconics.registerFont(new MaterialDesignIconic()); - View btnLicenses = findViewById(R.id.btn_licenses); btnLicenses.setOnClickListener(v -> showLicenseDialog()); diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java index 5cfe3da9..be8aa65d 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java @@ -192,6 +192,8 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene case CODE_SCAN_IMAGE: onScanImageResult(resultCode, data); } + + super.onActivityResult(requestCode, resultCode, data); } @Override @@ -505,11 +507,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene _entryListView.removeEntry(oldEntry); } - @Override - protected void attachBaseContext(Context newBase) { - super.attachBaseContext(IconicsContextWrapper.wrap(newBase)); - } - @Override public boolean onCreateOptionsMenu(Menu menu) { _menu = menu; diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java index 87013bf8..c679fa87 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java @@ -40,7 +40,6 @@ import com.beemdevelopment.aegis.services.NotificationService; import com.beemdevelopment.aegis.ui.models.ImportEntry; import com.beemdevelopment.aegis.ui.preferences.SwitchPreference; import com.beemdevelopment.aegis.util.UUIDMap; -import com.takisoft.preferencex.PreferenceFragmentCompat; import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.io.SuFile; import com.topjohnwu.superuser.io.SuFileInputStream; @@ -59,6 +58,7 @@ import javax.crypto.Cipher; import androidx.appcompat.app.AlertDialog; import androidx.preference.Preference; +import androidx.preference.PreferenceFragmentCompat; public class PreferencesFragment extends PreferenceFragmentCompat { // activity request codes @@ -88,7 +88,7 @@ public class PreferencesFragment extends PreferenceFragmentCompat { private Preference _groupsPreference; @Override - public void onCreatePreferencesFix(Bundle savedInstanceState, String rootKey) { + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.preferences); AegisApplication app = (AegisApplication) getActivity().getApplication(); diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index bd25a558..40225b9c 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -116,7 +116,7 @@ 试图读取文件时出错 错误:应用未安装 错误:无法获得 root 权限 - 导入 %!d 项条目 + 导入 %d 项条目 读取 %!d 项条目。 %!d 项错误。 导入时发生一个或多个错误 试图导出数据库时出错 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 8a06c9bc..78525f1c 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -146,11 +146,6 @@ #FFFFFF - -