Skip to content

Commit 6000845

Browse files
committed
Merge branch 'develop'
2 parents 0dabf6d + f79d8f1 commit 6000845

File tree

193 files changed

+2686
-779
lines changed

Some content is hidden

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

193 files changed

+2686
-779
lines changed

.github/workflows/production.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v3
2020

21-
- uses: actions/cache@v2
21+
- uses: actions/cache@v3
2222
with:
2323
path: |
2424
~/.gradle/caches
@@ -27,10 +27,12 @@ jobs:
2727
restore-keys: |
2828
${{ runner.os }}-gradle-
2929
30-
- name: set up JDK 1.17
31-
uses: actions/setup-java@v1
30+
- name: set up JDK 17
31+
uses: actions/setup-java@v3
3232
with:
33-
java-version: 1.17
33+
distribution: 'oracle'
34+
java-version: 17
35+
cache: 'gradle'
3436

3537
- name: Setup Android SDK
3638
uses: android-actions/setup-android@v2

.github/workflows/pull-request.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Pull request
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
apk:
8+
name: Build APK
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v3
13+
14+
- uses: actions/cache@v3
15+
with:
16+
path: |
17+
~/.gradle/caches
18+
~/.gradle/wrapper
19+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
20+
restore-keys: |
21+
${{ runner.os }}-gradle-
22+
23+
- name: set up JDK 17
24+
uses: actions/setup-java@v3
25+
with:
26+
distribution: 'oracle'
27+
java-version: 17
28+
cache: 'gradle'
29+
30+
- name: Setup Android SDK
31+
uses: android-actions/setup-android@v2
32+
33+
- name: set up Ruby for fastlane
34+
uses: ruby/setup-ruby@v1
35+
with:
36+
ruby-version: '2.7'
37+
38+
- name: Create debug keystore
39+
env:
40+
CI_KEYSTORE: ${{ secrets.CI_KEYSTORE }}
41+
run: |
42+
echo "$CI_KEYSTORE" | base64 --decode > /home/runner/.android/debug.keystore
43+
44+
- name: Install bundle
45+
run: bundle install
46+
47+
- name: Build apk with fastlane
48+
run: bundle exec fastlane testing

.github/workflows/testing.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v3
1919

20-
- uses: actions/cache@v2
20+
- uses: actions/cache@v3
2121
with:
2222
path: |
2323
~/.gradle/caches
@@ -32,10 +32,12 @@ jobs:
3232
property: VERSION_NUM
3333
value: ${{ github.run_number }}
3434

35-
- name: set up JDK 1.17
36-
uses: actions/setup-java@v1
35+
- name: set up JDK 17
36+
uses: actions/setup-java@v3
3737
with:
38-
java-version: 1.17
38+
distribution: 'oracle'
39+
java-version: 17
40+
cache: 'gradle'
3941

4042
- name: Setup Android SDK
4143
uses: android-actions/setup-android@v2
@@ -46,9 +48,10 @@ jobs:
4648
ruby-version: '2.7'
4749

4850
- name: Create debug keystore
51+
env:
52+
CI_KEYSTORE: ${{ secrets.CI_KEYSTORE }}
4953
run: |
50-
echo "${{ secrets.CI_KEYSTORE }}" > debug.keystore.asc
51-
gpg -d --passphrase "${{ secrets.CI_KEYSTORE_DECRYPT }}" --batch debug.keystore.asc > /home/runner/.android/debug.keystore
54+
echo "$CI_KEYSTORE" | base64 --decode > /home/runner/.android/debug.keystore
5255
5356
- name: Install bundle
5457
run: bundle install

app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
2020
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
2121
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
22-
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
22+
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
2323

2424
<!-- This permission is in each build variant's AndroidManifest -->
2525
<!-- <permission android:name="io.github.sds100.keymapper.KEY_EVENT_RECEIVER">-->
@@ -58,7 +58,7 @@
5858
<uses-feature
5959
android:name="android.hardware.telephony"
6060
android:required="false" />
61-
61+
6262
<uses-feature
6363
android:name="android.hardware.bluetooth"
6464
android:required="false" />
@@ -102,10 +102,10 @@
102102
<activity
103103
android:name=".api.LaunchKeyMapShortcutActivity"
104104
android:excludeFromRecents="true"
105+
android:exported="true"
105106
android:finishOnTaskLaunch="true"
106107
android:launchMode="singleInstance"
107108
android:taskAffinity=""
108-
android:exported="true"
109109
android:theme="@android:style/Theme.NoDisplay">
110110
<intent-filter>
111111
<action android:name="android.intent.action.MAIN" />
@@ -115,8 +115,8 @@
115115
<!-- Use a different task affinity so this activity can be opened at the same time as others -->
116116
<activity
117117
android:name=".mappings.keymaps.CreateKeyMapShortcutActivity"
118-
android:label="@string/shortcut_label_action"
119118
android:exported="true"
119+
android:label="@string/shortcut_label_action"
120120
android:taskAffinity="">
121121
<intent-filter>
122122
<action android:name="android.intent.action.CREATE_SHORTCUT" />
@@ -189,8 +189,8 @@
189189

