From c3c17083ba5624c7b26a4435df99e3153248d97c Mon Sep 17 00:00:00 2001 From: Florianisme Date: Sun, 15 Jan 2023 21:29:02 +0100 Subject: [PATCH 1/5] Upgrade Gradle, plugins and dependencies --- app/build.gradle | 4 ++-- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 24d6805..cfdd213 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,14 +12,14 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.navigation:navigation-fragment:2.5.3' implementation 'androidx.navigation:navigation-ui:2.5.3' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - def room_version = "2.4.3" + def room_version = "2.5.0" implementation "androidx.room:room-runtime:$room_version" annotationProcessor "androidx.room:room-compiler:$room_version" diff --git a/build.gradle b/build.gradle index 063716c..7f4fd88 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:7.4.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0e2ce2e..32d3669 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Dec 23 12:21:22 CET 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From fe09bbddee3c3b035cc7e664658534bded49f4c0 Mon Sep 17 00:00:00 2001 From: Florianisme Date: Fri, 27 Jan 2023 19:51:41 +0100 Subject: [PATCH 2/5] Add aliases to stay compatible with older Backup exports --- .../persistence/entities/Device.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/src/main/java/de/florianisme/wakeonlan/persistence/entities/Device.java b/app/src/main/java/de/florianisme/wakeonlan/persistence/entities/Device.java index 2d046ff..cba063b 100644 --- a/app/src/main/java/de/florianisme/wakeonlan/persistence/entities/Device.java +++ b/app/src/main/java/de/florianisme/wakeonlan/persistence/entities/Device.java @@ -5,28 +5,47 @@ import androidx.room.Ignore; import androidx.room.PrimaryKey; +import com.fasterxml.jackson.annotation.JsonAlias; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + @Entity(tableName = "Devices") +@JsonIgnoreProperties(ignoreUnknown = true) public class Device { @PrimaryKey(autoGenerate = true) + @JsonProperty("id") + @JsonAlias("a") public int id; @ColumnInfo(name = "name") + @JsonProperty("name") + @JsonAlias("b") public String name; @ColumnInfo(name = "mac_address") + @JsonProperty("mac_address") + @JsonAlias("c") public String macAddress; @ColumnInfo(name = "broadcast_address") + @JsonProperty("broadcast_address") + @JsonAlias("d") public String broadcastAddress; @ColumnInfo(name = "port") + @JsonProperty("port") + @JsonAlias("e") public int port; @ColumnInfo(name = "status_ip") + @JsonProperty("status_ip") + @JsonAlias("f") public String statusIp; @ColumnInfo(name = "secure_on_password") + @JsonProperty("secure_on_password") + @JsonAlias("g") public String secureOnPassword; @Ignore From 1ac9317aec3b2d9d4382178d78cc5530672ba50c Mon Sep 17 00:00:00 2001 From: Florianisme Date: Fri, 27 Jan 2023 19:52:40 +0100 Subject: [PATCH 3/5] Disable Proguard to fix Wear -> Mobile Device communication --- Jenkinsfile | 8 +++----- app/proguard-rules.pro | 30 ------------------------------ shared-build.gradle | 3 --- wear/proguard-rules.pro | 30 ------------------------------ 4 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 app/proguard-rules.pro delete mode 100644 wear/proguard-rules.pro diff --git a/Jenkinsfile b/Jenkinsfile index 169becb..32f2c1c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,10 +16,8 @@ pipeline { steps { archiveArtifacts artifacts: 'app/build/outputs/bundle/release/app-release.aab', followSymlinks: false, onlyIfSuccessful: true archiveArtifacts artifacts: 'app/build/outputs/apk/release/app-release.apk', followSymlinks: false, onlyIfSuccessful: true - archiveArtifacts artifacts: 'app/build/outputs/mapping/release/mapping.txt', followSymlinks: false, onlyIfSuccessful: true archiveArtifacts artifacts: 'wear/build/outputs/bundle/release/wear-release.aab', followSymlinks: false, onlyIfSuccessful: true archiveArtifacts artifacts: 'wear/build/outputs/apk/release/wear-release.apk', followSymlinks: false, onlyIfSuccessful: true - archiveArtifacts artifacts: 'wear/build/outputs/mapping/release/mapping.txt', followSymlinks: false, onlyIfSuccessful: true } } stage('Publish to Play Store') { @@ -27,14 +25,14 @@ pipeline { script { if (env.BRANCH_NAME == 'master') { echo 'Publishing Bundle to Beta channel (Not allowed to fail)' - androidApkUpload deobfuscationFilesPattern: 'app/build/outputs/mapping/release/mapping.txt,wear/build/outputs/mapping/release/mapping.txt', filesPattern: 'app/build/outputs/bundle/release/app-release.aab,wear/build/outputs/bundle/release/wear-release.aab', googleCredentialsId: 'Florianisme', rolloutPercentage: '20', trackName: 'beta' + androidApkUpload filesPattern: 'app/build/outputs/bundle/release/app-release.aab,wear/build/outputs/bundle/release/wear-release.aab', googleCredentialsId: 'Florianisme', rolloutPercentage: '20', trackName: 'beta' } else if (env.BRANCH_NAME == 'release') { echo 'Publishing Bundle to Internal channel (Not allowed to fail)' - androidApkUpload deobfuscationFilesPattern: 'app/build/outputs/mapping/release/mapping.txt,wear/build/outputs/mapping/release/mapping.txt', filesPattern: 'app/build/outputs/bundle/release/app-release.aab,wear/build/outputs/bundle/release/wear-release.aab', googleCredentialsId: 'Florianisme', rolloutPercentage: '100', trackName: 'internal' + androidApkUpload filesPattern: 'app/build/outputs/bundle/release/app-release.aab,wear/build/outputs/bundle/release/wear-release.aab', googleCredentialsId: 'Florianisme', rolloutPercentage: '100', trackName: 'internal' } else if (env.BRANCH_NAME == 'develop' || env.BRANCH_NAME.contains('feature')) { echo 'Publishing Bundle to Internal channel (Allowed to fail)' try { - androidApkUpload deobfuscationFilesPattern: 'app/build/outputs/mapping/release/mapping.txt,wear/build/outputs/mapping/release/mapping.txt', filesPattern: 'app/build/outputs/bundle/release/app-release.aab,wear/build/outputs/bundle/release/wear-release.aab', googleCredentialsId: 'Florianisme', rolloutPercentage: '100', trackName: 'internal' + androidApkUpload filesPattern: 'app/build/outputs/bundle/release/app-release.aab,wear/build/outputs/bundle/release/wear-release.aab', googleCredentialsId: 'Florianisme', rolloutPercentage: '100', trackName: 'internal' } catch(error) { currentBuild.result = 'SUCCESS' } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro deleted file mode 100644 index 3e8f971..0000000 --- a/app/proguard-rules.pro +++ /dev/null @@ -1,30 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. --renamesourcefileattribute SourceFile - -# Jackson --keep @com.fasterxml.jackson.annotation.JsonIgnoreProperties class * { *; } --keep class com.fasterxml.** { *; } --keep class org.codehaus.** { *; } --keepnames class com.fasterxml.jackson.** { *; } --keepclassmembers public final enum com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility { - public static final com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility *; -} diff --git a/shared-build.gradle b/shared-build.gradle index 9fdb679..3dec1d8 100644 --- a/shared-build.gradle +++ b/shared-build.gradle @@ -26,9 +26,6 @@ android { buildTypes { release { signingConfig signingConfigs.release - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { diff --git a/wear/proguard-rules.pro b/wear/proguard-rules.pro deleted file mode 100644 index 3e8f971..0000000 --- a/wear/proguard-rules.pro +++ /dev/null @@ -1,30 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. --renamesourcefileattribute SourceFile - -# Jackson --keep @com.fasterxml.jackson.annotation.JsonIgnoreProperties class * { *; } --keep class com.fasterxml.** { *; } --keep class org.codehaus.** { *; } --keepnames class com.fasterxml.jackson.** { *; } --keepclassmembers public final enum com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility { - public static final com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility *; -} From 8c44b35761cdfd4cef97031043237862e0358b8a Mon Sep 17 00:00:00 2001 From: Florianisme Date: Fri, 27 Jan 2023 19:52:56 +0100 Subject: [PATCH 4/5] Increase Version code/name --- app/build.gradle | 2 +- shared-build.gradle | 6 +++--- wear/build.gradle | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cfdd213..58bf2a2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply from: "$rootProject.projectDir/shared-build.gradle" android { defaultConfig { - versionCode 45 + versionCode 53 wearAppUnbundled true } buildFeatures { diff --git a/shared-build.gradle b/shared-build.gradle index 3dec1d8..e0beb84 100644 --- a/shared-build.gradle +++ b/shared-build.gradle @@ -1,6 +1,6 @@ android { namespace 'de.florianisme.wakeonlan' - compileSdk 32 + compileSdk 33 signingConfigs { release { @@ -17,8 +17,8 @@ android { defaultConfig { applicationId "de.florianisme.wakeonlan" minSdk 24 - targetSdk 32 - versionName "1.6.1" + targetSdk 33 + versionName "1.6.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/wear/build.gradle b/wear/build.gradle index f7ff163..0514197 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -3,7 +3,7 @@ apply from: "$rootProject.projectDir/shared-build.gradle" android { defaultConfig { - versionCode 44 + versionCode 52 } } From 443e1b95a699570182abc67464100778d60935eb Mon Sep 17 00:00:00 2001 From: Florianisme Date: Fri, 27 Jan 2023 19:55:12 +0100 Subject: [PATCH 5/5] Increase Version code/name --- app/build.gradle | 2 +- shared-build.gradle | 2 +- wear/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 58bf2a2..c676037 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply from: "$rootProject.projectDir/shared-build.gradle" android { defaultConfig { - versionCode 53 + versionCode 55 wearAppUnbundled true } buildFeatures { diff --git a/shared-build.gradle b/shared-build.gradle index e0beb84..6d42b0f 100644 --- a/shared-build.gradle +++ b/shared-build.gradle @@ -18,7 +18,7 @@ android { applicationId "de.florianisme.wakeonlan" minSdk 24 targetSdk 33 - versionName "1.6.4" + versionName "1.6.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/wear/build.gradle b/wear/build.gradle index 0514197..074c96e 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -3,7 +3,7 @@ apply from: "$rootProject.projectDir/shared-build.gradle" android { defaultConfig { - versionCode 52 + versionCode 54 } }