Skip to content

Commit 0bad6f4

Browse files
authored
Merge branch 'ltrudu:master' into master
2 parents 6607e2d + 058f182 commit 0bad6f4

File tree

11 files changed

+383
-159
lines changed

11 files changed

+383
-159
lines changed

CriticalPermissionsHelper/build.gradle

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ plugins {
44
ext {
55
PUBLISH_GROUP_ID = 'com.zebra.criticalpermissionshelper'
66
PUBLISH_ARTIFACT_ID = 'criticalpermissionshelper'
7-
PUBLISH_VERSION = '0.8.2'
7+
PUBLISH_VERSION = '1.15.0'
88
}
99

1010
android {
11-
compileSdkVersion 34
11+
namespace "com.zebra.criticalpermissionshelper"
12+
compileSdkVersion 35
1213

1314
defaultConfig {
1415
minSdkVersion 30
15-
targetSdkVersion 34
16-
versionCode 9
17-
versionName "0.8.2"
16+
targetSdkVersion 35
17+
versionCode 15
18+
versionName "1.15.0"
1819

1920
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2021

@@ -30,7 +31,12 @@ android {
3031
sourceCompatibility JavaVersion.VERSION_1_8
3132
targetCompatibility JavaVersion.VERSION_1_8
3233
}
33-
34+
publishing{
35+
singleVariant("release") {
36+
withSourcesJar()
37+
withJavadocJar()
38+
}
39+
}
3440
}
3541

3642
dependencies {
@@ -40,3 +46,24 @@ dependencies {
4046
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
4147
compileOnly 'com.symbol:emdk:9.1.1'
4248
}
49+
50+
afterEvaluate {
51+
publishing {
52+
publications {
53+
release(MavenPublication) {
54+
groupId = 'com.zebra.criticalpermissionshelper'
55+
artifactId = 'criticalpermissionshelper'
56+
version = '1.15.0'
57+
58+
afterEvaluate {
59+
from components.findByName('release')
60+
}
61+
}
62+
}
63+
}
64+
}
65+
java {
66+
toolchain {
67+
languageVersion = JavaLanguageVersion.of(17)
68+
}
69+
}

CriticalPermissionsHelper/src/main/java/com/zebra/criticalpermissionshelper/EPermissionType.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ public enum EPermissionType
1010
MANAGE_EXTERNAL_STORAGE( "android.permission.MANAGE_EXTERNAL_STORAGE" ),
1111
BIND_NOTIFICATION_LISTENER( "android.permission.BIND_NOTIFICATION_LISTENER" ),
1212
READ_LOGS( "android.permission.READ_LOGS" ),
13-
ALL_DANGEROUS_PERMISSIONS( "ALL_DANGEROUS_PERMISSIONS" );
13+
ALL_DANGEROUS_PERMISSIONS( "ALL_DANGEROUS_PERMISSIONS" ),
14+
ACCESS_RX_LOGGER( "com.zebra.permission.ACCESS_RXLOGGER" ),
15+
SCHEDULE_EXACT_ALARM( "android.permission.SCHEDULE_EXACT_ALARM" ),
16+
WRITE_SETTINGS( "android.permission.WRITE_SETTINGS" ),
17+
ACCESSIBILITY_SERVICE( "ACCESSIBILITY_SERVICE_ACCESS" );
1418

1519
String stringContent = "";
1620
EPermissionType(String stringContent)
@@ -45,6 +49,14 @@ public static EPermissionType fromString(String permissionType)
4549
return READ_LOGS;
4650
case "ALL_DANGEROUS_PERMISSIONS":
4751
return ALL_DANGEROUS_PERMISSIONS;
52+
case "com.zebra.permission.ACCESS_RXLOGGER":
53+
return ACCESS_RX_LOGGER;
54+
case "android.permission.SCHEDULE_EXACT_ALARM":
55+
return SCHEDULE_EXACT_ALARM;
56+
case "android.permission.WRITE_SETTINGS":
57+
return WRITE_SETTINGS;
58+
case "ACCESSIBILITY_SERVICE_ACCESS":
59+
return ACCESSIBILITY_SERVICE;
4860
default:
4961
return null;
5062
}

CriticalPermissionsHelper/src/main/java/com/zebra/criticalpermissionshelper/ProfileManagerCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void onClosed() {
107107
protected ProfileManagerCommand(Context aContext) {
108108
super(aContext);
109109
mSettings = new CommandBaseSettings(){{
110-
mTimeOutMS = 20000;
110+
mTimeOutMS = 60000;
111111
mEnableTimeOutMechanism = true;
112112
mCommandId = "DWProfileManagerCommand";
113113
}};

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Forget about AccessMgr, StageNow, EMDK, certificates, application signature... c
1212

1313
Just grant some critical permissions on your Zebra device in one method call (see at the end of this document).
1414

15-
Includes: ACCESS_NOTIFICATIONS, PACKAGE_USAGE_STATS, SYSTEM_ALERT_WINDOW, BATTERY_STATS, MANAGE_EXTERNAL_STORAGE, GET_APP_OPS_STATS, ALL_DANGEROUS_PERMISSIONS
15+
Includes: ACCESS_NOTIFICATIONS, PACKAGE_USAGE_STATS, SYSTEM_ALERT_WINDOW, BATTERY_STATS, MANAGE_EXTERNAL_STORAGE, GET_APP_OPS_STATS, ALL_DANGEROUS_PERMISSIONS, WRITE_SETTINGS, ACCESSIBILITY_SERVICE
1616

1717
Have fun with Zebra's devices :)
1818

@@ -48,6 +48,19 @@ Controls management of USB and/or SD card storage media attached to the device.
4848
Grants all permissions that requires runtime permission model
4949
To know which permissions are listed as Dangerous, execute the following ADB command:
5050
adb shell pm list permissions -g -d
51+
52+
#8. Access RX Logger
53+
Controls access to Zebra RxLogger diagnostics utility usage on the device.
54+
55+
#9. Schedule Exact Alarm
56+
Allows a user-facing app use Android exact alarm APIs to trigger an alarm at an exact time in the future, such as for an alarm clock or calendar app.
57+
58+
#10. Write Settings
59+
Allows an app to write (or read) Android system settings.
60+
61+
#11. Accessibility Service
62+
Controls permission for an app to interact with the device UI, for example to act on behalf of a disabled user.
63+
5164
```
5265

5366
This wrapper will use the EMDK with MX's AccessMgr feature to grant, deny or verify (WIP) critical permissions.
@@ -192,6 +205,10 @@ EPermissionType.GET_APP_OPS_STATS
192205
EPermissionType.BATTERY_STATS
193206
EPermissionType.MANAGE_EXTERNAL_STORAGE
194207
EPermissionType.ALL_DANGEROUS_PERMISSIONS
208+
EPermissionType.ACCESS_RX_LOGGER
209+
EPermissionType.SCHEDULE_EXACT_ALARM
210+
EPermissionType.WRITE_SETTINGS
211+
EPermissionType.ACCESSIBILITY_SERVICE
195212
```
196213

197214
Snippet code to grant a permission:

Settings.System-TC53-58.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
*List of Settings that can be read or written with the WRITE_SETTINGS permission on TC53/58*
2+
=========================================================
3+
# BSP: Android 14 (BSP: 14-28-03.00-UG-U60-STD-ATH-04)
4+
5+
| Category | Setting Key | Description | Data Type | Default Value |
6+
| --------------- | ------------------------------------ | ----------------------------------------------------------- | --------- | ---------------------------- |
7+
| Display | `accelerometer_rotation` | Auto-rotate screen based on orientation | int | 1 (enabled) |
8+
| | `dim_screen` | Dim screen in battery saver mode (deprecated in later APIs) | int | 1 (enabled) |
9+
| | `display_default_density_value` | Default screen pixel density (dpi) | int | Device-specific (e.g., 480) |
10+
| | `display_default_resolution_height` | Default screen height in pixels | int | Device-specific (e.g., 2160) |
11+
| | `display_default_resolution_width` | Default screen width in pixels | int | Device-specific (e.g., 1080) |
12+
| | `font_scale` | System font size multiplier | float | 1.0 (100%) |
13+
| | `min_refresh_rate` | Minimum display refresh rate (Hz) | float | Device-specific (e.g., 60.0) |
14+
| | `peak_refresh_rate` | Maximum display refresh rate (Hz) | float | Device-specific (e.g., 60.0) |
15+
| | `screen_auto_brightness_adj` | Auto-brightness adjustment factor (-1.0 to 1.0) | float | 0.0 (neutral) |
16+
| | `screen_brightness` | Manual screen brightness (0-255) | int | ~102 (40%) |
17+
| | `screen_brightness_for_vr` | Brightness level for VR mode | int | ~86 (34%) |
18+
| | `screen_brightness_mode` | Brightness control mode (0=manual, 1=auto) | int | 1 (auto) |
19+
| | `screen_off_timeout` | Time until screen sleeps (ms) | int | 60000 (1 min) |
20+
| | `user_rotation` | Forced screen orientation (0=0°, 1=90°, 2=180°, 3=270°) | int | 0 (portrait) |
21+
| Sound | `alarm_alert` | Alarm sound URI | string | Device-specific |
22+
| | `call_connected_tone_enabled` | Play tone when call connects | int | 0 (disabled) |
23+
| | `dtmf_tone` | Play tones when dialing | int | 0 (disabled) |
24+
| | `dtmf_tone_type` | DTMF tone type (0=normal, 1=long) | int | 0 |
25+
| | `lockscreen_sounds_enabled` | Play sounds when unlocking | int | 1 (enabled) |
26+
| | `mode_ringer_streams_affected` | Streams affected by ringer mode (bitmask) | int | 166 |
27+
| | `mute_streams_affected` | Streams that can be muted (bitmask) | int | 111 |
28+
| | `notification_sound` | Notification sound URI | string | Device-specific |
29+
| | `ringtone` | Incoming call ringtone URI | string | Device-specific |
30+
| | `sound_effects_enabled` | UI interaction sounds | int | 1 (enabled) |
31+
| | `vibrate_when_ringing` | Vibrate on incoming call | int | 1 (enabled) |
32+
| Volume | `volume_alarm` | Alarm volume level | int | 6 |
33+
| | `volume_bluetooth_sco` | Bluetooth call volume | int | 7 |
34+
| | `volume_music` | Media volume | int | 5 |
35+
| | `volume_music_ble_broadcast` | BLE broadcast media volume | int | 3 |
36+
| | `volume_music_ble_headset` | BLE headset media volume | int | 3 |
37+
| | `volume_music_bt_a2dp_hp` | Bluetooth A2DP headphone volume | int | 3 |
38+
| | `volume_music_speaker` | Speaker media volume | int | 9 |
39+
| | `volume_music_usb_headset` | USB headset media volume | int | 3 |
40+
| | `volume_notification` | Notification volume | int | 5 |
41+
| | `volume_notification_speaker` | Speaker notification volume | int | 2 |
42+
| | `volume_ring` | Ringer volume | int | 5 |
43+
| | `volume_ring_speaker` | Speaker ringer volume | int | 2 |
44+
| | `volume_system` | System sounds volume | int | 7 |
45+
| | `volume_voice` | Voice call volume | int | 4 |
46+
| Haptics | `haptic_feedback_enabled` | Vibrate on touch interactions | int | 1 (enabled) |
47+
| Notification | `charging_led_notification` | Show LED while charging | int | 1 (enabled) |
48+
| | `nled_brightness_value` | Notification LED brightness (0-255) | int | 255 (max) |
49+
| | `notification_light_pulse` | Pulse LED for notifications | int | 1 (enabled) |
50+
| Input | `keylight_auto_brightness` | Auto-adjust keyboard backlight | int | 1 (enabled) |
51+
| | `keylight_brightness` | Keyboard backlight brightness (0-255) | int | 51 |
52+
| | `pointer_speed` | Mouse/trackpad speed (-7 to 7) | int | 0 (neutral) |
53+
| | `touchkeylight_off_timeout` | Time until touchkey lights turn off (ms) | int | 6000 (6 sec) |
54+
| System | `apply_ramping_ringer` | Gradually increase ringer volume | int | 0 (disabled) |
55+
| | `end_button_behavior` | Power button action (2=sleep, 1=end call, etc.) | int | 2 (sleep) |
56+
| | `system_locales` | System language/locale | string | en-US |
57+
| | `time_12_24` | Time format (12h/24h) | string | 12 (12-hour format) |
58+
| | `tty_mode` | TTY mode (0=off, 1=full, 2=HCO, 3=VCO) | int | 0 (off) |
59+
| Connectivity | `data_connection_state_flag` | Mobile data connection state | int | 0 |
60+
| | `ethernet_tracker_flag` | Ethernet connection tracking | int | 0 |
61+
| | `rfid_sleep_state` | RFID sleep state | int | 0 |
62+
| | `wifi_state_flag` | Wi-Fi connection state | int | 0 |
63+
| Device-Specific | `smart_default_density_values` | Smart display density profiles (OEM-specific) | string | e.g., "408,480,540" |
64+
| | `smart_docking_densiy_on_dock_save` | Docking density profile (OEM-specific) | int | 0 |
65+
| | `smart_docking_resolution_dpi_value` | Docking resolution settings (OEM-specific) | string | e.g., "1920,1080,200,10" |
66+
| | `smart_docking_resolution_setting` | Active docking resolution profile (OEM-specific) | int | 10 |
67+
| | `xternal_display_id_connected` | Connected external display ID | int | \-1 (none) |
68+
| | `xternal_display_set_mirror` | Mirror display on external screen | int | 0 (disabled) |
69+
| | `xternal_display_taskbar_reset` | Reset taskbar on external display | int | 0 (disabled) |
70+
| Flags | `alarm_alert_set` | Alarm sound configured flag | int | 1 (configured) |
71+
| | `notification_sound_set` | Notification sound configured flag | int | 1 (configured) |
72+
| | `ringtone_set` | Ringtone configured flag | int | 1 (configured) |

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
plugins {
4-
id 'com.android.application' version '7.2.2' apply false
5-
id 'com.android.library' version '7.2.2' apply false
4+
id 'com.android.application' version '8.7.0' apply false
5+
id 'com.android.library' version '8.7.0' apply false
6+
id 'maven-publish'
67
}
78

89
task clean(type: Delete) {

gradle/wrapper/gradle-wrapper.jar

-10.5 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Tue Jun 09 09:22:20 BST 2020
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip

0 commit comments

Comments
 (0)