-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
aml.sh
592 lines (573 loc) · 25.2 KB
/
aml.sh
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
[ ! "$MODPATH" ] && MODPATH=${0%/*}
# destination
[ ! "$libdir" ] && libdir=/vendor
MODAECS=`find $MODPATH -type f -name *audio*effects*.conf`
MODAEXS=`find $MODPATH -type f -name *audio*effects*.xml`
MODAPS=`find $MODPATH -type f -name *policy*.conf -o -name *policy*.xml`
# function
archdir() {
if [ -f $libdir/lib/soundfx/$LIB ]\
|| [ -f $MODPATH/system$libdir/lib/soundfx/$LIB ]\
|| [ -f $MODPATH$libdir/lib/soundfx/$LIB ]; then
ARCHDIR=/lib
elif [ -f $libdir/lib64/soundfx/$LIB ]\
|| [ -f $MODPATH/system$libdir/lib64/soundfx/$LIB ]\
|| [ -f $MODPATH$libdir/lib64/soundfx/$LIB ]; then
ARCHDIR=/lib64
else
unset ARCHDIR
fi
}
remove_conf() {
for RMV in $RMVS; do
sed -i "s|$RMV|removed|g" $MODAEC
done
sed -i 's|path /vendor/lib/soundfx/removed||g' $MODAEC
sed -i 's|path /system/lib/soundfx/removed||g' $MODAEC
sed -i 's|path /vendor/lib/removed||g' $MODAEC
sed -i 's|path /system/lib/removed||g' $MODAEC
sed -i 's|path /vendor/lib64/soundfx/removed||g' $MODAEC
sed -i 's|path /system/lib64/soundfx/removed||g' $MODAEC
sed -i 's|path /vendor/lib64/removed||g' $MODAEC
sed -i 's|path /system/lib64/removed||g' $MODAEC
sed -i 's|library removed||g' $MODAEC
sed -i 's|uuid removed||g' $MODAEC
sed -i "/^ removed {/ {;N s/ removed {\n }//}" $MODAEC
sed -i 's|removed { }||g' $MODAEC
sed -i 's|removed {}||g' $MODAEC
}
remove_xml() {
for RMV in $RMVS; do
sed -i "s|\"$RMV\"|\"removed\"|g" $MODAEX
done
sed -i 's|<library name="removed" path="removed"/>||g' $MODAEX
sed -i 's|<library name="proxy" path="removed"/>||g' $MODAEX
sed -i 's|<effect name="removed" library="removed" uuid="removed"/>||g' $MODAEX
sed -i 's|<effect name="removed" uuid="removed" library="removed"/>||g' $MODAEX
sed -i 's|<libsw library="removed" uuid="removed"/>||g' $MODAEX
sed -i 's|<libhw library="removed" uuid="removed"/>||g' $MODAEX
sed -i 's|<apply effect="removed"/>||g' $MODAEX
sed -i 's|<library name="removed" path="removed" />||g' $MODAEX
sed -i 's|<library name="proxy" path="removed" />||g' $MODAEX
sed -i 's|<effect name="removed" library="removed" uuid="removed" />||g' $MODAEX
sed -i 's|<effect name="removed" uuid="removed" library="removed" />||g' $MODAEX
sed -i 's|<libsw library="removed" uuid="removed" />||g' $MODAEX
sed -i 's|<libhw library="removed" uuid="removed" />||g' $MODAEX
sed -i 's|<apply effect="removed" />||g' $MODAEX
}
# store
RMVS="ring_helper alarm_helper music_helper voice_helper
notification_helper ma_ring_helper ma_alarm_helper
ma_music_helper ma_voice_helper ma_system_helper
ma_notification_helper sa3d fens lmfv dirac dtsaudio
dlb_music_listener dlb_ring_listener dlb_alarm_listener
dlb_system_listener dlb_notification_listener"
# setup audio effects conf
for MODAEC in $MODAECS; do
for RMV in $RMVS; do
sed -i "/^ $RMV {/ {;N s/ $RMV {\n }//}" $MODAEC
sed -i "s|$RMV { }||g" $MODAEC
sed -i "s|$RMV {}||g" $MODAEC
done
if ! grep -q '^output_session_processing {' $MODAEC; then
sed -i '$a\
\
output_session_processing {\
music {\
}\
ring {\
}\
alarm {\
}\
system {\
}\
voice_call {\
}\
notification {\
}\
bluetooth_sco {\
}\
dtmf {\
}\
enforced_audible {\
}\
accessibility {\
}\
tts {\
}\
assistant {\
}\
call_assistant {\
}\
patch {\
}\
rerouting {\
}\
}\' $MODAEC
else
if ! grep -q '^ rerouting {' $MODAEC; then
sed -i "/^output_session_processing {/a\ rerouting {\n }" $MODAEC
fi
if ! grep -q '^ patch {' $MODAEC; then
sed -i "/^output_session_processing {/a\ patch {\n }" $MODAEC
fi
if ! grep -q '^ call_assistant {' $MODAEC; then
sed -i "/^output_session_processing {/a\ call_assistant {\n }" $MODAEC
fi
if ! grep -q '^ assistant {' $MODAEC; then
sed -i "/^output_session_processing {/a\ assistant {\n }" $MODAEC
fi
if ! grep -q '^ tts {' $MODAEC; then
sed -i "/^output_session_processing {/a\ tts {\n }" $MODAEC
fi
if ! grep -q '^ accessibility {' $MODAEC; then
sed -i "/^output_session_processing {/a\ accessibility {\n }" $MODAEC
fi
if ! grep -q '^ enforced_audible {' $MODAEC; then
sed -i "/^output_session_processing {/a\ enforced_audible {\n }" $MODAEC
fi
if ! grep -q '^ dtmf {' $MODAEC; then
sed -i "/^output_session_processing {/a\ dtmf {\n }" $MODAEC
fi
if ! grep -q '^ bluetooth_sco {' $MODAEC; then
sed -i "/^output_session_processing {/a\ bluetooth_sco {\n }" $MODAEC
fi
if ! grep -q '^ notification {' $MODAEC; then
sed -i "/^output_session_processing {/a\ notification {\n }" $MODAEC
fi
if ! grep -q '^ voice_call {' $MODAEC; then
sed -i "/^output_session_processing {/a\ voice_call {\n }" $MODAEC
fi
if ! grep -q '^ system {' $MODAEC; then
sed -i "/^output_session_processing {/a\ system {\n }" $MODAEC
fi
if ! grep -q '^ alarm {' $MODAEC; then
sed -i "/^output_session_processing {/a\ alarm {\n }" $MODAEC
fi
if ! grep -q '^ ring {' $MODAEC; then
sed -i "/^output_session_processing {/a\ ring {\n }" $MODAEC
fi
if ! grep -q '^ music {' $MODAEC; then
sed -i "/^output_session_processing {/a\ music {\n }" $MODAEC
fi
fi
done
# setup audio effects xml
for MODAEX in $MODAEXS; do
for RMV in $RMVS; do
sed -i "s|<apply effect=\"$RMV\"/>||g" $MODAEX
sed -i "s|<apply effect=\"$RMV\" />||g" $MODAEX
done
if ! grep -q '<postprocess>' $MODAEX\
|| grep -q '<!-- Audio post processor' $MODAEX; then
sed -i '/<\/effects>/a\
<postprocess>\
<stream type="music">\
<\/stream>\
<stream type="ring">\
<\/stream>\
<stream type="alarm">\
<\/stream>\
<stream type="system">\
<\/stream>\
<stream type="voice_call">\
<\/stream>\
<stream type="notification">\
<\/stream>\
<stream type="bluetooth_sco">\
<\/stream>\
<stream type="dtmf">\
<\/stream>\
<stream type="enforced_audible">\
<\/stream>\
<stream type="accessibility">\
<\/stream>\
<stream type="tts">\
<\/stream>\
<stream type="assistant">\
<\/stream>\
<stream type="call_assistant">\
<\/stream>\
<stream type="patch">\
<\/stream>\
<stream type="rerouting">\
<\/stream>\
<\/postprocess>' $MODAEX
else
if ! grep -q '<stream type="rerouting">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"rerouting\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="patch">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"patch\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="call_assistant">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"call_assistant\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="assistant">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"assistant\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="tts">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"tts\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="accessibility">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"accessibility\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="enforced_audible">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"enforced_audible\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="dtmf">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"dtmf\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="bluetooth_sco">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"bluetooth_sco\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="notification">' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- heaton.zhong' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"notification\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="voice_call">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"voice_call\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="system">' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"system\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="alarm">' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- heaton.zhong' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"alarm\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="ring">' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- heaton.zhong' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"ring\">\n <\/stream>" $MODAEX
fi
if ! grep -q '<stream type="music">' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- [email protected]' $MODAEX\
|| grep -q '<!-- heaton.zhong' $MODAEX; then
sed -i "/<postprocess>/a\ <stream type=\"music\">\n <\/stream>" $MODAEX
fi
fi
done
# function
misoundfx() {
LIB=libmisoundfx.so
LIBNAME=misoundfx
NAME=misoundfx
UUID=5b8e36a5-144a-4c38-b1d7-0002a5d5c51b
RMVS="$LIB $LIBNAME $NAME $UUID"
archdir
if [ "$ARCHDIR" ]; then
for MODAEC in $MODAECS; do
remove_conf
sed -i "/^libraries {/a\ $LIBNAME {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIB\n }" $MODAEC
sed -i "/^effects {/a\ $NAME {\n library $LIBNAME\n uuid $UUID\n }" $MODAEC
#m sed -i "/^ music {/a\ $NAME {\n }" $MODAEC
#r sed -i "/^ ring {/a\ $NAME {\n }" $MODAEC
#a sed -i "/^ alarm {/a\ $NAME {\n }" $MODAEC
#s sed -i "/^ system {/a\ $NAME {\n }" $MODAEC
#v sed -i "/^ voice_call {/a\ $NAME {\n }" $MODAEC
#n sed -i "/^ notification {/a\ $NAME {\n }" $MODAEC
#b sed -i "/^ bluetooth_sco {/a\ $NAME {\n }" $MODAEC
#f sed -i "/^ dtmf {/a\ $NAME {\n }" $MODAEC
#e sed -i "/^ enforced_audible {/a\ $NAME {\n }" $MODAEC
#y sed -i "/^ accessibility {/a\ $NAME {\n }" $MODAEC
#t sed -i "/^ tts {/a\ $NAME {\n }" $MODAEC
#i sed -i "/^ assistant {/a\ $NAME {\n }" $MODAEC
#c sed -i "/^ call_assistant {/a\ $NAME {\n }" $MODAEC
#p sed -i "/^ patch {/a\ $NAME {\n }" $MODAEC
#g sed -i "/^ rerouting {/a\ $NAME {\n }" $MODAEC
done
for MODAEX in $MODAEXS; do
remove_xml
sed -i "/<libraries>/a\ <library name=\"$LIBNAME\" path=\"$LIB\"\/>" $MODAEX
sed -i "/<effects>/a\ <effect name=\"$NAME\" library=\"$LIBNAME\" uuid=\"$UUID\"\/>" $MODAEX
#m sed -i "/<stream type=\"music\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#r sed -i "/<stream type=\"ring\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#a sed -i "/<stream type=\"alarm\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#s sed -i "/<stream type=\"system\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#v sed -i "/<stream type=\"voice_call\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#n sed -i "/<stream type=\"notification\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#b sed -i "/<stream type=\"bluetooth_sco\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#f sed -i "/<stream type=\"dtmf\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#e sed -i "/<stream type=\"enforced_audible\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#y sed -i "/<stream type=\"accessibility\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#t sed -i "/<stream type=\"tts\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#i sed -i "/<stream type=\"assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#c sed -i "/<stream type=\"call_assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#p sed -i "/<stream type=\"patch\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#g sed -i "/<stream type=\"rerouting\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
done
fi
}
dirac() {
LIB=libdirac.so
LIBNAME=dirac
LIBNAME=dirac_mod
NAME=dirac
NAME=dirac_mod
UUID=e069d9e0-8329-11df-9168-0002a5d5c51b
RMVS="$LIB $LIBNAME $NAME $UUID"
archdir
if [ "$ARCHDIR" ]; then
for MODAEC in $MODAECS; do
remove_conf
sed -i "/^libraries {/a\ $LIBNAME {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIB\n }" $MODAEC
sed -i "/^effects {/a\ $NAME {\n library $LIBNAME\n uuid $UUID\n }" $MODAEC
if ! grep -q '^global_processing {' $MODAEC; then
sed -i '$a\
\
global_processing {\
}\' $MODAEC
fi
sed -i '/^global_processing {/a\
dirac_mod {\
bl@lakala {\
param {\
int 6\
}\
value {\
string *com.lakala.android\
}\
}\
bl@jawboneup {\
param {\
int 6\
}\
value {\
string *com.jawbone.up\
}\
}\
bl@hojyremote {\
param {\
int 6\
}\
value {\
string *com.hojy.hremote\
}\
}\
}' $MODAEC
#m sed -i "/^ music {/a\ $NAME {\n }" $MODAEC
#r sed -i "/^ ring {/a\ $NAME {\n }" $MODAEC
#a sed -i "/^ alarm {/a\ $NAME {\n }" $MODAEC
#s sed -i "/^ system {/a\ $NAME {\n }" $MODAEC
#v sed -i "/^ voice_call {/a\ $NAME {\n }" $MODAEC
#n sed -i "/^ notification {/a\ $NAME {\n }" $MODAEC
#b sed -i "/^ bluetooth_sco {/a\ $NAME {\n }" $MODAEC
#f sed -i "/^ dtmf {/a\ $NAME {\n }" $MODAEC
#e sed -i "/^ enforced_audible {/a\ $NAME {\n }" $MODAEC
#y sed -i "/^ accessibility {/a\ $NAME {\n }" $MODAEC
#t sed -i "/^ tts {/a\ $NAME {\n }" $MODAEC
#i sed -i "/^ assistant {/a\ $NAME {\n }" $MODAEC
#c sed -i "/^ call_assistant {/a\ $NAME {\n }" $MODAEC
#p sed -i "/^ patch {/a\ $NAME {\n }" $MODAEC
#g sed -i "/^ rerouting {/a\ $NAME {\n }" $MODAEC
done
for MODAEX in $MODAEXS; do
remove_xml
sed -i "/<libraries>/a\ <library name=\"$LIBNAME\" path=\"$LIB\"\/>" $MODAEX
sed -i "/<effects>/a\ <effect name=\"$NAME\" library=\"$LIBNAME\" uuid=\"$UUID\"\/>" $MODAEX
#m sed -i "/<stream type=\"music\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#r sed -i "/<stream type=\"ring\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#a sed -i "/<stream type=\"alarm\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#s sed -i "/<stream type=\"system\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#v sed -i "/<stream type=\"voice_call\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#n sed -i "/<stream type=\"notification\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#b sed -i "/<stream type=\"bluetooth_sco\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#f sed -i "/<stream type=\"dtmf\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#e sed -i "/<stream type=\"enforced_audible\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#y sed -i "/<stream type=\"accessibility\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#t sed -i "/<stream type=\"tts\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#i sed -i "/<stream type=\"assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#c sed -i "/<stream type=\"call_assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#p sed -i "/<stream type=\"patch\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#g sed -i "/<stream type=\"rerouting\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
done
fi
}
dap_proxy() {
LIB=libswdap.so
LIBHW=libhwdap.so
LIBNAME=dap_sw
LIBNAME=dap_sw_mod
LIBNAMEHW=dap_hw
LIBNAMEHW=dap_hw_mod
NAME=dap
NAME=dap_mod
UUID=6ab06da4-c516-4611-8166-452799218539
UUIDHW=a0c30891-8246-4aef-b8ad-d53e26da0253
UUIDPROXY=9d4921da-8225-4f29-aefa-39537a04bcaa
RMVS="$LIB $LIBHW $LIBNAME $LIBNAMEHW $NAME $UUID
$UUIDHW $UUIDPROXY libeffectproxy.so"
archdir
if [ "$ARCHDIR" ]; then
for MODAEC in $MODAECS; do
remove_conf
sed -i "/^libraries {/a\ proxy {\n path \\$libdir\\$ARCHDIR\/soundfx\/libeffectproxy.so\n }" $MODAEC
sed -i "/^libraries {/a\ $LIBNAMEHW {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIBHW\n }" $MODAEC
sed -i "/^libraries {/a\ $LIBNAME {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIB\n }" $MODAEC
sed -i "/^effects {/a\ $NAME {\n library proxy\n uuid $UUIDPROXY\n }" $MODAEC
sed -i "/^ uuid $UUIDPROXY/a\ libhw {\n library $LIBNAMEHW\n uuid $UUIDHW\n }" $MODAEC
sed -i "/^ uuid $UUIDPROXY/a\ libsw {\n library $LIBNAME\n uuid $UUID\n }" $MODAEC
#m sed -i "/^ music {/a\ $NAME {\n }" $MODAEC
#r sed -i "/^ ring {/a\ $NAME {\n }" $MODAEC
#a sed -i "/^ alarm {/a\ $NAME {\n }" $MODAEC
#s sed -i "/^ system {/a\ $NAME {\n }" $MODAEC
#v sed -i "/^ voice_call {/a\ $NAME {\n }" $MODAEC
#n sed -i "/^ notification {/a\ $NAME {\n }" $MODAEC
#b sed -i "/^ bluetooth_sco {/a\ $NAME {\n }" $MODAEC
#f sed -i "/^ dtmf {/a\ $NAME {\n }" $MODAEC
#e sed -i "/^ enforced_audible {/a\ $NAME {\n }" $MODAEC
#y sed -i "/^ accessibility {/a\ $NAME {\n }" $MODAEC
#t sed -i "/^ tts {/a\ $NAME {\n }" $MODAEC
#i sed -i "/^ assistant {/a\ $NAME {\n }" $MODAEC
#c sed -i "/^ call_assistant {/a\ $NAME {\n }" $MODAEC
#p sed -i "/^ patch {/a\ $NAME {\n }" $MODAEC
#g sed -i "/^ rerouting {/a\ $NAME {\n }" $MODAEC
done
for MODAEX in $MODAEXS; do
remove_xml
sed -i "/<libraries>/a\ <library name=\"proxy\" path=\"libeffectproxy.so\"\/>" $MODAEX
sed -i "/<libraries>/a\ <library name=\"$LIBNAMEHW\" path=\"$LIBHW\"\/>" $MODAEX
sed -i "/<libraries>/a\ <library name=\"$LIBNAME\" path=\"$LIB\"\/>" $MODAEX
sed -i "/<effects>/a\ <\/effectProxy>" $MODAEX
sed -i "/<effects>/a\ <libhw library=\"$LIBNAMEHW\" uuid=\"$UUIDHW\"\/>" $MODAEX
sed -i "/<effects>/a\ <libsw library=\"$LIBNAME\" uuid=\"$UUID\"\/>" $MODAEX
sed -i "/<effects>/a\ <effectProxy name=\"$NAME\" library=\"proxy\" uuid=\"$UUIDPROXY\">" $MODAEX
#m sed -i "/<stream type=\"music\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#r sed -i "/<stream type=\"ring\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#a sed -i "/<stream type=\"alarm\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#s sed -i "/<stream type=\"system\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#v sed -i "/<stream type=\"voice_call\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#n sed -i "/<stream type=\"notification\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#b sed -i "/<stream type=\"bluetooth_sco\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#f sed -i "/<stream type=\"dtmf\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#e sed -i "/<stream type=\"enforced_audible\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#y sed -i "/<stream type=\"accessibility\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#t sed -i "/<stream type=\"tts\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#i sed -i "/<stream type=\"assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#c sed -i "/<stream type=\"call_assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#p sed -i "/<stream type=\"patch\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#g sed -i "/<stream type=\"rerouting\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
done
fi
}
dap() {
LIB=libswdap.so
LIBNAME=dap
LIBNAME=dap_mod
NAME=dap
NAME=dap_mod
UUID=9d4921da-8225-4f29-aefa-39537a04bcaa
RMVS="$LIB $LIBNAME $NAME $UUID"
archdir
if [ "$ARCHDIR" ]; then
for MODAEC in $MODAECS; do
remove_conf
sed -i "/^libraries {/a\ $LIBNAME {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIB\n }" $MODAEC
sed -i "/^effects {/a\ $NAME {\n library $LIBNAME\n uuid $UUID\n }" $MODAEC
#m sed -i "/^ music {/a\ $NAME {\n }" $MODAEC
#r sed -i "/^ ring {/a\ $NAME {\n }" $MODAEC
#a sed -i "/^ alarm {/a\ $NAME {\n }" $MODAEC
#s sed -i "/^ system {/a\ $NAME {\n }" $MODAEC
#v sed -i "/^ voice_call {/a\ $NAME {\n }" $MODAEC
#n sed -i "/^ notification {/a\ $NAME {\n }" $MODAEC
#b sed -i "/^ bluetooth_sco {/a\ $NAME {\n }" $MODAEC
#f sed -i "/^ dtmf {/a\ $NAME {\n }" $MODAEC
#e sed -i "/^ enforced_audible {/a\ $NAME {\n }" $MODAEC
#y sed -i "/^ accessibility {/a\ $NAME {\n }" $MODAEC
#t sed -i "/^ tts {/a\ $NAME {\n }" $MODAEC
#i sed -i "/^ assistant {/a\ $NAME {\n }" $MODAEC
#c sed -i "/^ call_assistant {/a\ $NAME {\n }" $MODAEC
#p sed -i "/^ patch {/a\ $NAME {\n }" $MODAEC
#g sed -i "/^ rerouting {/a\ $NAME {\n }" $MODAEC
done
for MODAEX in $MODAEXS; do
remove_xml
sed -i "/<libraries>/a\ <library name=\"$LIBNAME\" path=\"$LIB\"\/>" $MODAEX
sed -i "/<effects>/a\ <effect name=\"$NAME\" library=\"$LIBNAME\" uuid=\"$UUID\"\/>" $MODAEX
#m sed -i "/<stream type=\"music\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#r sed -i "/<stream type=\"ring\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#a sed -i "/<stream type=\"alarm\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#s sed -i "/<stream type=\"system\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#v sed -i "/<stream type=\"voice_call\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#n sed -i "/<stream type=\"notification\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#b sed -i "/<stream type=\"bluetooth_sco\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#f sed -i "/<stream type=\"dtmf\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#e sed -i "/<stream type=\"enforced_audible\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#y sed -i "/<stream type=\"accessibility\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#t sed -i "/<stream type=\"tts\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#i sed -i "/<stream type=\"assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#c sed -i "/<stream type=\"call_assistant\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#p sed -i "/<stream type=\"patch\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#g sed -i "/<stream type=\"rerouting\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
done
fi
}
vqe() {
LIB=libswvqe.so
LIBNAME=vqe
LIBNAME=vqe_mod
NAME=vqe
NAME=vqe_mod
UUID=64a0f614-7fa4-48b8-b081-d59dc954616f
RMVS="$LIB $LIBNAME $NAME $UUID"
archdir
if [ "$ARCHDIR" ]; then
for MODAEC in $MODAECS; do
remove_conf
sed -i "/^libraries {/a\ $LIBNAME {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIB\n }" $MODAEC
sed -i "/^effects {/a\ $NAME {\n library $LIBNAME\n uuid $UUID\n }" $MODAEC
done
for MODAEX in $MODAEXS; do
remove_xml
sed -i "/<libraries>/a\ <library name=\"$LIBNAME\" path=\"$LIB\"\/>" $MODAEX
sed -i "/<effects>/a\ <effect name=\"$NAME\" library=\"$LIBNAME\" uuid=\"$UUID\"\/>" $MODAEX
done
fi
}
gamedap() {
LIB=libswgamedap.so
LIBNAME=gamedap
LIBNAME=gamedap_mod
NAME=gamedap
NAME=gamedap_mod
UUID=3783c334-d3a0-4d13-874f-0032e5fb80e2
RMVS="$LIB $LIBNAME $NAME $UUID"
archdir
if [ "$ARCHDIR" ]; then
for MODAEC in $MODAECS; do
remove_conf
sed -i "/^libraries {/a\ $LIBNAME {\n path \\$libdir\\$ARCHDIR\/soundfx\/$LIB\n }" $MODAEC
sed -i "/^effects {/a\ $NAME {\n library $LIBNAME\n uuid $UUID\n }" $MODAEC
#x sed -i "/^ patch {/a\ $NAME {\n }" $MODAEC
#x sed -i "/^ rerouting {/a\ $NAME {\n }" $MODAEC
done
for MODAEX in $MODAEXS; do
remove_xml
sed -i "/<libraries>/a\ <library name=\"$LIBNAME\" path=\"$LIB\"\/>" $MODAEX
sed -i "/<effects>/a\ <effect name=\"$NAME\" library=\"$LIBNAME\" uuid=\"$UUID\"\/>" $MODAEX
#x sed -i "/<stream type=\"patch\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
#x sed -i "/<stream type=\"rerouting\">/a\ <apply effect=\"$NAME\"\/>" $MODAEX
done
fi
}
# patch audio effects
misoundfx
#ddap_proxy
#dvqe
#dgamedap
# patch audio policy
#ufor MODAP in $MODAPS; do
#u sed -i 's|RAW|NONE|g' $MODAP
#u sed -i 's|,raw||g' $MODAP
#udone
# patch audio policy
#dfor MODAP in $MODAPS; do
#d sed -i 's|COMPRESS_OFFLOAD|NONE|g' $MODAP
#d sed -i 's|,compressed_offload||g' $MODAP
#ddone