Skip to content

Commit

Permalink
See RN5.1.0 (20240720)
Browse files Browse the repository at this point in the history
- Built target for Android 14.0 (UpsideDownCake) or API-34
- Set app minSdk to API-24; diminish support in android libraries for < API-24
- Add new permissions required for API-34 and change UI to support.
- Drop com.jakewharton:butterknife-compiler:10.2.3 dependency (jdk-15 max restriction);
  use android View binding class instead.
- Upgrade to OpenPGP-API version 12
- Fix OpenPGP Application Provider availability check in Global Settings | Cryptography (queries settings)
- Implement support of cleartextTraffic content loading in XMWebViewClient#shouldInterceptRequest()
- Make UpdateServiceImpl() shows both version/code for installed and latest available debug apk.
- Fix ContextCompat.registerReceiver flag setting: If this receiver is listening for broadcasts sent from the system
  or from other apps—even other apps that you own: then use RECEIVER_EXPORTED flag. If instead this receiver is listening
  only for broadcasts sent by your app, use the RECEIVER_NOT_EXPORTED flag; and broadcaster must setPackage(getPackageName()).
  * Use RECEIVER_EXPORTED for ActivityListener, UpdateServiceImpl, AttachmentTempFileProvider, and DecryptedFileProvider
  * Use RECEIVER_NOT_EXPORTED and required to setPackage(getPackageName()) in sendBroadcast for:
   DeviceIdleManager, UnreadWidgetProvider, XryptoMail, XryptoMailRemoteControl, BootReceiver, CoreReceiver, and MessageListWidgetProvider
- Update gradle build environment to with gradle 8.0.0 and above:
  a. Use Android Studio Koala | 2024.1.1
  b. distributionUrl=https://services.gradle.org/distributions/gradle-8.2-bin.zip; not compatible with 8.5.
  c. classpath 'com.android.tools.build:gradle:8.2.2'
  d. Add to buildFeatures: dataBinding, viewBinding, and buildConfig to true; aidl true for oepnpgp
  e. Add namespace to xryptomail and openpgp modules
  f. Must add: tasks.withType(KotlinCompile.class){ kotlinOptions { jvmTarget = "1.8" } }
     to resolve compileDebugJavaWithJavac and kaptGenerateStubsDebugKotlin with incompatible Java version.
  g. Update gradle.properties to include:
     # Gradle >=8.0.0: Library project resource identifiers are not constant static final ints, just static ints.
     android.nonFinalResIds=false
     # Gradle >=8.0.0: Allow transitive resource identifiers use in aTalk.
     android.nonTransitiveRClass=false
  • Loading branch information
cmeng-git committed Jul 20, 2024
1 parent 03f4178 commit f880d43
Show file tree
Hide file tree
Showing 120 changed files with 1,883 additions and 1,973 deletions.
34 changes: 33 additions & 1 deletion XryptoMail/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
XryptoMail Release Notes:
=============================
Version: 5.1.0
Upload Date: 07/20/2024
- Built target for Android 14.0 (UpsideDownCake) or API-34
- Set app minSdk to API-24; diminish support in android libraries for < API-24
- Add new permissions required for API-34 and change UI to support.
- Drop com.jakewharton:butterknife-compiler:10.2.3 dependency (jdk-15 max restriction);
use android View binding class instead.
- Upgrade to OpenPGP-API version 12
- Fix OpenPGP Application Provider availability check in Global Settings | Cryptography (queries settings)
- Implement support of cleartextTraffic content loading in XMWebViewClient#shouldInterceptRequest()
- Make UpdateServiceImpl() shows both version/code for installed and latest available debug apk.
- Fix ContextCompat.registerReceiver flag setting: If this receiver is listening for broadcasts sent from the system
or from other apps—even other apps that you own: then use RECEIVER_EXPORTED flag. If instead this receiver is listening
only for broadcasts sent by your app, use the RECEIVER_NOT_EXPORTED flag; and broadcaster must setPackage(getPackageName()).
* Use RECEIVER_EXPORTED for ActivityListener, UpdateServiceImpl, AttachmentTempFileProvider, and DecryptedFileProvider
* Use RECEIVER_NOT_EXPORTED and required to setPackage(getPackageName()) in sendBroadcast for:
DeviceIdleManager, UnreadWidgetProvider, XryptoMail, XryptoMailRemoteControl, BootReceiver, CoreReceiver, and MessageListWidgetProvider
- Update gradle build environment to with gradle 8.0.0 and above:
a. Use Android Studio Koala | 2024.1.1
b. distributionUrl=https://services.gradle.org/distributions/gradle-8.2-bin.zip; not compatible with 8.5.
c. classpath 'com.android.tools.build:gradle:8.2.2'
d. Add to buildFeatures: dataBinding, viewBinding, and buildConfig to true; aidl true for oepnpgp
e. Add namespace to xryptomail and openpgp modules
f. Must add: tasks.withType(KotlinCompile.class){ kotlinOptions { jvmTarget = "1.8" } }
to resolve compileDebugJavaWithJavac and kaptGenerateStubsDebugKotlin with incompatible Java version.
g. Update gradle.properties to include:
# Gradle >=8.0.0: Library project resource identifiers are not constant static final ints, just static ints.
android.nonFinalResIds=false
# Gradle >=8.0.0: Allow transitive resource identifiers use in aTalk.
android.nonTransitiveRClass=false

