Skip to content

Commit 6bab804

Browse files
authored
Merge pull request #17 from sameerasw/develop
Develop
2 parents cd35e92 + 45111d1 commit 6bab804

38 files changed

+2262
-406
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ A collection of useful tiles to toggle system settings:
6464
<img src="https://github.com/user-attachments/assets/50d762a5-5bc6-46e7-a9ce-9ccfc207957f" width="19%" />
6565
<img src="https://github.com/user-attachments/assets/d77c91c0-a1b3-45e4-9123-eee0f09a558f" width="19%" />
6666
</p>
67+
68+
# How to grant accessibility permissions
69+
<img width="1280" height="696" alt="image" src="https://github.com/user-attachments/assets/685115e7-4caa-4add-9196-d2e1e2c126a6" />

app/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId = "com.sameerasw.essentials"
1515
minSdk = 23
1616
targetSdk = 36
17-
versionCode = 8
18-
versionName = "6.0"
17+
versionCode = 9
18+
versionName = "7.0"
1919

2020
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2121
}
@@ -38,6 +38,7 @@ android {
3838
}
3939
buildFeatures {
4040
compose = true
41+
buildConfig = true
4142
}
4243
}
4344

@@ -60,6 +61,7 @@ dependencies {
6061
implementation(libs.androidx.appcompat)
6162
implementation("androidx.activity:activity-compose:1.8.0")
6263
implementation("io.coil-kt:coil-compose:2.5.0")
64+
implementation(libs.androidx.compose.foundation.layout)
6365
testImplementation(libs.junit)
6466
androidTestImplementation(libs.androidx.junit)
6567
androidTestImplementation(libs.androidx.espresso.core)
@@ -72,6 +74,9 @@ dependencies {
7274
implementation(libs.shizuku.api)
7375
implementation(libs.shizuku.provider)
7476

77+
// Hidden API Bypass
78+
implementation(libs.hiddenapibypass)
79+
7580
// Gson for JSON serialization
7681
implementation("com.google.code.gson:gson:2.10.1")
7782

app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
1818
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
1919

20+
<instrumentation
21+
android:name=".services.PixelImsInstrumentation"
22+
android:targetPackage="${applicationId}" />
23+
24+
<overlay
25+
android:requiredSystemPropertyName="ro.boot.vbmeta.device_state"
26+
android:requiredSystemPropertyValue="locked"
27+
android:targetPackage="${applicationId}" />
28+
2029
<application
2130
android:name=".EssentialsApp"
2231
android:allowBackup="true"
@@ -214,7 +223,7 @@
214223
android:foregroundServiceType="specialUse" />
215224

216225
<provider
217-
android:name="rikka.shizuku.ShizukuProvider"
226+
android:name=".services.PixelImsProvider"
218227
android:authorities="${applicationId}.shizuku"
219228
android:multiprocess="false"
220229
android:enabled="true"

app/src/main/java/com/sameerasw/essentials/FeatureSettingsActivity.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import com.sameerasw.essentials.ui.composables.configs.ScreenOffWidgetSettingsUI
4242
import com.sameerasw.essentials.ui.composables.configs.EdgeLightingSettingsUI
4343
import com.sameerasw.essentials.ui.composables.configs.SoundModeTileSettingsUI
4444
import com.sameerasw.essentials.ui.composables.configs.QuickSettingsTilesSettingsUI
45-
import com.sameerasw.essentials.ui.composables.configs.FlashlightSettingsUI
45+
import com.sameerasw.essentials.ui.composables.configs.ButtonRemapSettingsUI
4646
import com.sameerasw.essentials.ui.composables.configs.DynamicNightLightSettingsUI
4747
import com.sameerasw.essentials.ui.composables.configs.SnoozeNotificationsSettingsUI
4848
import com.sameerasw.essentials.viewmodels.CaffeinateViewModel
@@ -68,7 +68,9 @@ class FeatureSettingsActivity : ComponentActivity() {
6868
"Flashlight toggle" to "Toggle flashlight while screen off",
6969
"Dynamic night light" to "Toggle based on current app",
7070
"Snooze system notifications" to "Automatically snooze persistent notifications",
71-
"Quick Settings Tiles" to "All available QS tiles"
71+
"Quick Settings Tiles" to "All available QS tiles",
72+
"Pixel IMS" to "Force enable IMS for Pixels",
73+
"Button remap" to "Remap hardware buttons"
7274
)
7375
val description = featureDescriptions[feature] ?: ""
7476
setContent {
@@ -113,7 +115,7 @@ class FeatureSettingsActivity : ComponentActivity() {
113115
"Screen off widget" -> !isAccessibilityEnabled
114116
"Statusbar icons" -> !isWriteSecureSettingsEnabled
115117
"Edge lighting" -> !isOverlayPermissionGranted || !isEdgeLightingAccessibilityEnabled || !isNotificationListenerEnabled
116-
"Flashlight toggle" -> !isAccessibilityEnabled
118+
"Button remap" -> !isAccessibilityEnabled
117119
"Dynamic night light" -> !isAccessibilityEnabled || !isWriteSecureSettingsEnabled
118120
"Snooze system notifications" -> !isNotificationListenerEnabled
119121
else -> false
@@ -193,17 +195,15 @@ class FeatureSettingsActivity : ComponentActivity() {
193195
isGranted = isNotificationListenerEnabled
194196
)
195197
)
196-
"Flashlight toggle" -> listOf(
198+
"Button remap" -> listOf(
197199
PermissionItem(
198200
iconRes = R.drawable.rounded_settings_accessibility_24,
199201
title = "Accessibility Service",
200-
description = "Required to intercept volume button presses when the screen is off",
202+
description = "Required to intercept hardware button events",
201203
dependentFeatures = PermissionRegistry.getFeatures("ACCESSIBILITY"),
202204
actionLabel = "Enable in Settings",
203205
action = {
204-
val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
205-
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
206-
context.startActivity(intent)
206+
context.startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS))
207207
},
208208
isGranted = isAccessibilityEnabled
209209
)
@@ -323,18 +323,18 @@ class FeatureSettingsActivity : ComponentActivity() {
323323
"Sound mode tile" -> {
324324
SoundModeTileSettingsUI(modifier = Modifier.padding(top = 16.dp))
325325
}
326-
"Flashlight toggle" -> {
327-
FlashlightSettingsUI(
326+
"Button remap" -> {
327+
ButtonRemapSettingsUI(
328328
viewModel = viewModel,
329329
modifier = Modifier.padding(top = 16.dp)
330330
)
331331
}
332332
"Dynamic night light" -> {
333-
DynamicNightLightSettingsUI(
334-
viewModel = viewModel,
335-
modifier = Modifier.padding(top = 16.dp)
336-
)
337-
}
333+
com.sameerasw.essentials.ui.composables.configs.DynamicNightLightSettingsUI(viewModel = viewModel)
334+
}
335+
"Pixel IMS" -> {
336+
com.sameerasw.essentials.ui.composables.configs.PixelImsSettingsUI(viewModel = viewModel)
337+
}
338338
"Snooze system notifications" -> {
339339
SnoozeNotificationsSettingsUI(
340340
viewModel = viewModel,

0 commit comments

Comments
 (0)