[Frontport] Fix Acra and workmanager, update gradle (#856)

Move acra to application

[Frontport] Fix Acra and workmanager errors, update gradle

Fix ACRA and workmanager errors

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/856
Reviewed-by: opyale <opyale@noreply.codeberg.org>
Co-Authored-By: M M Arif <mmarif@noreply.codeberg.org>
Co-Committed-By: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
M M Arif 2021-03-30 16:31:39 +02:00
parent 3e5fca4f52
commit 7c6247782b
4 changed files with 20 additions and 18 deletions

View File

@ -6,8 +6,8 @@ android {
applicationId "org.mian.gitnex" applicationId "org.mian.gitnex"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 30
versionCode 350 versionCode 395
versionName "3.5.0" versionName "4.0.0-dev"
multiDexEnabled true multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
@ -54,13 +54,13 @@ configurations {
} }
dependencies { dependencies {
def lifecycle_version = '2.3.0' def lifecycle_version = '2.3.1'
def markwon_version = '4.6.2' def markwon_version = '4.6.2'
def work_version = "2.5.0" def work_version = "2.5.0"
def acra = "5.7.0" def acra = "5.7.0"
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.3.0-beta01' implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
implementation 'com.google.android.material:material:1.3.0' implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "androidx.legacy:legacy-support-v4:1.0.0" implementation "androidx.legacy:legacy-support-v4:1.0.0"

View File

@ -7,6 +7,7 @@ import org.mian.gitnex.R;
import org.mian.gitnex.helpers.AppUtil; import org.mian.gitnex.helpers.AppUtil;
import org.mian.gitnex.helpers.TimeHelper; import org.mian.gitnex.helpers.TimeHelper;
import org.mian.gitnex.helpers.TinyDB; import org.mian.gitnex.helpers.TinyDB;
import org.mian.gitnex.notifications.Notifications;
/** /**
* Author M M Arif * Author M M Arif
@ -77,6 +78,8 @@ public abstract class BaseActivity extends AppCompatActivity {
} }
AppUtil.setAppLocale(getResources(), tinyDB.getString("locale")); AppUtil.setAppLocale(getResources(), tinyDB.getString("locale"));
Notifications.startWorker(appCtx);
} }
} }

View File

@ -71,21 +71,26 @@ public class MainApplication extends Application {
} }
Notifications.createChannels(appCtx);
}
@Override
protected void attachBaseContext(Context context) {
super.attachBaseContext(context);
tinyDB = TinyDB.getInstance(context);
if(tinyDB.getBoolean("crashReportingEnabled")) { if(tinyDB.getBoolean("crashReportingEnabled")) {
CoreConfigurationBuilder ACRABuilder = new CoreConfigurationBuilder(this); CoreConfigurationBuilder ACRABuilder = new CoreConfigurationBuilder(this);
ACRABuilder.setBuildConfigClass(BuildConfig.class).setReportFormat(StringFormat.KEY_VALUE_LIST); ACRABuilder.setBuildConfigClass(BuildConfig.class).setReportFormat(StringFormat.KEY_VALUE_LIST);
ACRABuilder.getPluginConfigurationBuilder(MailSenderConfigurationBuilder.class).setReportAsFile(true).setMailTo(getResources().getString(R.string.appEmail)).setSubject(getResources().getString(R.string.crashReportEmailSubject, AppUtil.getAppBuildNo(getApplicationContext()))).setEnabled(true); ACRABuilder.getPluginConfigurationBuilder(MailSenderConfigurationBuilder.class).setReportAsFile(true).setMailTo(getResources().getString(R.string.appEmail)).setSubject(getResources().getString(R.string.crashReportEmailSubject, AppUtil
.getAppBuildNo(context))).setEnabled(true);
ACRABuilder.getPluginConfigurationBuilder(LimiterConfigurationBuilder.class).setEnabled(true); ACRABuilder.getPluginConfigurationBuilder(LimiterConfigurationBuilder.class).setEnabled(true);
ACRA.init(this, ACRABuilder); ACRA.init(this, ACRABuilder);
} }
Notifications.createChannels(appCtx);
Notifications.startWorker(appCtx);
} }
private void setDefaults() { private void setDefaults() {

View File

@ -1,14 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<changelog> <changelog>
<release version="3.5.0" versioncode="350"> <release version="4.0.0-dev" versioncode="395">
<change>New: Render emoji in issue/pr titles, commit message and markdown files</change> <change>Under development</change>
<change>New: Cron tasks (Admin only)</change>
<change>New: Biometric support to unlock the app</change>
<change>New: Switch to saved instance when coming from email/links</change>
<change>New: Copy user login id to clipboard</change>
<change>New: Progress notification for downloading files</change>
<change>New: Rewrite file viewer in native code to move away from traditional js to load files faster</change>
</release> </release>
</changelog> </changelog>