diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d70463a..aceb4f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: echo "NEW_VERSION_NAME=${new_version}" >> $GITHUB_ENV echo "NEW_VERSION_CODE=${version_code}" >> $GITHUB_ENV - - name: Update build.gradle with new version code and version name + - name: Update build.gradle.kts with new version code and version name run: | # Update versionCode and versionName in build.gradle sed -i "s/versionCode [0-9]\+/versionCode ${NEW_VERSION_CODE}/" app/build.gradle diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b473b3b..5a49e1e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -72,7 +72,7 @@ jobs: echo "NEW_VERSION_NAME=${new_version}" >> $GITHUB_ENV echo "NEW_VERSION_CODE=${version_code}" >> $GITHUB_ENV - - name: Update build.gradle with new version code and version name + - name: Update build.gradle.kts with new version code and version name run: | # Update versionCode and versionName in build.gradle sed -i "s/versionCode [0-9]\+/versionCode ${NEW_VERSION_CODE}/" app/build.gradle diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index e0f97ec..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,104 +0,0 @@ -plugins { - alias(libs.plugins.android.application) - alias(libs.plugins.devtools.ksp) - alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.serialization) - alias(libs.plugins.compose.compiler) -} - -android { - compileSdk 35 - defaultConfig { - applicationId "com.github.capntrips.kernelflasher" - minSdk 29 - targetSdk 34 - versionCode 10600 - versionName "1.6.0" - - javaCompileOptions { - annotationProcessorOptions { - arguments += [ - "room.schemaLocation": "$projectDir/schemas".toString(), - "room.incremental": "true" - ] - } - } - ndk { - //noinspection ChromeOsAbiSupport - abiFilters = ['armeabi-v7a', 'arm64-v8a'] - } - vectorDrawables { - useSupportLibrary true - } - } - buildTypes { - release { - minifyEnabled true - shrinkResources true - zipAlignEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - sourceSets { - main { - jniLibs.srcDirs = ['src/main/jniLibs'] - } - } - buildFeatures { - compose true - aidl true - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - freeCompilerArgs += "-Xno-param-assertions" - freeCompilerArgs += "-Xno-call-assertions" - } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } - packagingOptions { - resources { - excludes += '/META-INF/{AL2.0,LGPL2.1}' - } - jniLibs { - useLegacyPackaging true - } - dex { - useLegacyPackaging true - } - } - androidResources { - generateLocaleConfig = true - } - namespace 'com.github.capntrips.kernelflasher' -} - -dependencies { - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.appcompat) - implementation(libs.androidx.compose.material) - implementation(libs.androidx.compose.material3) - implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.ui) - implementation(libs.androidx.core.ktx) - implementation(libs.androidx.core.splashscreen) - implementation(libs.androidx.lifecycle.runtime.ktx) - implementation(libs.androidx.lifecycle.viewmodel.compose) - implementation(libs.androidx.navigation.compose) - implementation(libs.androidx.room.runtime) - annotationProcessor(libs.androidx.room.compiler) - ksp(libs.androidx.room.compiler) - implementation(libs.libsu.core) - implementation(libs.libsu.io) - implementation(libs.libsu.nio) - implementation(libs.libsu.service) - implementation(libs.material) - implementation(libs.okhttp) - implementation(libs.kotlinx.serialization.json) - implementation 'com.squareup.retrofit2:retrofit:3.0.0' - implementation 'com.squareup.retrofit2:converter-gson:3.0.0' -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..7c8c2aa --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,118 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.devtools.ksp) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.kotlin.compose.compiler) +} + +android { + compileSdk = 36 + namespace = "com.github.capntrips.kernelflasher" + + defaultConfig { + applicationId = "com.github.capntrips.kernelflasher" + minSdk = 29 + targetSdk = 36 + versionCode = 10600 + versionName = "1.6.0" + + javaCompileOptions { + annotationProcessorOptions { + arguments += mapOf( + "room.schemaLocation" to "$projectDir/schemas", + "room.incremental" to "true", + ) + } + } + + ndk { + //noinspection ChromeOsAbiSupport + abiFilters.add("arm64-v8a") + } + + vectorDrawables { + useSupportLibrary = true + } + } + + buildTypes { + release { + isMinifyEnabled = false + isShrinkResources = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" + ) + } + } + + sourceSets { + getByName("main") { + jniLibs.srcDirs("src/main/jniLibs") + } + } + + buildFeatures { + buildConfig = true + aidl = true + compose = true + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + + kotlin { + jvmToolchain(21) + + } + + packaging { + resources { + excludes += setOf("/META-INF/{AL2.0,LGPL2.1}") + } + jniLibs { + useLegacyPackaging = true + } + dex { + useLegacyPackaging = true + } + } + + androidResources { + generateLocaleConfig = true + } + + ksp { + arg("room.schemaLocation", "$projectDir/schemas") + arg("room.incremental", "true") + } +} + + dependencies { + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.core.splashscreen) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.room.runtime) + annotationProcessor(libs.androidx.room.compiler) + ksp(libs.androidx.room.compiler) + implementation(libs.libsu.core) + implementation(libs.libsu.io) + implementation(libs.libsu.nio) + implementation(libs.libsu.service) + implementation(libs.material) + implementation(libs.okhttp) + implementation(libs.kotlinx.serialization.json) + implementation(libs.kotlinx.serialization.json) + implementation(libs.retrofit) + implementation(libs.converter.gson) + } \ No newline at end of file diff --git a/app/schemas/com.github.capntrips.kernelflasher.common.types.room.AppDatabase/1.json b/app/schemas/com.github.capntrips.kernelflasher.common.types.room.AppDatabase/1.json new file mode 100644 index 0000000..a1aa136 --- /dev/null +++ b/app/schemas/com.github.capntrips.kernelflasher.common.types.room.AppDatabase/1.json @@ -0,0 +1,81 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "bbe3033de836fa33fb2ed46b5272124e", + "entities": [ + { + "tableName": "Update", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `update_uri` TEXT, `kernel_name` TEXT NOT NULL, `kernel_version` TEXT NOT NULL, `kernel_link` TEXT NOT NULL, `kernel_changelog_url` TEXT NOT NULL, `kernel_date` INTEGER NOT NULL, `kernel_sha1` TEXT NOT NULL, `support_link` TEXT, `last_updated` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER" + }, + { + "fieldPath": "updateUri", + "columnName": "update_uri", + "affinity": "TEXT" + }, + { + "fieldPath": "kernelName", + "columnName": "kernel_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "kernelVersion", + "columnName": "kernel_version", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "kernelLink", + "columnName": "kernel_link", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "kernelChangelogUrl", + "columnName": "kernel_changelog_url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "kernelDate", + "columnName": "kernel_date", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "kernelSha1", + "columnName": "kernel_sha1", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "supportLink", + "columnName": "support_link", + "affinity": "TEXT" + }, + { + "fieldPath": "lastUpdated", + "columnName": "last_updated", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + } + } + ], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bbe3033de836fa33fb2ed46b5272124e')" + ] + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle.kts similarity index 61% rename from build.gradle rename to build.gradle.kts index 8b142f6..ddadb81 100644 --- a/build.gradle +++ b/build.gradle.kts @@ -3,9 +3,9 @@ plugins { alias(libs.plugins.devtools.ksp) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.serialization) apply false - alias(libs.plugins.compose.compiler) apply false + // alias(libs.plugins.compose.compiler) apply false } -tasks.register('clean', Delete) { - delete rootProject.buildDir +tasks.register("clean", Delete::class) { + delete(rootProject.layout.buildDirectory) } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fecc67e..1f91d68 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,23 +1,23 @@ [versions] -kotlin = "2.1.21" -compose-compiler = "1.5.6" +kotlin = "2.3.0" -androidx-activity-compose = "1.10.1" -androidx-appcompat = "1.7.0" -androidx-compose = "1.8.2" +androidx-activity-compose = "1.12.2" +androidx-appcompat = "1.7.1" +androidx-compose = "1.10.0" androidx-compose-material3 = "1.3.2" -androidx-core-ktx = "1.16.0" -androidx-core-splashscreen = "1.0.1" -androidx-lifecycle = "2.9.2" -androidx-navigation-compose = "2.9.0" -androidx-room = "2.7.1" -kotlinx-serialization-json = "1.8.1" +androidx-core-ktx = "1.17.0" +androidx-core-splashscreen = "1.2.0" +androidx-lifecycle = "2.10.0" +androidx-navigation-compose = "2.9.6" +androidx-room = "2.8.4" +kotlinx-serialization-json = "1.9.0" libsu = "6.0.0" -material = "1.12.0" -okhttp = "5.2.1" +material = "1.13.0" +okhttp = "5.3.2" -android-application = "8.10.0" -devtools-ksp = "2.1.20-2.0.1" +android-application = "8.13.2" +devtools-ksp = "2.3.4" +retrofit = "3.0.0" [libraries] androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidx-activity-compose" } @@ -33,6 +33,7 @@ androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "l androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidx-navigation-compose" } androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "androidx-room" } androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "androidx-room" } +converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" } libsu-core = { group = "com.github.topjohnwu.libsu", name = "core", version.ref = "libsu" } libsu-io = { group = "com.github.topjohnwu.libsu", name = "io", version.ref = "libsu" } @@ -40,10 +41,11 @@ libsu-nio = { group = "com.github.topjohnwu.libsu", name = "nio", version.ref = libsu-service = { group = "com.github.topjohnwu.libsu", name = "service", version.ref = "libsu" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } +retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } [plugins] android-application = { id = "com.android.application", version.ref = "android-application" } devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "devtools-ksp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 338a8f7..7f839b6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Apr 14 13:36:42 CDT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle.kts similarity index 78% rename from settings.gradle rename to settings.gradle.kts index 4fa6fbe..3502822 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -10,8 +10,10 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - maven { url 'https://jitpack.io' } + maven { + url = uri("https://jitpack.io") + } } } rootProject.name = "Kernel Flasher" -include ':app' +include(":app") \ No newline at end of file