From 6a24d2e54aa639213ffb8bdcb5e9fb3aabc83952 Mon Sep 17 00:00:00 2001 From: Arne Date: Mon, 23 Oct 2023 14:52:30 +0200 Subject: [PATCH] prepare 1.7.6 improve permission requests --- CHANGELOG.md | 8 +++ build.gradle | 12 ++-- git/release/output-metadata.json | 70 +++++++++---------- playstore/release/output-metadata.json | 70 +++++++++---------- .../ui/ConversationFragment.java | 8 +-- 5 files changed, 90 insertions(+), 78 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4137e3b6f..f281ba78a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ### Changelog +#### Version 1.7.6 +* Introduction of Material 3 +* Option to get square avatars back +* Option to show only needed avatars in chats +* Improved layouts and design +* Fixed and improved permissions for Android > 13 +* Reviving internal updater + #### Version 1.1 * presettings correction to avoid connection problems * some text corrections diff --git a/build.gradle b/build.gradle index eb4675637..1e7c76780 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10" classpath "com.diffplug.spotless:spotless-plugin-gradle:6.14.0" classpath 'com.novoda:bintray-release:0.8.0' + //classpath 'com.google.gms:google-services:4.4.0' // TODO: activate for playstore release } } @@ -163,7 +164,7 @@ android { // archivesBaseName += "$versionNameSuffix" // activate for beta versions applicationId "de.monocles.chat" multiDexEnabled true - versionName grgit.describe(always: true) + //versionName grgit.describe(always: true) buildConfigField("String", "LOGTAG", '"monocles chat"') buildConfigField("String", "DOMAIN_LOCK", 'null') buildConfigField("String", "MAGIC_CREATE_DOMAIN", '"monocles.eu"') @@ -204,6 +205,7 @@ android { applicationId "de.monocles.chat" buildConfigField("boolean", "SHOW_MIGRATION_INFO", 'false') resValue "string", "applicationId", applicationId + //apply plugin: 'com.google.gms.google-services' // TODO: activate for playstore release } git { dimension "distribution" @@ -229,7 +231,8 @@ android { minifyEnabled true shrinkResources true runProguard true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { @@ -238,7 +241,8 @@ android { minifyEnabled true shrinkResources true runProguard true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -271,7 +275,7 @@ android { if (baseAbiVersionCode != null) { output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode } else { -// output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + grgit.log(includes: ["HEAD"], excludes: [tags.last()]).size() + output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + grgit.log(includes: ["HEAD"], excludes: [tags.last()]).size() } } diff --git a/git/release/output-metadata.json b/git/release/output-metadata.json index e45ed85dd..bed3f2dd9 100644 --- a/git/release/output-metadata.json +++ b/git/release/output-metadata.json @@ -11,35 +11,9 @@ "type": "UNIVERSAL", "filters": [], "attributes": [], - "versionCode": 138, - "versionName": "4135a60", - "outputFile": "monocles chat-1.7.6-git-universal-release.apk" - }, - { - "type": "ONE_OF_MANY", - "filters": [ - { - "filterType": "ABI", - "value": "x86" - } - ], - "attributes": [], - "versionCode": 13802, - "versionName": "4135a60", - "outputFile": "monocles chat-1.7.6-git-x86-release.apk" - }, - { - "type": "ONE_OF_MANY", - "filters": [ - { - "filterType": "ABI", - "value": "armeabi-v7a" - } - ], - "attributes": [], - "versionCode": 13801, - "versionName": "4135a60", - "outputFile": "monocles chat-1.7.6-git-armeabi-v7a-release.apk" + "versionCode": 16480, + "versionName": "1.7.6.1", + "outputFile": "monocles chat-1.7.6.1-git-universal-release.apk" }, { "type": "ONE_OF_MANY", @@ -50,9 +24,35 @@ } ], "attributes": [], - "versionCode": 13804, - "versionName": "4135a60", - "outputFile": "monocles chat-1.7.6-git-arm64-v8a-release.apk" + "versionCode": 13904, + "versionName": "1.7.6.1", + "outputFile": "monocles chat-1.7.6.1-git-arm64-v8a-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "x86" + } + ], + "attributes": [], + "versionCode": 13902, + "versionName": "1.7.6.1", + "outputFile": "monocles chat-1.7.6.1-git-x86-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "armeabi-v7a" + } + ], + "attributes": [], + "versionCode": 13901, + "versionName": "1.7.6.1", + "outputFile": "monocles chat-1.7.6.1-git-armeabi-v7a-release.apk" }, { "type": "ONE_OF_MANY", @@ -63,9 +63,9 @@ } ], "attributes": [], - "versionCode": 13803, - "versionName": "4135a60", - "outputFile": "monocles chat-1.7.6-git-x86_64-release.apk" + "versionCode": 13903, + "versionName": "1.7.6.1", + "outputFile": "monocles chat-1.7.6.1-git-x86_64-release.apk" } ], "elementType": "File" diff --git a/playstore/release/output-metadata.json b/playstore/release/output-metadata.json index 99887c851..c65c3f64e 100644 --- a/playstore/release/output-metadata.json +++ b/playstore/release/output-metadata.json @@ -11,35 +11,9 @@ "type": "UNIVERSAL", "filters": [], "attributes": [], - "versionCode": 138, - "versionName": "4135a60-playstore", - "outputFile": "monocles chat-1.7.6-playstore-universal-release.apk" - }, - { - "type": "ONE_OF_MANY", - "filters": [ - { - "filterType": "ABI", - "value": "arm64-v8a" - } - ], - "attributes": [], - "versionCode": 13804, - "versionName": "4135a60-playstore", - "outputFile": "monocles chat-1.7.6-playstore-arm64-v8a-release.apk" - }, - { - "type": "ONE_OF_MANY", - "filters": [ - { - "filterType": "ABI", - "value": "armeabi-v7a" - } - ], - "attributes": [], - "versionCode": 13801, - "versionName": "4135a60-playstore", - "outputFile": "monocles chat-1.7.6-playstore-armeabi-v7a-release.apk" + "versionCode": 139, + "versionName": "6086d4a-playstore", + "outputFile": "monocles chat-1.7.6.1-playstore-universal-release.apk" }, { "type": "ONE_OF_MANY", @@ -50,9 +24,35 @@ } ], "attributes": [], - "versionCode": 13803, - "versionName": "4135a60-playstore", - "outputFile": "monocles chat-1.7.6-playstore-x86_64-release.apk" + "versionCode": 13903, + "versionName": "6086d4a-playstore", + "outputFile": "monocles chat-1.7.6.1-playstore-x86_64-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "armeabi-v7a" + } + ], + "attributes": [], + "versionCode": 13901, + "versionName": "6086d4a-playstore", + "outputFile": "monocles chat-1.7.6.1-playstore-armeabi-v7a-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "arm64-v8a" + } + ], + "attributes": [], + "versionCode": 13904, + "versionName": "6086d4a-playstore", + "outputFile": "monocles chat-1.7.6.1-playstore-arm64-v8a-release.apk" }, { "type": "ONE_OF_MANY", @@ -63,9 +63,9 @@ } ], "attributes": [], - "versionCode": 13802, - "versionName": "4135a60-playstore", - "outputFile": "monocles chat-1.7.6-playstore-x86-release.apk" + "versionCode": 13902, + "versionName": "6086d4a-playstore", + "outputFile": "monocles chat-1.7.6.1-playstore-x86-release.apk" } ], "elementType": "File" diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 7c8fa0b08..2d564efb8 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -531,7 +531,7 @@ public class ConversationFragment extends XmppFragment return false; } } - if ((Compatibility.runsThirtyThree() && hasPermissions(REQUEST_ADD_EDITOR_CONTENT)) || (hasPermissions(REQUEST_ADD_EDITOR_CONTENT, Manifest.permission.WRITE_EXTERNAL_STORAGE) && hasPermissions(REQUEST_ADD_EDITOR_CONTENT, Manifest.permission.READ_EXTERNAL_STORAGE))) { + if ((Compatibility.runsThirtyThree()) || (hasPermissions(REQUEST_ADD_EDITOR_CONTENT, Manifest.permission.WRITE_EXTERNAL_STORAGE) && hasPermissions(REQUEST_ADD_EDITOR_CONTENT, Manifest.permission.READ_EXTERNAL_STORAGE))) { attachEditorContentToConversation(inputContentInfo.getContentUri()); } else { mPendingEditorContent = inputContentInfo.getContentUri(); @@ -1355,7 +1355,7 @@ public class ConversationFragment extends XmppFragment private void commitAttachments() { final List attachments = mediaPreviewAdapter.getAttachments(); - if (anyNeedsExternalStoragePermission(attachments) && !hasPermissions(REQUEST_COMMIT_ATTACHMENTS, Manifest.permission.WRITE_EXTERNAL_STORAGE) && Compatibility.runsThirtyThree()) { + if ((anyNeedsExternalStoragePermission(attachments) && !hasPermissions(REQUEST_COMMIT_ATTACHMENTS, Manifest.permission.WRITE_EXTERNAL_STORAGE)) && !Compatibility.runsThirtyThree()) { return; } if (trustKeysIfNeeded(conversation, REQUEST_TRUST_KEYS_ATTACHMENTS)) { @@ -2554,8 +2554,8 @@ public class ConversationFragment extends XmppFragment if (!hasPermissions(attachmentChoice, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) { return; } - } else if (attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_FILE || attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_IMAGE || attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_VIDEO) { - if (!hasPermissions(attachmentChoice, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE) && !Compatibility.runsThirtyThree()) { + } else if ((attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_FILE || attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_IMAGE || attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_VIDEO) && !Compatibility.runsThirtyThree()) { + if (!hasPermissions(attachmentChoice, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE)) { return; } }