190190
<service
191191
android:name=".system.inputmethod.KeyMapperImeService"
192-
android:label="@string/ime_service_label"
193192
android:exported="true"
193+
android:label="@string/ime_service_label"
194194
android:permission="android.permission.BIND_INPUT_METHOD">
195195
<intent-filter>
196196
<action android:name="android.view.InputMethod" />
@@ -202,9 +202,9 @@
202202

203203
<service
204204
android:name=".system.tiles.ToggleMappingsTile"
205+
android:exported="true"
205206
android:icon="@drawable/ic_tile_pause"
206207
android:label="@string/tile_pause"
207-
android:exported="true"
208208
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
209209
<intent-filter>
210210
<action android:name="android.service.quicksettings.action.QS_TILE" />
@@ -213,9 +213,9 @@
213213

214214
<service
215215
android:name=".system.tiles.ToggleKeyMapperKeyboardTile"
216+
android:exported="true"
216217
android:icon="@drawable/ic_tile_keyboard"
217218
android:label="@string/tile_toggle_keymapper_keyboard"
218-
android:exported="true"
219219
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
220220
<intent-filter>
221221
<action android:name="android.service.quicksettings.action.QS_TILE" />
@@ -224,8 +224,8 @@
224224

225225
<service
226226
android:name="io.github.sds100.keymapper.system.notifications.NotificationReceiver"
227-
android:label="Key Mapper Notification Receiver"
228227
android:exported="true"
228+
android:label="Key Mapper Notification Receiver"
229229
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
230230
<intent-filter>
231231
<action android:name="android.service.notification.NotificationListenerService" />

app/src/main/assets/whats-new.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Action for doing swipe gestures on the screen with 1 or more fingers. Many thanks to Tino (@pixel-shock) for working on this feature. 😊
1+
Action for doing pinches and swipes on the screen with 2 or more fingers. Many thanks to Tino (@pixel-shock) for working on this feature. 😊

