Skip to content

Commit

Permalink
update to androidx, update compilesdk, remove internal filemanager
Browse files Browse the repository at this point in the history
  • Loading branch information
dkunzler committed Nov 1, 2022
1 parent d072a3a commit b23a855
Show file tree
Hide file tree
Showing 55 changed files with 177 additions and 278 deletions.
42 changes: 18 additions & 24 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 33

lintOptions {
disable 'MissingTranslation'
}

signingConfigs {
release {
Expand All @@ -21,7 +18,7 @@ android {

defaultConfig {
applicationId "de.devland.masterpassword"
minSdkVersion 15
minSdkVersion 21
targetSdkVersion 33
versionCode 51
versionName "1.14.0"
Expand All @@ -47,17 +44,14 @@ android {
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
resources {
excludes += ['lib/x86_64/darwin/libscrypt.dylib', 'META-INF/DEPENDENCIES.txt', 'META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/LICENSE', 'META-INF/DEPENDENCIES', 'META-INF/notice.txt', 'META-INF/license.txt', 'META-INF/dependencies.txt', 'META-INF/LGPL2.1']
}
}
lint {
disable 'MissingTranslation'
}
namespace 'de.devland.masterpassword'
}


Expand All @@ -72,27 +66,27 @@ repositories {

dependencies {
// import, export
implementation 'com.nononsenseapps:filepicker:2.5.2'
implementation 'com.google.code.gson:gson:2.8.0' // Apache v2.0
implementation 'com.google.code.gson:gson:2.8.6' // Apache v2.0

// styling
implementation 'com.github.emanzanoaxa:RippleEffect:52ea2a0ab6'
implementation(name:'showcaseview-git', ext:'aar') // Apache v2.0
implementation(name:'recyclerviewfastscroller-release', ext:'aar') // Apache v2.0
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support:design:26.0.1'
implementation 'com.android.support:cardview-v7:26.0.1'
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation('androidx.appcompat:appcompat:1.5.1')
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'

// annotation processors
annotationProcessor 'org.projectlombok:lombok:1.14.0' // MIT
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24' // MIT
annotationProcessor 'de.devland.esperandro:esperandro:2.5.1' // Apache v2.0
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'

// tools
implementation 'com.jakewharton:butterknife:8.8.1' // Apache v2.0
implementation 'com.jakewharton:butterknife:10.2.0' // Apache v2.0
implementation 'com.squareup:otto:1.3.8' // Apache v2.0
implementation files('libs/lombok-api-1.14.0.jar') // MIT
implementation 'com.github.satyan:sugar:1.5' // MIT
implementation 'de.devland.esperandro:esperandro-api:2.5.1' // Apache v2.0
implementation('de.devland.esperandro:esperandro-gson-addon:2.5.1') { // Apache v2.0
Expand Down

This file was deleted.

17 changes: 3 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="de.devland.masterpassword">
>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -58,7 +58,8 @@
</activity>
<activity-alias
android:name="de.devland.masterpassword.ui.AddSiteActivity"
android:targetActivity="de.devland.masterpassword.ui.EditActivity">
android:targetActivity="de.devland.masterpassword.ui.EditActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
Expand All @@ -85,18 +86,6 @@
android:enabled="true"
android:exported="false" />


<activity
android:name="com.nononsenseapps.filepicker.FilePickerActivity"
android:label="@string/app_name"
android:theme="@style/FilePickerTheme" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>


</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;

import com.squareup.otto.Bus;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.devland.masterpassword.base.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;

import com.squareup.otto.Bus;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.devland.masterpassword.base.util;

import android.app.Activity;
import android.support.design.widget.Snackbar;
import com.google.android.material.snackbar.Snackbar;
import android.view.View;

import de.devland.masterpassword.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorRes;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.app.AppCompatDelegate;
import androidx.annotation.ColorRes;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.appcompat.app.AppCompatDelegate;
import android.util.DisplayMetrics;
import android.widget.ImageView;

Expand Down
23 changes: 1 addition & 22 deletions app/src/main/java/de/devland/masterpassword/export/Exporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.lyndir.masterpassword.MPSiteType;
import com.lyndir.masterpassword.model.MPSiteMarshaller;
import com.lyndir.masterpassword.model.MPUser;
import com.nononsenseapps.filepicker.FilePickerActivity;

import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -66,12 +65,7 @@ public void startExportIntent(Activity activity, ExportType type) {
String fileName = dateFormat.format(now) + "_export." + type.getFileExtension();


Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT || defaultPrefs.useLegacyFileManager()) {
intent = getLegacyFolderChooserIntent();
} else {
intent = getStorageAccessFrameworkIntent(fileName);
}
Intent intent = getStorageAccessFrameworkIntent(fileName);

Bundle extraData = new Bundle();
extraData.putSerializable(EXTRA_EXPORT_TYPE, type);
Expand All @@ -82,21 +76,6 @@ public void startExportIntent(Activity activity, ExportType type) {
activity.startActivityForResult(intent, requestCode);
}

private Intent getLegacyFolderChooserIntent() {
Intent getContentIntent = new Intent(activity, FilePickerActivity.class);

getContentIntent.putExtra(FilePickerActivity.EXTRA_ALLOW_MULTIPLE, false);
getContentIntent.putExtra(FilePickerActivity.EXTRA_ALLOW_CREATE_DIR, true);
getContentIntent.putExtra(FilePickerActivity.EXTRA_MODE, FilePickerActivity.MODE_DIR);

// Configure initial directory by specifying a String.
// You could specify a String like "/storage/emulated/0/", but that can
// dangerous. Always use Android's API calls to get paths to the SD-card or
// internal memory.
getContentIntent.putExtra(FilePickerActivity.EXTRA_START_PATH, Environment.getExternalStorageDirectory().getPath());
return getContentIntent;
}

@TargetApi(Build.VERSION_CODES.KITKAT)
private Intent getStorageAccessFrameworkIntent(String fileName) {
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
Expand Down
25 changes: 2 additions & 23 deletions app/src/main/java/de/devland/masterpassword/export/Importer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

import com.google.common.base.Strings;
import com.google.gson.Gson;
Expand All @@ -22,7 +22,6 @@
import com.lyndir.masterpassword.model.MPSite;
import com.lyndir.masterpassword.model.MPSiteUnmarshaller;
import com.lyndir.masterpassword.model.MPUser;
import com.nononsenseapps.filepicker.FilePickerActivity;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down Expand Up @@ -102,12 +101,7 @@ public void startImportIntent(AppCompatActivity activity, ImportType importType)
this.activity = activity;
this.defaultPrefs = Esperandro.getPreferences(DefaultPrefs.class, activity);

Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT || defaultPrefs.useLegacyFileManager()) {
intent = getLegacyFileChooserIntent();
} else {
intent = getStorageAccessFrameworkIntent();
}
Intent intent = getStorageAccessFrameworkIntent();

Bundle extraData = new Bundle();
extraData.putSerializable(EXTRA_IMPORT_TYPE, importType);
Expand All @@ -130,21 +124,6 @@ private Intent getStorageAccessFrameworkIntent() {
return intent;
}

private Intent getLegacyFileChooserIntent() {
Intent getContentIntent = new Intent(activity, FilePickerActivity.class);

getContentIntent.putExtra(FilePickerActivity.EXTRA_ALLOW_MULTIPLE, false);
getContentIntent.putExtra(FilePickerActivity.EXTRA_ALLOW_CREATE_DIR, false);
getContentIntent.putExtra(FilePickerActivity.EXTRA_MODE, FilePickerActivity.MODE_FILE);

// Configure initial directory by specifying a String.
// You could specify a String like "/storage/emulated/0/", but that can
// dangerous. Always use Android's API calls to get paths to the SD-card or
// internal memory.
getContentIntent.putExtra(FilePickerActivity.EXTRA_START_PATH, Environment.getExternalStorageDirectory().getPath());
return getContentIntent;
}

@Override
public void run(int resultCode, Intent intent, Bundle data) {
if (resultCode == Activity.RESULT_OK) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
@Getter
@EqualsAndHashCode
@RequiredArgsConstructor(suppressConstructorProperties = true)
@RequiredArgsConstructor
public class Category implements Comparable<Category> {
private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.core.app.NavUtils;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Pair;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.util.Pair;
import android.support.v7.app.AlertDialog;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.util.Pair;
import androidx.appcompat.app.AlertDialog;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ protected void onPause() {

private PendingIntent getLogoutPendingIntent() {
Intent intent = new Intent(this, ClearPasswordReceiver.class);
return PendingIntent.getBroadcast(this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
return PendingIntent.getBroadcast(this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import androidx.fragment.app.Fragment;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import androidx.fragment.app.Fragment;
import androidx.core.view.MenuItemCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.appcompat.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -64,8 +64,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
builder.setCancelable(false);
builder.setTitle(R.string.title_addCategory);
View dialogView = View.inflate(getActivity(), R.layout.dialog_addcategory, null);
final EditText category = ButterKnife.findById(dialogView,
R.id.editText_category);
final EditText category = dialogView.findViewById(R.id.editText_category);
builder.setView(dialogView);
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Created by David Kunzler on 04/09/14.
*/
@RequiredArgsConstructor(suppressConstructorProperties = true)
@RequiredArgsConstructor
public abstract class DrawerItem {

@Getter
Expand Down
Loading

0 comments on commit b23a855

Please sign in to comment.