Skip to content

Commit

Permalink
feat: compose@1.3.0-beta01
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 9, 2022
1 parent 0a00a44 commit 6c72cba
Show file tree
Hide file tree
Showing 133 changed files with 7,334 additions and 1,597 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

## feature

- 扩展自css选择器语法的高级选择语法
- 跳过启动页面
- 关闭app内部广告
- 任意点击操作
- 支持导入订阅链接
- 任意点击操作, 组合操作
- 支持导入订阅链接, 订阅支持 json/json5/yaml/toml 格式
- 支持浏览器直接跳转导入规则至app
- 无障碍模式, shizuku 模式, root 模式, 设备管理员 模式

类似 uiautomatorviewer 的路径选取规则创建器

# Fix Bug

Expand Down
109 changes: 91 additions & 18 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-parcelize")
id("kotlin-kapt")
id("org.jetbrains.kotlin.plugin.serialization")
id("com.google.devtools.ksp") version "1.7.10-1.0.6"
}

val composeVersion = "1.0.5"
val composeVersion = "1.3.0-beta01"
android {
compileSdk = 31
buildToolsVersion = "31.0.0"
compileSdk = 33
buildToolsVersion = "33.0.0"

defaultConfig {
applicationId = "li.songe.gkd"
minSdk = 26
targetSdk = 31
targetSdk = 33
versionCode = 1
versionName = "1.0"
versionName = "1.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

kapt {
arguments {
// room 依赖每次构建的产物来执行自动迁移
arg("room.schemaLocation", "$projectDir/schemas")
}
}
}

signingConfigs {
Expand All @@ -31,8 +41,18 @@ android {
}
}

kotlin {
sourceSets.debug {
kotlin.srcDir("build/generated/ksp/debug/kotlin")
}
sourceSets.release {
kotlin.srcDir("build/generated/ksp/release/kotlin")
}
}

buildTypes {
release {
manifestPlaceholders += mapOf()
isMinifyEnabled = false
setProguardFiles(
listOf(
Expand All @@ -51,9 +71,17 @@ android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

// isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
// 忽略 compose 对 kotlin 版本的限制
// freeCompilerArgs = freeCompilerArgs + listOf(
// "-P",
// "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
// )
}
buildFeatures {
compose = true
Expand All @@ -63,28 +91,31 @@ android {
}
packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
excludes += "META-INF/*"
// Due to https://github.com/Kotlin/kotlinx.coroutines/issues/2023
excludes += "META-INF/licenses/*"
excludes += "**/attach_hotspot_windows.dll"
}
}
}

dependencies {

// normal
implementation("androidx.appcompat:appcompat:1.4.0")
implementation("com.google.android.material:material:1.4.0")
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("com.google.android.material:material:1.6.1")

// ktx
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")

// compose
implementation("androidx.compose.ui:ui:$composeVersion")
implementation("androidx.compose.material:material:$composeVersion")
implementation("androidx.compose.ui:ui-tooling-preview:$composeVersion")
debugImplementation("androidx.compose.ui:ui-tooling:$composeVersion")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$composeVersion")
implementation("androidx.activity:activity-compose:1.4.0")
implementation("androidx.navigation:navigation-compose:2.4.0-beta02")
implementation("androidx.activity:activity-compose:1.6.0")

// test
testImplementation("junit:junit:4.13.2")
Expand All @@ -98,21 +129,63 @@ dependencies {

// 工具集合类
// https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/README-CN.md
implementation("com.blankj:utilcodex:1.30.6")
implementation("com.blankj:utilcodex:1.31.0")

// https://developer.android.com/jetpack/compose/navigation
implementation("androidx.navigation:navigation-compose:2.4.0-beta02")
// implementation("androidx.navigation:navigation-compose:2.4.2")
// 2.4.0/2.4.1/2.4.2 在 红米k40 android 12 需要 向左滑动 才会渲染, 在 android studio 自带 preview 也不渲染
// implementation("com.google.accompanist:accompanist-navigation-animation:0.23.1")

// https://bugly.qq.com/docs/user-guide/instruction-manual-android/
implementation("com.tencent.bugly:crashreport:4.0.0")
implementation("com.tencent.bugly:crashreport:4.0.4")

// https://developer.android.google.cn/training/data-storage/room?hl=zh-cn
val roomVersion = "2.3.0"
val roomVersion = "2.4.3"
implementation("androidx.room:room-runtime:$roomVersion")
kapt("androidx.room:room-compiler:$roomVersion")
implementation("androidx.room:room-ktx:$roomVersion")

implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation ("com.google.code.gson:gson:2.8.9")
// implementation("com.squareup.retrofit2:retrofit:2.9.0")
// implementation ("com.google.code.gson:gson:2.8.9")

// https://github.com/Tencent/MMKV/blob/master/README_CN.md
implementation("com.tencent:mmkv:1.2.13")

// https://juejin.cn/post/6969841959082917901
implementation("com.squareup.moshi:moshi-kotlin:1.13.0")
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")

// ktor
implementation("io.ktor:ktor-server-core:2.1.0")
implementation("io.ktor:ktor-server-netty:2.1.0")
// https://ktor.io/docs/cors.html#install_plugin
implementation("io.ktor:ktor-server-cors:2.1.0")
implementation("io.ktor:ktor-server-content-negotiation:2.1.0")

// 请注意,当 client 和 server 版本不一致时, 会报错 socket hang up
implementation("io.ktor:ktor-client-core:2.1.0")
implementation("io.ktor:ktor-client-cio:2.1.0")
implementation("io.ktor:ktor-client-content-negotiation:2.1.0")

implementation("io.ktor:ktor-serialization-kotlinx-json:2.1.0")

// https://github.com/Kotlin/kotlinx.serialization/blob/master/docs
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")

// https://dylancaicoding.github.io/ActivityResultLauncher/#/
implementation("com.github.DylanCaiCoding:ActivityResultLauncher:1.1.2")

// https://github.com/journeyapps/zxing-android-embedded
implementation("com.journeyapps:zxing-android-embedded:4.3.0")


// implementation("androidx.startup:startup-runtime:1.1.1")

implementation("com.google.accompanist:accompanist-drawablepainter:0.23.1")
implementation("com.google.accompanist:accompanist-placeholder-material:0.23.1")


ksp(project(":room_processor"))
implementation(project(mapOf("path" to ":node_selector")))

}
154 changes: 154 additions & 0 deletions app/schemas/li.songe.gkd.db.AppDatabase/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "f3082a1bb735b6f7f163e448585542ce",
"entities": [
{
"tableName": "subs_item",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `ctime` INTEGER NOT NULL, `mtime` INTEGER NOT NULL, `url` TEXT NOT NULL, `file_path` TEXT NOT NULL, `comment` TEXT NOT NULL, `description` TEXT NOT NULL, `enable` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "ctime",
"columnName": "ctime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mtime",
"columnName": "mtime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "comment",
"columnName": "comment",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "enable",
"columnName": "enable",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_subs_item_url",
"unique": true,
"columnNames": [
"url"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_subs_item_url` ON `${TABLE_NAME}` (`url`)"
}
],
"foreignKeys": []
},
{
"tableName": "subs_config",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `ctime` INTEGER NOT NULL, `mtime` INTEGER NOT NULL, `type` INTEGER NOT NULL, `enable` INTEGER NOT NULL, `subs_item_id` INTEGER NOT NULL, `package_name` TEXT NOT NULL, `group_key` INTEGER NOT NULL, `rule_key` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "ctime",
"columnName": "ctime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mtime",
"columnName": "mtime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "enable",
"columnName": "enable",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "subsItemId",
"columnName": "subs_item_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "packageName",
"columnName": "package_name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "groupKey",
"columnName": "group_key",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "ruleKey",
"columnName": "rule_key",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"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, 'f3082a1bb735b6f7f163e448585542ce')"
]
}
}
Loading

0 comments on commit 6c72cba

Please sign in to comment.