diff --git a/app/build.gradle b/app/build.gradle index 521af8f3a..964a731d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -106,13 +106,20 @@ android { repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + jcenter() // for ico4a } dependencies { - // https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.3' + // This solves conflicts error between + // org.jetbrains.kotlin:kotlin-stdlib:1.8.0 & org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 + // leanback uses 1.6.21, but kotlin-stdlib-jdk7 & kotlin-stdlib-jdk8 were + // merged into kotlin-stdlib in v1.8.0, causing a class duplication conflict + implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) + coreLibraryDesugaring "com.android.tools:desugar_jdk_libs_nio:${desugarVersion}" + + //noinspection GradleDynamicVersion compileOnly 'org.jetbrains:annotations:+' // https://mvnrepository.com/artifact/dnsjava/dnsjava @@ -120,6 +127,8 @@ dependencies { coreFlavorImplementation 'dnsjava:dnsjava:2.1.9' // For Tips $ + // https://developer.android.com/google/play/billing/release-notes + // 6.1.0 is minSDK 19 googleFlavorImplementation 'com.android.billingclient:billing:6.0.1' // See versions constant in /build.gradle @@ -137,8 +146,12 @@ dependencies { // https://mvnrepository.com/artifact/androidx.preference/preference?repo=google implementation "androidx.preference:preference:${preferenceVersion}" // https://mvnrepository.com/artifact/androidx.leanback/leanback-preference?repo=google + // https://developer.android.com/jetpack/androidx/releases/leanback + // 1.2.0-alpha03+: compileSdkVersion 34 implementation "androidx.leanback:leanback-preference:1.2.0-alpha02" // https://mvnrepository.com/artifact/androidx.constraintlayout/constraintlayout + // https://developer.android.com/jetpack/androidx/releases/constraintlayout + // https://github.com/androidx/constraintlayout implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // https://mvnrepository.com/artifact/androidx.multidex/multidex implementation 'androidx.multidex:multidex:2.0.1' @@ -147,15 +160,17 @@ dependencies { implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' // 1.6.1 gives conflicts between org.jetbrains.kotlin:kotlin-stdlib:1.8.0 and org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 // Because leanback uses 1.6.21 (So does androidx.lifecycle, but latest uses 1.8.0) - implementation "androidx.fragment:fragment:1.5.7" + implementation "androidx.fragment:fragment:1.6.2" implementation 'androidx.documentfile:documentfile:1.1.0-alpha01' // https://developer.android.com/jetpack/androidx/releases/viewpager2 implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02' - // https://github.com/alibaba/fastjson - implementation 'com.alibaba:fastjson:1.1.72.android' + // https://github.com/alibaba/fastjson2 + // https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 + implementation 'com.alibaba.fastjson2:fastjson2:2.0.42.android4' // https://jcifs.samba.org/ + // There's a 1.3.19, but it's not in any gradle repo I can find implementation 'jcifs:jcifs:1.3.17' // https://github.com/square/picasso @@ -163,6 +178,7 @@ dependencies { implementation 'com.squareup.picasso:picasso:2.5.2' // https://github.com/divStar/ico4a + // May have to switch to https://mvnrepository.com/artifact/org.jclarion/image4j implementation 'divstar:ico4a:v1.0' // https://github.com/square/okhttp @@ -183,7 +199,7 @@ dependencies { implementation 'com.github.SumiMakito:AwesomeQRCode:1.0.6' // https://github.com/google/flexbox-layout - implementation 'com.google.android:flexbox:2.0.1' + implementation 'com.google.android.flexbox:flexbox:3.0.0' // https://github.com/grandcentrix/tray // grandcentrix's implementation has ConcurrentModificationException errors diff --git a/app/src/main/java/com/biglybt/android/util/JSONUtils.java b/app/src/main/java/com/biglybt/android/util/JSONUtils.java index 8b0ac8bc2..cc7f04f6e 100644 --- a/app/src/main/java/com/biglybt/android/util/JSONUtils.java +++ b/app/src/main/java/com/biglybt/android/util/JSONUtils.java @@ -19,10 +19,10 @@ import java.io.Reader; import java.util.*; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONReader; -import com.alibaba.fastjson.parser.Feature; -import com.alibaba.fastjson.serializer.SerializerFeature; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONReader; +import com.alibaba.fastjson2.JSONReader.Feature; +import com.alibaba.fastjson2.JSONWriter; import com.biglybt.android.client.AnalyticsTracker; import androidx.annotation.Nullable; @@ -40,9 +40,8 @@ public class JSONUtils { private static final String TAG = "JSONUtils"; - - private static final int features = Feature.SortFeidFastMatch.mask - | Feature.IgnoreNotMatch.mask | Feature.DisableSpecialKeyDetect.mask; + + private static final Feature features = Feature.AllowUnQuotedFieldNames; private static final String DEFAULT_MAP_KEY = "value"; @@ -99,7 +98,7 @@ private static Object parseWithException(String json) { private static Object parseWithException(Reader reader) { //return new JSONParser(JSONParser.MODE_PERMISSIVE).parse(reader); - JSONReader jsonReader = new JSONReader(reader); + JSONReader jsonReader = JSONReader.of(reader); Object readObject = jsonReader.readObject(); jsonReader.close(); return readObject; @@ -139,7 +138,7 @@ private static Map encodeMap(Map map) { */ public static String encodeToJSON(@Nullable Map map) { - return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); + return JSON.toJSONString(map, JSONWriter.Feature.WriteMapNullValue, JSONWriter.Feature.WriteNulls); } public static String encodeToJSON(Collection list) { diff --git a/build.gradle b/build.gradle index 6d6afacb1..6113f459c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,27 +3,28 @@ apply plugin: 'com.github.ben-manes.versions' ext { // https://developer.android.com/jetpack/androidx/releases/recyclerview - recyclerviewVersion = '1.3.1' + recyclerviewVersion = '1.3.2' // https://developer.android.com/jetpack/androidx/releases/preference preferenceVersion = '1.2.1' // https://github.com/material-components/material-components-android/releases + // 1.10+: compileSdkVersion 34 materialVersion = '1.9.0' // https://developer.android.com/jetpack/androidx/releases/lifecycle - // 2.6.1 gives conflicts between org.jetbrains.kotlin:kotlin-stdlib:1.8.0 and org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 - // Because leanback uses 1.6.21 - lifecycleVersion = '2.5.1' + lifecycleVersion = '2.6.2' // https://developer.android.com/jetpack/androidx/releases/leanback - leanbackVersion = '1.1.0-rc02' + // 1.2.0-alpha03+: compileSdkVersion 34 + leanbackVersion = '1.2.0-alpha02' // https://developer.android.com/jetpack/androidx/releases/appcompat + // 1.7.0-alpha03+: compileSdkVersion 34 appcompatVersion = '1.6.1' // https://developer.android.com/jetpack/androidx/releases/annotation - // 1.6.0 gives conflicts between org.jetbrains.kotlin:kotlin-stdlib:1.8.0 and org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 - // Because leanback uses 1.6.21 - annotationVersion = '1.5.0' + annotationVersion = '1.7.0' + // https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md + desugarVersion = '2.0.4' } buildscript { - ext.kotlin_version = '1.9.0' + ext.kotlin_version = '1.9.20' repositories { google() mavenCentral() @@ -32,10 +33,10 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:8.1.4' // https://github.com/KeepSafe/dexcount-gradle-plugin - classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:3.1.0' + classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" // https://github.com/ben-manes/gradle-versions-plugin - classpath "com.github.ben-manes:gradle-versions-plugin:0.47.0" + classpath "com.github.ben-manes:gradle-versions-plugin:0.50.0" } } @@ -43,7 +44,6 @@ allprojects { repositories { google() mavenCentral() - jcenter() // for ico4a maven { url 'https://jitpack.io' } // for AwesomeQRCode } project.ext {