diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3e4a0cb0..ab532ac7 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -13,7 +13,7 @@ plugins { id("com.mikepenz.aboutlibraries.plugin") kotlin("android") kotlin("kapt") - id("com.google.devtools.ksp") version "1.9.10-1.0.13" + id("com.google.devtools.ksp") version "1.9.23-1.0.19" } android { // functions to get git info: gitCommitHash, gitBranch, gitRemote @@ -48,8 +48,8 @@ android { applicationId = "com.fox2code.mmm" minSdk = 26 targetSdk = 34 - versionCode = 91 - versionName = "2.3.6" + versionCode = 92 + versionName = "2.3.7" vectorDrawables { useSupportLibrary = true } @@ -100,7 +100,7 @@ android { // Specifies a list of ABIs for Gradle to create APKs for. include("x86", "x86_64", "arm64-v8a", "armeabi-v7a") - isUniversalApk = false + isUniversalApk = true } } @@ -372,9 +372,9 @@ dependencies { // logging interceptor debugImplementation("com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.12") // Chromium cronet from androidacy - implementation("org.chromium.net:cronet-embedded:113.5672.61") + implementation("org.chromium.net:cronet-embedded:119.6045.31") - val libsuVersion = "5.2.1" + val libsuVersion = "5.2.2" // The core module that provides APIs to a shell implementation("com.github.topjohnwu.libsu:core:${libsuVersion}") @@ -406,10 +406,10 @@ dependencies { // some utils implementation("commons-io:commons-io:2.15.1") - implementation("org.apache.commons:commons-compress:1.26.0") + implementation("org.apache.commons:commons-compress:1.26.1") // analytics - implementation("ly.count.android:sdk:23.8.4") + implementation("ly.count.android:sdk:24.1.1") // annotations implementation("org.jetbrains:annotations-java5:24.1.0") diff --git a/app/src/main/kotlin/com/fox2code/mmm/MainApplication.kt b/app/src/main/kotlin/com/fox2code/mmm/MainApplication.kt index 9f3e6222..49a082e1 100644 --- a/app/src/main/kotlin/com/fox2code/mmm/MainApplication.kt +++ b/app/src/main/kotlin/com/fox2code/mmm/MainApplication.kt @@ -281,7 +281,7 @@ class MainApplication : Application(), Configuration.Provider, ActivityLifecycle } else { val config = CountlyConfig( this, - "ff1dc022295f64a7a5f6a5ca07c0294400c71b60", + "25145081ac0b5e2beb1e9320ab714285a45ad2d3", "https://ctly.androidacy.com" ) if (isCrashReportingEnabled) { diff --git a/app/src/main/kotlin/com/fox2code/mmm/utils/io/net/Http.kt b/app/src/main/kotlin/com/fox2code/mmm/utils/io/net/Http.kt index f7fe29f0..f91bffe1 100644 --- a/app/src/main/kotlin/com/fox2code/mmm/utils/io/net/Http.kt +++ b/app/src/main/kotlin/com/fox2code/mmm/utils/io/net/Http.kt @@ -254,35 +254,14 @@ enum class Http {; val httpclientBuilder = OkHttpClient.Builder() // Default is 10, extend it a bit for slow mobile connections. httpclientBuilder.connectTimeout(5, TimeUnit.SECONDS) - httpclientBuilder.writeTimeout(10, TimeUnit.SECONDS) - httpclientBuilder.readTimeout(15, TimeUnit.SECONDS) + httpclientBuilder.writeTimeout(5, TimeUnit.SECONDS) + httpclientBuilder.readTimeout(5, TimeUnit.SECONDS) httpclientBuilder.proxy(Proxy.NO_PROXY) // Do not use system proxy - var dns = Dns.SYSTEM + // TODO: Make compatible w/ cronet + // var dns = Dns.SYSTEM try { - val cloudflareBootstrap = arrayOf( - InetAddress.getByName("162.159.36.1"), - InetAddress.getByName("162.159.46.1"), - InetAddress.getByName("1.1.1.1"), - InetAddress.getByName("1.0.0.1"), - InetAddress.getByName("162.159.132.53"), - InetAddress.getByName("2606:4700:4700::1111"), - InetAddress.getByName("2606:4700:4700::1001"), - InetAddress.getByName("2606:4700:4700::0064"), - InetAddress.getByName("2606:4700:4700::6400") - ) - dns = Dns { s: String? -> - if ("cloudflare-dns.com" == s) { - return@Dns listOf(*cloudflareBootstrap) - } - Dns.SYSTEM.lookup(s!!) - } - httpclientBuilder.dns(dns) val cookieJar = WebkitCookieManagerProxy() httpclientBuilder.cookieJar(cookieJar) - dns = DnsOverHttps.Builder().client(httpclientBuilder.build()) - .url("https://cloudflare-dns.com/dns-query".toHttpUrl()).bootstrapDnsHosts( - *cloudflareBootstrap - ).build() } catch (e: UnknownHostException) { Timber.e(e, "Failed to init DoH") } catch (e: RuntimeException) { @@ -381,7 +360,7 @@ enum class Http {; // Gracefully fallback to okhttp } // Fallback DNS cache responses in case request fail but already succeeded once in the past - fallbackDNS = FallBackDNS( +/* fallbackDNS = FallBackDNS( dns, "github.com", "api.github.com", @@ -395,23 +374,12 @@ enum class Http {; "api.androidacy.com", "production-api.androidacy.com" ) - httpclientBuilder.dns(Dns.SYSTEM) + httpclientBuilder.dns(Dns.SYSTEM)*/ httpClient = followRedirects(httpclientBuilder, true).build() followRedirects(httpclientBuilder, false).build() - httpclientBuilder.dns(fallbackDNS!!) httpClientDoH = followRedirects(httpclientBuilder, true).build() followRedirects(httpclientBuilder, false).build() - httpclientBuilder.cache( - Cache( - File( - mainApplication.cacheDir, "http_cache" - ), 16L * 1024L * 1024L - ) - ) // 16Mib of cache - httpclientBuilder.dns(Dns.SYSTEM) httpClientWithCache = followRedirects(httpclientBuilder, true).build() - httpclientBuilder.dns(fallbackDNS!!) - httpClientWithCacheDoH = followRedirects(httpclientBuilder, true).build() if (MainApplication.forceDebugLogging) Timber.i("Initialized Http successfully!") doh = MainApplication.isDohEnabled } diff --git a/app/src/main/res/raw/gh_main_crt b/app/src/main/res/raw/gh_main_crt new file mode 100644 index 00000000..2418796c --- /dev/null +++ b/app/src/main/res/raw/gh_main_crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID0zCCArugAwIBAgIQVmcdBOpPmUxvEIFHWdJ1lDANBgkqhkiG9w0BAQwFADB7 +MQswCQYDVQQGEwJHQjEbMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYD +VQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UE +AwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTE5MDMxMjAwMDAwMFoXDTI4 +MTIzMTIzNTk1OVowgYgxCzAJBgNVBAYTAlVTMRMwEQY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xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml index 3011f9ca..5a0b5905 100644 --- a/app/src/main/res/xml/network_security_config.xml +++ b/app/src/main/res/xml/network_security_config.xml @@ -11,6 +11,11 @@ github.com + + + + + githubusercontent.com @@ -34,4 +39,4 @@ - \ No newline at end of file + diff --git a/build.gradle.kts b/build.gradle.kts index 0ce4cac3..4ecbe901 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,8 +13,8 @@ buildscript { gradlePluginPortal() } dependencies { - classpath("com.android.tools.build:gradle:8.2.0") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10") + classpath("com.android.tools.build:gradle:8.3.0") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23") classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:11.1.0") } } diff --git a/gradle.properties b/gradle.properties index 41738e5c..2ae0d224 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,11 +12,11 @@ # org.gradle.parallel=true #Tue Jul 18 21:42:11 EDT 2023 #android.defaults.buildfeatures.buildconfig=true -android.enableJetifier=true +android.enableJetifier=false android.enableR8.fullMode=true android.useAndroidX=true org.gradle.caching=true org.gradle.configuration-cache=false # temporarily disabled due to https://github.com/getsentry/sentry-android-gradle-plugin/issues/554 org.gradle.configuration-cache.problems=warn org.gradle.jvmargs=-Xmx1536M -Dorg.gradle.android.cache-fix.ignoreVersionCheck\=true -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Dfile.encoding\=UTF-8 -XX\:+UseParallelGC -XX\:ReservedCodeCacheSize\=768m -org.gradle.parallel=true \ No newline at end of file +org.gradle.parallel=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79..d64cd491 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1065cc2b..a80b22ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ -#Mon Jul 03 11:59:05 EDT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..7101f8e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail