Skip to content

Commit

Permalink
Merge pull request #1351 from keymapperorg/1274-set-key-mapper-as-the…
Browse files Browse the repository at this point in the history
…-device-assistant-to-trigger-key-maps

#1274 set key mapper as the device assistant to trigger key maps
  • Loading branch information
sds100 authored Dec 4, 2024
2 parents 9fbe7c9 + 7f630c2 commit 8fad3e2
Show file tree
Hide file tree
Showing 124 changed files with 2,747 additions and 1,380 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[*.{kt,kts}]
ktlint_standard_function-expression-body = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_ignore_back_ticked_identifier = true
ktlint_code_style = intellij_idea # Use IntelliJ style because it has trailing commas
68 changes: 68 additions & 0 deletions .idea/runConfigurations/app.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,18 @@ Key Mapper is a free and open source Android app that can remap your buttons and

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

[//]: # (## Translations)

[//]: # ()
[//]: # (![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))
## Translations

[//]: # (![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))
[![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)
[![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)
[![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)
[![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)
[![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)
[![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)
[![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)

[//]: # (![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))

[//]: # (![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))

[//]: # (![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))

[//]: # (![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))

[//]: # (![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))
## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=keymapperorg/KeyMapper&type=Date)](https://star-history.com/#keymapperorg/KeyMapper&Date)
Expand Down
144 changes: 97 additions & 47 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-kapt"
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: "kotlinx-serialization"
apply plugin: "org.jetbrains.kotlin.plugin.parcelize"
apply plugin: "org.jlleitschuh.gradle.ktlint"

android {

namespace 'io.github.sds100.keymapper'
namespace "io.github.sds100.keymapper"
compileSdk 34
buildToolsVersion = '34.0.0'
buildToolsVersion = "34.0.0"

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

release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}

Expand All @@ -55,31 +55,63 @@ android {
versionNameSuffix "-debug"
}

debug_release {
// Extend from debug build type so compose Live Edit and rapid building works
initWith debug

// Do not alter the package name so can test revenuecat and billing while developing.
applicationIdSuffix ""

/*
This is required because the splitties library does not have a debug_release build type.
*/
matchingFallbacks = ["debug"]
}

ci {
postprocessing {
removeUnusedCode true
removeUnusedResources true
obfuscate false
optimizeCode true
proguardFiles 'proguard-rules.pro'
proguardFiles "proguard-rules.pro"
}

/*
This is required because the splitties library doesn't have a ci build type.
This is required because the splitties library does not have a ci build type.
*/
matchingFallbacks = ['debug']
matchingFallbacks = ["debug"]

applicationIdSuffix ".ci"
versionNameSuffix "-ci." + versionProperties.getProperty("VERSION_NUM")
signingConfig signingConfigs.debug
}
}

flavorDimensions = ["pro"]
productFlavors {
free {
dimension "pro"
}
pro {
dimension "pro"

File file = rootProject.file("local.properties")

if (file.exists()) {
def localProperties = new Properties()
localProperties.load(new FileInputStream(file))
buildConfigField("String", "REVENUECAT_API_KEY", localProperties["REVENUECAT_API_KEY"])
}
}
}

buildFeatures {
dataBinding true
viewBinding true
aidl true
buildConfig true
compose true
}

compileOptions {
Expand All @@ -95,56 +127,66 @@ android {
kapt {
correctErrorTypes = true
}
}

android.sourceSets {
androidTest {
assets.srcDirs += files("$projectDir/schemas".toString())
resources.srcDirs += ['src/test/resources']
composeOptions {
kotlinCompilerExtensionVersion "1.5.10"
}

sourceSets {
androidTest {
assets.srcDirs += files("$projectDir/schemas".toString())
resources.srcDirs += ["src/test/resources"]
}

test {
java.srcDirs += ["src/pro/test/java"]
}
}
}

android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "keymapper-${variant.versionName}.apk"
applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "keymapper-${variant.versionName}.apk"
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ["*.jar"], dir: "libs")

compileOnly project(':systemstubs')
compileOnly project(":systemstubs")

def room_version = "2.6.1"
def coroutinesVersion = "1.9.0"
def nav_version = '2.7.7'
def nav_version = '2.8.4'
def work_version = "2.9.1"
def epoxy_version = "4.6.2"
def splitties_version = "3.0.0"
def multidex_version = "2.0.1"
def shizuku_version = '13.1.5'
def shizuku_version = "13.1.5"

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

// random stuff
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.github.salomonbrys.kotson:kotson:2.5.0'
implementation "com.google.android.material:material:1.12.0"
implementation "com.github.salomonbrys.kotson:kotson:2.5.0"
implementation "com.airbnb.android:epoxy:$epoxy_version"
implementation 'com.github.AppIntro:AppIntro:6.1.0'
implementation "com.github.AppIntro:AppIntro:6.1.0"
implementation "com.airbnb.android:epoxy-databinding:$epoxy_version"
kapt "com.airbnb.android:epoxy-processor:$epoxy_version"
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'uk.co.samuelwall:material-tap-target-prompt:3.1.0'
implementation 'net.lingala.zip4j:zip4j:2.8.0'
implementation "com.jakewharton.timber:timber:4.7.1"
implementation "uk.co.samuelwall:material-tap-target-prompt:3.1.0"
implementation "net.lingala.zip4j:zip4j:2.8.0"
implementation "com.anggrayudi:storage:0.8.1"
implementation 'com.github.MFlisar:DragSelectRecyclerView:0.3'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation "com.github.MFlisar:DragSelectRecyclerView:0.3"
implementation "com.google.android.flexbox:flexbox:3.0.0"
implementation "dev.rikka.shizuku:api:$shizuku_version"
implementation "dev.rikka.shizuku:provider:$shizuku_version"
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
implementation "org.lsposed.hiddenapibypass:hiddenapibypass:4.3"
proImplementation 'com.revenuecat.purchases:purchases:8.8.1'


// splitties
implementation "com.louiscad.splitties:splitties-bitflags:$splitties_version"
Expand All @@ -155,31 +197,39 @@ dependencies {
implementation "com.louiscad.splitties:splitties-mainthread:$splitties_version"

// androidx
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.core:core-ktx:1.13.1'

implementation 'androidx.activity:activity-ktx:1.9.1'
implementation 'androidx.fragment:fragment-ktx:1.8.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.4'
implementation "androidx.legacy:legacy-support-core-ui:1.0.0"
implementation "androidx.core:core-ktx:1.13.1"

implementation "androidx.activity:activity-ktx:1.9.3"
implementation "androidx.fragment:fragment-ktx:1.8.5"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.7"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.7"
implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.work:work-runtime-ktx:$work_version"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.multidex:multidex:$multidex_version"
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "androidx.constraintlayout:constraintlayout:2.2.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.viewpager2:viewpager2:1.1.0"
implementation "androidx.datastore:datastore-preferences:1.1.1"
implementation "androidx.core:core-splashscreen:1.0.1"
kapt "androidx.room:room-compiler:$room_version"

// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6'
// Compose
implementation "androidx.compose.ui:ui-android:1.7.5"
implementation "androidx.compose.material3:material3-android:1.3.1"
implementation "androidx.compose.ui:ui-tooling-preview-android:1.7.5"
implementation "androidx.compose.material:material-icons-extended-android:1.7.5"
debugImplementation "androidx.compose.ui:ui-tooling:1.7.5"
debug_releaseImplementation "androidx.compose.ui:ui-tooling:1.7.5"

// debugImplementation "com.squareup.leakcanary:leakcanary-android:2.6"

def junitVersion = "4.13.2"
def androidXTestExtKotlinRunnerVersion = "1.2.1"
Expand All @@ -197,16 +247,16 @@ dependencies {
testImplementation "pl.pragmatists:JUnitParams:1.1.1"
testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0"
testImplementation "org.mockito:mockito-core:5.1.1"
testImplementation 'org.mockito:mockito-inline:5.0.0'
testImplementation "org.mockito:mockito-inline:5.0.0"

androidTestImplementation "androidx.test.ext:junit:$androidXTestExtKotlinRunnerVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
androidTestImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
androidTestImplementation "org.mockito:mockito-android:4.6.1"
debugImplementation "androidx.fragment:fragment-testing:1.8.2"
debugImplementation "androidx.fragment:fragment-testing:1.8.5"
implementation "androidx.test:core:$androidXTestCoreVersion"
}
3 changes: 3 additions & 0 deletions app/src/free/java/io/github/sds100/keymapper/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.github.sds100.keymapper

class MainActivity : BaseMainActivity()
Loading

0 comments on commit 8fad3e2

Please sign in to comment.