=============================
Version: 5.0.5
Upload Date: 08/19/2023
Expand Down Expand Up @@ -191,7 +223,7 @@ Improvements:
- Fixed crash when encountering invalid email addresses
- Fixed display errors of plain text messages
- Add new languages support and updated translations
- Upgrade to OpenPGP-API version 12
- Upgrade to OpenPGP-API version 11
- Add mail new capabilities: CONDSTORE and UIDPLUS
- Temporary commented out in HtmlConverter.java
text = ASCII_PATTERN_FOR_HR.matcher(text).replaceAll("<hr>");
Expand Down
178 changes: 101 additions & 77 deletions XryptoMail/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

// if (rootProject.testCoverage) {
// apply plugin: 'jacoco'
Expand All @@ -11,95 +14,53 @@ repositories {
}

//noinspection GroovyAssignabilityCheck
configurations.all {
configurations.implementation {
resolutionStrategy {
force "com.android.support:support-annotations:1.1.0"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')

implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.annotation:annotation:1.6.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "com.google.android.material:material:1.9.0"

implementation project(':plugins:openpgp-api-lib:openpgp-api')
// implementation 'org.sufficientlysecure:openpgp-api:11.0'

implementation 'commons-io:commons-io:2.11.0'
implementation 'com.beetstra.jutf7:jutf7:1.0.0'
implementation 'com.github.amlcurran.showcaseview:library:5.4.1'

// source not compatible with v4.x.x
implementation 'com.github.bumptech.glide:glide:3.8.0'

implementation 'com.jakewharton:butterknife:10.2.3'
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.9.8'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'

implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.karumi:dexter:6.2.3'

// DO NOT change; else cannot refresh mailbox
// ImapConnection.open().enableCompressionIfRequested() does not work with jzlib version 1.1.3
implementation 'com.jcraft:jzlib:1.0.7'

implementation 'com.squareup.moshi:moshi:1.13.0'
implementation 'com.squareup.okio:okio:3.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.splitwise:tokenautocomplete:2.0.8'

implementation 'de.cketti.library.changelog:ckchangelog:1.2.2'
implementation 'de.cketti.safecontentresolver:safe-content-resolver-v14:1.0.0'
implementation 'com.getkeepsafe.relinker:relinker:1.4.4'
implementation 'dnsjava:dnsjava:3.0.2'
// Resolve compileDebugJavaWithJavac and kaptGenerateStubsDebugKotlin with incompatible Java version.
tasks.withType(KotlinCompile.class){
kotlinOptions {
jvmTarget = "1.8"
}
}
}

implementation 'me.zhanghai.android.materialprogressbar:library:1.4.1'
implementation "me.leolin:ShortcutBadger:1.1.22@aar"
implementation 'net.jcip:jcip-annotations:1.0'
android {
compileSdk rootProject.compileSdk
// buildToolsVersion rootProject.buildTools

defaultConfig {
namespace 'org.atalk.xryptomail'
applicationId "org.atalk.xryptomail"
testApplicationId "org.atalk.xryptomail.tests"

implementation 'org.apache.james:apache-mime4j-core:0.8.7'
implementation 'org.apache.james:apache-mime4j-dom:0.8.6'
compileOnly "org.apache.httpcomponents:httpclient:4.5.6"
implementation 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
implementation 'org.apache.httpcomponents:httpcore:4.4.16'
versionCode 19101
versionName '5.1.0'

// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21"
implementation 'org.jsoup:jsoup:1.15.1'
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk

// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// testImplementation "com.google.truth:truth:${truthVersion}"
// testImplementation "junit:junit:${junitVersion}"
// testImplementation "org.mockito:mockito-core:${mockitoVersion}"
// testImplementation "org.jdom:jdom2:2.0.6"
// testImplementation "org.robolectric:robolectric:3.7.1"
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}

compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion

defaultConfig {
applicationId "org.atalk.xryptomail"
testApplicationId "org.atalk.xryptomail.tests"

versionCode 19050
versionName '5.0.5'
buildFeatures {
dataBinding true

minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.compileSdkVersion
multiDexEnabled true
// for view binding to replace butterKnife in PermissionsActivity:
viewBinding true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// Required for gradle version >= 8.0.0 and above
buildConfig true
}

buildTypes {
Expand Down Expand Up @@ -170,19 +131,82 @@ android {
}

packagingOptions {
exclude 'mozilla/public-suffix-list.txt'
exclude 'LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/README'
exclude 'LICENSE.txt'
exclude 'mozilla/public-suffix-list.txt'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')

implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.annotation:annotation:1.8.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "com.google.android.material:material:1.12.0"

implementation project(':plugins:openpgp-api-lib:openpgp-api')
// implementation 'org.sufficientlysecure:openpgp-api:11.0'

implementation 'commons-io:commons-io:2.16.0'
implementation 'com.beetstra.jutf7:jutf7:1.0.0'
implementation 'com.github.amlcurran.showcaseview:library:5.4.1'

// ContactPictureLoader source is not compatible with v4.x.x
implementation 'com.github.bumptech.glide:glide:3.8.0'

implementation 'com.jakewharton:butterknife:10.2.3'
implementation 'com.google.firebase:firebase-crashlytics-buildtools:3.0.2'

implementation('com.jakewharton.timber:timber:5.0.1') {
transitive = false
}
implementation 'com.karumi:dexter:6.2.3'

// DO NOT change; else cannot refresh mailbox
// ImapConnection.open().enableCompressionIfRequested() does not work with jzlib version 1.1.3
implementation 'com.jcraft:jzlib:1.0.7'

implementation 'com.squareup.moshi:moshi:1.13.0'
implementation 'com.squareup.okio:okio:3.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.splitwise:tokenautocomplete:2.0.8'

implementation 'de.cketti.library.changelog:ckchangelog:1.2.2'
implementation 'de.cketti.safecontentresolver:safe-content-resolver-v14:1.0.0'
implementation 'com.getkeepsafe.relinker:relinker:1.4.4'
implementation 'dnsjava:dnsjava:3.0.2'

implementation 'me.zhanghai.android.materialprogressbar:library:1.4.1'
implementation "me.leolin:ShortcutBadger:1.1.22@aar"
implementation 'net.jcip:jcip-annotations:1.0'


implementation 'org.apache.james:apache-mime4j-core:0.8.7'
implementation 'org.apache.james:apache-mime4j-dom:0.8.6'
compileOnly "org.apache.httpcomponents:httpclient:4.5.6"
implementation 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
implementation 'org.apache.httpcomponents:httpcore:4.4.16'

// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21"
implementation 'org.jsoup:jsoup:1.15.1'

// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// testImplementation "com.google.truth:truth:${truthVersion}"
// testImplementation "junit:junit:${junitVersion}"
// testImplementation "org.mockito:mockito-core:${mockitoVersion}"
// testImplementation "org.jdom:jdom2:2.0.6"
// testImplementation "org.robolectric:robolectric:3.7.1"
}

task updateVersionFile(type: Copy) {
description '<!-- Generate versionupdate.properties file -->'
description '<!-- Generate version.properties file -->'

def versionName = android.defaultConfig.versionName
def versionCode = android.defaultConfig.versionCode
Expand All @@ -196,11 +220,11 @@ task updateVersionFile(type: Copy) {
outputs.upToDateWhen {
false
}
from('./versionupdate.properties') {
from('lib/version.properties') {
// Substitute property tokens in files
expand(DATE: date, BUILD_VERSION: versionName, BUILD_VERSION_CODE: versionCode)
}
into 'build/outputs/apk'
into 'release'
}

build.dependsOn 'updateVersionFile'
Expand Down
4 changes: 4 additions & 0 deletions XryptoMail/lib/version.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Date: ${DATE}

last_version=${BUILD_VERSION}
last_version_code=${BUILD_VERSION_CODE}
19 changes: 19 additions & 0 deletions XryptoMail/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@
-dontwarn org.jaxen.**
-dontwarn sun.net.spi.nameservice.**

# Add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn android.os.SystemProperties
-dontwarn com.sun.jna.Library
-dontwarn com.sun.jna.Memory
-dontwarn com.sun.jna.Native
-dontwarn com.sun.jna.Pointer
-dontwarn com.sun.jna.Structure$ByReference
-dontwarn com.sun.jna.Structure$FieldOrder
-dontwarn com.sun.jna.Structure
-dontwarn com.sun.jna.WString
-dontwarn com.sun.jna.platform.win32.Win32Exception
-dontwarn com.sun.jna.ptr.IntByReference
-dontwarn com.sun.jna.win32.W32APIOptions
-dontwarn javax.naming.NamingException
-dontwarn javax.naming.directory.DirContext
-dontwarn javax.naming.directory.InitialDirContext
-dontwarn org.slf4j.impl.StaticLoggerBinder

-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
# -keep http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass

Expand Down
6 changes: 3 additions & 3 deletions XryptoMail/release/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Date: Wed Jul 17 10:53:07 SGT 2024
Date: Sat Jul 20 08:47:24 SGT 2024

last_version=5.0.5
last_version_code=19050
last_version=5.1.0
last_version_code=19101
Loading

0 comments on commit f880d43

Please sign in to comment.