-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppDisabler_392.pbp
138 lines (129 loc) · 2.56 KB
/
AppDisabler_392.pbp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
; This patch allows to selectively disable
; certain built-in apps.
#ver 392
; The stock app order is:
; 1. TicToc
; 2. Watch only
; 3. Settings
; 4. Music
; 5. Notifications
; 6. Alarms
; 7. Watchfaces
; 8. Quick launch setup
; 9. Timeline
; 10. Launcher
; 11. Shutdown Charging
; 12. Battery Critical
; 13. Health
; 14. Send Text
; 15. Golf
; 16. Sports
; Usage:
; for each app you want to disable, specify corresponding #define option
; Options:
;@disable_tictoc
; Disable TicToc watchface (will cause problems if you have no watchfaces installed)
;@disable_music
; Disable Music app
;@disable_notifications
; Disable Notifications app
;@disable_alarms
; Disable Alarms app
;@disable_watchfaces
; Disable Watchfaces app
;@disable_health
; Disable Health app
;@disable_sendtext
; Disable Send Text app
#ifndef disable_tictoc
#ifndef disable_music
#ifndef disable_notifications
#ifndef disable_alarms
#ifndef disable_watchfaces
#ifndef disable_health
#ifndef disable_sendtext
#error Please choose at least one app to disable!
#endif
#endif
#endif
#endif
#endif
#endif
#endif
2d e9 f0 4f 0c 46 8b b0 05 46 00 28 00 f0 a8 80
{
proc find_and_smth
}
; This is in enumerate_sys_apps proc.
; It loops over an array of system application data structs
; and calls a callback for each of them.
; We want it to skip some app idents.
; (ident is the first field of app info, and is negative for sys apps)
; Struct size is 0x24.
;
; There are 4 other funcs which also use that sys apps list,
; but they only search it for certain ident or uuid,
; and not enumerate it all.
00 25 04 46 0D 4B 21 46 E8 58 @ ?4
18 B1 20 46 31 46 B8 47 50 B1 24 35 B5 F5 10 7F
F1 D1
{
; Here is loop initialization:
;
; BL pbl_kernel_malloc
; MOV R5, 0
; MOV R4, R0
; loop:
; LDR R3, =lst_system_apps
; MOV R1, R4
; LDR R0, [R5,R3]
; was:
; BL find_smth_sysapp_by_ident
B.W my_code
global cont
}
{
proc my_code
; Here R0 is an ident and R1 is some struct.
; Original code calls find_smth...
; and if it returned TRUE then calls a callback.
; So if we want it to ignore some app, we just need to put 0 in R0.
;
; R2 is unused, so we can occupy it
RSB R2, R0, 0
#ifdef disable_tictoc
CMP R2, 69
BEQ skip
#endif
#ifdef disable_music
CMP R2, 3
BEQ skip
#endif
#ifdef disable_notifications
CMP R2, 4
BEQ skip
#endif
#ifdef disable_alarms
CMP R2, 5
BEQ skip
#endif
#ifdef disable_watchfaces
CMP R2, 6
BEQ skip
#endif
#ifdef disable_health
CMP R2, 82
BEQ skip
#endif
#ifdef disable_sendtext
CMP R2, 83
BEQ skip
#endif
; re-exec proc and continue
BL find_and_smth
B ret
skip:
MOV R0, 0
ret:
B.W cont
}