Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG committed Jul 16, 2023
1 parent cd11109 commit 721dcb8
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 243 deletions.
69 changes: 35 additions & 34 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,28 @@ import java.util.*
val officialBuild: Boolean by rootProject.extra

plugins {
kotlin("android")
kotlin("plugin.serialization")
id("com.android.application")
id("com.google.devtools.ksp")
id("dev.rikka.tools.autoresconfig")
id("dev.rikka.tools.materialthemebuilder")
id("dev.rikka.tools.refine")
id("androidx.navigation.safeargs.kotlin")
alias(libs.plugins.agp.app)
alias(libs.plugins.autoresconfig)
alias(libs.plugins.materialthemebuilder)
alias(libs.plugins.refine)
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ksp)
alias(libs.plugins.nav.safeargs.kotlin)
}

if (officialBuild) {
plugins.apply("com.google.gms.google-services")
plugins.apply(libs.plugins.gms.get().pluginId)
}

android {
namespace = "com.tsng.hidemyapplist"

buildFeatures {
buildConfig = true
viewBinding = true
}

kotlinOptions {
jvmTarget = "11"
}

applicationVariants.all {
kotlin {
sourceSets.getByName(name) {
Expand All @@ -37,6 +34,10 @@ android {
}
}

kotlin {
jvmToolchain(17)
}

autoResConfig {
generateClass.set(true)
generateRes.set(false)
Expand Down Expand Up @@ -99,27 +100,27 @@ dependencies {
implementation(projects.common)
runtimeOnly(projects.xposed)

val rxhttpVersion = "3.0.1"
implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("com.drakeet.about:about:2.5.2")
implementation("com.drakeet.multitype:multitype:4.3.0")
implementation("com.github.kirich1409:viewbindingpropertydelegate:1.5.6")
implementation("com.github.liujingxing.rxhttp:rxhttp:$rxhttpVersion")
implementation("com.github.liujingxing.rxhttp:converter-serialization:$rxhttpVersion")
implementation("com.github.topjohnwu.libsu:core:5.0.3")
implementation("com.google.android.material:material:1.7.0")
implementation("com.google.android.gms:play-services-ads:21.4.0")
implementation("com.google.firebase:firebase-analytics-ktx:21.2.0")
implementation("com.squareup.okhttp3:okhttp:4.10.0")
implementation("dev.rikka.hidden:compat:3.4.3")
implementation("dev.rikka.rikkax.material:material:2.5.1")
implementation("dev.rikka.rikkax.material:material-preference:2.0.0")
implementation("me.zhanghai.android.appiconloader:appiconloader:1.5.0")
compileOnly("dev.rikka.hidden:stub:3.4.3")
ksp("com.github.liujingxing.rxhttp:rxhttp-compiler:$rxhttpVersion")
implementation(platform(libs.com.google.firebase.bom))
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.androidx.preference.ktx)
implementation(libs.androidx.swiperefreshlayout)
implementation(libs.com.drakeet.about)
implementation(libs.com.drakeet.multitype)
implementation(libs.com.github.kirich1409.viewbindingpropertydelegate)
implementation(libs.com.github.liujingxing.rxhttp)
implementation(libs.com.github.liujingxing.rxhttp.converter.serialization)
implementation(libs.com.github.topjohnwu.libsu.core)
implementation(libs.com.google.android.material)
implementation(libs.com.google.android.gms.play.services.ads)
implementation(libs.com.google.firebase.analytics.ktx)
implementation(libs.com.squareup.okhttp3)
implementation(libs.dev.rikka.hidden.compat)
implementation(libs.dev.rikka.rikkax.material)
implementation(libs.dev.rikka.rikkax.material.preference)
implementation(libs.me.zhanghai.android.appiconloader)
compileOnly(libs.dev.rikka.hidden.stub)
ksp(libs.com.github.liujingxing.rxhttp.compiler)
}

configurations.all {
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/icu/nullptr/hidemyapplist/MyApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package icu.nullptr.hidemyapplist

import android.annotation.SuppressLint
import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.tsng.hidemyapplist.R
import icu.nullptr.hidemyapplist.service.ConfigManager
import icu.nullptr.hidemyapplist.service.PrefManager
Expand All @@ -10,7 +11,6 @@ import icu.nullptr.hidemyapplist.ui.util.makeToast
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import me.zhanghai.android.appiconloader.AppIconLoader
import rikka.material.app.DayNightDelegate
import rikka.material.app.LocaleDelegate
import java.util.*
import kotlin.system.exitProcess
Expand Down Expand Up @@ -40,8 +40,7 @@ class MyApp : Application() {
AppChangeReceiver.register(this)
ConfigManager.init()

DayNightDelegate.setApplicationContext(this)
DayNightDelegate.setDefaultNightMode(PrefManager.darkTheme)
AppCompatDelegate.setDefaultNightMode(PrefManager.darkTheme)
LocaleDelegate.defaultLocale = getLocale(PrefManager.locale)
val config = resources.configuration
config.setLocale(LocaleDelegate.defaultLocale)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package icu.nullptr.hidemyapplist.service
import android.content.ComponentName
import android.content.Context.MODE_PRIVATE
import android.content.pm.PackageManager
import androidx.appcompat.app.AppCompatDelegate
import icu.nullptr.hidemyapplist.hmaApp
import rikka.material.app.DayNightDelegate

object PrefManager {

Expand Down Expand Up @@ -42,7 +42,7 @@ object PrefManager {
set(value) = pref.edit().putString(PREF_LOCALE, value).apply()

var darkTheme: Int
get() = pref.getInt(PREF_DARK_THEME, DayNightDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
get() = pref.getInt(PREF_DARK_THEME, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
set(value) = pref.edit().putInt(PREF_DARK_THEME, value).apply()

var blackDarkTheme: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.net.toUri
import androidx.core.text.HtmlCompat
import androidx.fragment.app.Fragment
Expand All @@ -26,7 +27,6 @@ import icu.nullptr.hidemyapplist.ui.util.makeToast
import icu.nullptr.hidemyapplist.ui.util.setupToolbar
import icu.nullptr.hidemyapplist.util.LangList
import icu.nullptr.hidemyapplist.util.SuUtils
import rikka.material.app.DayNightDelegate
import rikka.material.app.LocaleDelegate
import rikka.preference.SimpleMenuPreference
import java.util.*
Expand Down Expand Up @@ -213,7 +213,7 @@ class SettingsFragment : Fragment(R.layout.fragment_settings), PreferenceFragmen
findPreference<SimpleMenuPreference>("darkTheme")?.setOnPreferenceChangeListener { _, newValue ->
val newMode = (newValue as String).toInt()
if (PrefManager.darkTheme != newMode) {
DayNightDelegate.setDefaultNightMode(newMode)
AppCompatDelegate.setDefaultNightMode(newMode)
activity?.recreate()
}
true
Expand Down
35 changes: 12 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,12 @@ import com.android.build.api.dsl.ApplicationExtension
import com.android.build.gradle.BaseExtension
import org.jetbrains.kotlin.konan.properties.Properties

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(kotlin("gradle-plugin", version = "1.8.0"))
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.google.gms:google-services:4.3.14")
}
}

plugins {
id("com.android.application") apply false
id("com.android.library") apply false
kotlin("android") apply false
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.agp.app) apply false
alias(libs.plugins.agp.lib) apply false
alias(libs.plugins.gms) apply false
alias(libs.plugins.nav.safeargs.kotlin) apply false
}

fun String.execute(currentWorkingDir: File = file("./")): String {
Expand All @@ -31,20 +20,20 @@ fun String.execute(currentWorkingDir: File = file("./")): String {
return String(byteOut.toByteArray()).trim()
}

val gitCommitCount = "git rev-list HEAD --count".execute().toInt()
val gitCommitHash = "git rev-parse --verify --short HEAD".execute()

val minSdkVer by extra(24)
val targetSdkVer by extra(33)
val buildToolsVer by extra("33.0.1")
val targetSdkVer by extra(34)
val buildToolsVer by extra("34.0.0")

val appVerName by extra("3.1.1")
val configVerCode by extra(90)
val serviceVerCode by extra(95)
val minBackupVerCode by extra(65)

val androidSourceCompatibility = JavaVersion.VERSION_11
val androidTargetCompatibility = JavaVersion.VERSION_11

val gitCommitCount = "git rev-list HEAD --count".execute().toInt()
val gitCommitHash = "git rev-parse --verify --short HEAD".execute()
val androidSourceCompatibility = JavaVersion.VERSION_17
val androidTargetCompatibility = JavaVersion.VERSION_17

val localProperties = Properties()
localProperties.load(file("local.properties").inputStream())
Expand Down
21 changes: 15 additions & 6 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id("com.android.library")
id("dev.rikka.tools.refine")
kotlin("android")
kotlin("plugin.serialization")
alias(libs.plugins.agp.lib)
alias(libs.plugins.refine)
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlin.serialization)
}

val configVerCode: Int by rootProject.extra
Expand All @@ -12,14 +12,23 @@ val minBackupVerCode: Int by rootProject.extra
android {
namespace = "icu.nullptr.hidemyapplist.common"

buildFeatures {
aidl = true
buildConfig = true
}

defaultConfig {
buildConfigField("int", "CONFIG_VERSION", configVerCode.toString())
buildConfigField("int", "SERVICE_VERSION", serviceVerCode.toString())
buildConfigField("int", "MIN_BACKUP_VERSION", minBackupVerCode.toString())
}
}

kotlin {
jvmToolchain(17)
}

dependencies {
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
compileOnly("dev.rikka.hidden:stub:3.4.3")
api(libs.kotlinx.serialization.json)
compileOnly(libs.dev.rikka.hidden.stub)
}
5 changes: 0 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
android.experimental.enableNewResourceShrinker=true
android.experimental.enableNewResourceShrinker.preciseShrinking=true
android.enableAppCompileTimeRClass=true
android.nonTransitiveRClass=true
android.enableR8.fullMode=true
android.useAndroidX=true

agpVersion=7.3.1
45 changes: 45 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[versions]
agp = "8.0.2"
kotlin = "1.9.0"
rxhttp = "3.0.6"
hidden-api = "4.2.0"

[plugins]
agp-app = { id = "com.android.application", version.ref = "agp" }
agp-lib = { id = "com.android.library", version.ref = "agp" }
kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version = "1.9.0-1.0.11" }
gms = { id = "com.google.gms.google-services", version = "4.3.15" }
nav-safeargs-kotlin = { id = "androidx.navigation.safeargs.kotlin", version = "2.6.0" }
autoresconfig = { id = "dev.rikka.tools.autoresconfig", version = "1.2.2" }
materialthemebuilder = { id = "dev.rikka.tools.materialthemebuilder", version = "1.3.3" }
refine = { id = "dev.rikka.tools.refine", version = "4.3.0" }

[libraries]
androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version = "2.5.3" }
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version = "2.5.3" }
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version = "1.2.0" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version = "1.1.0" }
com-android-tools-build-apksig = { module = "com.android.tools.build:apksig", version.ref = "agp" }
com-drakeet-about = { module = "com.drakeet.about:about", version = "2.5.2" }
com-drakeet-multitype = { module = "com.drakeet.multitype:multitype", version = "4.3.0" }
com-github-kirich1409-viewbindingpropertydelegate = { module = "com.github.kirich1409:viewbindingpropertydelegate", version = "1.5.9" }
com-github-kyuubiran-ezxhelper = { module = "com.github.kyuubiran:EzXHelper", version = "1.0.3" }
com-github-liujingxing-rxhttp = { module = "com.github.liujingxing.rxhttp:rxhttp", version.ref = "rxhttp" }
com-github-liujingxing-rxhttp-compiler = { module = "com.github.liujingxing.rxhttp:rxhttp-compiler", version.ref = "rxhttp" }
com-github-liujingxing-rxhttp-converter-serialization = { module = "com.github.liujingxing.rxhttp:converter-serialization", version.ref = "rxhttp" }
com-github-topjohnwu-libsu-core = { module = "com.github.topjohnwu.libsu:core", version = "5.0.3" }
com-google-android-material = { module = "com.google.android.material:material", version = "1.7.0" }
com-google-android-gms-play-services-ads = { module = "com.google.android.gms:play-services-ads", version = "22.2.0" }
com-google-firebase-firebase-analytics-ktx = { module = "com.google.firebase:firebase-analytics-ktx", version = "21.2.0" }
com-google-firebase-bom = { module = "com.google.firebase:firebase-bom", version = "32.1.1" }
com-google-firebase-analytics-ktx = { module = "com.google.firebase:firebase-analytics-ktx" }
com-squareup-okhttp3 = { module = "com.squareup.okhttp3:okhttp", version = "4.10.0" }
de-robv-android-xposed-api = { module = "de.robv.android.xposed:api", version = "82" }
dev-rikka-hidden-compat = { module = "dev.rikka.hidden:compat", version.ref = "hidden-api" }
dev-rikka-hidden-stub = { module = "dev.rikka.hidden:stub", version.ref = "hidden-api" }
dev-rikka-rikkax-material = { module = "dev.rikka.rikkax.material:material", version = "2.7.0" }
dev-rikka-rikkax-material-preference = { module = "dev.rikka.rikkax.material:material-preference", version = "2.0.0" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.5.1" }
me-zhanghai-android-appiconloader = { module = "me.zhanghai.android.appiconloader:appiconloader", version = "1.5.0" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 721dcb8

Please sign in to comment.