app/src/main/java/io/github/sds100/keymapper/KeyMapperApp.kt

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ class KeyMapperApp : MultiDexApplication() {
7878

7979
val packageManagerAdapter by lazy {
8080
AndroidPackageManagerAdapter(
81-
this,
81+
this,
8282
appCoroutineScope
8383
)
8484
}
8585

8686
val inputMethodAdapter by lazy {
8787
AndroidInputMethodAdapter(
88-
this,
89-
appCoroutineScope,
90-
accessibilityServiceAdapter,
91-
permissionAdapter,
92-
suAdapter
88+
this,
89+
appCoroutineScope,
90+
accessibilityServiceAdapter,
91+
permissionAdapter,
92+
suAdapter
9393
)
9494
}
9595
val devicesAdapter by lazy {
@@ -103,10 +103,10 @@ class KeyMapperApp : MultiDexApplication() {
103103
val cameraAdapter by lazy { AndroidCameraAdapter(this) }
104104
val permissionAdapter by lazy {
105105
AndroidPermissionAdapter(
106-
this,
107-
appCoroutineScope,
108-
suAdapter,
109-
notificationReceiverAdapter
106+
this,
107+
appCoroutineScope,
108+
suAdapter,
109+
notificationReceiverAdapter
110110
)
111111
}
112112

@@ -144,18 +144,18 @@ class KeyMapperApp : MultiDexApplication() {
144144

145145
val autoGrantPermissionController by lazy {
146146
AutoGrantPermissionController(
147-
appCoroutineScope,
148-
permissionAdapter,
149-
popupMessageAdapter,
150-
resourceProvider
147+
appCoroutineScope,
148+
permissionAdapter,
149+
popupMessageAdapter,
150+
resourceProvider
151151
)
152152
}
153153

154154
private val loggingTree by lazy {
155155
KeyMapperLoggingTree(
156-
appCoroutineScope,
157-
ServiceLocator.settingsRepository(this),
158-
ServiceLocator.logRepository(this)
156+
appCoroutineScope,
157+
ServiceLocator.settingsRepository(this),
158+
ServiceLocator.logRepository(this)
159159
)
160160
}
161161

@@ -167,10 +167,10 @@ class KeyMapperApp : MultiDexApplication() {
167167
Thread.setDefaultUncaughtExceptionHandler { thread, exception ->
168168
//log in a blocking manner and always log regardless of whether the setting is turned on
169169
val entry = LogEntryEntity(
170-
id = 0,
171-
time = Calendar.getInstance().timeInMillis,
172-
severity = LogEntryEntity.SEVERITY_ERROR,
173-
message = exception.stackTraceToString()
170+
id = 0,
171+
time = Calendar.getInstance().timeInMillis,
172+
severity = LogEntryEntity.SEVERITY_ERROR,
173+
message = exception.stackTraceToString()
174174
)
175175

176176
runBlocking {
@@ -195,8 +195,8 @@ class KeyMapperApp : MultiDexApplication() {
195195
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
196196
}
197197
}
198-
.onEach { mode -> AppCompatDelegate.setDefaultNightMode(mode) }
199-
.launchIn(appCoroutineScope)
198+
.onEach { mode -> AppCompatDelegate.setDefaultNightMode(mode) }
199+
.launchIn(appCoroutineScope)
200200

201201
if (BuildConfig.BUILD_TYPE == "debug" || BuildConfig.BUILD_TYPE == "debug_release") {
202202
Timber.plant(Timber.DebugTree())
@@ -222,14 +222,14 @@ class KeyMapperApp : MultiDexApplication() {
222222
)
223223

224224
autoSwitchImeController = AutoSwitchImeController(
225-
appCoroutineScope,
226-
ServiceLocator.settingsRepository(this),
227-
ServiceLocator.inputMethodAdapter(this),
228-
UseCases.pauseMappings(this),
229-
devicesAdapter,
230-
popupMessageAdapter,
231-
resourceProvider,
232-
ServiceLocator.accessibilityServiceAdapter(this)
225+
appCoroutineScope,
226+
ServiceLocator.settingsRepository(this),
227+
ServiceLocator.inputMethodAdapter(this),
228+
UseCases.pauseMappings(this),
229+
devicesAdapter,
230+
popupMessageAdapter,
231+
resourceProvider,
232+
ServiceLocator.accessibilityServiceAdapter(this)
233233
)
234234

235235
processLifecycleOwner.lifecycle.addObserver(object : LifecycleObserver {

app/src/main/java/io/github/sds100/keymapper/MainActivity.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MainActivity : AppCompatActivity() {
2525

2626
companion object {
2727
const val ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG =
28-
"$PACKAGE_NAME.ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG"
28+
"$PACKAGE_NAME.ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG"
2929
}
3030

3131
private val viewModel by viewModels<ActivityViewModel> {
@@ -51,14 +51,14 @@ class MainActivity : AppCompatActivity() {
5151
requestPermissionDelegate = RequestPermissionDelegate(this, showDialogs = true)
5252

5353
ServiceLocator.permissionAdapter(this@MainActivity).request
54-
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
55-
.onEach { permission ->
56-
requestPermissionDelegate.requestPermission(
57-
permission,
58-
findNavController(R.id.container)
59-
)
60-
}
61-
.launchIn(lifecycleScope)
54+
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
55+
.onEach { permission ->
56+
requestPermissionDelegate.requestPermission(
57+
permission,
58+
findNavController(R.id.container)
59+
)
60+
}
61+
.launchIn(lifecycleScope)
6262

6363
if (intent.action == ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG) {
6464
viewModel.onCantFindAccessibilitySettings()

app/src/main/java/io/github/sds100/keymapper/ServiceLocator.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import io.github.sds100.keymapper.actions.sound.SoundsManagerImpl
88
import io.github.sds100.keymapper.backup.BackupManager
99
import io.github.sds100.keymapper.backup.BackupManagerImpl
1010
import io.github.sds100.keymapper.data.db.AppDatabase
11-
import io.github.sds100.keymapper.data.repositories.*
11+
import io.github.sds100.keymapper.data.repositories.PreferenceRepository
12+
import io.github.sds100.keymapper.data.repositories.RoomFingerprintMapRepository
13+
import io.github.sds100.keymapper.data.repositories.RoomKeyMapRepository
14+
import io.github.sds100.keymapper.data.repositories.RoomLogRepository
15+
import io.github.sds100.keymapper.data.repositories.SettingsPreferenceRepository
1216
import io.github.sds100.keymapper.logging.LogRepository
1317
import io.github.sds100.keymapper.mappings.fingerprintmaps.FingerprintMapRepository
1418
import io.github.sds100.keymapper.shizuku.ShizukuAdapter

app/src/main/java/io/github/sds100/keymapper/UseCases.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import io.github.sds100.keymapper.mappings.DisplaySimpleMappingUseCaseImpl
1313
import io.github.sds100.keymapper.mappings.PauseMappingsUseCaseImpl
1414
import io.github.sds100.keymapper.mappings.fingerprintmaps.AreFingerprintGesturesSupportedUseCaseImpl
1515
import io.github.sds100.keymapper.mappings.fingerprintmaps.DetectFingerprintMapsUseCaseImpl
16-
import io.github.sds100.keymapper.mappings.keymaps.*
16+
import io.github.sds100.keymapper.mappings.keymaps.ConfigKeyMapUseCase
17+
import io.github.sds100.keymapper.mappings.keymaps.ConfigKeyMapUseCaseImpl
18+
import io.github.sds100.keymapper.mappings.keymaps.CreateKeyMapShortcutUseCaseImpl
19+
import io.github.sds100.keymapper.mappings.keymaps.DisplayKeyMapUseCase
20+
import io.github.sds100.keymapper.mappings.keymaps.DisplayKeyMapUseCaseImpl
1721
import io.github.sds100.keymapper.mappings.keymaps.detection.DetectKeyMapsUseCaseImpl
1822
import io.github.sds100.keymapper.onboarding.OnboardingUseCaseImpl
1923
import io.github.sds100.keymapper.reroutekeyevents.RerouteKeyEventsUseCaseImpl

0 commit comments

Comments
 (0)