Skip to content

Commit 8fad3e2

Browse files
authored
Merge pull request #1351 from keymapperorg/1274-set-key-mapper-as-the-device-assistant-to-trigger-key-maps
#1274 set key mapper as the device assistant to trigger key maps
2 parents 9fbe7c9 + 7f630c2 commit 8fad3e2

File tree

124 files changed

+2747
-1380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2747
-1380
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[*.{kt,kts}]
2+
ktlint_standard_function-expression-body = disabled
23
ktlint_function_naming_ignore_when_annotated_with = Composable
34
ktlint_ignore_back_ticked_identifier = true
45
ktlint_code_style = intellij_idea # Use IntelliJ style because it has trailing commas

.idea/runConfigurations/app.xml

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,18 @@ Key Mapper is a free and open source Android app that can remap your buttons and
2727

2828
🎉 Check out the [website](https://docs.keymapper.club) for more information and help! 🎉
2929

30-
[//]: # (## Translations)
3130

32-
[//]: # ()
33-
[//]: # (![cs translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Czech&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27cs%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
31+
## Translations
3432

35-
[//]: # (![es-ES translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Spanish&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27es-ES%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
33+
[![cs proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=cs&style=flat&logo=crowdin&query=%24.progress.1.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
34+
[![es-ES proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=es-ES&style=flat&logo=crowdin&query=%24.progress.3.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
35+
[![pl proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=pl&style=flat&logo=crowdin&query=%24.progress.8.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
36+
[![pt-BR proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=pt-BR&style=flat&logo=crowdin&query=%24.progress.9.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
37+
[![ru proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=ru&style=flat&logo=crowdin&query=%24.progress.10.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
38+
[![sk proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=sk&style=flat&logo=crowdin&query=%24.progress.11.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
39+
[![zh-CN proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=zh-CN&style=flat&logo=crowdin&query=%24.progress.15.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
3640

37-
[//]: # (![pl translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Polish&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27pl%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
3841

39-
[//]: # (![ru translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Russian&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ru%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
40-
41-
[//]: # (![sk translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Slovak&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27sk%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
42-
43-
[//]: # (![vi translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Vietnamese&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27vi%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
44-
45-
[//]: # (![zh-CN translation](https://img.shields.io/badge/dynamic/json?color=blue&label=Chinese%20(Simplified)&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27zh-CN%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045.json))
4642
## Star History
4743

4844
[![Star History Chart](https://api.star-history.com/svg?repos=keymapperorg/KeyMapper&type=Date)](https://star-history.com/#keymapperorg/KeyMapper&Date)

app/build.gradle

Lines changed: 97 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
apply plugin: 'com.android.application'
2-
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-kapt'
1+
apply plugin: "com.android.application"
2+
apply plugin: "kotlin-android"
3+
apply plugin: "kotlin-kapt"
44
apply plugin: "androidx.navigation.safeargs.kotlin"
55
apply plugin: "kotlinx-serialization"
66
apply plugin: "org.jetbrains.kotlin.plugin.parcelize"
77
apply plugin: "org.jlleitschuh.gradle.ktlint"
88

99
android {
1010

11-
namespace 'io.github.sds100.keymapper'
11+
namespace "io.github.sds100.keymapper"
1212
compileSdk 34
13-
buildToolsVersion = '34.0.0'
13+
buildToolsVersion = "34.0.0"
1414

1515
def versionProperties = new Properties()
1616
file("version.properties").withInputStream { versionProperties.load(it) }
@@ -46,7 +46,7 @@ android {
4646

4747
release {
4848
minifyEnabled true
49-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
49+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
5050
signingConfig signingConfigs.release
5151
}
5252

@@ -55,31 +55,63 @@ android {
5555
versionNameSuffix "-debug"
5656
}
5757

58+
debug_release {
59+
// Extend from debug build type so compose Live Edit and rapid building works
60+
initWith debug
61+
62+
// Do not alter the package name so can test revenuecat and billing while developing.
63+
applicationIdSuffix ""
64+
65+
/*
66+
This is required because the splitties library does not have a debug_release build type.
67+
*/
68+
matchingFallbacks = ["debug"]
69+
}
70+
5871
ci {
5972
postprocessing {
6073
removeUnusedCode true
6174
removeUnusedResources true
6275
obfuscate false
6376
optimizeCode true
64-
proguardFiles 'proguard-rules.pro'
77+
proguardFiles "proguard-rules.pro"
6578
}
6679

6780
/*
68-
This is required because the splitties library doesn't have a ci build type.
81+
This is required because the splitties library does not have a ci build type.
6982
*/
70-
matchingFallbacks = ['debug']
83+
matchingFallbacks = ["debug"]
7184

7285
applicationIdSuffix ".ci"
7386
versionNameSuffix "-ci." + versionProperties.getProperty("VERSION_NUM")
7487
signingConfig signingConfigs.debug
7588
}
7689
}
7790

91+
flavorDimensions = ["pro"]
92+
productFlavors {
93+
free {
94+
dimension "pro"
95+
}
96+
pro {
97+
dimension "pro"
98+
99+
File file = rootProject.file("local.properties")
100+
101+
if (file.exists()) {
102+
def localProperties = new Properties()
103+
localProperties.load(new FileInputStream(file))
104+
buildConfigField("String", "REVENUECAT_API_KEY", localProperties["REVENUECAT_API_KEY"])
105+
}
106+
}
107+
}
108+
78109
buildFeatures {
79110
dataBinding true
80111
viewBinding true
81112
aidl true
82113
buildConfig true
114+
compose true
83115
}
84116

85117
compileOptions {
@@ -95,56 +127,66 @@ android {
95127
kapt {
96128
correctErrorTypes = true
97129
}
98-
}
99130

100-
android.sourceSets {
101-
androidTest {
102-
assets.srcDirs += files("$projectDir/schemas".toString())
103-
resources.srcDirs += ['src/test/resources']
131+
composeOptions {
132+
kotlinCompilerExtensionVersion "1.5.10"
133+
}
134+
135+
sourceSets {
136+
androidTest {
137+
assets.srcDirs += files("$projectDir/schemas".toString())
138+
resources.srcDirs += ["src/test/resources"]
139+
}
140+
141+
test {
142+
java.srcDirs += ["src/pro/test/java"]
143+
}
104144
}
105-
}
106145

107-
android.applicationVariants.all { variant ->
108-
variant.outputs.all {
109-
outputFileName = "keymapper-${variant.versionName}.apk"
146+
applicationVariants.configureEach { variant ->
147+
variant.outputs.configureEach {
148+
outputFileName = "keymapper-${variant.versionName}.apk"
149+
}
110150
}
111151
}
112152

113153
dependencies {
114-
implementation fileTree(include: ['*.jar'], dir: 'libs')
154+
implementation fileTree(include: ["*.jar"], dir: "libs")
115155

116-
compileOnly project(':systemstubs')
156+
compileOnly project(":systemstubs")
117157

118158
def room_version = "2.6.1"
119159
def coroutinesVersion = "1.9.0"
120-
def nav_version = '2.7.7'
160+
def nav_version = '2.8.4'
121161
def work_version = "2.9.1"
122162
def epoxy_version = "4.6.2"
123163
def splitties_version = "3.0.0"
124164
def multidex_version = "2.0.1"
125-
def shizuku_version = '13.1.5'
165+
def shizuku_version = "13.1.5"
126166

127167
// kotlin stuff
128168
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
129169
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
130170
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0"
131171

132172
// random stuff
133-
implementation 'com.google.android.material:material:1.12.0'
134-
implementation 'com.github.salomonbrys.kotson:kotson:2.5.0'
173+
implementation "com.google.android.material:material:1.12.0"
174+
implementation "com.github.salomonbrys.kotson:kotson:2.5.0"
135175
implementation "com.airbnb.android:epoxy:$epoxy_version"
136-
implementation 'com.github.AppIntro:AppIntro:6.1.0'
176+
implementation "com.github.AppIntro:AppIntro:6.1.0"
137177
implementation "com.airbnb.android:epoxy-databinding:$epoxy_version"
138178
kapt "com.airbnb.android:epoxy-processor:$epoxy_version"
139-
implementation 'com.jakewharton.timber:timber:4.7.1'
140-
implementation 'uk.co.samuelwall:material-tap-target-prompt:3.1.0'
141-
implementation 'net.lingala.zip4j:zip4j:2.8.0'
179+
implementation "com.jakewharton.timber:timber:4.7.1"
180+
implementation "uk.co.samuelwall:material-tap-target-prompt:3.1.0"
181+
implementation "net.lingala.zip4j:zip4j:2.8.0"
142182
implementation "com.anggrayudi:storage:0.8.1"
143-
implementation 'com.github.MFlisar:DragSelectRecyclerView:0.3'
144-
implementation 'com.google.android.flexbox:flexbox:3.0.0'
183+
implementation "com.github.MFlisar:DragSelectRecyclerView:0.3"
184+
implementation "com.google.android.flexbox:flexbox:3.0.0"
145185
implementation "dev.rikka.shizuku:api:$shizuku_version"
146186
implementation "dev.rikka.shizuku:provider:$shizuku_version"
147-
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
187+
implementation "org.lsposed.hiddenapibypass:hiddenapibypass:4.3"
188+
proImplementation 'com.revenuecat.purchases:purchases:8.8.1'
189+
148190

149191
// splitties
150192
implementation "com.louiscad.splitties:splitties-bitflags:$splitties_version"
@@ -155,31 +197,39 @@ dependencies {
155197
implementation "com.louiscad.splitties:splitties-mainthread:$splitties_version"
156198

157199
// androidx
158-
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
159-
implementation 'androidx.core:core-ktx:1.13.1'
160-
161-
implementation 'androidx.activity:activity-ktx:1.9.1'
162-
implementation 'androidx.fragment:fragment-ktx:1.8.2'
163-
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'
164-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
165-
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.4'
200+
implementation "androidx.legacy:legacy-support-core-ui:1.0.0"
201+
implementation "androidx.core:core-ktx:1.13.1"
202+
203+
implementation "androidx.activity:activity-ktx:1.9.3"
204+
implementation "androidx.fragment:fragment-ktx:1.8.5"
205+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7"
206+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.7"
207+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.7"
166208
implementation "androidx.room:room-ktx:$room_version"
167209
implementation "androidx.work:work-runtime-ktx:$work_version"
168210
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
169211
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
170212
implementation "androidx.multidex:multidex:$multidex_version"
171-
implementation 'androidx.appcompat:appcompat:1.7.0'
172-
implementation 'androidx.recyclerview:recyclerview:1.3.2'
173-
implementation 'androidx.preference:preference-ktx:1.2.1'
174-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
213+
implementation "androidx.appcompat:appcompat:1.7.0"
214+
implementation "androidx.recyclerview:recyclerview:1.3.2"
215+
implementation "androidx.preference:preference-ktx:1.2.1"
216+
implementation "androidx.constraintlayout:constraintlayout:2.2.0"
175217
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
176218
implementation "androidx.room:room-runtime:$room_version"
177219
implementation "androidx.viewpager2:viewpager2:1.1.0"
178220
implementation "androidx.datastore:datastore-preferences:1.1.1"
179221
implementation "androidx.core:core-splashscreen:1.0.1"
180222
kapt "androidx.room:room-compiler:$room_version"
181223

182-
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6'
224+
// Compose
225+
implementation "androidx.compose.ui:ui-android:1.7.5"
226+
implementation "androidx.compose.material3:material3-android:1.3.1"
227+
implementation "androidx.compose.ui:ui-tooling-preview-android:1.7.5"
228+
implementation "androidx.compose.material:material-icons-extended-android:1.7.5"
229+
debugImplementation "androidx.compose.ui:ui-tooling:1.7.5"
230+
debug_releaseImplementation "androidx.compose.ui:ui-tooling:1.7.5"
231+
232+
// debugImplementation "com.squareup.leakcanary:leakcanary-android:2.6"
183233

184234
def junitVersion = "4.13.2"
185235
def androidXTestExtKotlinRunnerVersion = "1.2.1"
@@ -197,16 +247,16 @@ dependencies {
197247
testImplementation "pl.pragmatists:JUnitParams:1.1.1"
198248
testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0"
199249
testImplementation "org.mockito:mockito-core:5.1.1"
200-
testImplementation 'org.mockito:mockito-inline:5.0.0'
250+
testImplementation "org.mockito:mockito-inline:5.0.0"
201251

202252
androidTestImplementation "androidx.test.ext:junit:$androidXTestExtKotlinRunnerVersion"
203253
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
204254
androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
205255
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
206256
androidTestImplementation "junit:junit:$junitVersion"
207257
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
208-
androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
258+
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
209259
androidTestImplementation "org.mockito:mockito-android:4.6.1"
210-
debugImplementation "androidx.fragment:fragment-testing:1.8.2"
260+
debugImplementation "androidx.fragment:fragment-testing:1.8.5"
211261
implementation "androidx.test:core:$androidXTestCoreVersion"
212262
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.github.sds100.keymapper
2+
3+
class MainActivity : BaseMainActivity()

0 commit comments

Comments
 (0)