mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-16 01:21:07 -08:00
Compare commits
2747 Commits
manager-v3
...
manager-v7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fe03d2795 | ||
|
|
c595a87ccf | ||
|
|
fac07c3913 | ||
|
|
c63fdbbc6b | ||
|
|
2ff5d9606b | ||
|
|
ed43452c1a | ||
|
|
8f28d4028f | ||
|
|
b54543b18c | ||
|
|
966d6593ca | ||
|
|
ad95b1c9d1 | ||
|
|
3bfa38c60a | ||
|
|
0bdbcad8be | ||
|
|
80cd85b061 | ||
|
|
89275270f3 | ||
|
|
e7339ba619 | ||
|
|
d9ad7d522c | ||
|
|
ef0e22cc41 | ||
|
|
62db65bf18 | ||
|
|
d5371f752c | ||
|
|
a5f5e94115 | ||
|
|
67c3f40adb | ||
|
|
ff7a0ba599 | ||
|
|
b152c63102 | ||
|
|
415ff23be5 | ||
|
|
b0d6de783e | ||
|
|
ac28e6e5ca | ||
|
|
a9350f50c9 | ||
|
|
ed7babcbf1 | ||
|
|
61ebc335c4 | ||
|
|
0167bd76f1 | ||
|
|
79d704008b | ||
|
|
0a703585b0 | ||
|
|
b27801a27c | ||
|
|
a0cfce7cbc | ||
|
|
8b7144c986 | ||
|
|
d3f5f5ee59 | ||
|
|
a2a3c7f438 | ||
|
|
4496f82d5b | ||
|
|
09d531557d | ||
|
|
7fee82f731 | ||
|
|
475054c48a | ||
|
|
a743d05751 | ||
|
|
d1ed502e03 | ||
|
|
37744c7ab6 | ||
|
|
b25c49725f | ||
|
|
b245782c7e | ||
|
|
a9f32baae0 | ||
|
|
e7ef71865d | ||
|
|
88c4f72b37 | ||
|
|
abbcdf91a5 | ||
|
|
b876df6e21 | ||
|
|
4bb81f35d7 | ||
|
|
ff20267b3f | ||
|
|
2c9586d811 | ||
|
|
2813d2031a | ||
|
|
4040a0242f | ||
|
|
781ec810d9 | ||
|
|
9e90a71c04 | ||
|
|
5571714b26 | ||
|
|
e0d1f02ef5 | ||
|
|
1b729e5ff2 | ||
|
|
51e587d4e8 | ||
|
|
ac9c55dbc1 | ||
|
|
0893ac3141 | ||
|
|
fb40e96917 | ||
|
|
4ca25f74c6 | ||
|
|
7fda917b86 | ||
|
|
e6bd5f2c40 | ||
|
|
8a904ee384 | ||
|
|
00a9f18a1e | ||
|
|
8d68ebb074 | ||
|
|
5f53cfb4a9 | ||
|
|
a2fa8d8be1 | ||
|
|
70a3c78ebb | ||
|
|
db218407b0 | ||
|
|
d52210dd90 | ||
|
|
f3cd9a096a | ||
|
|
e426090a18 | ||
|
|
cbe64fd559 | ||
|
|
63ea7a70bd | ||
|
|
fb0998f7a2 | ||
|
|
a9b00dd537 | ||
|
|
52eb059515 | ||
|
|
7640246255 | ||
|
|
52c83b2916 | ||
|
|
d9cded0fc9 | ||
|
|
750c42caf1 | ||
|
|
bbf650c6cf | ||
|
|
a25dace7e0 | ||
|
|
14ff22fbcd | ||
|
|
07eb7dda2d | ||
|
|
54d1207f92 | ||
|
|
003e44fb84 | ||
|
|
515f346dcc | ||
|
|
d4058175b4 | ||
|
|
2de984ae24 | ||
|
|
761a8bf2a9 | ||
|
|
6df7006b36 | ||
|
|
aceb3ee863 | ||
|
|
11d716a3c8 | ||
|
|
7cc8c014eb | ||
|
|
f21241d944 | ||
|
|
a181fa0652 | ||
|
|
3f748b4d2a | ||
|
|
683450f9c6 | ||
|
|
6050c4e8ba | ||
|
|
158af8819a | ||
|
|
7787bb31fa | ||
|
|
a1fe3e7ccd | ||
|
|
4316028b23 | ||
|
|
f2b52755d6 | ||
|
|
adbd47a36c | ||
|
|
ce693aa5e9 | ||
|
|
ad80804461 | ||
|
|
2d55632430 | ||
|
|
e81f00ef1a | ||
|
|
93fb0e3d74 | ||
|
|
71ce0de606 | ||
|
|
0407062c1d | ||
|
|
f315c4416b | ||
|
|
cda14af208 | ||
|
|
258f170cd7 | ||
|
|
f76015d714 | ||
|
|
7e5e14163c | ||
|
|
bcd1064e94 | ||
|
|
8a8441c875 | ||
|
|
15aa813416 | ||
|
|
605faccffd | ||
|
|
79f2d08c81 | ||
|
|
0568ae5391 | ||
|
|
5330dda9f8 | ||
|
|
ebab126579 | ||
|
|
0e5417a13e | ||
|
|
9a968e0584 | ||
|
|
ffec64d209 | ||
|
|
f332746188 | ||
|
|
b2fa5b551e | ||
|
|
36e83edddc | ||
|
|
6b045eadef | ||
|
|
147264822c | ||
|
|
36e4ccd800 | ||
|
|
796c16237d | ||
|
|
861ad9881c | ||
|
|
3101c538e9 | ||
|
|
42adc7382f | ||
|
|
9bb4dfad13 | ||
|
|
4e7dafb0e4 | ||
|
|
bd00ae8ede | ||
|
|
f309522268 | ||
|
|
a6395d35db | ||
|
|
a028cd5cec | ||
|
|
540000d26e | ||
|
|
888c656aa8 | ||
|
|
0efaddff23 | ||
|
|
94ba7cb0c5 | ||
|
|
2d58c725e0 | ||
|
|
e035523eb8 | ||
|
|
bea5308ab7 | ||
|
|
f006a85fec | ||
|
|
ea93013ebc | ||
|
|
8d4c407201 | ||
|
|
fdeede23f7 | ||
|
|
53c5ca59b6 | ||
|
|
679db97209 | ||
|
|
fbdd72273e | ||
|
|
0165602515 | ||
|
|
96127f8bd1 | ||
|
|
0dbdf336d6 | ||
|
|
48879df2da | ||
|
|
b067a5bb13 | ||
|
|
4b54cf1288 | ||
|
|
6128c24f96 | ||
|
|
d9c58f307f | ||
|
|
b521fbeeda | ||
|
|
d00a3b89f2 | ||
|
|
3d15518191 | ||
|
|
9b6535fdf5 | ||
|
|
e0424fdba3 | ||
|
|
7481c53451 | ||
|
|
7219947237 | ||
|
|
b72004e9cc | ||
|
|
f187213568 | ||
|
|
fc0df84edd | ||
|
|
f24df4f43d | ||
|
|
dab32e1599 | ||
|
|
bc286fd4d3 | ||
|
|
befe1a83b5 | ||
|
|
82ea9db9fd | ||
|
|
c5758b3f2d | ||
|
|
ace3708c9c | ||
|
|
fc5026d268 | ||
|
|
77fd0e54be | ||
|
|
24490e0ff5 | ||
|
|
da3937ff4e | ||
|
|
ebe1ab982e | ||
|
|
98590cb00d | ||
|
|
ff95f634f0 | ||
|
|
ced9b4a8ee | ||
|
|
7af7910e78 | ||
|
|
a4f5d47e72 | ||
|
|
6953cc2411 | ||
|
|
6a0b2ddee9 | ||
|
|
24f5bc98d8 | ||
|
|
5203886f0b | ||
|
|
c10b376575 | ||
|
|
ceb21ced2b | ||
|
|
86789a8694 | ||
|
|
ca2235aee7 | ||
|
|
a385e5cd92 | ||
|
|
0c7a95bdf6 | ||
|
|
036b5acf42 | ||
|
|
056dafc59f | ||
|
|
a9c90718d6 | ||
|
|
cc77a24502 | ||
|
|
71a91ac7a7 | ||
|
|
08a70f033a | ||
|
|
1b0c36dbd5 | ||
|
|
91da1cf817 | ||
|
|
c577a9525d | ||
|
|
0149b1368d | ||
|
|
cd6bcb97ef | ||
|
|
df4161ffcc | ||
|
|
7a133eaf03 | ||
|
|
1cd45b53b1 | ||
|
|
5b30c77403 | ||
|
|
8248480d56 | ||
|
|
345d992d39 | ||
|
|
a7f6afa4bc | ||
|
|
d22c7de79a | ||
|
|
3eae9494ce | ||
|
|
be7e737253 | ||
|
|
b6eb912dba | ||
|
|
8049b08918 | ||
|
|
d1fa5be210 | ||
|
|
fdbb1af02c | ||
|
|
c85a5cae88 | ||
|
|
649ef53409 | ||
|
|
e784212283 | ||
|
|
66eb1078fe | ||
|
|
1c09b3642f | ||
|
|
d08b1a6639 | ||
|
|
10f50e2401 | ||
|
|
8e9a7b25a1 | ||
|
|
4859ee2da9 | ||
|
|
b45db44ad9 | ||
|
|
e25ce63872 | ||
|
|
162eeaa0a6 | ||
|
|
f36ce905aa | ||
|
|
8ac3aaf36c | ||
|
|
a199b0ace1 | ||
|
|
2f2108e4e8 | ||
|
|
f5f7fd9132 | ||
|
|
f9ae4ab475 | ||
|
|
8de03eef3f | ||
|
|
8df942f96e | ||
|
|
9bb2243b56 | ||
|
|
db06038548 | ||
|
|
ecb33d3176 | ||
|
|
eae1c17738 | ||
|
|
ea55532e33 | ||
|
|
2a40cb60a9 | ||
|
|
d371d017b7 | ||
|
|
1d9359d563 | ||
|
|
945f88105f | ||
|
|
957feca626 | ||
|
|
c0447009db | ||
|
|
8893cbd64a | ||
|
|
f0240b1f06 | ||
|
|
e476c18c99 | ||
|
|
a1b5185ecb | ||
|
|
981e90cc32 | ||
|
|
da0a72e8b0 | ||
|
|
b7e2e972c7 | ||
|
|
650b2ce6b1 | ||
|
|
ecf3d30349 | ||
|
|
15ddd0e284 | ||
|
|
18ac6b270f | ||
|
|
3e35de9b39 | ||
|
|
1e24c72c11 | ||
|
|
217564963d | ||
|
|
f2f4649ab0 | ||
|
|
4395ffec5f | ||
|
|
9a7a26407a | ||
|
|
5072a67807 | ||
|
|
dce0b6c05a | ||
|
|
a4a661bf34 | ||
|
|
771e500468 | ||
|
|
7e3ff03109 | ||
|
|
a1827fd680 | ||
|
|
9ce334feac | ||
|
|
ed11e0bff6 | ||
|
|
5111086637 | ||
|
|
20f204810e | ||
|
|
4581354e7a | ||
|
|
faf4d76388 | ||
|
|
a46e255709 | ||
|
|
63e2bbb4d1 | ||
|
|
c3dabae237 | ||
|
|
f1abcbb7fb | ||
|
|
70efddb90f | ||
|
|
f24a5dfd45 | ||
|
|
081074ad9d | ||
|
|
ab0cc78d2c | ||
|
|
de5c902fdb | ||
|
|
cf65169c99 | ||
|
|
745865ee53 | ||
|
|
c134fb1939 | ||
|
|
0204d05316 | ||
|
|
c345633d80 | ||
|
|
a57a94040e | ||
|
|
1bde78d121 | ||
|
|
bbd014ad1b | ||
|
|
1287372f5a | ||
|
|
d2cb638fcd | ||
|
|
bbe4b69c8d | ||
|
|
7f08c06943 | ||
|
|
8f4a6415cd | ||
|
|
0442d6d509 | ||
|
|
a3fc6d2a27 | ||
|
|
7db05ac927 | ||
|
|
8bed93b3c5 | ||
|
|
915b49014f | ||
|
|
c699f30831 | ||
|
|
3e73e3a906 | ||
|
|
32c65d8a88 | ||
|
|
a49328edd3 | ||
|
|
9a15365a57 | ||
|
|
82c864d57e | ||
|
|
6226f875ff | ||
|
|
370015a853 | ||
|
|
6597b7adc0 | ||
|
|
4e53ebfe44 | ||
|
|
04ef1e6405 | ||
|
|
b278d07b05 | ||
|
|
6c3896079d | ||
|
|
e73fa57d54 | ||
|
|
eaa9c7e2a0 | ||
|
|
14ae29d907 | ||
|
|
e8f35b02ca | ||
|
|
dee3c3e7ba | ||
|
|
d8cd2031c7 | ||
|
|
7203e7df5c | ||
|
|
b51feffe80 | ||
|
|
b1afd554fc | ||
|
|
885e3c574b | ||
|
|
05dd5f3396 | ||
|
|
ec3c43faf1 | ||
|
|
e72c6685ed | ||
|
|
99d6bd8efc | ||
|
|
4c8587a9f2 | ||
|
|
54a8a05dae | ||
|
|
164a99681b | ||
|
|
0eef4eacd6 | ||
|
|
5764f0c839 | ||
|
|
f28e425542 | ||
|
|
d1a4f046e9 | ||
|
|
2ce1dc4afe | ||
|
|
37ac249fd7 | ||
|
|
f152bea8d8 | ||
|
|
7b089b888a | ||
|
|
68f0e1fe39 | ||
|
|
8032bd0bac | ||
|
|
0c227f2917 | ||
|
|
c9fa8118d1 | ||
|
|
63b18246d8 | ||
|
|
16ec37a226 | ||
|
|
bd4e5bfc1a | ||
|
|
621fd0ee29 | ||
|
|
6ca8db2f0c | ||
|
|
ea129fb206 | ||
|
|
3356d7b6ff | ||
|
|
c84023bdc2 | ||
|
|
86f778c0aa | ||
|
|
defbbdfe21 | ||
|
|
0f46493477 | ||
|
|
340bac7e42 | ||
|
|
1d3ce9fef1 | ||
|
|
4a398642b8 | ||
|
|
9c89e56c56 | ||
|
|
267c59b1f1 | ||
|
|
2ab17204c6 | ||
|
|
75939047d1 | ||
|
|
2d7f130d2c | ||
|
|
f7ae72a36c | ||
|
|
391783e268 | ||
|
|
6f12c08204 | ||
|
|
cb8fe70734 | ||
|
|
69d10b747a | ||
|
|
da3394f34e | ||
|
|
b4c2a9f49f | ||
|
|
7cee77f57a | ||
|
|
f28bd1972f | ||
|
|
0f92d1de1b | ||
|
|
e59c5c8780 | ||
|
|
86d8026301 | ||
|
|
d67b827338 | ||
|
|
660e0dc09a | ||
|
|
3ebc886f8a | ||
|
|
5b54ef840a | ||
|
|
c08b0d4974 | ||
|
|
7d652afd87 | ||
|
|
0f61c627b1 | ||
|
|
7126648404 | ||
|
|
4a5e2dc9c7 | ||
|
|
10613686ed | ||
|
|
17ab55115a | ||
|
|
2708c74ebe | ||
|
|
50ff11405f | ||
|
|
31a27838f5 | ||
|
|
2f1b0fe57f | ||
|
|
692f893e1f | ||
|
|
14aa6041ec | ||
|
|
fb55fe184c | ||
|
|
6412bfc7b5 | ||
|
|
3c56f38229 | ||
|
|
f4f2274c60 | ||
|
|
19ee189468 | ||
|
|
a19c7215d2 | ||
|
|
8b84039f1f | ||
|
|
9430dbb96c | ||
|
|
4872df6a46 | ||
|
|
014105f0a0 | ||
|
|
b106d1c501 | ||
|
|
99db0672b4 | ||
|
|
d584360de2 | ||
|
|
4eed6794c7 | ||
|
|
c66cabd80f | ||
|
|
24da3485bd | ||
|
|
7384d2d330 | ||
|
|
e5940168fe | ||
|
|
6855baf0f8 | ||
|
|
dfd16e8fef | ||
|
|
98a36819bc | ||
|
|
de8bc9ca9d | ||
|
|
c137f2de4f | ||
|
|
0f55fcafe8 | ||
|
|
ed027ec3ee | ||
|
|
b3fd79cbb9 | ||
|
|
ed4df87b57 | ||
|
|
1321f097b8 | ||
|
|
cfa28f0c4a | ||
|
|
ab47b717b1 | ||
|
|
65ebb0d2f8 | ||
|
|
49640ce03a | ||
|
|
e05cdc83f3 | ||
|
|
992a9ea2f9 | ||
|
|
228351fc13 | ||
|
|
8a5b6f2b86 | ||
|
|
71ecbb3af3 | ||
|
|
5746614ccf | ||
|
|
3a422c3f15 | ||
|
|
b3242322fd | ||
|
|
9826640ae6 | ||
|
|
1f5267204b | ||
|
|
ed25e1bbd6 | ||
|
|
c8491d008f | ||
|
|
08e3405394 | ||
|
|
4ebfa07186 | ||
|
|
6698c189fc | ||
|
|
f0639390aa | ||
|
|
bbdfed2d5a | ||
|
|
7f4daa2c50 | ||
|
|
baf9b67b35 | ||
|
|
caf73b0b36 | ||
|
|
acf87c2794 | ||
|
|
7f5f6b54fb | ||
|
|
a08eb8a446 | ||
|
|
b31402766e | ||
|
|
9ab3143bf0 | ||
|
|
81a0cddb9e | ||
|
|
f620ac769f | ||
|
|
dc91041edd | ||
|
|
6ee08b6717 | ||
|
|
5a2cd2ac84 | ||
|
|
2bd8448aaa | ||
|
|
2360adb592 | ||
|
|
c7301a5161 | ||
|
|
72270825c1 | ||
|
|
1e94f0a094 | ||
|
|
e39d2567ea | ||
|
|
949136c92a | ||
|
|
9f456a9b19 | ||
|
|
4cf6ba25ca | ||
|
|
093f971896 | ||
|
|
df38a9da71 | ||
|
|
813814c54a | ||
|
|
68cb32f375 | ||
|
|
93c9590b0f | ||
|
|
619d979c39 | ||
|
|
c30faad838 | ||
|
|
bea0de4980 | ||
|
|
ef5a490415 | ||
|
|
fa404285be | ||
|
|
0e526258ff | ||
|
|
56d2fb9a3b | ||
|
|
7c82690852 | ||
|
|
62acc17e42 | ||
|
|
9fbe5895b7 | ||
|
|
6bbe0f07d4 | ||
|
|
bd3e0b9336 | ||
|
|
699debdaca | ||
|
|
70eba568af | ||
|
|
bb7560e441 | ||
|
|
43c0cac52f | ||
|
|
4b4aa148a9 | ||
|
|
c9c90c4e7f | ||
|
|
99093e9a4c | ||
|
|
2cf33d635d | ||
|
|
d6abaf846e | ||
|
|
4b88131977 | ||
|
|
4520f46a57 | ||
|
|
348d47076a | ||
|
|
6e7b90a184 | ||
|
|
28d7a7a6d2 | ||
|
|
da13b5dbf2 | ||
|
|
a60710e3bb | ||
|
|
7d2a2b9983 | ||
|
|
749df5dacd | ||
|
|
af88b7c807 | ||
|
|
4091687733 | ||
|
|
cfb0a3ba2a | ||
|
|
6c4d082f35 | ||
|
|
262185046a | ||
|
|
da9d00be7d | ||
|
|
454abc388b | ||
|
|
3e9174deed | ||
|
|
4df1047b07 | ||
|
|
60f69feaff | ||
|
|
5df426380d | ||
|
|
976c299657 | ||
|
|
18ab6b51fd | ||
|
|
4be8bd4d18 | ||
|
|
075bc4a6d5 | ||
|
|
1c61feb368 | ||
|
|
d32b788988 | ||
|
|
7565ea2787 | ||
|
|
9275975b2c | ||
|
|
b3e0d5ba58 | ||
|
|
841dee94c6 | ||
|
|
71638191ee | ||
|
|
9d6851cbbd | ||
|
|
d633d05803 | ||
|
|
45d7879d7b | ||
|
|
4a8375355c | ||
|
|
d3ebd763a2 | ||
|
|
b7f69238a1 | ||
|
|
118a9f224e | ||
|
|
a44dc8df37 | ||
|
|
abf19aad74 | ||
|
|
d73127b175 | ||
|
|
00f4242fa4 | ||
|
|
f6a4510659 | ||
|
|
33215424d8 | ||
|
|
6094bc9210 | ||
|
|
a8cd9b3aa9 | ||
|
|
a189dec1c8 | ||
|
|
858216796a | ||
|
|
f24342f117 | ||
|
|
50b55a77de | ||
|
|
fdf167db11 | ||
|
|
a4f8bd4ee0 | ||
|
|
3e4c12cf56 | ||
|
|
03c39e692a | ||
|
|
ab63b0e970 | ||
|
|
6ea42a35a9 | ||
|
|
d366dfc72b | ||
|
|
85042fbe25 | ||
|
|
23e5188422 | ||
|
|
93ee0c8798 | ||
|
|
aa88486f59 | ||
|
|
1d9c441038 | ||
|
|
928c56bda2 | ||
|
|
bc6f37eecc | ||
|
|
ffebff8cab | ||
|
|
6d6bd89d6b | ||
|
|
0a64a7e5d4 | ||
|
|
586488af48 | ||
|
|
7b9a45f1a8 | ||
|
|
4ff70aefac | ||
|
|
d63b5d7014 | ||
|
|
ab5f6bf901 | ||
|
|
04088b34a2 | ||
|
|
3edcd2004e | ||
|
|
7bd52d0245 | ||
|
|
1df65940b9 | ||
|
|
d9ace35c3e | ||
|
|
1fe92cee6f | ||
|
|
267868c3b0 | ||
|
|
6d27eb7f64 | ||
|
|
2e10fa494f | ||
|
|
039be65a89 | ||
|
|
570ecd9987 | ||
|
|
a575180475 | ||
|
|
07d1a20f3d | ||
|
|
76491cbb31 | ||
|
|
bf7d6ddcb2 | ||
|
|
44b969e0b6 | ||
|
|
176e470497 | ||
|
|
646a10d9bf | ||
|
|
52137fd64f | ||
|
|
3ccac8c3b8 | ||
|
|
0be158afa1 | ||
|
|
e6942e0122 | ||
|
|
496b22026f | ||
|
|
bb2df02dff | ||
|
|
4c850ecc31 | ||
|
|
da9c6f6e23 | ||
|
|
58ba0b0b4e | ||
|
|
1d0b87246a | ||
|
|
920b60da19 | ||
|
|
523e66294b | ||
|
|
23f8f35098 | ||
|
|
8d210b5e37 | ||
|
|
3c6c0e6700 | ||
|
|
01344c451f | ||
|
|
2c42c79482 | ||
|
|
75c2cfe7bf | ||
|
|
6c6eeb3f28 | ||
|
|
31053e0cd0 | ||
|
|
aad9aced18 | ||
|
|
dd2c9eeafe | ||
|
|
740d76bc42 | ||
|
|
45f4f5afd9 | ||
|
|
e875de3e98 | ||
|
|
fd7786633d | ||
|
|
bce9cfa39a | ||
|
|
ff3d66a661 | ||
|
|
006d28abd5 | ||
|
|
59b1e63bdf | ||
|
|
eab74ef06b | ||
|
|
89837de9b0 | ||
|
|
b245931c79 | ||
|
|
fd5e42698c | ||
|
|
c75512ba6e | ||
|
|
a22e7aa0b1 | ||
|
|
020dd97f99 | ||
|
|
e9882d9702 | ||
|
|
fd4a27dbf2 | ||
|
|
9c63e31da6 | ||
|
|
c91f809eba | ||
|
|
a54eaf5371 | ||
|
|
8032bd4bb9 | ||
|
|
ea1beec2f7 | ||
|
|
05f2f6820e | ||
|
|
0f5f15a5ce | ||
|
|
14ac37e8a5 | ||
|
|
1fae89cbb6 | ||
|
|
8b4008798f | ||
|
|
fd4faf59b8 | ||
|
|
109891d668 | ||
|
|
bdea796121 | ||
|
|
c8813c05c9 | ||
|
|
1cff08ce5d | ||
|
|
a868118f6f | ||
|
|
e5c62f5750 | ||
|
|
4084e8790b | ||
|
|
8d931dd773 | ||
|
|
25d6366297 | ||
|
|
08cd5b81d1 | ||
|
|
5d3a8a5b1a | ||
|
|
79b84da4b8 | ||
|
|
68b07c5913 | ||
|
|
553db9124d | ||
|
|
b495f37299 | ||
|
|
1915547594 | ||
|
|
03de29164a | ||
|
|
86d8b50547 | ||
|
|
7b04386162 | ||
|
|
07bfdf3e4d | ||
|
|
d510224e2a | ||
|
|
e658f9297d | ||
|
|
2b502e9a0f | ||
|
|
59141f9bbe | ||
|
|
3af66b72f2 | ||
|
|
422c24bd68 | ||
|
|
f0f87c8eb9 | ||
|
|
80dad54119 | ||
|
|
56a76df28e | ||
|
|
ee2c801fe0 | ||
|
|
fc314cc248 | ||
|
|
fe231a4c80 | ||
|
|
2e2bbe0a7f | ||
|
|
857e6e8345 | ||
|
|
3402981ada | ||
|
|
f401e577e5 | ||
|
|
0241a50c6f | ||
|
|
2a2e1236fc | ||
|
|
9b170f2b4f | ||
|
|
51e9ff59de | ||
|
|
2977dbcded | ||
|
|
ac60b51035 | ||
|
|
4c2f33a089 | ||
|
|
3b071116ac | ||
|
|
a9f265a591 | ||
|
|
5b62fc8103 | ||
|
|
0598f5f89a | ||
|
|
f723427b8b | ||
|
|
f69a004c1c | ||
|
|
1134b18a8b | ||
|
|
2e4aa507f7 | ||
|
|
5fb96cdcf4 | ||
|
|
e8cba3524e | ||
|
|
7e6b5363f1 | ||
|
|
29457a1d28 | ||
|
|
731455f164 | ||
|
|
b01a8cace6 | ||
|
|
72db5b4fac | ||
|
|
ddfd42994e | ||
|
|
2a9ff9c5ef | ||
|
|
6d49f05356 | ||
|
|
85a5e62e36 | ||
|
|
e67965a381 | ||
|
|
ec4723096f | ||
|
|
762b678d24 | ||
|
|
38fcc57bbf | ||
|
|
c8c57c74cc | ||
|
|
0784448c69 | ||
|
|
de0064af47 | ||
|
|
baae1fc84f | ||
|
|
2ab999f4ca | ||
|
|
c9f390d6e0 | ||
|
|
af05922ecc | ||
|
|
299edbf3ab | ||
|
|
c8abed9d48 | ||
|
|
3622c49ce1 | ||
|
|
0462e9a7d9 | ||
|
|
c3a6091908 | ||
|
|
ab5fedda0b | ||
|
|
ba70269398 | ||
|
|
77fd5fa7de | ||
|
|
ab74290fe3 | ||
|
|
3aad9d8166 | ||
|
|
572e078d87 | ||
|
|
ee4548230b | ||
|
|
96b93bd876 | ||
|
|
927f69fe30 | ||
|
|
7e9ad5927a | ||
|
|
6d6b07865e | ||
|
|
376e7977f0 | ||
|
|
83ae66daea | ||
|
|
89e0be0099 | ||
|
|
ef40c1212e | ||
|
|
3a2a2a4ffa | ||
|
|
9592a69986 | ||
|
|
89be07e1f2 | ||
|
|
c61c3ae0e9 | ||
|
|
817350c8c5 | ||
|
|
3603b7c82b | ||
|
|
5743c72cca | ||
|
|
4cdd66ceff | ||
|
|
d3947d2cfa | ||
|
|
07718b994a | ||
|
|
ef9d463bd7 | ||
|
|
8745c7884e | ||
|
|
b6965105b7 | ||
|
|
3d269fe8be | ||
|
|
be5f00aa1a | ||
|
|
59ba350f34 | ||
|
|
803c5377a6 | ||
|
|
7c12bf7fa1 | ||
|
|
ca35a9681f | ||
|
|
9fe5f37337 | ||
|
|
0742901cd2 | ||
|
|
5e4d2dedbe | ||
|
|
411ea56a3e | ||
|
|
cda57dd4b4 | ||
|
|
4351de503f | ||
|
|
6339ba6bfb | ||
|
|
ef6677f43d | ||
|
|
a7824af5a8 | ||
|
|
1eb7d7b7a8 | ||
|
|
11c33d4447 | ||
|
|
b8a3cc8b60 | ||
|
|
27c688252d | ||
|
|
3e2afd4b1d | ||
|
|
f45b0686d2 | ||
|
|
1f3f881f81 | ||
|
|
ceb51bb14f | ||
|
|
3e22573d8d | ||
|
|
79418a3767 | ||
|
|
40d4683de1 | ||
|
|
79e5b54ec7 | ||
|
|
bd81923f2f | ||
|
|
69560b8ad7 | ||
|
|
dc413e7b73 | ||
|
|
7fc00c446b | ||
|
|
2efc423cf8 | ||
|
|
8ec3086cdd | ||
|
|
5fc7079023 | ||
|
|
bfbd254be7 | ||
|
|
f8ea43466c | ||
|
|
75ab1fa570 | ||
|
|
bf4a46d57c | ||
|
|
1046dd5eda | ||
|
|
f9e32a119a | ||
|
|
dbb8b8a439 | ||
|
|
2a65c3dc8f | ||
|
|
f17ec9e9d7 | ||
|
|
675d6d8328 | ||
|
|
6dc9ccad75 | ||
|
|
6add02702b | ||
|
|
958d6377e3 | ||
|
|
9954154ca2 | ||
|
|
4ecbf8c12c | ||
|
|
fc8a3c5fb4 | ||
|
|
01e7dff1a0 | ||
|
|
018c0064cd | ||
|
|
c2b016370b | ||
|
|
fc791b4371 | ||
|
|
f76bb009f4 | ||
|
|
8a1292b295 | ||
|
|
d7d80d3fc1 | ||
|
|
41b01003fd | ||
|
|
6557070ae1 | ||
|
|
e7e580e177 | ||
|
|
dd9ddd2019 | ||
|
|
74aae523ba | ||
|
|
48c40f9516 | ||
|
|
e0e7674715 | ||
|
|
e1a65276b9 | ||
|
|
469adc85ad | ||
|
|
e1b181ca4e | ||
|
|
a4f0fbf8b7 | ||
|
|
190cdaddf8 | ||
|
|
5c4ba13839 | ||
|
|
e62630cf3e | ||
|
|
36fe7846c0 | ||
|
|
8d150dd67a | ||
|
|
506df00d81 | ||
|
|
a9121fa28f | ||
|
|
d5a56d9e85 | ||
|
|
acf7c0c665 | ||
|
|
619d48c97a | ||
|
|
2cb198c38c | ||
|
|
e8e39e0f3c | ||
|
|
37860181d4 | ||
|
|
d119dd9a0c | ||
|
|
09ef19f7ec | ||
|
|
6a06c92fa6 | ||
|
|
58ae596b0f | ||
|
|
f1ca21678d | ||
|
|
d7eeef2c8a | ||
|
|
4f626897f2 | ||
|
|
b127e01845 | ||
|
|
2118beeb23 | ||
|
|
5020cd1bbf | ||
|
|
cce636224c | ||
|
|
60b3b8ddce | ||
|
|
41446ec9ba | ||
|
|
df8b047bca | ||
|
|
12ced52012 | ||
|
|
1d53335ae5 | ||
|
|
971a50d290 | ||
|
|
36dd9106a8 | ||
|
|
0a4ee3ffc7 | ||
|
|
cfe32f1a70 | ||
|
|
d877f5d5c6 | ||
|
|
0ab6ffefb4 | ||
|
|
a292a1d23a | ||
|
|
3f87f6aee3 | ||
|
|
04bcd145d3 | ||
|
|
244e811291 | ||
|
|
ac7467fb59 | ||
|
|
2c0436216f | ||
|
|
017fbf267b | ||
|
|
e6afbf2ec0 | ||
|
|
906b4aad9e | ||
|
|
4cf8d41f6a | ||
|
|
47c860142e | ||
|
|
2fba3f213b | ||
|
|
af7c6f9fce | ||
|
|
78534deab6 | ||
|
|
6710314832 | ||
|
|
0cd4fa6fa0 | ||
|
|
065949496e | ||
|
|
39c82576ae | ||
|
|
37221a508d | ||
|
|
6b43a32a10 | ||
|
|
d7cd1ff142 | ||
|
|
659d947863 | ||
|
|
39be7a6288 | ||
|
|
8ac976c579 | ||
|
|
70fd432c57 | ||
|
|
00135f2f49 | ||
|
|
9b944bc29c | ||
|
|
d520b3d2a0 | ||
|
|
6f41d9855b | ||
|
|
2d7c1da741 | ||
|
|
c0f45b6b1e | ||
|
|
7a0025673c | ||
|
|
ad7ec79903 | ||
|
|
0543239cca | ||
|
|
ff3dad2457 | ||
|
|
298d5e197b | ||
|
|
d73c0a998d | ||
|
|
1b79a3ddbf | ||
|
|
a8478ace18 | ||
|
|
72cf5f3f9f | ||
|
|
6f9d493a18 | ||
|
|
08f7d5ebff | ||
|
|
1fe3675403 | ||
|
|
a0f956d2c1 | ||
|
|
1560f91b4a | ||
|
|
c20f362594 | ||
|
|
7ae8c26e50 | ||
|
|
adfffe6121 | ||
|
|
64601baa76 | ||
|
|
aa374b51f1 | ||
|
|
5c483745ff | ||
|
|
0c247110a0 | ||
|
|
1643638a78 | ||
|
|
4ace228fc2 | ||
|
|
25aa86a0dc | ||
|
|
70d3b24338 | ||
|
|
8664e9d19b | ||
|
|
50d9877446 | ||
|
|
fe06352089 | ||
|
|
7b599419b5 | ||
|
|
491adf072e | ||
|
|
f6aae2b048 | ||
|
|
d2d5c94633 | ||
|
|
10581f9ef2 | ||
|
|
c7e0e1c038 | ||
|
|
a914d701eb | ||
|
|
0f9dee6e9c | ||
|
|
aa383e2190 | ||
|
|
9bbfcf326c | ||
|
|
3948e67c8f | ||
|
|
d56e1b2cc5 | ||
|
|
bfac1f1bc2 | ||
|
|
d4a956c355 | ||
|
|
6c71fefa58 | ||
|
|
ad3003c00a | ||
|
|
0ad5dcb258 | ||
|
|
d790309b02 | ||
|
|
1072faf309 | ||
|
|
d2c196896d | ||
|
|
e42b608444 | ||
|
|
89a501a3af | ||
|
|
c19b78180c | ||
|
|
c0b750a09a | ||
|
|
c967e618a1 | ||
|
|
59f78d7dfc | ||
|
|
d8405f0d05 | ||
|
|
0f34f0033c | ||
|
|
190646d50c | ||
|
|
a46c6252c6 | ||
|
|
5c1886c8f5 | ||
|
|
afcb3d8f34 | ||
|
|
9fbffafdbf | ||
|
|
075f0458f7 | ||
|
|
d4568aa0a7 | ||
|
|
97588408a2 | ||
|
|
1def9b301b | ||
|
|
5bac442b18 | ||
|
|
6add682705 | ||
|
|
8b50d84a05 | ||
|
|
d3858b81e2 | ||
|
|
bdff9769be | ||
|
|
c61df75e5e | ||
|
|
a74bf2cc27 | ||
|
|
ada0f93686 | ||
|
|
ff36f2ba17 | ||
|
|
5164cfd399 | ||
|
|
5fa021503e | ||
|
|
7b5d79d313 | ||
|
|
3e3f38500d | ||
|
|
5109b9abfd | ||
|
|
7fb4777c1c | ||
|
|
c38533e0f8 | ||
|
|
51ba99d09e | ||
|
|
9159f86a9e | ||
|
|
e139f4fc13 | ||
|
|
2fbfeacb87 | ||
|
|
ebb7a9fcda | ||
|
|
9e72317302 | ||
|
|
d764c20c08 | ||
|
|
9c17b8a098 | ||
|
|
3084873154 | ||
|
|
32809e56d0 | ||
|
|
9f05b182a2 | ||
|
|
525484e834 | ||
|
|
65a4e69cae | ||
|
|
e973f8bab9 | ||
|
|
92466671ff | ||
|
|
6d61106070 | ||
|
|
ac13749fb8 | ||
|
|
7ec1a9a316 | ||
|
|
cf17e21ad3 | ||
|
|
0e0240c4ab | ||
|
|
d1b290b91a | ||
|
|
a63696836c | ||
|
|
46aad00f16 | ||
|
|
252afe8932 | ||
|
|
9dd467a613 | ||
|
|
4c14df67cc | ||
|
|
20e0fe3ba1 | ||
|
|
6a005135f2 | ||
|
|
82e8375957 | ||
|
|
bb25edc09e | ||
|
|
169c0fe4af | ||
|
|
cd6918e6eb | ||
|
|
5be035fd44 | ||
|
|
f1edc8443c | ||
|
|
d9564bd04c | ||
|
|
35f1c396f2 | ||
|
|
6acb950990 | ||
|
|
27e0d1641a | ||
|
|
9ac71ff8af | ||
|
|
075737a4ec | ||
|
|
6d0e4a6a5e | ||
|
|
a2544768a0 | ||
|
|
8574a14ed2 | ||
|
|
e90c555c18 | ||
|
|
863b9a410f | ||
|
|
23c7bbc7d5 | ||
|
|
f900189f90 | ||
|
|
7c74be2790 | ||
|
|
70dd2d4829 | ||
|
|
914b7ee056 | ||
|
|
e39f83edbf | ||
|
|
52fe0c6abb | ||
|
|
5cb3e5937f | ||
|
|
e0cd224831 | ||
|
|
de225ac64a | ||
|
|
5807808a10 | ||
|
|
362877d18f | ||
|
|
88b8dd0149 | ||
|
|
1552f32e09 | ||
|
|
50b73a6720 | ||
|
|
53e51f1735 | ||
|
|
40b63bfebe | ||
|
|
89861eceef | ||
|
|
b8eaff66fa | ||
|
|
a747fdd27d | ||
|
|
27851bdefa | ||
|
|
3fdeb40ddf | ||
|
|
546c7cebd3 | ||
|
|
473902f5f4 | ||
|
|
41c0721159 | ||
|
|
413d4badfd | ||
|
|
c5d67ebf72 | ||
|
|
91818cfa1a | ||
|
|
6263d684d9 | ||
|
|
07140d33a7 | ||
|
|
4ffc388491 | ||
|
|
0ef026c610 | ||
|
|
153c7fdf20 | ||
|
|
90379eeb35 | ||
|
|
3ae959af95 | ||
|
|
c8cc652b71 | ||
|
|
4b6285e5c2 | ||
|
|
013de7b3ef | ||
|
|
e11e88a9c5 | ||
|
|
7cec8baa55 | ||
|
|
e987db9fb5 | ||
|
|
c603b9084f | ||
|
|
492d6dfcf0 | ||
|
|
a3e0f2dcc3 | ||
|
|
cf211e26f4 | ||
|
|
c5aaaa7c55 | ||
|
|
f86d077e27 | ||
|
|
f8076825cb | ||
|
|
201d8a97d4 | ||
|
|
d08f326990 | ||
|
|
8dc9d3bc78 | ||
|
|
adf95ce3a0 | ||
|
|
3c1aca114f | ||
|
|
18d0fd9d2a | ||
|
|
c2e673f978 | ||
|
|
2bde8a1975 | ||
|
|
bf9927c7dd | ||
|
|
f339a087a2 | ||
|
|
6ccc5f3788 | ||
|
|
1affb91f17 | ||
|
|
7779c3e372 | ||
|
|
49ba7ad22e | ||
|
|
6ad33d60f7 | ||
|
|
0117274061 | ||
|
|
e50192a407 | ||
|
|
c6fc0e587e | ||
|
|
68c448bc34 | ||
|
|
ef62272df7 | ||
|
|
375cd0e42b | ||
|
|
b885ccbd63 | ||
|
|
da6f1d0f12 | ||
|
|
3934821436 | ||
|
|
c3b473e4bc | ||
|
|
4c0d435b6b | ||
|
|
7ed2c077de | ||
|
|
52a6a7bce8 | ||
|
|
1283167595 | ||
|
|
23c2e22910 | ||
|
|
f44b2dbd45 | ||
|
|
46ee2c3f4e | ||
|
|
5d5ec08566 | ||
|
|
0e717a2de4 | ||
|
|
cada862214 | ||
|
|
c3a6179a21 | ||
|
|
682c6d4e7b | ||
|
|
d0a253c97e | ||
|
|
c0e2b3027b | ||
|
|
e7dc14b07d | ||
|
|
0da9146e90 | ||
|
|
ad05a33e02 | ||
|
|
ef175e3cbe | ||
|
|
4de51d93ef | ||
|
|
8224e038a3 | ||
|
|
03c04c2141 | ||
|
|
2e091b04e5 | ||
|
|
60296493fe | ||
|
|
20c20f8f9b | ||
|
|
f1d642a4e5 | ||
|
|
e0e5ea17a4 | ||
|
|
91a0ba72dc | ||
|
|
c54c5a974a | ||
|
|
532b8c54ab | ||
|
|
5ac87891b5 | ||
|
|
2d905ce3fb | ||
|
|
831112abd2 | ||
|
|
153d0f5505 | ||
|
|
c78896a335 | ||
|
|
316ec98e0f | ||
|
|
cf58545a45 | ||
|
|
e7a2144def | ||
|
|
52a2c6958b | ||
|
|
70243d7a47 | ||
|
|
b5b8c4b725 | ||
|
|
6c4d81b1e9 | ||
|
|
513d732934 | ||
|
|
c88dc8795b | ||
|
|
a8030c39b1 | ||
|
|
7243b9e72f | ||
|
|
d149af9628 | ||
|
|
c0ac2d540b | ||
|
|
528634d755 | ||
|
|
3283439fd4 | ||
|
|
e86015badc | ||
|
|
c8f65fc9a1 | ||
|
|
c8216f9bc5 | ||
|
|
e579f314a6 | ||
|
|
2c4001387e | ||
|
|
caa39474cb | ||
|
|
7684602ea8 | ||
|
|
d1a7372bd2 | ||
|
|
4601989d4a | ||
|
|
23f697d62b | ||
|
|
e837bdc8ad | ||
|
|
7265450e2e | ||
|
|
058dbc9f9e | ||
|
|
daf9b019c6 | ||
|
|
14eebd582f | ||
|
|
9a8eeacee8 | ||
|
|
45b0bf5bc5 | ||
|
|
88db822c43 | ||
|
|
fbf3588fdf | ||
|
|
a82ef6bd35 | ||
|
|
312466aaf8 | ||
|
|
c0ca99f4b4 | ||
|
|
196f15d240 | ||
|
|
bfddef2671 | ||
|
|
44395e8ff0 | ||
|
|
4ff39f8817 | ||
|
|
1df41003ec | ||
|
|
1f39ee41ad | ||
|
|
42d8b1ecb9 | ||
|
|
a4da7b33e6 | ||
|
|
e4ee9e9095 | ||
|
|
835ece5469 | ||
|
|
77430a282f | ||
|
|
d93fc67a75 | ||
|
|
838f3cc01e | ||
|
|
4d5841332a | ||
|
|
9b41976252 | ||
|
|
d08fd0561a | ||
|
|
30e459252c | ||
|
|
a6958ac139 | ||
|
|
d7d76f54cc | ||
|
|
e6c1dd532d | ||
|
|
970a2e87b3 | ||
|
|
cabaae8403 | ||
|
|
d1f301e059 | ||
|
|
79eb5b2ed2 | ||
|
|
f0533fca70 | ||
|
|
08e98eeb15 | ||
|
|
f2064a84ed | ||
|
|
b2f719989d | ||
|
|
1e812c40ce | ||
|
|
a949641342 | ||
|
|
6db27c7758 | ||
|
|
c231e88a5d | ||
|
|
3f83919e09 | ||
|
|
72a5b83544 | ||
|
|
d2e8ecc646 | ||
|
|
30eb4074cb | ||
|
|
79c71509f6 | ||
|
|
5dab580cfc | ||
|
|
9929e7d8e8 | ||
|
|
f6ee252572 | ||
|
|
90d218ebc8 | ||
|
|
499a157946 | ||
|
|
c5a7ab2415 | ||
|
|
3dd5a6f378 | ||
|
|
7be26a0677 | ||
|
|
c183fdd3ca | ||
|
|
baa439457e | ||
|
|
4dbcd54b72 | ||
|
|
11062f2d4f | ||
|
|
b0a5dbb4c2 | ||
|
|
0abdfda5a2 | ||
|
|
a0466085fe | ||
|
|
a7ceb04cb7 | ||
|
|
274efb49e7 | ||
|
|
b3cd83bbca | ||
|
|
b8bd83ba05 | ||
|
|
34dcf49fbc | ||
|
|
f2f7d77847 | ||
|
|
b2105f2d88 | ||
|
|
4126f3bdcb | ||
|
|
74ccfe6088 | ||
|
|
48085b5573 | ||
|
|
ef2f8d485b | ||
|
|
9fb9212b0a | ||
|
|
7b9ddc9b3b | ||
|
|
15726a759c | ||
|
|
2c7474ea87 | ||
|
|
c726aee643 | ||
|
|
f31a24b16d | ||
|
|
b436bce565 | ||
|
|
886286a819 | ||
|
|
c3e94e1480 | ||
|
|
5f1343e5b4 | ||
|
|
ffb1303d61 | ||
|
|
a0b0d938f0 | ||
|
|
158f5ba7d9 | ||
|
|
b8cf40161c | ||
|
|
fb96e6a56f | ||
|
|
6668ba2511 | ||
|
|
6d93831488 | ||
|
|
4668ef3020 | ||
|
|
bcdadc6581 | ||
|
|
36448191b7 | ||
|
|
be5be108c3 | ||
|
|
c9ca42aaa9 | ||
|
|
630f2b7d19 | ||
|
|
dde0a4a7c8 | ||
|
|
c0e2f44092 | ||
|
|
1412fcbb22 | ||
|
|
c69dc0f036 | ||
|
|
9b445d89a1 | ||
|
|
c3c78428c4 | ||
|
|
c6d2bf577f | ||
|
|
b06f69573d | ||
|
|
8fd03f7434 | ||
|
|
25703c1750 | ||
|
|
90e4ac2d23 | ||
|
|
956bceae75 | ||
|
|
c663be86de | ||
|
|
aca78baecf | ||
|
|
fbcf6b7954 | ||
|
|
84123222aa | ||
|
|
e9dbcf693d | ||
|
|
1cd0a9d48f | ||
|
|
1b48e44914 | ||
|
|
0a398f03fd | ||
|
|
3a9a3ed184 | ||
|
|
88fae36b8a | ||
|
|
15ed3e52f2 | ||
|
|
8990919dab | ||
|
|
e5638e4b15 | ||
|
|
404c6fac9a | ||
|
|
fc9d4034a9 | ||
|
|
cecc0b932d | ||
|
|
0faed7159c | ||
|
|
fb491cfdcf | ||
|
|
fc706dcb40 | ||
|
|
a2c1b024f3 | ||
|
|
267395bfa2 | ||
|
|
920fc5ae99 | ||
|
|
92ed0ae51b | ||
|
|
3d865394d7 | ||
|
|
76ef1d0d86 | ||
|
|
c694776162 | ||
|
|
9484ec0c17 | ||
|
|
7e2ba41c64 | ||
|
|
614c552e55 | ||
|
|
7db3d84ba2 | ||
|
|
bb2c744ec0 | ||
|
|
87f6018468 | ||
|
|
9194c50590 | ||
|
|
873f14bbe0 | ||
|
|
31110b1927 | ||
|
|
6764a98409 | ||
|
|
7ff45974c6 | ||
|
|
fd7b5f393a | ||
|
|
2533a4fc4a | ||
|
|
2ca528f93f | ||
|
|
42284c5efb | ||
|
|
ce2e6b7d35 | ||
|
|
684c5d225a | ||
|
|
b75018b03b | ||
|
|
41499d4b3c | ||
|
|
383c97c303 | ||
|
|
74b54ef371 | ||
|
|
bbf7b4db79 | ||
|
|
c61f0acab5 | ||
|
|
398af123b2 | ||
|
|
315fa9d7d3 | ||
|
|
fb5e8ef40c | ||
|
|
7d7686da33 | ||
|
|
e79d764148 | ||
|
|
ebbee0dc43 | ||
|
|
65e455ef0b | ||
|
|
ed0c16e201 | ||
|
|
209fdf349a | ||
|
|
f49f2afacd | ||
|
|
8c6330a3c4 | ||
|
|
337b777125 | ||
|
|
1b756e8d96 | ||
|
|
ac05e2f2e2 | ||
|
|
787f7b3035 | ||
|
|
31bd642b80 | ||
|
|
f0bac6b154 | ||
|
|
cc7e74ca11 | ||
|
|
52d478df1a | ||
|
|
e8a44646b8 | ||
|
|
0c782edf21 | ||
|
|
e3948d295e | ||
|
|
5f2c742a5c | ||
|
|
ae97d011ae | ||
|
|
1b7657a374 | ||
|
|
5665e04014 | ||
|
|
b30c77aab9 | ||
|
|
a5916b9c49 | ||
|
|
453180e30b | ||
|
|
8bd432d391 | ||
|
|
c9d3e20aef | ||
|
|
bb70385a42 | ||
|
|
9855877b03 | ||
|
|
d5408d1f09 | ||
|
|
f334532aba | ||
|
|
be77c09f3d | ||
|
|
7de6a92753 | ||
|
|
36f76f5a14 | ||
|
|
b84523d557 | ||
|
|
21a557a184 | ||
|
|
2c78c415e9 | ||
|
|
79ccb30dd2 | ||
|
|
3c566becf6 | ||
|
|
76c9188fae | ||
|
|
e4e5269836 | ||
|
|
9e737df534 | ||
|
|
151ca593af | ||
|
|
4132eacba0 | ||
|
|
06e6151816 | ||
|
|
70277d4edd | ||
|
|
d21d2f1a9c | ||
|
|
74a7be996f | ||
|
|
0b3192c4d5 | ||
|
|
968e6237bd | ||
|
|
d780b5a0e4 | ||
|
|
3e48427eaf | ||
|
|
31360c34ed | ||
|
|
e9624e2304 | ||
|
|
3f38579529 | ||
|
|
4d5a9f6e15 | ||
|
|
41f47acd76 | ||
|
|
821dcaa7c7 | ||
|
|
7135d26419 | ||
|
|
f7fd354dce | ||
|
|
0c69a65bc4 | ||
|
|
2f2ca5eab4 | ||
|
|
9c6e64f47d | ||
|
|
0afa601551 | ||
|
|
df9c40c035 | ||
|
|
25b67017e4 | ||
|
|
bc9c3346f3 | ||
|
|
1db7e19fe8 | ||
|
|
102c03ce2b | ||
|
|
ec19eb4455 | ||
|
|
6d9924d50e | ||
|
|
16c4d74274 | ||
|
|
e4af5fd36a | ||
|
|
702775493a | ||
|
|
b2ae826066 | ||
|
|
cc3e9990fa | ||
|
|
271cbddd5e | ||
|
|
26dfbb3028 | ||
|
|
f16cd987e4 | ||
|
|
c1423ca9ad | ||
|
|
74379150a1 | ||
|
|
a94fa81195 | ||
|
|
6119c24720 | ||
|
|
c840a30c30 | ||
|
|
ae5277a898 | ||
|
|
bffa837825 | ||
|
|
b9e7d0faea | ||
|
|
860b08d9ed | ||
|
|
691dc1d49e | ||
|
|
7da205f4c8 | ||
|
|
9d6886d367 | ||
|
|
9589b68f5a | ||
|
|
28d88af1af | ||
|
|
8b5acd1849 | ||
|
|
33dc63a7fd | ||
|
|
754fafcfe9 | ||
|
|
bd7766b17e | ||
|
|
70b7d73453 | ||
|
|
5ad4702a5b | ||
|
|
40b6fe03c2 | ||
|
|
49ecba2476 | ||
|
|
ebd509d92d | ||
|
|
7193374a7e | ||
|
|
6728445542 | ||
|
|
10ed299c78 | ||
|
|
d0a86385b7 | ||
|
|
32b124913e | ||
|
|
599ae95251 | ||
|
|
d1be34c34a | ||
|
|
bc2cac90fe | ||
|
|
50a49e2c8c | ||
|
|
c60adb113e | ||
|
|
aee015e8f6 | ||
|
|
bf6af29205 | ||
|
|
329905d472 | ||
|
|
00d450d262 | ||
|
|
2365d1bd20 | ||
|
|
5b385c18e5 | ||
|
|
98c0434ec0 | ||
|
|
f318d0a3bc | ||
|
|
27f5b410c0 | ||
|
|
3f55be9676 | ||
|
|
28350e3ad9 | ||
|
|
f48e6c93b8 | ||
|
|
7cfc24d68f | ||
|
|
a58d3ea04d | ||
|
|
dfee9954e0 | ||
|
|
eed86c760f | ||
|
|
c471bb6f67 | ||
|
|
518c2b0f95 | ||
|
|
328fc44194 | ||
|
|
b6f735a8f6 | ||
|
|
b05d2d3a2d | ||
|
|
deae08fc4b | ||
|
|
19af5f9e0b | ||
|
|
c61135ee7b | ||
|
|
f37f330670 | ||
|
|
40082d4571 | ||
|
|
97cf15007f | ||
|
|
00d655f346 | ||
|
|
821726e7c0 | ||
|
|
e8302dfbe2 | ||
|
|
558f95cf7e | ||
|
|
18f6ead891 | ||
|
|
759e905c3c | ||
|
|
8bf7e42913 | ||
|
|
0dcd073554 | ||
|
|
2fe35d578d | ||
|
|
8d139e156e | ||
|
|
7c2849356a | ||
|
|
0025ffd1c0 | ||
|
|
2ef7146642 | ||
|
|
10bd25be52 | ||
|
|
1b27e69e40 | ||
|
|
65511845d2 | ||
|
|
1c743839ea | ||
|
|
bcae9dec41 | ||
|
|
482c9af41f | ||
|
|
8e7b757efd | ||
|
|
1ab543cea1 | ||
|
|
a3f86903e4 | ||
|
|
c239c305ab | ||
|
|
2bf2e7461f | ||
|
|
7d1082b1cb | ||
|
|
0dbae83aec | ||
|
|
f927c1b997 | ||
|
|
89ec7dad2b | ||
|
|
4fd61345af | ||
|
|
2e02af994e | ||
|
|
66cca24453 | ||
|
|
2f4062a923 | ||
|
|
e733484fab | ||
|
|
e5c3183025 | ||
|
|
836d9afe17 | ||
|
|
007a352742 | ||
|
|
e526e5659e | ||
|
|
4a5227c7bf | ||
|
|
c2c151ec4c | ||
|
|
452096e7e4 | ||
|
|
50c2a9859e | ||
|
|
677b667307 | ||
|
|
930c82316a | ||
|
|
3dc22db265 | ||
|
|
d8c51cb286 | ||
|
|
2f79d0c3b3 | ||
|
|
5c338cd0a7 | ||
|
|
d8bb3af06b | ||
|
|
e139e8777b | ||
|
|
1adf331268 | ||
|
|
349b3e961b | ||
|
|
96650c06f0 | ||
|
|
26038a0a07 | ||
|
|
6a148b5dd9 | ||
|
|
0e109ef979 | ||
|
|
d52d7cfbd9 | ||
|
|
4f74a259e3 | ||
|
|
de2285d5e9 | ||
|
|
b2483ba437 | ||
|
|
a82a5e5a49 | ||
|
|
74da6e1dc0 | ||
|
|
84ffdf0ed5 | ||
|
|
022b18c8ce | ||
|
|
b92b1dcddb | ||
|
|
d161a02e71 | ||
|
|
d2b6a700b1 | ||
|
|
af203cef24 | ||
|
|
673e917e76 | ||
|
|
a3bd41db54 | ||
|
|
1472dbb291 | ||
|
|
d58a8dc868 | ||
|
|
0d9527921a | ||
|
|
e94be0b70e | ||
|
|
f0e4aec0af | ||
|
|
b0d65b5edd | ||
|
|
75532ef591 | ||
|
|
9a6d1bd700 | ||
|
|
a7ed6c15d3 | ||
|
|
5ee49ba065 | ||
|
|
f6ae7e1bf1 | ||
|
|
190d857949 | ||
|
|
f7b4935677 | ||
|
|
a3c49de6a5 | ||
|
|
d34bd47bea | ||
|
|
f17792380b | ||
|
|
c11920110e | ||
|
|
ec5a993fea | ||
|
|
d250c2cc89 | ||
|
|
767e73f40c | ||
|
|
3f699c9d2f | ||
|
|
50dbd9befd | ||
|
|
760e01bf92 | ||
|
|
543f435b1e | ||
|
|
e8dd1b292f | ||
|
|
91337218b3 | ||
|
|
afff3c0a49 | ||
|
|
d21264d01b | ||
|
|
b0567eadfd | ||
|
|
5fc2058336 | ||
|
|
d0567d29d2 | ||
|
|
2b6c271d37 | ||
|
|
b0c1a6f73a | ||
|
|
4db0ad32f0 | ||
|
|
a1871e4bc3 | ||
|
|
d065040321 | ||
|
|
3aa0294cd4 | ||
|
|
17f0fea3fc | ||
|
|
8ca1e43533 | ||
|
|
310b266251 | ||
|
|
21b1b5098e | ||
|
|
a3a4a5d8a5 | ||
|
|
270536f33c | ||
|
|
66bb433cc6 | ||
|
|
bd4ef1a03a | ||
|
|
aa2d9a3bf1 | ||
|
|
bd01c314dc | ||
|
|
257308d5db | ||
|
|
d4620e1654 | ||
|
|
fd6cbb138c | ||
|
|
aa75c8e5e4 | ||
|
|
e404476609 | ||
|
|
942c870981 | ||
|
|
c461fc6daa | ||
|
|
baff9256c5 | ||
|
|
b4c0a255fc | ||
|
|
9f6a27c20d | ||
|
|
742dc137ed | ||
|
|
39a6bd33ce | ||
|
|
4672a5fad6 | ||
|
|
e649b0a2df | ||
|
|
96eaa833f5 | ||
|
|
fd8dbe3eff | ||
|
|
bb97cc594d | ||
|
|
70a322263e | ||
|
|
c6f144d482 | ||
|
|
3709489b3a | ||
|
|
863b13a694 | ||
|
|
e6fea4e6dd | ||
|
|
83bfc13056 | ||
|
|
bc4f09209b | ||
|
|
145ef32e28 | ||
|
|
2212800a23 | ||
|
|
2e25431bb6 | ||
|
|
967ca17238 | ||
|
|
595c72147c | ||
|
|
f3c3b5a649 | ||
|
|
1cd2c5e653 | ||
|
|
b2873dd44b | ||
|
|
bb80ab4026 | ||
|
|
32c8e7522f | ||
|
|
a5e4f3cc6b | ||
|
|
80cabb338b | ||
|
|
2c69e2c151 | ||
|
|
a30777bd9f | ||
|
|
e989195a68 | ||
|
|
c1dd23f5e0 | ||
|
|
f93624a41c | ||
|
|
9f4559a059 | ||
|
|
fd05cad303 | ||
|
|
d58b06e493 | ||
|
|
d7a6127273 | ||
|
|
997d58932e | ||
|
|
b4015f877f | ||
|
|
8ee9984e4e | ||
|
|
d15fff95b9 | ||
|
|
2f0b549027 | ||
|
|
87dbd7e541 | ||
|
|
96e5da36be | ||
|
|
43745edac0 | ||
|
|
687e3b13ea | ||
|
|
8c6bb383b7 | ||
|
|
18bee21cfc | ||
|
|
e5b6121d17 | ||
|
|
f5ceee547c | ||
|
|
b612bce779 | ||
|
|
2e88e5e9c7 | ||
|
|
9a7aa25c90 | ||
|
|
c4420fe932 | ||
|
|
a5260f3a95 | ||
|
|
bc592c1d13 | ||
|
|
968bd8be67 | ||
|
|
47ccf4b1f5 | ||
|
|
a356b21895 | ||
|
|
614a36c888 | ||
|
|
d8b8adb88c | ||
|
|
f42d820891 | ||
|
|
bc21a1fb71 | ||
|
|
b7e717ee8c | ||
|
|
f520fe36bd | ||
|
|
7273a1c34d | ||
|
|
dc45cbce37 | ||
|
|
708d8f75c0 | ||
|
|
bd37d90228 | ||
|
|
b1ad691464 | ||
|
|
f4e7baf31e | ||
|
|
c0e60c41f2 | ||
|
|
c8dad43e00 | ||
|
|
3bc31374ac | ||
|
|
858e7bae2b | ||
|
|
a8f124704d | ||
|
|
eed2816491 | ||
|
|
a6334b3e35 | ||
|
|
334beebfeb | ||
|
|
13dad848bd | ||
|
|
e518f4cef8 | ||
|
|
c8fd5da2da | ||
|
|
3a74729ecc | ||
|
|
49c672ac4d | ||
|
|
b570cb5b77 | ||
|
|
97bf388471 | ||
|
|
1a32aaea6f | ||
|
|
4635883dec | ||
|
|
8c02d120a2 | ||
|
|
3ba6db4a50 | ||
|
|
2f1de25747 | ||
|
|
f60fd42ac0 | ||
|
|
ecc8f9c792 | ||
|
|
e295dfdcf7 | ||
|
|
fc42c25390 | ||
|
|
27d5858e06 | ||
|
|
07e353f4ff | ||
|
|
bb33d9e600 | ||
|
|
68eb0bdec9 | ||
|
|
32ee8e462c | ||
|
|
e1ef732b60 | ||
|
|
9840b95c21 | ||
|
|
a6f8446d81 | ||
|
|
c1c844c830 | ||
|
|
389299afd1 | ||
|
|
826543a291 | ||
|
|
4ac83cfded | ||
|
|
e79aa54b70 | ||
|
|
9a95652034 | ||
|
|
912c188b53 | ||
|
|
e9d0f615ba | ||
|
|
9136573596 | ||
|
|
2487ec94e6 | ||
|
|
811489f157 | ||
|
|
b438cc9335 | ||
|
|
1d3d30fa45 | ||
|
|
72b5985398 | ||
|
|
64c363ce53 | ||
|
|
cca4347bf9 | ||
|
|
3ae3d4926a | ||
|
|
36025d6d9f | ||
|
|
e171362e3e | ||
|
|
3e0bf2ae15 | ||
|
|
07aa9f4b8b | ||
|
|
b2d9f3fc64 | ||
|
|
5fb3e9167e | ||
|
|
2db60e0a6b | ||
|
|
e710848345 | ||
|
|
99c74b31be | ||
|
|
ce5b13824e | ||
|
|
c39170c42e | ||
|
|
9e96824161 | ||
|
|
fd19fbf300 | ||
|
|
166469827f | ||
|
|
a34ed538b6 | ||
|
|
8d6f3c2450 | ||
|
|
f863d127e7 | ||
|
|
5f22d3e055 | ||
|
|
a831110816 | ||
|
|
fdd700f3e5 | ||
|
|
adf930f126 | ||
|
|
e97bdb53f4 | ||
|
|
05f41928cd | ||
|
|
2ee0829871 | ||
|
|
743560825d | ||
|
|
e3d84ac349 | ||
|
|
266c832b30 | ||
|
|
f5374a024e | ||
|
|
fe1439fbac | ||
|
|
4956d826fb | ||
|
|
f5cc2af5d0 | ||
|
|
2bc30e5c22 | ||
|
|
7244c02a0d | ||
|
|
84ca8e1f3e | ||
|
|
5880d4a6ec | ||
|
|
ae05dce958 | ||
|
|
9ebe372a9a | ||
|
|
6c229ffa68 | ||
|
|
e6e04cc5b3 | ||
|
|
12352510fd | ||
|
|
2b3d927937 | ||
|
|
a8890740f5 | ||
|
|
f60d7ee54b | ||
|
|
896ca2ef6b | ||
|
|
c036f6d529 | ||
|
|
6f457c0c59 | ||
|
|
cdc5d983f3 | ||
|
|
13bf1b27b4 | ||
|
|
f742bb1c47 | ||
|
|
96688e4dac | ||
|
|
28a945fee9 | ||
|
|
c7e777255a | ||
|
|
2dd4cf040e | ||
|
|
aa0b9e2db2 | ||
|
|
c10076f7ed | ||
|
|
bcd92499f2 | ||
|
|
b2bb0d4f72 | ||
|
|
d1b9eca5eb | ||
|
|
594a67fe28 | ||
|
|
cddeaffada | ||
|
|
e140481f14 | ||
|
|
6b7b71b1f8 | ||
|
|
186bd11463 | ||
|
|
a0490d6687 | ||
|
|
beef740ade | ||
|
|
2ac7786a90 | ||
|
|
a3fb5e910f | ||
|
|
319afe86b5 | ||
|
|
762ab66b86 | ||
|
|
0c239a42de | ||
|
|
2a8898e7c3 | ||
|
|
ce3f3b09b4 | ||
|
|
fe4b3df7e9 | ||
|
|
25bdbcf526 | ||
|
|
df7eaa5598 | ||
|
|
bb7099376b | ||
|
|
0327fd9710 | ||
|
|
e645c6e465 | ||
|
|
78a3d36ccc | ||
|
|
3942858ccd | ||
|
|
03c8d716cc | ||
|
|
e9322fba26 | ||
|
|
60181c4fcb | ||
|
|
c215447405 | ||
|
|
39b6df27b3 | ||
|
|
b1ee284e7f | ||
|
|
e986332bf2 | ||
|
|
48f9b27381 | ||
|
|
42a6e0dd10 | ||
|
|
d4798b02ac | ||
|
|
963edfe8ab | ||
|
|
53237f3ae0 | ||
|
|
64da9281a4 | ||
|
|
ab7fd9799d | ||
|
|
f6bcc84251 | ||
|
|
35dc3d9df9 | ||
|
|
566714a75d | ||
|
|
c92f30b122 | ||
|
|
294ad094c4 | ||
|
|
c1a0f520f9 | ||
|
|
89330b89d8 | ||
|
|
a8f3718ed0 | ||
|
|
a78ba44709 | ||
|
|
ff110e3513 | ||
|
|
773c24b7fc | ||
|
|
8f926c7ca9 | ||
|
|
cfae6c63b5 | ||
|
|
dbfe49c56f | ||
|
|
98e21f9f5b | ||
|
|
83af0497e4 | ||
|
|
6ce37b44db | ||
|
|
c562cbc2bb | ||
|
|
9cb1cf756f | ||
|
|
3fbbb0865a | ||
|
|
7d5f612a48 | ||
|
|
4a5a36440b | ||
|
|
43dd5cfea1 | ||
|
|
7b5fec1842 | ||
|
|
ffa005e4ab | ||
|
|
5762ded601 | ||
|
|
af102e47f1 | ||
|
|
73064a816d | ||
|
|
a3abb86daa | ||
|
|
4f5c656b05 | ||
|
|
9b4ae8fcc5 | ||
|
|
a31cddbe7b | ||
|
|
a1a2c52409 | ||
|
|
9a0b26e0b0 | ||
|
|
b805b96e16 | ||
|
|
b4ecd93f1c | ||
|
|
590e7f7724 | ||
|
|
1a702b08b9 | ||
|
|
8c52dfb804 | ||
|
|
0acc23e058 | ||
|
|
cdd5f9b628 | ||
|
|
4c9f5f4655 | ||
|
|
b80ba13cb4 | ||
|
|
4d61e5e319 | ||
|
|
8c8a63ebfb | ||
|
|
e5e34797a8 | ||
|
|
8516ebe6f5 | ||
|
|
9f6205f47f | ||
|
|
8b2ec23a89 | ||
|
|
1816ca6b02 | ||
|
|
7394ff9346 | ||
|
|
bb5a6a1c28 | ||
|
|
b614b06736 | ||
|
|
7a376c9efc | ||
|
|
8260bdc09c | ||
|
|
24f856e02b | ||
|
|
3aa619b928 | ||
|
|
4cb5e98d94 | ||
|
|
272910575e | ||
|
|
a15a62f4bc | ||
|
|
53cf11db8c | ||
|
|
518f3d229f | ||
|
|
46c91f923d | ||
|
|
3a2262dfb3 | ||
|
|
ff7c38f8e9 | ||
|
|
4229ba364f | ||
|
|
ba8e7a211a | ||
|
|
6b41653a32 | ||
|
|
59c1125e72 | ||
|
|
b536046720 | ||
|
|
619b805894 | ||
|
|
8662537883 | ||
|
|
717890395b | ||
|
|
b7b4164f4f | ||
|
|
7e65296470 | ||
|
|
cd5f5d702f | ||
|
|
01052fbe47 | ||
|
|
a5e1e075c7 | ||
|
|
6be32ac688 | ||
|
|
44b93e7cc4 | ||
|
|
0eb79e5acd | ||
|
|
b362c0ef38 | ||
|
|
bba9969e31 | ||
|
|
007ba24809 | ||
|
|
df21539311 | ||
|
|
2592cb6019 | ||
|
|
f7df17a7ed | ||
|
|
62f42b72f8 | ||
|
|
a1ba4fda6f | ||
|
|
1c06b04c45 | ||
|
|
eceba26894 | ||
|
|
0bf404f75e | ||
|
|
cd8dd65a65 | ||
|
|
50c56f8b50 | ||
|
|
2ee22fd374 | ||
|
|
4c230d9e61 | ||
|
|
727294fbbe | ||
|
|
478c43969b | ||
|
|
79b5303350 | ||
|
|
ce4b742b25 | ||
|
|
a9dc15bda5 | ||
|
|
ba6387ff5c | ||
|
|
8fa98508b7 | ||
|
|
decdbaecf9 | ||
|
|
6d87cf9be0 | ||
|
|
94f434c4a6 | ||
|
|
7ba867c30b | ||
|
|
3424395e10 | ||
|
|
926c7359a2 | ||
|
|
ec0af99a2e | ||
|
|
b4d948886c | ||
|
|
4d8d79372a | ||
|
|
04a589722c | ||
|
|
d4a10e2873 | ||
|
|
4998ad6c7e | ||
|
|
a07ca5ff50 | ||
|
|
f07e7571ab | ||
|
|
834c16485c | ||
|
|
04a4265ef3 | ||
|
|
0ec473195d | ||
|
|
9e9f8ca8f3 | ||
|
|
0bf09256b0 | ||
|
|
f63af0601c | ||
|
|
db8fd2c913 | ||
|
|
189c671ce2 | ||
|
|
dbe6e5b3d7 | ||
|
|
cc81cd446b | ||
|
|
439c7118f1 | ||
|
|
d8154a5815 | ||
|
|
4e3787bc0d | ||
|
|
02e0955924 | ||
|
|
bb39a01361 | ||
|
|
3c6a170138 | ||
|
|
a78950e822 | ||
|
|
764999704a | ||
|
|
1ce1a94a35 | ||
|
|
977b6d9f67 | ||
|
|
b5e6dbd797 | ||
|
|
833e6688f1 | ||
|
|
bc22c9f84f | ||
|
|
2149a7d116 | ||
|
|
29175d2c17 | ||
|
|
803454d5c8 | ||
|
|
36cf32dc42 | ||
|
|
ecfa4aafc1 | ||
|
|
a1e33c4d2f | ||
|
|
7f8ba74dac | ||
|
|
657f4ab303 | ||
|
|
e3df62d812 | ||
|
|
1913125881 | ||
|
|
e8e58f3fed | ||
|
|
1ca9ec384b | ||
|
|
9522255e3a | ||
|
|
2a22fa694e | ||
|
|
1591f5a0ca | ||
|
|
c0c38022ea | ||
|
|
3bc4e9a724 | ||
|
|
f7a6bb0723 | ||
|
|
e9c17a3ef7 | ||
|
|
29bb5840b5 | ||
|
|
c9d8d860f6 | ||
|
|
cc18096882 | ||
|
|
15f2a664d1 | ||
|
|
93b66d26ff | ||
|
|
70b4f62ddc | ||
|
|
e1023fdfaf | ||
|
|
5e9648387a | ||
|
|
2ba8b4df67 | ||
|
|
3a084c5d7b | ||
|
|
f7200e39c3 | ||
|
|
ea6552615d | ||
|
|
4bf3287fce | ||
|
|
832c2034c2 | ||
|
|
b0aa26e1f1 | ||
|
|
e52baeb967 | ||
|
|
8268eb9a83 | ||
|
|
a7dfc20967 | ||
|
|
6eb7c0b5d6 | ||
|
|
0b3c078aeb | ||
|
|
3cc458abd9 | ||
|
|
750872cc37 | ||
|
|
337b4c4268 | ||
|
|
001f8657f6 | ||
|
|
ea884e7fa1 | ||
|
|
29895ff474 | ||
|
|
9be2844c82 | ||
|
|
44adccc147 | ||
|
|
2a7e2c70b5 | ||
|
|
8d431b6762 | ||
|
|
273849c0c8 | ||
|
|
5cc14405c7 | ||
|
|
1b1394cf5d | ||
|
|
1eef930dbb | ||
|
|
f0cfd60e62 | ||
|
|
875c687e3f | ||
|
|
1e175e74ed | ||
|
|
d6547f0701 | ||
|
|
75a46c365e | ||
|
|
8e7b8825f5 | ||
|
|
2ecbca303b | ||
|
|
3b68905037 | ||
|
|
eae611c54d | ||
|
|
b37bad35c2 | ||
|
|
8195a4d616 | ||
|
|
7ba40f925f | ||
|
|
345cd1795f | ||
|
|
5fab15fee5 | ||
|
|
10c8ea17aa | ||
|
|
7058c8ff5a | ||
|
|
64e85da59f | ||
|
|
f79fad64aa | ||
|
|
cb70eebb08 | ||
|
|
959aaee045 | ||
|
|
edaf8787d1 | ||
|
|
53477f0f59 | ||
|
|
5716218f41 | ||
|
|
9df6b9d5c0 | ||
|
|
24164c8580 | ||
|
|
9fca7011aa | ||
|
|
a0be47ab8b | ||
|
|
ec46031d36 | ||
|
|
55b84d166a | ||
|
|
34ae8bacec | ||
|
|
cb4e5ca0f7 | ||
|
|
0ba45468c4 | ||
|
|
710502784e | ||
|
|
b13eb3fd40 | ||
|
|
b7986a351c | ||
|
|
ce87591c62 | ||
|
|
0275a8558d | ||
|
|
58acc75cf6 | ||
|
|
874ababb9f | ||
|
|
3771e6b0cd | ||
|
|
33eaefa966 | ||
|
|
cd7e236d57 | ||
|
|
54c0b7c7d5 | ||
|
|
a2177daec2 | ||
|
|
628386b453 | ||
|
|
b222bfb3e0 | ||
|
|
ab199d883d | ||
|
|
356065d1ee | ||
|
|
76e7c5623d | ||
|
|
085fba050a | ||
|
|
295334d3ac | ||
|
|
36124ddca4 | ||
|
|
bd6585765e | ||
|
|
c325deb4ed | ||
|
|
73bb0b10ee | ||
|
|
72820b162c | ||
|
|
89e5b8d057 | ||
|
|
da4f53ebbb | ||
|
|
8458553b74 | ||
|
|
55ecc41d06 | ||
|
|
28fcdf2cbb | ||
|
|
24087679a8 | ||
|
|
5ac6a8cb4a | ||
|
|
668d85d14e | ||
|
|
c11a3dc95c | ||
|
|
56f57c20a2 | ||
|
|
240d14779a | ||
|
|
25c289ad3e | ||
|
|
8c5f11b7dd | ||
|
|
7f7dda9ec2 | ||
|
|
9c1005ff0c | ||
|
|
5b36b4472c | ||
|
|
3550d1e61c | ||
|
|
6513ad249c | ||
|
|
50297b1880 | ||
|
|
f189b78b9e | ||
|
|
5c0250f495 | ||
|
|
2093f726e9 | ||
|
|
10efe3859d | ||
|
|
6933bcf7bb | ||
|
|
2ea046cd80 | ||
|
|
a3fcc64aaa | ||
|
|
f4097a372b | ||
|
|
f3078bc903 | ||
|
|
6072744f7e | ||
|
|
40b6de599c | ||
|
|
87ea2a2bef | ||
|
|
cc14a1c361 | ||
|
|
bcdface60d | ||
|
|
4dc9419d2e | ||
|
|
d2bcac813e | ||
|
|
080c37a7f6 | ||
|
|
a87ad35a50 | ||
|
|
cf56d7e4ed | ||
|
|
e33a5eb307 | ||
|
|
c1c6f55f8f | ||
|
|
e5b704eb32 | ||
|
|
f9a3838db6 | ||
|
|
1e61db104b | ||
|
|
30a9c7718d | ||
|
|
34b052b5d3 | ||
|
|
aaa12853ad | ||
|
|
b0ab55b0bf | ||
|
|
d2f8496f4e | ||
|
|
56457bd325 | ||
|
|
bdbb3c6657 | ||
|
|
4c7e081e15 | ||
|
|
c4d7001489 | ||
|
|
c07bac9a63 | ||
|
|
d27d04783f | ||
|
|
58de5a7ec7 | ||
|
|
1a69b16d36 | ||
|
|
b5e8673e62 | ||
|
|
264c6a50b6 | ||
|
|
493642eb38 | ||
|
|
504a9b4746 | ||
|
|
cccb5a3e08 | ||
|
|
d75fa62cab | ||
|
|
3d43c3c5bc | ||
|
|
28d42b9164 | ||
|
|
42f29062ca | ||
|
|
b570b363d9 | ||
|
|
09392be069 | ||
|
|
5529dab84e | ||
|
|
b9968aa1e6 | ||
|
|
60ca704a9e | ||
|
|
c0d77808f6 | ||
|
|
9679492c28 | ||
|
|
f3b68e6543 | ||
|
|
0dcfaaf5ff | ||
|
|
ba513dcb9a | ||
|
|
ebabc60477 | ||
|
|
cf565d0145 | ||
|
|
52a23e7904 | ||
|
|
9e22b80714 | ||
|
|
7eed9c4a6d | ||
|
|
bf42fce17e | ||
|
|
9d421226a7 | ||
|
|
c4377ed6c2 | ||
|
|
7c4d5cee95 | ||
|
|
7d283ed65f | ||
|
|
bf1f941e50 | ||
|
|
789fef34ba | ||
|
|
1daf5a611c | ||
|
|
6aed1db67e | ||
|
|
7b9be8369e | ||
|
|
7cf4b819ae | ||
|
|
9e1aea33c3 | ||
|
|
8767a88854 | ||
|
|
47c0084641 | ||
|
|
54e6a790cf | ||
|
|
2a86bc8695 | ||
|
|
04538372c6 | ||
|
|
cf68854770 | ||
|
|
711392c73b | ||
|
|
9573c32481 | ||
|
|
a15f80f79d | ||
|
|
23e7475f06 | ||
|
|
1eb571b787 | ||
|
|
dd3b716d85 | ||
|
|
28649c07e3 | ||
|
|
961e02be0d | ||
|
|
9430ed66cd | ||
|
|
96f8efc27a | ||
|
|
a161491bfd | ||
|
|
a90e8b6112 | ||
|
|
561c1fb798 | ||
|
|
e0b4d1c1e4 | ||
|
|
fd4aaab137 | ||
|
|
42d14d5ca2 | ||
|
|
806fec7017 | ||
|
|
b3da28eade | ||
|
|
166f6412c2 | ||
|
|
1e877808bc | ||
|
|
1777d9f751 | ||
|
|
309b99eac0 | ||
|
|
a5aa1b3917 | ||
|
|
aced0632ec | ||
|
|
4e801788d7 | ||
|
|
0b4baad78b | ||
|
|
d3ff482c9b | ||
|
|
c9286624d4 | ||
|
|
f682368eeb | ||
|
|
4a5d033efb | ||
|
|
343161b195 | ||
|
|
201e32d4c4 | ||
|
|
0980cb6eb5 | ||
|
|
f75d23363b | ||
|
|
bc576a9659 | ||
|
|
19e407fcc4 | ||
|
|
bc7327d004 | ||
|
|
666fa1c797 | ||
|
|
0eda4a7821 | ||
|
|
6c0ba66f17 | ||
|
|
862058fd2b | ||
|
|
f32ce7392e | ||
|
|
193d160bed | ||
|
|
8bf382adad | ||
|
|
541ba357bb | ||
|
|
69e5bcd57d | ||
|
|
efeddda328 | ||
|
|
b6578b52e3 | ||
|
|
fb01c43ece | ||
|
|
b9a012c6e3 | ||
|
|
17684ed8a8 | ||
|
|
1b6b3b2cd5 | ||
|
|
acd8567586 | ||
|
|
e780c76c93 | ||
|
|
532c6caddf | ||
|
|
ef8d9be633 | ||
|
|
2cdbcc5666 | ||
|
|
c282a8f328 | ||
|
|
b9eab39541 | ||
|
|
20903784a4 | ||
|
|
3ec9ff7467 | ||
|
|
1ddd746862 | ||
|
|
ff6938280e | ||
|
|
1e4425b30f | ||
|
|
b5d1d8cdad | ||
|
|
029be5ccca | ||
|
|
29c2d785b5 | ||
|
|
abda8cfa32 | ||
|
|
44e7d79d4c | ||
|
|
9a1dc8ee0e | ||
|
|
27879c3f01 | ||
|
|
29096eb5d7 | ||
|
|
17d3a87b1f | ||
|
|
a573baea03 | ||
|
|
14c5c60863 | ||
|
|
48ace3de57 | ||
|
|
5af07c4531 | ||
|
|
70a80090c4 | ||
|
|
44e36feb09 | ||
|
|
3395c84560 | ||
|
|
b6cb5d09cb | ||
|
|
2a7d996881 | ||
|
|
94c2fc80d2 | ||
|
|
69cfde4516 | ||
|
|
bdc83da098 | ||
|
|
f872a122a9 | ||
|
|
738f943a68 | ||
|
|
47e62a5681 | ||
|
|
1ecbfd7590 | ||
|
|
67c139a04b | ||
|
|
31cc008249 | ||
|
|
9cb026439d | ||
|
|
e6f10176c6 | ||
|
|
0917c79470 | ||
|
|
597baa986d | ||
|
|
75cc4b4843 | ||
|
|
aac088d496 | ||
|
|
a822e5bbc5 | ||
|
|
c527249c21 | ||
|
|
9ef798f534 | ||
|
|
e69b99f089 | ||
|
|
55b8079e86 | ||
|
|
aa92e4cbd0 | ||
|
|
e272dbe9af | ||
|
|
962f8354ac | ||
|
|
20e4a960f7 | ||
|
|
e603877a17 | ||
|
|
bb96477779 | ||
|
|
543ee79720 | ||
|
|
371db886b4 | ||
|
|
ea8cd98361 | ||
|
|
3904ca38c0 | ||
|
|
58849f28a8 | ||
|
|
16527ceaf6 | ||
|
|
d66c284bed | ||
|
|
693848280b | ||
|
|
396afaa181 | ||
|
|
05ed29133b | ||
|
|
a31c1e8084 | ||
|
|
21891230f2 | ||
|
|
47da76c5a5 | ||
|
|
6017ff2318 | ||
|
|
e16d604d0d | ||
|
|
feec3e8255 | ||
|
|
82249cb50a | ||
|
|
d3d5703f3f | ||
|
|
fad417e553 | ||
|
|
5ba692f50c | ||
|
|
62fe92d922 | ||
|
|
512e7be74f | ||
|
|
f799db67eb | ||
|
|
3e106a9dc5 | ||
|
|
727abbea8f | ||
|
|
76f81ece62 | ||
|
|
907e01e524 | ||
|
|
b8ed23efa7 | ||
|
|
2b3bbf7e67 | ||
|
|
464fe627a3 | ||
|
|
6a9e39c470 | ||
|
|
7fec9a3cc6 | ||
|
|
008f6ef462 | ||
|
|
2440c108ca | ||
|
|
430baad8a4 | ||
|
|
51132e74b4 | ||
|
|
a4f33e106a | ||
|
|
baba3190e0 | ||
|
|
47b13aa5ea | ||
|
|
495654f9ff | ||
|
|
a0de3fc643 | ||
|
|
95fec2100e | ||
|
|
623a879797 | ||
|
|
4c96d23f48 | ||
|
|
9bc8f6e9d7 | ||
|
|
e00e6509ee | ||
|
|
be5739508b | ||
|
|
38c867ea94 | ||
|
|
2a985ce6c0 | ||
|
|
e4f3fb36f3 | ||
|
|
b2f8792873 | ||
|
|
2065133e2d | ||
|
|
86da87f254 | ||
|
|
102a7f8723 | ||
|
|
e9afc15719 | ||
|
|
08527dde9b | ||
|
|
d9c3a3c9a9 | ||
|
|
fe89f9e55e | ||
|
|
73802aabac | ||
|
|
bc66733289 | ||
|
|
f4c93b2251 | ||
|
|
c079c598f2 | ||
|
|
8a2f0063d4 | ||
|
|
dfe4b33f2f | ||
|
|
2f7cfa7ab2 | ||
|
|
bdcb813ee6 | ||
|
|
f0751007f3 | ||
|
|
6ad993704c | ||
|
|
796c3009c7 | ||
|
|
144ff5e716 | ||
|
|
054a1e5ea4 | ||
|
|
a223f6056e | ||
|
|
a1fd7704e0 | ||
|
|
b94227efc9 | ||
|
|
3a7e782c07 | ||
|
|
8f6b33d790 | ||
|
|
f476daa041 | ||
|
|
acfde9458d | ||
|
|
82e969627a | ||
|
|
9de3c582c0 | ||
|
|
45cff2b51b | ||
|
|
670397a73e | ||
|
|
272eb37e9a | ||
|
|
ca79e58ab9 | ||
|
|
977c049875 | ||
|
|
aefbc1c9bf | ||
|
|
c37a2e61ed | ||
|
|
7f6cd5e469 | ||
|
|
f6d1f1985c | ||
|
|
222c31b306 | ||
|
|
e99185f011 | ||
|
|
5c662f1230 | ||
|
|
a65c7ee2fc | ||
|
|
743c4f554d | ||
|
|
838b2757eb | ||
|
|
a92c9fc226 | ||
|
|
ed052e0b0b | ||
|
|
ae88d3054d | ||
|
|
7bb8b9039c | ||
|
|
3800b4b45c | ||
|
|
cd498711bc | ||
|
|
40766b3375 | ||
|
|
411b600e14 | ||
|
|
0a0ad9a184 | ||
|
|
234bead59e | ||
|
|
d274e45587 | ||
|
|
76de310986 | ||
|
|
0a0eb3f710 | ||
|
|
81d054a525 | ||
|
|
817f050bcd | ||
|
|
60ae685d1e | ||
|
|
dc9670c439 | ||
|
|
2e185f4ec9 | ||
|
|
67f347f880 | ||
|
|
03c8079858 | ||
|
|
0cfc527328 | ||
|
|
81542fc6a8 | ||
|
|
5aced279d6 | ||
|
|
3f016f785f | ||
|
|
a6427d081e | ||
|
|
8c7fbe20f9 | ||
|
|
f66a820e14 | ||
|
|
469aba8ed0 | ||
|
|
4c7bdbb284 | ||
|
|
6e8e4ad5da | ||
|
|
2f33d654e4 | ||
|
|
760b6385f1 | ||
|
|
91527500f9 | ||
|
|
e87d989ca3 | ||
|
|
64d61bae08 | ||
|
|
9862265465 | ||
|
|
624b7616d0 | ||
|
|
d53f33bed8 | ||
|
|
435251ca41 | ||
|
|
02e039d792 | ||
|
|
324a0dd38f | ||
|
|
cc77d93918 | ||
|
|
0ea7d8bd8c | ||
|
|
9f9333315e | ||
|
|
0d10b812fe | ||
|
|
2e6bea23ac | ||
|
|
b4fe4f3d10 | ||
|
|
ba93fcbda0 | ||
|
|
88d19a4ca4 | ||
|
|
ca75dd0728 | ||
|
|
849b217143 | ||
|
|
9af6efba59 | ||
|
|
079d6f06ef | ||
|
|
9cf0757689 | ||
|
|
b54c438948 | ||
|
|
c3ff4bfdad | ||
|
|
af7b9ea898 | ||
|
|
e103676b65 | ||
|
|
09cd0468cf | ||
|
|
529aa754f5 | ||
|
|
17e395c2a8 | ||
|
|
d50c1f39ab | ||
|
|
ef6b25b3bb | ||
|
|
3c7e865555 | ||
|
|
7877ac0c3b | ||
|
|
1442e29d0e | ||
|
|
9a7e9b736e | ||
|
|
c421e45fa0 | ||
|
|
8833d21ac3 | ||
|
|
1a3c522c94 | ||
|
|
c55aa92d4f | ||
|
|
212a303347 | ||
|
|
3f3568d8af | ||
|
|
1e3bcfc8cd | ||
|
|
a4ce9f6f05 | ||
|
|
65dc99744e | ||
|
|
c6d4740b0c | ||
|
|
9f91c8b59d | ||
|
|
2b3b087c29 | ||
|
|
e08d46aa76 | ||
|
|
9f35fa0fa3 | ||
|
|
ff48996bbe | ||
|
|
feccc97a14 | ||
|
|
77eec3d21d | ||
|
|
ecaafd1b70 | ||
|
|
0d51997e46 | ||
|
|
463cbceb07 | ||
|
|
2fe4d97061 | ||
|
|
eb38393cad | ||
|
|
1437c5c63f | ||
|
|
52f1d50902 | ||
|
|
a839cb787e | ||
|
|
f621fb2060 | ||
|
|
2ccd8b8838 | ||
|
|
7ef0746c52 | ||
|
|
6f609f0dd7 | ||
|
|
ee2a30470a | ||
|
|
5d62e066e2 | ||
|
|
e94219c5a3 | ||
|
|
8ed9634adf | ||
|
|
0aefa9599f | ||
|
|
e279cf0575 | ||
|
|
a3f0ef8e77 | ||
|
|
8eba05ed4a | ||
|
|
e11fb2c09e | ||
|
|
2f78155723 | ||
|
|
6785221479 | ||
|
|
9bc410dd3d | ||
|
|
2491ab6bf9 | ||
|
|
f615ed40cd | ||
|
|
430f2cafc1 | ||
|
|
0ad049da88 | ||
|
|
2c7691567b | ||
|
|
1d70d0fe94 | ||
|
|
ac44f05811 | ||
|
|
d99252f394 | ||
|
|
b58c7ba7c5 | ||
|
|
8c5acd1a0a | ||
|
|
b9b1ebf18c | ||
|
|
8ca132cef0 | ||
|
|
a03bb90754 | ||
|
|
d1c939f48a | ||
|
|
21b11f1b48 | ||
|
|
23c84a7803 | ||
|
|
f9ab060403 | ||
|
|
df7a5bf149 | ||
|
|
c6e9270590 | ||
|
|
3e2e171407 | ||
|
|
e205969b11 | ||
|
|
332f531a10 | ||
|
|
6bf19ecc34 | ||
|
|
bae2c9bc63 | ||
|
|
5ac68f8df8 | ||
|
|
c4afa069df | ||
|
|
1bfafdb44f | ||
|
|
1ef5bd7076 | ||
|
|
29176fa4f4 | ||
|
|
958c95732b | ||
|
|
44b0d4127c | ||
|
|
1418ec2416 | ||
|
|
b51978f51c | ||
|
|
b07361580a | ||
|
|
6ff45a754d | ||
|
|
06d3b94804 | ||
|
|
d1b5ebad7d | ||
|
|
32d2df0f08 | ||
|
|
f4ce813de9 | ||
|
|
b44ac994d8 | ||
|
|
333948814c | ||
|
|
1a51ad6e01 | ||
|
|
22a5c11f0d | ||
|
|
51b22d1ad4 | ||
|
|
bef5969580 | ||
|
|
c6bf7bb9cd | ||
|
|
2a84d92cbf | ||
|
|
62de36b0da | ||
|
|
03a9aaeff7 | ||
|
|
45765e292d | ||
|
|
e7c314fefc | ||
|
|
faab79b41a | ||
|
|
6e28a26015 | ||
|
|
9150bf720d | ||
|
|
14204c9bfc | ||
|
|
45dbd4464b | ||
|
|
472255924a | ||
|
|
6d3ac2aa55 | ||
|
|
9ad03994d1 | ||
|
|
845864679c | ||
|
|
b3b2149ebb | ||
|
|
0886dca385 | ||
|
|
53198ba4a7 | ||
|
|
a9652ee1fd | ||
|
|
75caf2f01c | ||
|
|
65bab2666e | ||
|
|
6d93ae399a | ||
|
|
7239c2e31a | ||
|
|
35228f80b8 | ||
|
|
69ded881c6 | ||
|
|
d9bce45db4 | ||
|
|
5e92b4faa9 | ||
|
|
db501822ef | ||
|
|
f269695d4a | ||
|
|
443af5f760 | ||
|
|
0e35350160 | ||
|
|
10bf497cda | ||
|
|
76eb629fc2 | ||
|
|
91de738563 | ||
|
|
43b7ef8110 | ||
|
|
99ef0b8cb4 | ||
|
|
ef9948a967 | ||
|
|
0cf13f6393 | ||
|
|
4a8acfd123 | ||
|
|
abaffc1908 | ||
|
|
ea61d5c1a5 | ||
|
|
298f09402f | ||
|
|
d4149d4b7a | ||
|
|
9a14931175 | ||
|
|
165eee102a | ||
|
|
6900c197cd | ||
|
|
fe3c66a7c8 | ||
|
|
0efb4da0ee | ||
|
|
1d728475e3 | ||
|
|
827057b9f1 | ||
|
|
ed7920d61e | ||
|
|
c0379c8e25 | ||
|
|
00a0e64fdd | ||
|
|
0dc60debea | ||
|
|
c44ae5888c | ||
|
|
b9495cd1bb | ||
|
|
bfec381933 | ||
|
|
2dddb8df69 | ||
|
|
d30397e9c0 | ||
|
|
d9597549fd | ||
|
|
13512b4146 | ||
|
|
49e546919a | ||
|
|
586015c2ed | ||
|
|
4a7e067d1a | ||
|
|
9bc0b7f183 | ||
|
|
cd4dfc9861 | ||
|
|
1716452203 | ||
|
|
09bdbc1224 | ||
|
|
978b3a64c5 | ||
|
|
651547ef20 | ||
|
|
b4d95977d0 | ||
|
|
5d8bb897db | ||
|
|
84c8ecb372 | ||
|
|
61abe5b948 | ||
|
|
a5b573eaaa | ||
|
|
cbb32f82eb | ||
|
|
ca9334b2df | ||
|
|
959ed7f866 | ||
|
|
a5c0411be0 | ||
|
|
32e1303742 | ||
|
|
7263b6fe89 | ||
|
|
46a4070f84 | ||
|
|
c3c155a1ed | ||
|
|
b067105660 | ||
|
|
15ca18848e | ||
|
|
67c9e2ead6 | ||
|
|
3681177be4 | ||
|
|
6eb814ef0b | ||
|
|
bcc695234c | ||
|
|
ad16a6fc1b | ||
|
|
478b7eeb65 | ||
|
|
151a153dc9 | ||
|
|
ad131854ca | ||
|
|
0bd0eb9e59 | ||
|
|
54827cacb9 | ||
|
|
e3a4a16507 | ||
|
|
cf16fd0104 | ||
|
|
21b00ac6ca | ||
|
|
57e6f3080c | ||
|
|
89744100ce | ||
|
|
a718f9bbfd | ||
|
|
e81bc4f044 | ||
|
|
4dbacd79ae | ||
|
|
ae74d54451 | ||
|
|
dc316c5669 | ||
|
|
e9f04256c9 | ||
|
|
3315228a90 | ||
|
|
f72205c401 | ||
|
|
11862bbaee | ||
|
|
ef1d1303f4 | ||
|
|
8d846993ee | ||
|
|
1f84626278 | ||
|
|
b4cfe6e9c0 | ||
|
|
94a861e318 | ||
|
|
1421e775d2 | ||
|
|
f8eab72c7a | ||
|
|
2afd2f0d3b | ||
|
|
2b72f40cec | ||
|
|
ff5c0d6361 | ||
|
|
edd4b477f8 | ||
|
|
198b14e5fc | ||
|
|
f9fea265cf | ||
|
|
668601ca23 | ||
|
|
04fcb33d7e | ||
|
|
99406f2099 | ||
|
|
632b3cb9ae | ||
|
|
f31d2486c9 | ||
|
|
7dea682713 | ||
|
|
7955ddceb2 | ||
|
|
0bf04c04f9 | ||
|
|
dc29018ec0 | ||
|
|
b6412afe96 | ||
|
|
4e88186903 | ||
|
|
f387378b69 | ||
|
|
f894e6b4ea | ||
|
|
e33f5996f3 | ||
|
|
8f7f1ff7dd | ||
|
|
54a0e52e05 | ||
|
|
b2431b982f | ||
|
|
8d6d619eed | ||
|
|
70e332b9e8 | ||
|
|
0a53c42a8a | ||
|
|
42a66ad49e | ||
|
|
2d1d70b3b6 | ||
|
|
0ccc92dc1e | ||
|
|
c9157cc13b | ||
|
|
2b1270381d | ||
|
|
cdb8ee3946 | ||
|
|
1e3586621b | ||
|
|
c07e9ac29d | ||
|
|
6e3bb48574 | ||
|
|
a180395832 | ||
|
|
3dfcc6b0be | ||
|
|
16d7ae62bd | ||
|
|
eea3cb32a5 | ||
|
|
670fe8590c | ||
|
|
30c048723c | ||
|
|
85dc669ddf | ||
|
|
397c1a1c2b | ||
|
|
f1d3e35aac | ||
|
|
0e69201f05 | ||
|
|
f8fdaf5c1f | ||
|
|
1f3b81338c | ||
|
|
5921d3a42a | ||
|
|
dbbc85719e | ||
|
|
0ddb6c3f10 | ||
|
|
f760a9d0c2 | ||
|
|
e13281726c | ||
|
|
0ddf4355a1 | ||
|
|
7c8a3ca1a8 | ||
|
|
3068738a70 | ||
|
|
cfa0d8b7c0 | ||
|
|
7ac41652f7 | ||
|
|
24a510bc2e | ||
|
|
0498540439 | ||
|
|
da94c2e1e5 | ||
|
|
bcdd74514f | ||
|
|
1d0c36a0ab | ||
|
|
be1dcb7264 | ||
|
|
a34ea8f131 | ||
|
|
7fbfa6a52b | ||
|
|
799ef3380d | ||
|
|
d5087858ca | ||
|
|
d9fc5650b8 | ||
|
|
9ea028f5ab | ||
|
|
aa309087fd | ||
|
|
57bdd9d3bf | ||
|
|
dc9871fe5b | ||
|
|
3255ca3ea4 | ||
|
|
a06ef6fe25 | ||
|
|
696d256fa0 | ||
|
|
70e8ad7104 | ||
|
|
f785dcac3d | ||
|
|
aa54ef10ae | ||
|
|
14946da163 | ||
|
|
5f9bcfbefe | ||
|
|
aa2eed2c38 | ||
|
|
6bff6e9cff | ||
|
|
023d369b74 | ||
|
|
c9d4241afe | ||
|
|
e1279c29c2 | ||
|
|
2d6fb1c45e | ||
|
|
cd9643fb15 | ||
|
|
f64f95d8ff | ||
|
|
88c25a9390 | ||
|
|
e4ace49536 | ||
|
|
3a0df56605 | ||
|
|
98cdee7f03 | ||
|
|
f140f5f14b | ||
|
|
88a97319cc | ||
|
|
c69db035ee | ||
|
|
60a7eaf2bb | ||
|
|
3f43567c8f | ||
|
|
0f12a9de3b | ||
|
|
937b9009e0 | ||
|
|
66b6098d32 | ||
|
|
348bc1d0fc | ||
|
|
b56a757f2e | ||
|
|
f7c0499158 | ||
|
|
9ebcefee00 | ||
|
|
957e319649 | ||
|
|
a8978a0d4d | ||
|
|
10712c5ec0 | ||
|
|
83c39f57f0 | ||
|
|
173757cfa2 | ||
|
|
c6be73dba2 | ||
|
|
ccf293906a | ||
|
|
0f4c0b95e2 | ||
|
|
82973e7608 | ||
|
|
c011bccc45 | ||
|
|
8473caf5a6 | ||
|
|
85b038525b | ||
|
|
51a5c3c664 | ||
|
|
d6cda9df0a | ||
|
|
ca7d09d1cb | ||
|
|
4ab478c49c | ||
|
|
1a1c1fd0da | ||
|
|
370951ab67 | ||
|
|
a0632a572a | ||
|
|
10601e7760 | ||
|
|
088ce9c2ad | ||
|
|
e1a69b97db | ||
|
|
a2fd45bb95 | ||
|
|
01ddd8eaa8 | ||
|
|
22fa57b82c | ||
|
|
92a51ca546 | ||
|
|
6a9234e634 | ||
|
|
e8d062a95a | ||
|
|
3394d64f6c | ||
|
|
0fd5a277ed | ||
|
|
8eef2818fa | ||
|
|
a15703d5af | ||
|
|
34d8165edd | ||
|
|
1759add2b6 | ||
|
|
dd80f1b997 | ||
|
|
90ff602ecd | ||
|
|
0099ff1321 |
19
.gitattributes
vendored
Normal file
19
.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||||
|
* text eol=lf
|
||||||
|
|
||||||
|
# Explicitly declare text files you want to always be normalized and converted
|
||||||
|
# to native line endings on checkout.
|
||||||
|
# *.c text
|
||||||
|
# *.h text
|
||||||
|
|
||||||
|
# Declare files that will always have CRLF line endings on checkout.
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
|
||||||
|
# Denote all files that are truly binary and should not be modified.
|
||||||
|
chromeos/** binary
|
||||||
|
*.jar binary
|
||||||
|
*.exe binary
|
||||||
|
*.apk binary
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,8 +1,17 @@
|
|||||||
|
out
|
||||||
|
*.zip
|
||||||
|
*.jks
|
||||||
|
*.apk
|
||||||
|
config.prop
|
||||||
|
update.sh
|
||||||
|
|
||||||
|
# Built binaries
|
||||||
|
native/out
|
||||||
|
|
||||||
|
# Android Studio / Gradle
|
||||||
*.iml
|
*.iml
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
/local.properties
|
||||||
.idea/
|
/.idea
|
||||||
/build
|
/build
|
||||||
app/app-release.apk
|
/captures
|
||||||
*.hprof
|
|
||||||
app/.externalNativeBuild/
|
|
||||||
|
|||||||
21
.gitmodules
vendored
Normal file
21
.gitmodules
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[submodule "selinux"]
|
||||||
|
path = native/jni/external/selinux
|
||||||
|
url = https://github.com/topjohnwu/selinux.git
|
||||||
|
[submodule "busybox"]
|
||||||
|
path = native/jni/external/busybox
|
||||||
|
url = https://github.com/topjohnwu/ndk-busybox.git
|
||||||
|
[submodule "dtc"]
|
||||||
|
path = native/jni/external/dtc
|
||||||
|
url = https://github.com/dgibson/dtc
|
||||||
|
[submodule "lz4"]
|
||||||
|
path = native/jni/external/lz4
|
||||||
|
url = https://github.com/lz4/lz4.git
|
||||||
|
[submodule "bzip2"]
|
||||||
|
path = native/jni/external/bzip2
|
||||||
|
url = https://github.com/nemequ/bzip2.git
|
||||||
|
[submodule "xz"]
|
||||||
|
path = native/jni/external/xz
|
||||||
|
url = https://github.com/xz-mirror/xz.git
|
||||||
|
[submodule "nanopb"]
|
||||||
|
path = native/jni/external/nanopb
|
||||||
|
url = https://github.com/nanopb/nanopb.git
|
||||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
{one line to give the program's name and a brief idea of what it does.}
|
||||||
|
Copyright (C) {year} {name of author}
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
{project} Copyright (C) {year} {fullname}
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
75
README.MD
Normal file
75
README.MD
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# Magisk
|
||||||
|
|
||||||
|
[Downloads](https://github.com/topjohnwu/Magisk/releases) \| [Documentation](https://topjohnwu.github.io/Magisk/) \| [XDA Thread](https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445)
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
Magisk is a suite of open source tools for customizing Android, supporting devices higher than Android 4.2 (API 17). It covers the fundamental parts for Android customization: root, boot scripts, SELinux patches, AVB2.0 / dm-verity / forceencrypt removals etc.
|
||||||
|
|
||||||
|
Furthermore, Magisk provides a **Systemless Interface** to alter the system (or vendor) arbitrarily while the actual partitions stay completely intact. With its systemless nature along with several other hacks, Magisk can hide modifications from nearly any system integrity verifications used in banking apps, corporation monitoring apps, game cheat detections, and most importantly [Google's SafetyNet API](https://developer.android.com/training/safetynet/index.html).
|
||||||
|
|
||||||
|
## Bug Reports
|
||||||
|
|
||||||
|
**Make sure to install the latest [Canary Build](https://forum.xda-developers.com/apps/magisk/dev-magisk-canary-channel-bleeding-edge-t3839337) before reporting any bugs!** **DO NOT** report bugs that is already fixed upstream. Follow the instructions in the [Canary Channel XDA Thread](https://forum.xda-developers.com/apps/magisk/dev-magisk-canary-channel-bleeding-edge-t3839337), and report a bug either by opening an issue on GitHub or directly in the thread.
|
||||||
|
|
||||||
|
## Building Environment Requirements
|
||||||
|
|
||||||
|
- Python 3: run `build.py` script
|
||||||
|
- Java Development Kit (JDK) 8: Compile Magisk Manager and sign zips
|
||||||
|
- Latest Android SDK: set `ANDROID_HOME` environment variable to the path to Android SDK
|
||||||
|
- Android NDK: Install NDK along with SDK (`$ANDROID_HOME/ndk-bundle`), or optionally specify a custom path `ANDROID_NDK_HOME`
|
||||||
|
- (Windows Only) Python package Colorama: Install with `pip install colorama`, used for ANSI color codes
|
||||||
|
|
||||||
|
## Building Notes and Instructions
|
||||||
|
|
||||||
|
- Clone sources with submodules: `git clone --recurse-submodules https://github.com/topjohnwu/Magisk.git`
|
||||||
|
- Building is supported on macOS, Linux, and Windows. Official releases are built and tested with [FrankeNDK](https://github.com/topjohnwu/FrankeNDK); point `ANDROID_NDK_HOME` to FrankeNDK if you want to use it for compiling.
|
||||||
|
- Set configurations in `config.prop`. A sample file `config.prop.sample` is provided as an example.
|
||||||
|
- Run `build.py` with argument `-h` to see the built-in help message. The `-h` option also works for each supported actions, e.g. `./build.py binary -h`
|
||||||
|
- By default, `build.py` build binaries and Magisk Manager in debug mode. If you want to build Magisk Manager in release mode (via the `-r, --release` flag), you need a Java Keystore file `release-key.jks` (only `JKS` format is supported) to sign APKs and zips. For more information, check out [Google's Official Documentation](https://developer.android.com/studio/publish/app-signing.html#signing-manually).
|
||||||
|
|
||||||
|
## Translations
|
||||||
|
|
||||||
|
Default string resources for Magisk Manager are scattered throughout
|
||||||
|
|
||||||
|
- `app/src/main/res/values/strings.xml`
|
||||||
|
- `stub/src/main/res/values/strings.xml`
|
||||||
|
- `shared/src/main/res/values/strings.xml`
|
||||||
|
|
||||||
|
Translate each and place them in the respective locations (`<module>/src/main/res/values-<lang>/strings.xml`).
|
||||||
|
|
||||||
|
## Signature Verification
|
||||||
|
|
||||||
|
Official release zips and APKs are signed with my personal private key. You can verify the key certificate to make sure the binaries you downloaded are not manipulated in anyway.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# Use the keytool command from JDK to print certificates
|
||||||
|
keytool -printcert -jarfile <APK or Magisk zip>
|
||||||
|
|
||||||
|
# The output should contain the following signature
|
||||||
|
Owner: CN=John Wu, L=Taipei, C=TW
|
||||||
|
Issuer: CN=John Wu, L=Taipei, C=TW
|
||||||
|
Serial number: 50514879
|
||||||
|
Valid from: Sun Aug 14 13:23:44 EDT 2016 until: Tue Jul 21 13:23:44 EDT 2116
|
||||||
|
Certificate fingerprints:
|
||||||
|
MD5: CE:DA:68:C1:E1:74:71:0A:EF:58:89:7D:AE:6E:AB:4F
|
||||||
|
SHA1: DC:0F:2B:61:CB:D7:E9:D3:DB:BE:06:0B:2B:87:0D:46:BB:06:02:11
|
||||||
|
SHA256: B4:CB:83:B4:DA:D9:9F:99:7D:BE:87:2F:01:3A:A1:6C:14:EE:C4:1D:16:70:21:F3:71:F7:E1:33:0F:27:3E:E6
|
||||||
|
Signature algorithm name: SHA256withRSA
|
||||||
|
Version: 3
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Magisk, including all git submodules are free software:
|
||||||
|
you can redistribute it and/or modify it under the terms of the
|
||||||
|
GNU General Public License as published by the Free Software Foundation,
|
||||||
|
either version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Magisk Manager
|
|
||||||
The project should be built with Android Studio version 2.2.0+
|
|
||||||
I use Java 8 features, which requires Jack compiler and it's only available in 2.2.0+
|
|
||||||
Also, you need to install CMake and NDK to build the zipadjust library for zip preprocessing
|
|
||||||
10
app/.gitignore
vendored
10
app/.gitignore
vendored
@@ -1 +1,11 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
.idea/
|
||||||
/build
|
/build
|
||||||
|
app/release
|
||||||
|
*.hprof
|
||||||
|
.externalNativeBuild/
|
||||||
|
public.certificate.x509.pem
|
||||||
|
private.key.pk8
|
||||||
|
*.apk
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.6)
|
|
||||||
add_library(zipadjust SHARED src/main/jni/zipadjust.c)
|
|
||||||
find_library(libz z)
|
|
||||||
find_library(liblog log)
|
|
||||||
target_link_libraries(zipadjust ${libz} ${liblog})
|
|
||||||
111
app/build.gradle
111
app/build.gradle
@@ -1,64 +1,83 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
apply plugin: 'kotlin-kapt'
|
||||||
|
|
||||||
|
kapt {
|
||||||
|
correctErrorTypes = true
|
||||||
|
useBuildCache = true
|
||||||
|
mapDiagnosticLocations = true
|
||||||
|
javacOptions {
|
||||||
|
option("-Xmaxerrs", 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
|
||||||
buildToolsVersion "25.0.2"
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.topjohnwu.magisk"
|
applicationId 'com.topjohnwu.magisk'
|
||||||
minSdkVersion 21
|
vectorDrawables.useSupportLibrary = true
|
||||||
targetSdkVersion 25
|
multiDexEnabled true
|
||||||
versionCode 12
|
versionName configProps['appVersion']
|
||||||
versionName "3.1"
|
versionCode configProps['appVersionCode'] as Integer
|
||||||
jackOptions {
|
javaCompileOptions {
|
||||||
enabled true
|
annotationProcessorOptions {
|
||||||
}
|
argument('butterknife.debuggable', 'false')
|
||||||
ndk {
|
|
||||||
moduleName 'zipadjust'
|
|
||||||
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
incremental false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
dataBinding {
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
enabled = true
|
||||||
}
|
}
|
||||||
dexOptions {
|
|
||||||
preDexLibraries = false
|
packagingOptions {
|
||||||
|
exclude '/META-INF/*.version'
|
||||||
|
exclude '/META-INF/*.kotlin_module'
|
||||||
|
exclude '/META-INF/rxkotlin.properties'
|
||||||
|
exclude '/androidsupportmultidexversion.txt'
|
||||||
|
exclude '/org/**'
|
||||||
|
exclude '/kotlin/**'
|
||||||
|
exclude '/kotlinx/**'
|
||||||
}
|
}
|
||||||
externalNativeBuild {
|
|
||||||
cmake {
|
|
||||||
path 'CMakeLists.txt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url "https://jitpack.io" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
compile 'com.android.support:recyclerview-v7:25.1.0'
|
implementation project(':net')
|
||||||
compile 'com.android.support:cardview-v7:25.1.0'
|
implementation project(':shared')
|
||||||
compile 'com.android.support:design:25.1.0'
|
implementation project(':signing')
|
||||||
compile 'com.jakewharton:butterknife:8.4.0'
|
|
||||||
compile 'com.google.code.gson:gson:2.8.0'
|
implementation 'com.github.topjohnwu:jtar:1.0.0'
|
||||||
compile 'com.github.clans:fab:1.6.4'
|
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||||
compile 'com.madgag.spongycastle:core:1.54.0.0'
|
implementation 'com.github.skoumalcz:teanity:0.3.3'
|
||||||
compile 'com.madgag.spongycastle:prov:1.54.0.0'
|
implementation 'com.ncapdevi:frag-nav:3.2.0'
|
||||||
compile 'com.madgag.spongycastle:pkix:1.54.0.0'
|
|
||||||
compile 'com.madgag.spongycastle:pg:1.54.0.0'
|
def markwonVersion = '3.0.1'
|
||||||
compile 'com.google.android.gms:play-services-safetynet:9.0.1'
|
implementation "ru.noties.markwon:core:${markwonVersion}"
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
|
implementation "ru.noties.markwon:html:${markwonVersion}"
|
||||||
|
implementation "ru.noties.markwon:image-svg:${markwonVersion}"
|
||||||
|
|
||||||
|
def libsuVersion = '2.5.0'
|
||||||
|
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
|
||||||
|
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"
|
||||||
|
|
||||||
|
def koin = "2.0.0-rc-2"
|
||||||
|
implementation "org.koin:koin-core:${koin}"
|
||||||
|
implementation "org.koin:koin-android:${koin}"
|
||||||
|
implementation "org.koin:koin-androidx-viewmodel:${koin}"
|
||||||
|
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||||
|
implementation 'androidx.preference:preference:1.0.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
|
||||||
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
|
implementation 'com.google.android.material:material:1.1.0-alpha06'
|
||||||
|
implementation 'androidx.work:work-runtime:2.0.1'
|
||||||
|
implementation 'androidx.transition:transition:1.2.0-alpha01'
|
||||||
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
}
|
}
|
||||||
|
|||||||
47
app/proguard-rules.pro
vendored
47
app/proguard-rules.pro
vendored
@@ -16,31 +16,34 @@
|
|||||||
# public *;
|
# public *;
|
||||||
#}
|
#}
|
||||||
|
|
||||||
# Gson uses generic type information stored in a class file when working with fields. Proguard
|
# Snet
|
||||||
# removes such information by default, so configure it to keep all of it.
|
-keepclassmembers class com.topjohnwu.magisk.utils.ISafetyNetHelper { *; }
|
||||||
-keepattributes Signature
|
-keep,allowobfuscation interface com.topjohnwu.magisk.utils.ISafetyNetHelper$Callback
|
||||||
|
-keepclassmembers class * implements com.topjohnwu.magisk.utils.ISafetyNetHelper$Callback {
|
||||||
|
void onResponse(int);
|
||||||
|
}
|
||||||
|
|
||||||
# For using GSON @Expose annotation
|
# Keep all fragment constructors
|
||||||
-keepattributes *Annotation*
|
-keepclassmembers class * extends androidx.fragment.app.Fragment {
|
||||||
|
public <init>(...);
|
||||||
|
}
|
||||||
|
|
||||||
# Gson specific classes
|
# DelegateWorker
|
||||||
-keep class sun.misc.Unsafe { *; }
|
-keep,allowobfuscation class * extends com.topjohnwu.magisk.model.worker.DelegateWorker
|
||||||
-keep class com.google.gson.** { *; }
|
|
||||||
|
|
||||||
# Application classes that will be serialized/deserialized over Gson
|
# BootSigner
|
||||||
-keep class com.topjohnwu.magisk.module.** { *; }
|
-keepclassmembers class com.topjohnwu.signing.BootSigner { *; }
|
||||||
-keep class com.topjohnwu.magisk.utils.ModuleHelper$ValueSortedMap { *; }
|
|
||||||
|
|
||||||
# Prevent proguard from stripping interface information from TypeAdapterFactory,
|
# Strip logging
|
||||||
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
-assumenosideeffects class com.topjohnwu.magisk.utils.Logger {
|
||||||
-keep class * implements com.google.gson.TypeAdapterFactory
|
public *** debug(...);
|
||||||
-keep class * implements com.google.gson.JsonSerializer
|
}
|
||||||
-keep class * implements com.google.gson.JsonDeserializer
|
|
||||||
|
|
||||||
-keep class android.support.v7.internal.** { *; }
|
# Excessive obfuscation
|
||||||
-keep interface android.support.v7.internal.** { *; }
|
-repackageclasses 'a'
|
||||||
-keep class android.support.v7.** { *; }
|
-allowaccessmodification
|
||||||
-keep interface android.support.v7.** { *; }
|
|
||||||
|
|
||||||
# SpongyCastle
|
# QOL
|
||||||
-keep class org.spongycastle.** {*;}
|
-dontnote **
|
||||||
|
-dontwarn com.caverock.androidsvg.**
|
||||||
|
-dontwarn ru.noties.markwon.**
|
||||||
|
|||||||
@@ -1,31 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest package="com.topjohnwu.magisk"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="com.topjohnwu.magisk">
|
||||||
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
android:name="android.permission.PACKAGE_USAGE_STATS"
|
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||||
tools:ignore="ProtectedPermissions" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:name="a.e"
|
||||||
android:label="@string/app_name"
|
android:theme="@style/MagiskTheme"
|
||||||
android:supportsRtl="true"
|
android:usesCleartextTraffic="true"
|
||||||
android:theme="@style/AppTheme"
|
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning">
|
||||||
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
|
|
||||||
<activity
|
<!-- Activities -->
|
||||||
android:name=".MainActivity"
|
|
||||||
android:configChanges="orientation|screenSize"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".SplashActivity"
|
android:name="a.b"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:exported="true" />
|
||||||
|
<activity
|
||||||
|
android:name="a.c"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/SplashTheme">
|
android:theme="@style/SplashTheme">
|
||||||
@@ -34,27 +31,46 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name="a.f"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:screenOrientation="nosensor"
|
||||||
|
android:theme="@style/MagiskTheme.Flashing" />
|
||||||
|
|
||||||
|
<!-- Superuser -->
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".AboutActivity"
|
android:name="a.m"
|
||||||
android:theme="@style/AppTheme.Transparent"/>
|
|
||||||
<activity
|
|
||||||
android:name=".SettingsActivity"
|
|
||||||
android:theme="@style/AppTheme.Transparent" />
|
|
||||||
|
|
||||||
<provider
|
|
||||||
android:name="android.support.v4.content.FileProvider"
|
|
||||||
android:authorities="com.topjohnwu.magisk.provider"
|
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:grantUriPermissions="true">
|
android:directBootAware="true"
|
||||||
<meta-data
|
android:excludeFromRecents="true"
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:theme="@style/MagiskTheme.SU" />
|
||||||
android:resource="@xml/file_paths" />
|
|
||||||
</provider>
|
|
||||||
|
|
||||||
|
<!-- Receiver -->
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name="a.h"
|
||||||
|
android:directBootAware="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
<action android:name="android.intent.action.LOCALE_CHANGED" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
|
<action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
|
||||||
|
|
||||||
|
<data android:scheme="package" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<!-- Service -->
|
||||||
|
|
||||||
|
<service android:name="a.j" />
|
||||||
|
|
||||||
|
<!-- Hardcode GMS version -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.gms.version"
|
android:name="com.google.android.gms.version"
|
||||||
android:value="@integer/google_play_services_version" />
|
android:value="12451000" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB |
13
app/src/main/java/a/a.java
Normal file
13
app/src/main/java/a/a.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.utils.PatchAPK;
|
||||||
|
import com.topjohnwu.signing.BootSigner;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
public class a extends BootSigner {
|
||||||
|
public static boolean patchAPK(String in, String out, String pkg) {
|
||||||
|
return PatchAPK.patch(in, out, pkg);
|
||||||
|
}
|
||||||
|
}
|
||||||
7
app/src/main/java/a/b.java
Normal file
7
app/src/main/java/a/b.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.ui.MainActivity;
|
||||||
|
|
||||||
|
public class b extends MainActivity {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
7
app/src/main/java/a/c.java
Normal file
7
app/src/main/java/a/c.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||||
|
|
||||||
|
public class c extends SplashActivity {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
7
app/src/main/java/a/e.java
Normal file
7
app/src/main/java/a/e.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App;
|
||||||
|
|
||||||
|
public class e extends App {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
7
app/src/main/java/a/f.java
Normal file
7
app/src/main/java/a/f.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||||
|
|
||||||
|
public class f extends FlashActivity {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
15
app/src/main/java/a/g.java
Normal file
15
app/src/main/java/a/g.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.model.update.UpdateCheckService;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.work.WorkerParameters;
|
||||||
|
|
||||||
|
public class g extends w<UpdateCheckService> {
|
||||||
|
/* Stub */
|
||||||
|
public g(@NonNull Context context, @NonNull WorkerParameters workerParams) {
|
||||||
|
super(context, workerParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
7
app/src/main/java/a/h.java
Normal file
7
app/src/main/java/a/h.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.model.receiver.GeneralReceiver;
|
||||||
|
|
||||||
|
public class h extends GeneralReceiver {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
7
app/src/main/java/a/j.java
Normal file
7
app/src/main/java/a/j.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.model.download.DownloadModuleService;
|
||||||
|
|
||||||
|
public class j extends DownloadModuleService {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
7
app/src/main/java/a/m.java
Normal file
7
app/src/main/java/a/m.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity;
|
||||||
|
|
||||||
|
public class m extends SuRequestActivity {
|
||||||
|
/* stub */
|
||||||
|
}
|
||||||
42
app/src/main/java/a/w.java
Normal file
42
app/src/main/java/a/w.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package a;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.model.worker.DelegateWorker;
|
||||||
|
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.work.Worker;
|
||||||
|
import androidx.work.WorkerParameters;
|
||||||
|
|
||||||
|
public abstract class w<T extends DelegateWorker> extends Worker {
|
||||||
|
|
||||||
|
/* Wrapper class to workaround Proguard -keep class * extends Worker */
|
||||||
|
|
||||||
|
private T base;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
w(@NonNull Context context, @NonNull WorkerParameters workerParams) {
|
||||||
|
super(context, workerParams);
|
||||||
|
try {
|
||||||
|
base = ((Class<T>) ((ParameterizedType) getClass().getGenericSuperclass())
|
||||||
|
.getActualTypeArguments()[0]).newInstance();
|
||||||
|
base.setActualWorker(this);
|
||||||
|
} catch (Exception ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Result doWork() {
|
||||||
|
if (base == null)
|
||||||
|
return Result.failure();
|
||||||
|
return base.doWork();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStopped() {
|
||||||
|
if (base != null)
|
||||||
|
base.onStopped();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,152 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.text.Spanned;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.text.method.LinkMovementMethod;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class AboutActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
private static final String SOURCE_CODE_URL = "https://github.com/topjohnwu/MagiskManager";
|
|
||||||
private static final String XDA_THREAD = "http://forum.xda-developers.com/showthread.php?t=3432382";
|
|
||||||
private static final String DONATION_URL = "http://topjohnwu.github.io/donate";
|
|
||||||
@BindView(R.id.toolbar) Toolbar toolbar;
|
|
||||||
@BindView(R.id.app_version_info) AboutCardRow appVersionInfo;
|
|
||||||
@BindView(R.id.app_changelog) AboutCardRow appChangelog;
|
|
||||||
@BindView(R.id.app_developers) AboutCardRow appDevelopers;
|
|
||||||
@BindView(R.id.app_translators) AboutCardRow appTranslators;
|
|
||||||
@BindView(R.id.app_source_code) AboutCardRow appSourceCode;
|
|
||||||
@BindView(R.id.support_thread) AboutCardRow supportThread;
|
|
||||||
@BindView(R.id.donation) AboutCardRow donation;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
String theme = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("theme", "");
|
|
||||||
Logger.dev("AboutActivity: Theme is " + theme);
|
|
||||||
if (Utils.isDarkTheme) {
|
|
||||||
setTheme(R.style.AppTheme_dh);
|
|
||||||
}
|
|
||||||
setContentView(R.layout.activity_about);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
toolbar.setNavigationOnClickListener(view -> finish());
|
|
||||||
|
|
||||||
ActionBar ab = getSupportActionBar();
|
|
||||||
if (ab != null) {
|
|
||||||
ab.setTitle(R.string.about);
|
|
||||||
ab.setDisplayHomeAsUpEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
appVersionInfo.setSummary(BuildConfig.VERSION_NAME);
|
|
||||||
|
|
||||||
String changes = null;
|
|
||||||
try {
|
|
||||||
InputStream is = getAssets().open("changelog.html");
|
|
||||||
int size = is.available();
|
|
||||||
|
|
||||||
byte[] buffer = new byte[size];
|
|
||||||
is.read(buffer);
|
|
||||||
is.close();
|
|
||||||
|
|
||||||
changes = new String(buffer);
|
|
||||||
} catch (IOException ignored) {
|
|
||||||
}
|
|
||||||
|
|
||||||
appChangelog.removeSummary();
|
|
||||||
if (changes == null) {
|
|
||||||
appChangelog.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
Spanned result;
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
|
|
||||||
result = Html.fromHtml(changes, Html.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE);
|
|
||||||
} else {
|
|
||||||
result = Html.fromHtml(changes);
|
|
||||||
}
|
|
||||||
appChangelog.setOnClickListener(v -> {
|
|
||||||
AlertDialog d = Utils.getAlertDialogBuilder(this)
|
|
||||||
.setTitle(R.string.app_changelog)
|
|
||||||
.setMessage(result)
|
|
||||||
.setPositiveButton(android.R.string.ok, null)
|
|
||||||
.show();
|
|
||||||
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
appDevelopers.removeSummary();
|
|
||||||
appDevelopers.setOnClickListener(view -> {
|
|
||||||
Spanned result;
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
|
|
||||||
result = Html.fromHtml(getString(R.string.app_developers_), Html.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE);
|
|
||||||
} else {
|
|
||||||
result = Html.fromHtml(getString(R.string.app_developers_));
|
|
||||||
}
|
|
||||||
AlertDialog d = Utils.getAlertDialogBuilder(this)
|
|
||||||
.setTitle(R.string.app_developers)
|
|
||||||
.setMessage(result)
|
|
||||||
.setPositiveButton(android.R.string.ok, null)
|
|
||||||
.create();
|
|
||||||
|
|
||||||
d.show();
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
|
||||||
});
|
|
||||||
|
|
||||||
String translators = getString(R.string.translators);
|
|
||||||
if (TextUtils.isEmpty(translators)) {
|
|
||||||
appTranslators.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
appTranslators.setSummary(translators);
|
|
||||||
}
|
|
||||||
|
|
||||||
appSourceCode.removeSummary();
|
|
||||||
appSourceCode.setOnClickListener(view -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(SOURCE_CODE_URL))));
|
|
||||||
|
|
||||||
supportThread.removeSummary();
|
|
||||||
supportThread.setOnClickListener(view -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(XDA_THREAD))));
|
|
||||||
|
|
||||||
donation.removeSummary();
|
|
||||||
donation.setOnClickListener(view -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(DONATION_URL))));
|
|
||||||
|
|
||||||
setFloating();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFloating() {
|
|
||||||
boolean isTablet = getResources().getBoolean(R.bool.isTablet);
|
|
||||||
if (isTablet) {
|
|
||||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
|
||||||
params.height = getResources().getDimensionPixelSize(R.dimen.floating_height);
|
|
||||||
params.width = getResources().getDimensionPixelSize(R.dimen.floating_width);
|
|
||||||
params.alpha = 1.0f;
|
|
||||||
params.dimAmount = 0.6f;
|
|
||||||
params.flags |= 2;
|
|
||||||
getWindow().setAttributes(params);
|
|
||||||
setFinishOnTouchOutside(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 dvdandroid
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author dvdandroid
|
|
||||||
*/
|
|
||||||
public class AboutCardRow extends LinearLayout {
|
|
||||||
|
|
||||||
private final String title;
|
|
||||||
private final Drawable icon;
|
|
||||||
|
|
||||||
private final TextView mTitle;
|
|
||||||
private final TextView mSummary;
|
|
||||||
private final ImageView mIcon;
|
|
||||||
|
|
||||||
private final View mView;
|
|
||||||
|
|
||||||
public AboutCardRow(Context context) {
|
|
||||||
this(context, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AboutCardRow(Context context, AttributeSet attrs) {
|
|
||||||
this(context, attrs, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AboutCardRow(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
||||||
super(context, attrs, defStyleAttr);
|
|
||||||
LayoutInflater.from(context).inflate(R.layout.info_item_row, this);
|
|
||||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AboutCardRow, 0, 0);
|
|
||||||
|
|
||||||
try {
|
|
||||||
title = a.getString(R.styleable.AboutCardRow_text);
|
|
||||||
icon = a.getDrawable(R.styleable.AboutCardRow_icon);
|
|
||||||
} finally {
|
|
||||||
a.recycle();
|
|
||||||
}
|
|
||||||
|
|
||||||
mView = findViewById(R.id.container);
|
|
||||||
|
|
||||||
mTitle = (TextView) findViewById(android.R.id.title);
|
|
||||||
mSummary = (TextView) findViewById(android.R.id.summary);
|
|
||||||
mIcon = (ImageView) findViewById(android.R.id.icon);
|
|
||||||
|
|
||||||
mTitle.setText(title);
|
|
||||||
mIcon.setImageDrawable(icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOnClickListener(OnClickListener l) {
|
|
||||||
super.setOnClickListener(l);
|
|
||||||
|
|
||||||
mView.setOnClickListener(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSummary(String s) {
|
|
||||||
mSummary.setText(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeSummary() {
|
|
||||||
mSummary.setVisibility(GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
130
app/src/main/java/com/topjohnwu/magisk/App.kt
Normal file
130
app/src/main/java/com/topjohnwu/magisk/App.kt
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
package com.topjohnwu.magisk
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.Activity
|
||||||
|
import android.app.Application
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.content.res.Configuration
|
||||||
|
import android.os.AsyncTask
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import androidx.multidex.MultiDex
|
||||||
|
import com.topjohnwu.magisk.data.database.MagiskDB
|
||||||
|
import com.topjohnwu.magisk.data.database.RepoDatabaseHelper
|
||||||
|
import com.topjohnwu.magisk.di.koinModules
|
||||||
|
import com.topjohnwu.magisk.utils.LocaleManager
|
||||||
|
import com.topjohnwu.magisk.utils.RootUtils
|
||||||
|
import com.topjohnwu.magisk.utils.inject
|
||||||
|
import com.topjohnwu.net.Networking
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
import org.koin.android.ext.android.inject
|
||||||
|
import org.koin.android.ext.koin.androidContext
|
||||||
|
import org.koin.core.context.startKoin
|
||||||
|
import timber.log.Timber
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor
|
||||||
|
|
||||||
|
open class App : Application(), Application.ActivityLifecycleCallbacks {
|
||||||
|
|
||||||
|
lateinit var protectedContext: Context
|
||||||
|
|
||||||
|
@Deprecated("Use dependency injection")
|
||||||
|
val prefs: SharedPreferences by inject()
|
||||||
|
@Deprecated("Use dependency injection")
|
||||||
|
val DB: MagiskDB by inject()
|
||||||
|
@Deprecated("Use dependency injection")
|
||||||
|
val repoDB: RepoDatabaseHelper by inject()
|
||||||
|
|
||||||
|
@Volatile
|
||||||
|
private var foreground: Activity? = null
|
||||||
|
|
||||||
|
override fun attachBaseContext(base: Context) {
|
||||||
|
super.attachBaseContext(base)
|
||||||
|
if (BuildConfig.DEBUG)
|
||||||
|
MultiDex.install(base)
|
||||||
|
Timber.plant(Timber.DebugTree())
|
||||||
|
|
||||||
|
startKoin {
|
||||||
|
androidContext(this@App)
|
||||||
|
modules(koinModules)
|
||||||
|
}
|
||||||
|
|
||||||
|
protectedContext = baseContext
|
||||||
|
self = this
|
||||||
|
deContext = base
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 24) {
|
||||||
|
protectedContext = base.createDeviceProtectedStorageContext()
|
||||||
|
deContext = protectedContext
|
||||||
|
deContext.moveSharedPreferencesFrom(base, base.defaultPrefsName)
|
||||||
|
}
|
||||||
|
|
||||||
|
registerActivityLifecycleCallbacks(this)
|
||||||
|
|
||||||
|
Networking.init(base)
|
||||||
|
LocaleManager.setLocale(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||||
|
super.onConfigurationChanged(newConfig)
|
||||||
|
LocaleManager.setLocale(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
//region ActivityLifecycleCallbacks
|
||||||
|
override fun onActivityCreated(activity: Activity, bundle: Bundle?) {}
|
||||||
|
|
||||||
|
override fun onActivityStarted(activity: Activity) {}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
|
override fun onActivityResumed(activity: Activity) {
|
||||||
|
foreground = activity
|
||||||
|
}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
|
override fun onActivityPaused(activity: Activity) {
|
||||||
|
foreground = null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityStopped(activity: Activity) {}
|
||||||
|
|
||||||
|
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {}
|
||||||
|
|
||||||
|
override fun onActivityDestroyed(activity: Activity) {}
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
private val Context.defaultPrefsName get() = "${packageName}_preferences"
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
@Deprecated("Use dependency injection")
|
||||||
|
@JvmStatic
|
||||||
|
lateinit var self: App
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
@Deprecated("Use dependency injection; replace with protectedContext")
|
||||||
|
@JvmStatic
|
||||||
|
lateinit var deContext: Context
|
||||||
|
|
||||||
|
@Deprecated("Use Rx or similar")
|
||||||
|
@JvmField
|
||||||
|
var THREAD_POOL: ThreadPoolExecutor
|
||||||
|
|
||||||
|
init {
|
||||||
|
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
|
||||||
|
Shell.Config.setFlags(Shell.FLAG_MOUNT_MASTER or Shell.FLAG_USE_MAGISK_BUSYBOX)
|
||||||
|
Shell.Config.verboseLogging(BuildConfig.DEBUG)
|
||||||
|
Shell.Config.addInitializers(RootUtils::class.java)
|
||||||
|
Shell.Config.setTimeout(2)
|
||||||
|
THREAD_POOL = AsyncTask.THREAD_POOL_EXECUTOR as ThreadPoolExecutor
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated("")
|
||||||
|
@JvmStatic
|
||||||
|
fun foreground(): Activity? {
|
||||||
|
val app: App by inject()
|
||||||
|
return app.foreground
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
app/src/main/java/com/topjohnwu/magisk/ClassMap.java
Normal file
31
app/src/main/java/com/topjohnwu/magisk/ClassMap.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package com.topjohnwu.magisk;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.model.download.DownloadModuleService;
|
||||||
|
import com.topjohnwu.magisk.model.receiver.GeneralReceiver;
|
||||||
|
import com.topjohnwu.magisk.model.update.UpdateCheckService;
|
||||||
|
import com.topjohnwu.magisk.ui.MainActivity;
|
||||||
|
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||||
|
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||||
|
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ClassMap {
|
||||||
|
private static Map<Class, Class> classMap = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
classMap.put(App.class, a.e.class);
|
||||||
|
classMap.put(MainActivity.class, a.b.class);
|
||||||
|
classMap.put(SplashActivity.class, a.c.class);
|
||||||
|
classMap.put(FlashActivity.class, a.f.class);
|
||||||
|
classMap.put(UpdateCheckService.class, a.g.class);
|
||||||
|
classMap.put(GeneralReceiver.class, a.h.class);
|
||||||
|
classMap.put(DownloadModuleService.class, a.j.class);
|
||||||
|
classMap.put(SuRequestActivity.class, a.m.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Class<T> get(Class c) {
|
||||||
|
return classMap.get(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
396
app/src/main/java/com/topjohnwu/magisk/Config.java
Normal file
396
app/src/main/java/com/topjohnwu/magisk/Config.java
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
package com.topjohnwu.magisk;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.util.Xml;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
import com.topjohnwu.superuser.ShellUtils;
|
||||||
|
import com.topjohnwu.superuser.io.SuFile;
|
||||||
|
import com.topjohnwu.superuser.io.SuFileInputStream;
|
||||||
|
|
||||||
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import androidx.collection.ArrayMap;
|
||||||
|
|
||||||
|
public class Config {
|
||||||
|
|
||||||
|
// Current status
|
||||||
|
public static String magiskVersionString;
|
||||||
|
public static int magiskVersionCode = -1;
|
||||||
|
private static boolean magiskHide;
|
||||||
|
|
||||||
|
// Update Info
|
||||||
|
public static String remoteMagiskVersionString;
|
||||||
|
public static int remoteMagiskVersionCode = -1;
|
||||||
|
public static String magiskLink;
|
||||||
|
public static String magiskNoteLink;
|
||||||
|
public static String magiskMD5;
|
||||||
|
public static String remoteManagerVersionString;
|
||||||
|
public static int remoteManagerVersionCode = -1;
|
||||||
|
public static String managerLink;
|
||||||
|
public static String managerNoteLink;
|
||||||
|
public static String uninstallerLink;
|
||||||
|
|
||||||
|
// Install flags
|
||||||
|
public static boolean keepVerity = false;
|
||||||
|
public static boolean keepEnc = false;
|
||||||
|
public static boolean recovery = false;
|
||||||
|
|
||||||
|
public static int suLogTimeout = 14;
|
||||||
|
|
||||||
|
public static class Key {
|
||||||
|
// su configs
|
||||||
|
public static final String ROOT_ACCESS = "root_access";
|
||||||
|
public static final String SU_MULTIUSER_MODE = "multiuser_mode";
|
||||||
|
public static final String SU_MNT_NS = "mnt_ns";
|
||||||
|
public static final String SU_MANAGER = "requester";
|
||||||
|
public static final String SU_REQUEST_TIMEOUT = "su_request_timeout";
|
||||||
|
public static final String SU_AUTO_RESPONSE = "su_auto_response";
|
||||||
|
public static final String SU_NOTIFICATION = "su_notification";
|
||||||
|
public static final String SU_REAUTH = "su_reauth";
|
||||||
|
public static final String SU_FINGERPRINT = "su_fingerprint";
|
||||||
|
|
||||||
|
// prefs
|
||||||
|
public static final String CHECK_UPDATES = "check_update";
|
||||||
|
public static final String UPDATE_CHANNEL = "update_channel";
|
||||||
|
public static final String CUSTOM_CHANNEL = "custom_channel";
|
||||||
|
public static final String LOCALE = "locale";
|
||||||
|
public static final String DARK_THEME = "dark_theme";
|
||||||
|
public static final String ETAG_KEY = "ETag";
|
||||||
|
public static final String REPO_ORDER = "repo_order";
|
||||||
|
public static final String SHOW_SYSTEM_APP = "show_system";
|
||||||
|
|
||||||
|
// system state
|
||||||
|
public static final String UPDATE_SERVICE_VER = "update_service_version";
|
||||||
|
public static final String MAGISKHIDE = "magiskhide";
|
||||||
|
public static final String COREONLY = "disable";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Value {
|
||||||
|
public static final int DEFAULT_CHANNEL = -1;
|
||||||
|
public static final int STABLE_CHANNEL = 0;
|
||||||
|
public static final int BETA_CHANNEL = 1;
|
||||||
|
public static final int CUSTOM_CHANNEL = 2;
|
||||||
|
public static final int CANARY_CHANNEL = 3;
|
||||||
|
public static final int CANARY_DEBUG_CHANNEL = 4;
|
||||||
|
public static final int ROOT_ACCESS_DISABLED = 0;
|
||||||
|
public static final int ROOT_ACCESS_APPS_ONLY = 1;
|
||||||
|
public static final int ROOT_ACCESS_ADB_ONLY = 2;
|
||||||
|
public static final int ROOT_ACCESS_APPS_AND_ADB = 3;
|
||||||
|
public static final int MULTIUSER_MODE_OWNER_ONLY = 0;
|
||||||
|
public static final int MULTIUSER_MODE_OWNER_MANAGED = 1;
|
||||||
|
public static final int MULTIUSER_MODE_USER = 2;
|
||||||
|
public static final int NAMESPACE_MODE_GLOBAL = 0;
|
||||||
|
public static final int NAMESPACE_MODE_REQUESTER = 1;
|
||||||
|
public static final int NAMESPACE_MODE_ISOLATE = 2;
|
||||||
|
public static final int NO_NOTIFICATION = 0;
|
||||||
|
public static final int NOTIFICATION_TOAST = 1;
|
||||||
|
public static final int SU_PROMPT = 0;
|
||||||
|
public static final int SU_AUTO_DENY = 1;
|
||||||
|
public static final int SU_AUTO_ALLOW = 2;
|
||||||
|
public static final int[] TIMEOUT_LIST = {0, -1, 10, 20, 30, 60};
|
||||||
|
public static final int ORDER_NAME = 0;
|
||||||
|
public static final int ORDER_DATE = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loadMagiskInfo() {
|
||||||
|
try {
|
||||||
|
magiskVersionString = ShellUtils.fastCmd("magisk -v").split(":")[0];
|
||||||
|
magiskVersionCode = Integer.parseInt(ShellUtils.fastCmd("magisk -V"));
|
||||||
|
magiskHide = Shell.su("magiskhide --status").exec().isSuccess();
|
||||||
|
} catch (NumberFormatException ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void export() {
|
||||||
|
// Flush prefs to disk
|
||||||
|
App app = App.self;
|
||||||
|
app.getPrefs().edit().commit();
|
||||||
|
File xml = new File(App.deContext.getFilesDir().getParent() + "/shared_prefs",
|
||||||
|
app.getPackageName() + "_preferences.xml");
|
||||||
|
Shell.su(Utils.fmt("cat %s > /data/adb/%s", xml, Const.MANAGER_CONFIGS)).exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initialize() {
|
||||||
|
SharedPreferences pref = App.self.getPrefs();
|
||||||
|
SharedPreferences.Editor editor = pref.edit();
|
||||||
|
File config = SuFile.open("/data/adb", Const.MANAGER_CONFIGS);
|
||||||
|
if (config.exists()) {
|
||||||
|
try {
|
||||||
|
SuFileInputStream is = new SuFileInputStream(config);
|
||||||
|
XmlPullParser parser = Xml.newPullParser();
|
||||||
|
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||||
|
parser.setInput(is, "UTF-8");
|
||||||
|
parser.nextTag();
|
||||||
|
parser.require(XmlPullParser.START_TAG, null, "map");
|
||||||
|
while (parser.next() != XmlPullParser.END_TAG) {
|
||||||
|
if (parser.getEventType() != XmlPullParser.START_TAG)
|
||||||
|
continue;
|
||||||
|
String key = parser.getAttributeValue(null, "name");
|
||||||
|
String value = parser.getAttributeValue(null, "value");
|
||||||
|
switch (parser.getName()) {
|
||||||
|
case "string":
|
||||||
|
parser.require(XmlPullParser.START_TAG, null, "string");
|
||||||
|
editor.putString(key, parser.nextText());
|
||||||
|
parser.require(XmlPullParser.END_TAG, null, "string");
|
||||||
|
break;
|
||||||
|
case "boolean":
|
||||||
|
parser.require(XmlPullParser.START_TAG, null, "boolean");
|
||||||
|
editor.putBoolean(key, Boolean.parseBoolean(value));
|
||||||
|
parser.nextTag();
|
||||||
|
parser.require(XmlPullParser.END_TAG, null, "boolean");
|
||||||
|
break;
|
||||||
|
case "int":
|
||||||
|
parser.require(XmlPullParser.START_TAG, null, "int");
|
||||||
|
editor.putInt(key, Integer.parseInt(value));
|
||||||
|
parser.nextTag();
|
||||||
|
parser.require(XmlPullParser.END_TAG, null, "int");
|
||||||
|
break;
|
||||||
|
case "long":
|
||||||
|
parser.require(XmlPullParser.START_TAG, null, "long");
|
||||||
|
editor.putLong(key, Long.parseLong(value));
|
||||||
|
parser.nextTag();
|
||||||
|
parser.require(XmlPullParser.END_TAG, null, "long");
|
||||||
|
break;
|
||||||
|
case "float":
|
||||||
|
parser.require(XmlPullParser.START_TAG, null, "int");
|
||||||
|
editor.putFloat(key, Float.parseFloat(value));
|
||||||
|
parser.nextTag();
|
||||||
|
parser.require(XmlPullParser.END_TAG, null, "int");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
parser.next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException | XmlPullParserException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
editor.remove(Key.ETAG_KEY);
|
||||||
|
editor.apply();
|
||||||
|
editor = pref.edit();
|
||||||
|
config.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set defaults if not set
|
||||||
|
setDefs(pref, editor);
|
||||||
|
|
||||||
|
// These settings are from actual device state
|
||||||
|
editor.putBoolean(Key.MAGISKHIDE, magiskHide)
|
||||||
|
.putBoolean(Key.COREONLY, Const.MAGISK_DISABLE_FILE.exists())
|
||||||
|
.putInt(Key.UPDATE_SERVICE_VER, Const.UPDATE_SERVICE_VER)
|
||||||
|
.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int PREF_INT = 0;
|
||||||
|
private static final int PREF_STR_INT = 1;
|
||||||
|
private static final int PREF_BOOL = 2;
|
||||||
|
private static final int PREF_STR = 3;
|
||||||
|
private static final int DB_INT = 4;
|
||||||
|
private static final int DB_BOOL = 5;
|
||||||
|
private static final int DB_STR = 6;
|
||||||
|
|
||||||
|
private static int getConfigType(String key) {
|
||||||
|
switch (key) {
|
||||||
|
case Key.REPO_ORDER:
|
||||||
|
return PREF_INT;
|
||||||
|
|
||||||
|
case Key.SU_REQUEST_TIMEOUT:
|
||||||
|
case Key.SU_AUTO_RESPONSE:
|
||||||
|
case Key.SU_NOTIFICATION:
|
||||||
|
case Key.UPDATE_CHANNEL:
|
||||||
|
return PREF_STR_INT;
|
||||||
|
|
||||||
|
case Key.DARK_THEME:
|
||||||
|
case Key.SU_REAUTH:
|
||||||
|
case Key.CHECK_UPDATES:
|
||||||
|
case Key.MAGISKHIDE:
|
||||||
|
case Key.COREONLY:
|
||||||
|
case Key.SHOW_SYSTEM_APP:
|
||||||
|
return PREF_BOOL;
|
||||||
|
|
||||||
|
case Key.CUSTOM_CHANNEL:
|
||||||
|
case Key.LOCALE:
|
||||||
|
case Key.ETAG_KEY:
|
||||||
|
return PREF_STR;
|
||||||
|
|
||||||
|
case Key.ROOT_ACCESS:
|
||||||
|
case Key.SU_MNT_NS:
|
||||||
|
case Key.SU_MULTIUSER_MODE:
|
||||||
|
return DB_INT;
|
||||||
|
|
||||||
|
case Key.SU_FINGERPRINT:
|
||||||
|
return DB_BOOL;
|
||||||
|
|
||||||
|
case Key.SU_MANAGER:
|
||||||
|
return DB_STR;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static <T> T get(String key) {
|
||||||
|
App app = App.self;
|
||||||
|
switch (getConfigType(key)) {
|
||||||
|
case PREF_INT:
|
||||||
|
return (T) (Integer) app.getPrefs().getInt(key, getDef(key));
|
||||||
|
case PREF_STR_INT:
|
||||||
|
return (T) (Integer) Utils.getPrefsInt(app.getPrefs(), key, getDef(key));
|
||||||
|
case PREF_BOOL:
|
||||||
|
return (T) (Boolean) app.getPrefs().getBoolean(key, getDef(key));
|
||||||
|
case PREF_STR:
|
||||||
|
return (T) app.getPrefs().getString(key, getDef(key));
|
||||||
|
case DB_INT:
|
||||||
|
return (T) (Integer) app.getDB().getSettings(key, getDef(key));
|
||||||
|
case DB_BOOL:
|
||||||
|
return (T) (Boolean) (app.getDB().getSettings(key, getDef(key) ? 1 : 0) != 0);
|
||||||
|
case DB_STR:
|
||||||
|
return (T) app.getDB().getStrings(key, getDef(key));
|
||||||
|
}
|
||||||
|
/* Will never get here (IllegalArgumentException in getConfigType) */
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(String key, Object val) {
|
||||||
|
App app = App.self;
|
||||||
|
switch (getConfigType(key)) {
|
||||||
|
case PREF_INT:
|
||||||
|
app.getPrefs().edit().putInt(key, (int) val).apply();
|
||||||
|
break;
|
||||||
|
case PREF_STR_INT:
|
||||||
|
app.getPrefs().edit().putString(key, String.valueOf(val)).apply();
|
||||||
|
break;
|
||||||
|
case PREF_BOOL:
|
||||||
|
app.getPrefs().edit().putBoolean(key, (boolean) val).apply();
|
||||||
|
break;
|
||||||
|
case PREF_STR:
|
||||||
|
app.getPrefs().edit().putString(key, (String) val).apply();
|
||||||
|
break;
|
||||||
|
case DB_INT:
|
||||||
|
app.getDB().setSettings(key, (int) val);
|
||||||
|
break;
|
||||||
|
case DB_BOOL:
|
||||||
|
app.getDB().setSettings(key, (boolean) val ? 1 : 0);
|
||||||
|
break;
|
||||||
|
case DB_STR:
|
||||||
|
app.getDB().setStrings(key, (String) val);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void remove(String key) {
|
||||||
|
App app = App.self;
|
||||||
|
switch (getConfigType(key)) {
|
||||||
|
case PREF_INT:
|
||||||
|
case PREF_STR_INT:
|
||||||
|
case PREF_BOOL:
|
||||||
|
case PREF_STR:
|
||||||
|
app.getPrefs().edit().remove(key).apply();
|
||||||
|
break;
|
||||||
|
case DB_BOOL:
|
||||||
|
case DB_INT:
|
||||||
|
app.getDB().rmSettings(key);
|
||||||
|
break;
|
||||||
|
case DB_STR:
|
||||||
|
app.getDB().setStrings(key, null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ArrayMap<String, Object> defs = new ArrayMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
/* Set default configurations */
|
||||||
|
|
||||||
|
// prefs int
|
||||||
|
defs.put(Key.REPO_ORDER, Value.ORDER_DATE);
|
||||||
|
|
||||||
|
// prefs string int
|
||||||
|
defs.put(Key.SU_REQUEST_TIMEOUT, 10);
|
||||||
|
defs.put(Key.SU_AUTO_RESPONSE, Value.SU_PROMPT);
|
||||||
|
defs.put(Key.SU_NOTIFICATION, Value.NOTIFICATION_TOAST);
|
||||||
|
defs.put(Key.UPDATE_CHANNEL, Utils.isCanary() ?
|
||||||
|
Value.CANARY_DEBUG_CHANNEL : Value.DEFAULT_CHANNEL);
|
||||||
|
|
||||||
|
// prefs bool
|
||||||
|
defs.put(Key.CHECK_UPDATES, true);
|
||||||
|
defs.put(Key.DARK_THEME, true);
|
||||||
|
//defs.put(Key.SU_REAUTH, false);
|
||||||
|
//defs.put(Key.SHOW_SYSTEM_APP, false);
|
||||||
|
|
||||||
|
// prefs string
|
||||||
|
defs.put(Key.CUSTOM_CHANNEL, "");
|
||||||
|
defs.put(Key.LOCALE, "");
|
||||||
|
//defs.put(Key.ETAG_KEY, null);
|
||||||
|
|
||||||
|
// db int
|
||||||
|
defs.put(Key.ROOT_ACCESS, Value.ROOT_ACCESS_APPS_AND_ADB);
|
||||||
|
defs.put(Key.SU_MNT_NS, Value.NAMESPACE_MODE_REQUESTER);
|
||||||
|
defs.put(Key.SU_MULTIUSER_MODE, Value.MULTIUSER_MODE_OWNER_ONLY);
|
||||||
|
|
||||||
|
// db bool
|
||||||
|
//defs.put(Key.SU_FINGERPRINT, false);
|
||||||
|
|
||||||
|
// db strings
|
||||||
|
//defs.put(Key.SU_MANAGER, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <T> T getDef(String key) {
|
||||||
|
Object val = defs.get(key);
|
||||||
|
switch (getConfigType(key)) {
|
||||||
|
case PREF_INT:
|
||||||
|
case DB_INT:
|
||||||
|
case PREF_STR_INT:
|
||||||
|
return val != null ? (T) val : (T) (Integer) 0;
|
||||||
|
case DB_BOOL:
|
||||||
|
case PREF_BOOL:
|
||||||
|
return val != null ? (T) val : (T) (Boolean) false;
|
||||||
|
case DB_STR:
|
||||||
|
case PREF_STR:
|
||||||
|
return (T) val;
|
||||||
|
}
|
||||||
|
/* Will never get here (IllegalArgumentException in getConfigType) */
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setDefs(SharedPreferences pref, SharedPreferences.Editor editor) {
|
||||||
|
App app = App.self;
|
||||||
|
for (String key : defs.keySet()) {
|
||||||
|
int type = getConfigType(key);
|
||||||
|
switch (type) {
|
||||||
|
case DB_INT:
|
||||||
|
editor.putString(key, String.valueOf(
|
||||||
|
app.getDB().getSettings(key, (Integer) defs.get(key))));
|
||||||
|
continue;
|
||||||
|
case DB_STR:
|
||||||
|
editor.putString(key, app.getDB().getStrings(key, (String) defs.get(key)));
|
||||||
|
continue;
|
||||||
|
case DB_BOOL:
|
||||||
|
int bs = app.getDB().getSettings(key, -1);
|
||||||
|
editor.putBoolean(key, bs < 0 ? (Boolean) defs.get(key) : bs != 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (pref.contains(key))
|
||||||
|
continue;
|
||||||
|
switch (type) {
|
||||||
|
case PREF_INT:
|
||||||
|
editor.putInt(key, (Integer) defs.get(key));
|
||||||
|
break;
|
||||||
|
case PREF_STR_INT:
|
||||||
|
editor.putString(key, String.valueOf(defs.get(key)));
|
||||||
|
break;
|
||||||
|
case PREF_STR:
|
||||||
|
editor.putString(key, (String) defs.get(key));
|
||||||
|
break;
|
||||||
|
case PREF_BOOL:
|
||||||
|
editor.putBoolean(key, (Boolean) defs.get(key));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
102
app/src/main/java/com/topjohnwu/magisk/Const.java
Normal file
102
app/src/main/java/com/topjohnwu/magisk/Const.java
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
package com.topjohnwu.magisk;
|
||||||
|
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.os.Process;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class Const {
|
||||||
|
|
||||||
|
public static final String DEBUG_TAG = "MagiskManager";
|
||||||
|
|
||||||
|
// APK content
|
||||||
|
public static final String ANDROID_MANIFEST = "AndroidManifest.xml";
|
||||||
|
|
||||||
|
public static final String SU_KEYSTORE_KEY = "su_key";
|
||||||
|
|
||||||
|
// Paths
|
||||||
|
public static final String MAGISK_PATH = "/sbin/.magisk/img";
|
||||||
|
public static final File EXTERNAL_PATH;
|
||||||
|
public static File MAGISK_DISABLE_FILE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
MAGISK_DISABLE_FILE = new File("xxx");
|
||||||
|
EXTERNAL_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||||
|
EXTERNAL_PATH.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
||||||
|
public static final String MAGISK_LOG = "/cache/magisk.log";
|
||||||
|
public static final String MANAGER_CONFIGS = ".tmp.magisk.config";
|
||||||
|
|
||||||
|
// Versions
|
||||||
|
public static final int UPDATE_SERVICE_VER = 1;
|
||||||
|
public static final int SNET_EXT_VER = 12;
|
||||||
|
|
||||||
|
public static final int USER_ID = Process.myUid() / 100000;
|
||||||
|
|
||||||
|
// Generic
|
||||||
|
public static final String MAGISK_INSTALL_LOG_FILENAME = "magisk_install_log_%s.log";
|
||||||
|
|
||||||
|
public static final class MAGISK_VER {
|
||||||
|
public static final int MIN_SUPPORT = 18000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ID {
|
||||||
|
public static final int FETCH_ZIP = 2;
|
||||||
|
public static final int SELECT_BOOT = 3;
|
||||||
|
|
||||||
|
// notifications
|
||||||
|
public static final int MAGISK_UPDATE_NOTIFICATION_ID = 4;
|
||||||
|
public static final int APK_UPDATE_NOTIFICATION_ID = 5;
|
||||||
|
public static final int DTBO_NOTIFICATION_ID = 7;
|
||||||
|
public static final int HIDE_MANAGER_NOTIFICATION_ID = 8;
|
||||||
|
public static final String UPDATE_NOTIFICATION_CHANNEL = "update";
|
||||||
|
public static final String PROGRESS_NOTIFICATION_CHANNEL = "progress";
|
||||||
|
public static final String CHECK_MAGISK_UPDATE_WORKER_ID = "magisk_update";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Url {
|
||||||
|
private static String getRaw(String where, String name) {
|
||||||
|
return String.format("https://raw.githubusercontent.com/topjohnwu/magisk_files/%s/%s", where, name);
|
||||||
|
}
|
||||||
|
public static final String STABLE_URL = getRaw("master", "stable.json");
|
||||||
|
public static final String BETA_URL = getRaw("master", "beta.json");
|
||||||
|
public static final String CANARY_URL = getRaw("master", "canary_builds/release.json");
|
||||||
|
public static final String CANARY_DEBUG_URL = getRaw("master", "canary_builds/canary.json");
|
||||||
|
public static final String REPO_URL = "https://api.github.com/users/Magisk-Modules-Repo/repos?per_page=100&sort=pushed&page=%d";
|
||||||
|
public static final String FILE_URL = "https://raw.githubusercontent.com/Magisk-Modules-Repo/%s/master/%s";
|
||||||
|
public static final String ZIP_URL = "https://github.com/Magisk-Modules-Repo/%s/archive/master.zip";
|
||||||
|
public static final String MODULE_INSTALLER = "https://raw.githubusercontent.com/topjohnwu/Magisk/master/scripts/module_installer.sh";
|
||||||
|
public static final String PAYPAL_URL = "https://www.paypal.me/topjohnwu";
|
||||||
|
public static final String PATREON_URL = "https://www.patreon.com/topjohnwu";
|
||||||
|
public static final String TWITTER_URL = "https://twitter.com/topjohnwu";
|
||||||
|
public static final String XDA_THREAD = "http://forum.xda-developers.com/showthread.php?t=3432382";
|
||||||
|
public static final String SOURCE_CODE_URL = "https://github.com/topjohnwu/Magisk";
|
||||||
|
public static final String SNET_URL = getRaw("b66b1a914978e5f4c4bbfd74a59f4ad371bac107", "snet.apk");
|
||||||
|
public static final String BOOTCTL_URL = getRaw("9c5dfc1b8245c0b5b524901ef0ff0f8335757b77", "bootctl");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Key {
|
||||||
|
// others
|
||||||
|
public static final String LINK_KEY = "Link";
|
||||||
|
public static final String IF_NONE_MATCH = "If-None-Match";
|
||||||
|
// intents
|
||||||
|
public static final String OPEN_SECTION = "section";
|
||||||
|
public static final String INTENT_SET_NAME = "filename";
|
||||||
|
public static final String INTENT_SET_LINK = "link";
|
||||||
|
public static final String FLASH_ACTION = "action";
|
||||||
|
public static final String BROADCAST_MANAGER_UPDATE = "manager_update";
|
||||||
|
public static final String BROADCAST_REBOOT = "reboot";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Value {
|
||||||
|
public static final String FLASH_ZIP = "flash";
|
||||||
|
public static final String PATCH_FILE = "patch";
|
||||||
|
public static final String FLASH_MAGISK = "magisk";
|
||||||
|
public static final String FLASH_INACTIVE_SLOT = "slot";
|
||||||
|
public static final String UNINSTALL = "uninstall";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.design.widget.CoordinatorLayout;
|
|
||||||
import android.support.design.widget.Snackbar;
|
|
||||||
import android.support.v4.view.ViewCompat;
|
|
||||||
import android.support.v4.view.ViewPropertyAnimatorCompat;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import com.github.clans.fab.FloatingActionMenu;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Matteo on 08/08/2015.
|
|
||||||
*
|
|
||||||
* Floating Action Menu Behavior for Clans.FloatingActionButton
|
|
||||||
* https://github.com/Clans/FloatingActionButton/
|
|
||||||
*
|
|
||||||
* Use this behavior as your app:layout_behavior attribute in your Floating Action Menu to use the
|
|
||||||
* FabMenu in a Coordinator Layout.
|
|
||||||
*
|
|
||||||
* Remember to use the correct namespace for the fab:
|
|
||||||
* xmlns:fab="http://schemas.android.com/apk/res-auto"
|
|
||||||
*/
|
|
||||||
public class FABBehavior extends CoordinatorLayout.Behavior {
|
|
||||||
private float mTranslationY;
|
|
||||||
|
|
||||||
public FABBehavior(Context context, AttributeSet attrs) {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
|
|
||||||
return dependency instanceof Snackbar.SnackbarLayout;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
|
|
||||||
if (dependency instanceof Snackbar.SnackbarLayout) {
|
|
||||||
updateTranslation(parent, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDependentViewRemoved(CoordinatorLayout parent, View child, View dependency) {
|
|
||||||
if (dependency instanceof Snackbar.SnackbarLayout) {
|
|
||||||
revertTranslation(child);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateTranslation(CoordinatorLayout parent, View child) {
|
|
||||||
float translationY = getTranslationY(parent, child);
|
|
||||||
if (translationY != mTranslationY) {
|
|
||||||
ViewPropertyAnimatorCompat anim = ViewCompat.animate(child);
|
|
||||||
anim.cancel();
|
|
||||||
anim.translationY(translationY).setDuration(100);
|
|
||||||
mTranslationY = translationY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void revertTranslation(View child) {
|
|
||||||
if (mTranslationY != 0) {
|
|
||||||
ViewPropertyAnimatorCompat anim = ViewCompat.animate(child);
|
|
||||||
anim.cancel();
|
|
||||||
anim.translationY(0).setDuration(100);
|
|
||||||
mTranslationY = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private float getTranslationY(CoordinatorLayout parent, View child) {
|
|
||||||
float minOffset = 0.0F;
|
|
||||||
List dependencies = parent.getDependencies(child);
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
for (int z = dependencies.size(); i < z; ++i) {
|
|
||||||
View view = (View) dependencies.get(i);
|
|
||||||
if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(child, view)) {
|
|
||||||
minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - (float) view.getHeight());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return minOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* onStartNestedScroll and onNestedScroll will hide/show the FabMenu when a scroll is detected.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child,
|
|
||||||
View directTargetChild, View target, int nestedScrollAxes) {
|
|
||||||
return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL ||
|
|
||||||
super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target,
|
|
||||||
nestedScrollAxes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNestedScroll(CoordinatorLayout coordinatorLayout, View child, View target,
|
|
||||||
int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
|
|
||||||
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed,
|
|
||||||
dyUnconsumed);
|
|
||||||
FloatingActionMenu fabMenu = (FloatingActionMenu) child;
|
|
||||||
if (dyConsumed > 0 && !fabMenu.isMenuButtonHidden()) {
|
|
||||||
fabMenu.hideMenuButton(true);
|
|
||||||
} else if (dyConsumed < 0 && fabMenu.isMenuButtonHidden()) {
|
|
||||||
fabMenu.showMenuButton(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v7.widget.CardView;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.receivers.MagiskDlReceiver;
|
|
||||||
import com.topjohnwu.magisk.utils.CallbackHandler;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class InstallFragment extends Fragment implements CallbackHandler.EventListener {
|
|
||||||
|
|
||||||
public static final CallbackHandler.Event blockDetectionDone = new CallbackHandler.Event();
|
|
||||||
|
|
||||||
public static List<String> blockList;
|
|
||||||
public static String bootBlock = null;
|
|
||||||
|
|
||||||
@BindView(R.id.current_version_title) TextView currentVersionTitle;
|
|
||||||
@BindView(R.id.install_title) TextView installTitle;
|
|
||||||
@BindView(R.id.block_spinner) Spinner spinner;
|
|
||||||
@BindView(R.id.detect_bootimage) Button detectButton;
|
|
||||||
@BindView(R.id.flash_button) CardView flashButton;
|
|
||||||
@BindView(R.id.keep_force_enc) CheckBox keepEncChkbox;
|
|
||||||
@BindView(R.id.keep_verity) CheckBox keepVerityChkbox;
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
||||||
View v = inflater.inflate(R.layout.install_fragment, container, false);
|
|
||||||
ButterKnife.bind(this, v);
|
|
||||||
detectButton.setOnClickListener(v1 -> toAutoDetect());
|
|
||||||
currentVersionTitle.setText(getString(R.string.current_magisk_title, StatusFragment.magiskVersionString));
|
|
||||||
installTitle.setText(getString(R.string.install_magisk_title, StatusFragment.remoteMagiskVersion));
|
|
||||||
flashButton.setOnClickListener(v1 -> {
|
|
||||||
String bootImage = bootBlock;
|
|
||||||
if (bootImage == null) {
|
|
||||||
bootImage = blockList.get(spinner.getSelectedItemPosition() - 1);
|
|
||||||
}
|
|
||||||
String filename = "Magisk-v" + StatusFragment.remoteMagiskVersion + ".zip";
|
|
||||||
String finalBootImage = bootImage;
|
|
||||||
Utils.getAlertDialogBuilder(getActivity())
|
|
||||||
.setTitle(getString(R.string.repo_install_title, getString(R.string.magisk)))
|
|
||||||
.setMessage(getString(R.string.repo_install_msg, filename))
|
|
||||||
.setCancelable(true)
|
|
||||||
.setPositiveButton(R.string.download_install, (dialogInterface, i) -> Utils.dlAndReceive(
|
|
||||||
getActivity(),
|
|
||||||
new MagiskDlReceiver(finalBootImage, keepEncChkbox.isChecked(), keepVerityChkbox.isChecked()),
|
|
||||||
StatusFragment.magiskLink,
|
|
||||||
Utils.getLegalFilename(filename)))
|
|
||||||
.setNeutralButton(R.string.check_release_notes, (dialog, which) -> {
|
|
||||||
getActivity().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(StatusFragment.releaseNoteLink)));
|
|
||||||
})
|
|
||||||
.setNegativeButton(R.string.no_thanks, null)
|
|
||||||
.show();
|
|
||||||
});
|
|
||||||
if (blockDetectionDone.isTriggered) {
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrigger(CallbackHandler.Event event) {
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateUI() {
|
|
||||||
List<String> items = new ArrayList<>(blockList);
|
|
||||||
items.add(0, getString(R.string.auto_detect, bootBlock));
|
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(),
|
|
||||||
android.R.layout.simple_spinner_item, items);
|
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
spinner.setAdapter(adapter);
|
|
||||||
toAutoDetect();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void toAutoDetect() {
|
|
||||||
if (bootBlock != null) {
|
|
||||||
spinner.setSelection(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
getActivity().setTitle(R.string.install);
|
|
||||||
CallbackHandler.register(blockDetectionDone, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
CallbackHandler.unRegister(blockDetectionDone, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,236 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
import android.support.design.widget.Snackbar;
|
|
||||||
import android.support.v4.app.ActivityCompat;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.HorizontalScrollView;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.ScrollView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class LogFragment extends Fragment {
|
|
||||||
|
|
||||||
private static final String MAGISK_LOG = "/cache/magisk.log";
|
|
||||||
|
|
||||||
@BindView(R.id.txtLog) TextView txtLog;
|
|
||||||
@BindView(R.id.svLog) ScrollView svLog;
|
|
||||||
@BindView(R.id.hsvLog) HorizontalScrollView hsvLog;
|
|
||||||
|
|
||||||
@BindView(R.id.progressBar) ProgressBar progressBar;
|
|
||||||
|
|
||||||
private MenuItem mClickedMenuItem;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.log_fragment, container, false);
|
|
||||||
ButterKnife.bind(this, view);
|
|
||||||
|
|
||||||
txtLog.setTextIsSelectable(true);
|
|
||||||
|
|
||||||
new LogManager().read();
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
new LogManager().read();
|
|
||||||
getActivity().setTitle(R.string.log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
||||||
inflater.inflate(R.menu.menu_log, menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
mClickedMenuItem = item;
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case R.id.menu_refresh:
|
|
||||||
new LogManager().read();
|
|
||||||
return true;
|
|
||||||
case R.id.menu_send:
|
|
||||||
new LogManager().send();
|
|
||||||
return true;
|
|
||||||
case R.id.menu_save:
|
|
||||||
new LogManager().save();
|
|
||||||
return true;
|
|
||||||
case R.id.menu_clear:
|
|
||||||
new LogManager().clear();
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
||||||
if (requestCode == 0) {
|
|
||||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mClickedMenuItem != null) {
|
|
||||||
new Handler().postDelayed(() -> onOptionsItemSelected(mClickedMenuItem), 500);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Snackbar.make(txtLog, R.string.permissionNotGranted, Snackbar.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class LogManager extends Async.RootTask<Object, Void, Object> {
|
|
||||||
|
|
||||||
int mode;
|
|
||||||
File targetFile;
|
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
|
||||||
@Override
|
|
||||||
protected Object doInBackground(Object... params) {
|
|
||||||
mode = (int) params[0];
|
|
||||||
switch (mode) {
|
|
||||||
case 0:
|
|
||||||
List<String> logList = Utils.readFile(MAGISK_LOG);
|
|
||||||
|
|
||||||
StringBuilder llog = new StringBuilder(15 * 10 * 1024);
|
|
||||||
for (String s : logList) {
|
|
||||||
llog.append(s).append("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return llog.toString();
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
Shell.su("echo > " + MAGISK_LOG);
|
|
||||||
Snackbar.make(txtLog, R.string.logs_cleared, Snackbar.LENGTH_SHORT).show();
|
|
||||||
return "";
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
case 3:
|
|
||||||
if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Calendar now = Calendar.getInstance();
|
|
||||||
String filename = String.format(
|
|
||||||
"magisk_%s_%04d%02d%02d_%02d%02d%02d.log", "error",
|
|
||||||
now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1,
|
|
||||||
now.get(Calendar.DAY_OF_MONTH), now.get(Calendar.HOUR_OF_DAY),
|
|
||||||
now.get(Calendar.MINUTE), now.get(Calendar.SECOND));
|
|
||||||
|
|
||||||
targetFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/MagiskManager/" + filename);
|
|
||||||
|
|
||||||
if ((!targetFile.getParentFile().exists() && !targetFile.getParentFile().mkdirs())
|
|
||||||
|| (targetFile.exists() && !targetFile.delete()))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
List<String> in = Utils.readFile(MAGISK_LOG);
|
|
||||||
|
|
||||||
try {
|
|
||||||
FileWriter out = new FileWriter(targetFile);
|
|
||||||
for (String line : in) {
|
|
||||||
out.write(line + "\n");
|
|
||||||
}
|
|
||||||
out.close();
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Object o) {
|
|
||||||
boolean bool;
|
|
||||||
String llog;
|
|
||||||
switch (mode) {
|
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
llog = (String) o;
|
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
if (llog.length() == 0)
|
|
||||||
txtLog.setText(R.string.log_is_empty);
|
|
||||||
else
|
|
||||||
txtLog.setText(llog);
|
|
||||||
svLog.post(() -> svLog.scrollTo(0, txtLog.getHeight()));
|
|
||||||
hsvLog.post(() -> hsvLog.scrollTo(0, 0));
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
bool = (boolean) o;
|
|
||||||
if (bool)
|
|
||||||
Toast.makeText(getActivity(), targetFile.toString(), Toast.LENGTH_LONG).show();
|
|
||||||
else
|
|
||||||
Toast.makeText(getActivity(), getString(R.string.logs_save_failed), Toast.LENGTH_LONG).show();
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
bool = (boolean) o;
|
|
||||||
if (bool) {
|
|
||||||
Intent sendIntent = new Intent();
|
|
||||||
sendIntent.setAction(Intent.ACTION_SEND);
|
|
||||||
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(targetFile));
|
|
||||||
sendIntent.setType("application/html");
|
|
||||||
startActivity(Intent.createChooser(sendIntent, getResources().getString(R.string.menuSend)));
|
|
||||||
} else {
|
|
||||||
Toast.makeText(getActivity(), getString(R.string.logs_save_failed), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void read() {
|
|
||||||
exec(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clear() {
|
|
||||||
exec(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save() {
|
|
||||||
exec(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send() {
|
|
||||||
exec(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.view.MenuItemCompat;
|
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.SearchView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.adapters.ApplicationAdapter;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.CallbackHandler;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class MagiskHideFragment extends Fragment implements CallbackHandler.EventListener {
|
|
||||||
|
|
||||||
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
|
|
||||||
@BindView(R.id.recyclerView) RecyclerView recyclerView;
|
|
||||||
|
|
||||||
// Don't show in list...
|
|
||||||
public static final List<String> BLACKLIST = Arrays.asList(
|
|
||||||
"android",
|
|
||||||
"com.topjohnwu.magisk",
|
|
||||||
"com.google.android.gms",
|
|
||||||
"com.google.android.apps.walletnfcrel",
|
|
||||||
"com.nianticlabs.pokemongo"
|
|
||||||
);
|
|
||||||
public static CallbackHandler.Event packageLoadDone = new CallbackHandler.Event();
|
|
||||||
|
|
||||||
private ApplicationAdapter appAdapter;
|
|
||||||
|
|
||||||
private SearchView.OnQueryTextListener searchListener;
|
|
||||||
private String lastFilter;
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.magisk_hide_fragment, container, false);
|
|
||||||
ButterKnife.bind(this, view);
|
|
||||||
|
|
||||||
PackageManager packageManager = getActivity().getPackageManager();
|
|
||||||
|
|
||||||
mSwipeRefreshLayout.setRefreshing(true);
|
|
||||||
mSwipeRefreshLayout.setOnRefreshListener(() -> new Async.LoadApps(packageManager).exec());
|
|
||||||
|
|
||||||
appAdapter = new ApplicationAdapter(packageManager);
|
|
||||||
recyclerView.setAdapter(appAdapter);
|
|
||||||
|
|
||||||
searchListener = new SearchView.OnQueryTextListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onQueryTextSubmit(String query) {
|
|
||||||
lastFilter = query;
|
|
||||||
appAdapter.filter(query);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onQueryTextChange(String newText) {
|
|
||||||
lastFilter = newText;
|
|
||||||
appAdapter.filter(newText);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
||||||
inflater.inflate(R.menu.menu_magiskhide, menu);
|
|
||||||
SearchView search = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.app_search));
|
|
||||||
search.setOnQueryTextListener(searchListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
getActivity().setTitle(R.string.magiskhide);
|
|
||||||
CallbackHandler.register(packageLoadDone, this);
|
|
||||||
if (packageLoadDone.isTriggered) {
|
|
||||||
onTrigger(packageLoadDone);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
CallbackHandler.unRegister(packageLoadDone, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrigger(CallbackHandler.Event event) {
|
|
||||||
Logger.dev("MagiskHideFragment: UI refresh");
|
|
||||||
Async.LoadApps.Result result = (Async.LoadApps.Result) event.getResult();
|
|
||||||
appAdapter.setLists(result.listApps, result.hideList);
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
if (!TextUtils.isEmpty(lastFilter)) {
|
|
||||||
appAdapter.filter(lastFilter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.app.FragmentTransaction;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.annotation.IdRes;
|
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
import android.support.design.widget.NavigationView;
|
|
||||||
import android.support.v4.app.ActivityCompat;
|
|
||||||
import android.support.v4.view.GravityCompat;
|
|
||||||
import android.support.v4.widget.DrawerLayout;
|
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.CallbackHandler;
|
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
|
||||||
implements NavigationView.OnNavigationItemSelectedListener, CallbackHandler.EventListener {
|
|
||||||
|
|
||||||
private static final String SELECTED_ITEM_ID = "SELECTED_ITEM_ID";
|
|
||||||
|
|
||||||
public static CallbackHandler.Event recreate = new CallbackHandler.Event();
|
|
||||||
|
|
||||||
private final Handler mDrawerHandler = new Handler();
|
|
||||||
private SharedPreferences prefs;
|
|
||||||
|
|
||||||
@BindView(R.id.toolbar) Toolbar toolbar;
|
|
||||||
@BindView(R.id.drawer_layout) DrawerLayout drawer;
|
|
||||||
@BindView(R.id.nav_view) public NavigationView navigationView;
|
|
||||||
|
|
||||||
@IdRes
|
|
||||||
private int mSelectedId = R.id.status;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(final Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
|
||||||
|
|
||||||
if (Utils.isDarkTheme) {
|
|
||||||
setTheme(R.style.AppTheme_dh);
|
|
||||||
}
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
|
|
||||||
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
|
|
||||||
@Override
|
|
||||||
public void onDrawerOpened(View drawerView) {
|
|
||||||
super.onDrawerOpened(drawerView);
|
|
||||||
super.onDrawerSlide(drawerView, 0); // this disables the arrow @ completed tate
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDrawerSlide(View drawerView, float slideOffset) {
|
|
||||||
super.onDrawerSlide(drawerView, 0); // this disables the animation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
drawer.addDrawerListener(toggle);
|
|
||||||
toggle.syncState();
|
|
||||||
|
|
||||||
//noinspection ResourceType
|
|
||||||
mSelectedId = savedInstanceState == null ? mSelectedId : savedInstanceState.getInt(SELECTED_ITEM_ID);
|
|
||||||
navigationView.setCheckedItem(mSelectedId);
|
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
|
||||||
mDrawerHandler.removeCallbacksAndMessages(null);
|
|
||||||
mDrawerHandler.postDelayed(() -> navigate(mSelectedId), 250);
|
|
||||||
}
|
|
||||||
|
|
||||||
navigationView.setNavigationItemSelectedListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
CallbackHandler.register(StatusFragment.updateCheckDone, this);
|
|
||||||
CallbackHandler.register(recreate, this);
|
|
||||||
if (StatusFragment.updateCheckDone.isTriggered) {
|
|
||||||
onTrigger(StatusFragment.updateCheckDone);
|
|
||||||
}
|
|
||||||
checkHideSection();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
CallbackHandler.unRegister(StatusFragment.updateCheckDone, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
CallbackHandler.unRegister(recreate, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
|
||||||
super.onSaveInstanceState(outState);
|
|
||||||
outState.putInt(SELECTED_ITEM_ID, mSelectedId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onNavigationItemSelected(@NonNull final MenuItem menuItem) {
|
|
||||||
mSelectedId = menuItem.getItemId();
|
|
||||||
mDrawerHandler.removeCallbacksAndMessages(null);
|
|
||||||
mDrawerHandler.postDelayed(() -> navigate(menuItem.getItemId()), 250);
|
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrigger(CallbackHandler.Event event) {
|
|
||||||
if (event == StatusFragment.updateCheckDone) {
|
|
||||||
Menu menu = navigationView.getMenu();
|
|
||||||
menu.findItem(R.id.install).setVisible(StatusFragment.remoteMagiskVersion > 0 &&
|
|
||||||
Shell.rootAccess());
|
|
||||||
} else if (event == recreate) {
|
|
||||||
recreate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkHideSection() {
|
|
||||||
Menu menu = navigationView.getMenu();
|
|
||||||
menu.findItem(R.id.magiskhide).setVisible(StatusFragment.magiskVersion >= 8 &&
|
|
||||||
prefs.getBoolean("magiskhide", false) && Shell.rootAccess());
|
|
||||||
menu.findItem(R.id.modules).setVisible(StatusFragment.magiskVersion >= 4 &&
|
|
||||||
Shell.rootAccess());
|
|
||||||
menu.findItem(R.id.downloads).setVisible(StatusFragment.magiskVersion >= 4 &&
|
|
||||||
Shell.rootAccess());
|
|
||||||
menu.findItem(R.id.log).setVisible(Shell.rootAccess());
|
|
||||||
menu.findItem(R.id.install).setVisible(Shell.rootAccess());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void navigate(final int itemId) {
|
|
||||||
Fragment navFragment = null;
|
|
||||||
String tag = "";
|
|
||||||
switch (itemId) {
|
|
||||||
case R.id.status:
|
|
||||||
tag = "status";
|
|
||||||
navFragment = new StatusFragment();
|
|
||||||
break;
|
|
||||||
case R.id.install:
|
|
||||||
tag = "install";
|
|
||||||
navFragment = new InstallFragment();
|
|
||||||
break;
|
|
||||||
case R.id.modules:
|
|
||||||
tag = "modules";
|
|
||||||
navFragment = new ModulesFragment();
|
|
||||||
break;
|
|
||||||
case R.id.downloads:
|
|
||||||
tag = "downloads";
|
|
||||||
navFragment = new ReposFragment();
|
|
||||||
break;
|
|
||||||
case R.id.magiskhide:
|
|
||||||
tag = "magiskhide";
|
|
||||||
navFragment = new MagiskHideFragment();
|
|
||||||
break;
|
|
||||||
case R.id.log:
|
|
||||||
tag = "log";
|
|
||||||
navFragment = new LogFragment();
|
|
||||||
break;
|
|
||||||
case R.id.settings:
|
|
||||||
startActivity(new Intent(this, SettingsActivity.class));
|
|
||||||
break;
|
|
||||||
case R.id.app_about:
|
|
||||||
startActivity(new Intent(this, AboutActivity.class));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (navFragment != null) {
|
|
||||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
|
||||||
transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out);
|
|
||||||
try {
|
|
||||||
transaction.replace(R.id.content_frame, navFragment, tag).commit();
|
|
||||||
} catch (IllegalStateException ignored) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.github.clans.fab.FloatingActionButton;
|
|
||||||
import com.topjohnwu.magisk.adapters.ModulesAdapter;
|
|
||||||
import com.topjohnwu.magisk.module.Module;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.CallbackHandler;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.ModuleHelper;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class ModulesFragment extends Fragment implements CallbackHandler.EventListener {
|
|
||||||
|
|
||||||
public static final CallbackHandler.Event moduleLoadDone = new CallbackHandler.Event();
|
|
||||||
|
|
||||||
private static final int FETCH_ZIP_CODE = 2;
|
|
||||||
|
|
||||||
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
|
|
||||||
@BindView(R.id.recyclerView) RecyclerView recyclerView;
|
|
||||||
@BindView(R.id.empty_rv) TextView emptyTv;
|
|
||||||
@BindView(R.id.fab) FloatingActionButton fabio;
|
|
||||||
|
|
||||||
private List<Module> listModules = new ArrayList<>();
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.modules_fragment, container, false);
|
|
||||||
ButterKnife.bind(this, view);
|
|
||||||
|
|
||||||
fabio.setOnClickListener(v -> {
|
|
||||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
|
||||||
intent.setType("application/zip");
|
|
||||||
startActivityForResult(intent, FETCH_ZIP_CODE);
|
|
||||||
});
|
|
||||||
|
|
||||||
mSwipeRefreshLayout.setOnRefreshListener(() -> {
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
|
||||||
new Async.LoadModules().exec();
|
|
||||||
});
|
|
||||||
|
|
||||||
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
||||||
@Override
|
|
||||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
|
||||||
mSwipeRefreshLayout.setEnabled(recyclerView.getChildAt(0).getTop() >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
|
||||||
super.onScrollStateChanged(recyclerView, newState);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (moduleLoadDone.isTriggered) {
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrigger(CallbackHandler.Event event) {
|
|
||||||
Logger.dev("ModulesFragment: UI refresh triggered");
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
if (requestCode == FETCH_ZIP_CODE && resultCode == Activity.RESULT_OK && data != null) {
|
|
||||||
// Get the URI of the selected file
|
|
||||||
final Uri uri = data.getData();
|
|
||||||
new Async.FlashZIP(getActivity(), uri).exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
CallbackHandler.register(moduleLoadDone, this);
|
|
||||||
getActivity().setTitle(R.string.modules);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
CallbackHandler.unRegister(moduleLoadDone, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateUI() {
|
|
||||||
ModuleHelper.getModuleList(listModules);
|
|
||||||
if (listModules.size() == 0) {
|
|
||||||
emptyTv.setVisibility(View.VISIBLE);
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
emptyTv.setVisibility(View.GONE);
|
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
|
||||||
recyclerView.setAdapter(new ModulesAdapter(listModules));
|
|
||||||
}
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,193 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.view.MenuItemCompat;
|
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.SearchView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.adapters.ReposAdapter;
|
|
||||||
import com.topjohnwu.magisk.adapters.SimpleSectionedRecyclerViewAdapter;
|
|
||||||
import com.topjohnwu.magisk.module.Repo;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.CallbackHandler;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.ModuleHelper;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class ReposFragment extends Fragment implements CallbackHandler.EventListener {
|
|
||||||
|
|
||||||
public static final CallbackHandler.Event repoLoadDone = new CallbackHandler.Event();
|
|
||||||
|
|
||||||
@BindView(R.id.recyclerView) RecyclerView recyclerView;
|
|
||||||
@BindView(R.id.empty_rv) TextView emptyTv;
|
|
||||||
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
|
|
||||||
|
|
||||||
private List<Repo> mUpdateRepos = new ArrayList<>();
|
|
||||||
private List<Repo> mInstalledRepos = new ArrayList<>();
|
|
||||||
private List<Repo> mOthersRepos = new ArrayList<>();
|
|
||||||
private List<Repo> fUpdateRepos = new ArrayList<>();
|
|
||||||
private List<Repo> fInstalledRepos = new ArrayList<>();
|
|
||||||
private List<Repo> fOthersRepos = new ArrayList<>();
|
|
||||||
|
|
||||||
private SimpleSectionedRecyclerViewAdapter mSectionedAdapter;
|
|
||||||
|
|
||||||
private SearchView.OnQueryTextListener searchListener;
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.repos_fragment, container, false);
|
|
||||||
|
|
||||||
ButterKnife.bind(this, view);
|
|
||||||
|
|
||||||
mSectionedAdapter = new
|
|
||||||
SimpleSectionedRecyclerViewAdapter(getActivity(), R.layout.section,
|
|
||||||
R.id.section_text, new ReposAdapter(fUpdateRepos, fInstalledRepos, fOthersRepos));
|
|
||||||
|
|
||||||
recyclerView.setAdapter(mSectionedAdapter);
|
|
||||||
|
|
||||||
mSwipeRefreshLayout.setRefreshing(true);
|
|
||||||
|
|
||||||
mSwipeRefreshLayout.setOnRefreshListener(() -> {
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
|
||||||
new Async.LoadRepos(getActivity()).exec();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (repoLoadDone.isTriggered) {
|
|
||||||
reloadRepos();
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
searchListener = new SearchView.OnQueryTextListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onQueryTextSubmit(String query) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onQueryTextChange(String newText) {
|
|
||||||
new FilterApps().exec(newText);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrigger(CallbackHandler.Event event) {
|
|
||||||
Logger.dev("ReposFragment: UI refresh triggered");
|
|
||||||
reloadRepos();
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
||||||
inflater.inflate(R.menu.menu_repo, menu);
|
|
||||||
SearchView search = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.repo_search));
|
|
||||||
search.setOnQueryTextListener(searchListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
CallbackHandler.register(repoLoadDone, this);
|
|
||||||
getActivity().setTitle(R.string.downloads);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
CallbackHandler.unRegister(repoLoadDone, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void reloadRepos() {
|
|
||||||
ModuleHelper.getRepoLists(mUpdateRepos, mInstalledRepos, mOthersRepos);
|
|
||||||
fUpdateRepos.clear();
|
|
||||||
fInstalledRepos.clear();
|
|
||||||
fOthersRepos.clear();
|
|
||||||
fUpdateRepos.addAll(mUpdateRepos);
|
|
||||||
fInstalledRepos.addAll(mInstalledRepos);
|
|
||||||
fOthersRepos.addAll(mOthersRepos);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateUI() {
|
|
||||||
if (fUpdateRepos.size() + fInstalledRepos.size() + fOthersRepos.size() == 0) {
|
|
||||||
emptyTv.setVisibility(View.VISIBLE);
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
List<SimpleSectionedRecyclerViewAdapter.Section> sections = new ArrayList<>();
|
|
||||||
if (!fUpdateRepos.isEmpty()) {
|
|
||||||
sections.add(new SimpleSectionedRecyclerViewAdapter.Section(0, getString(R.string.update_available)));
|
|
||||||
}
|
|
||||||
if (!fInstalledRepos.isEmpty()) {
|
|
||||||
sections.add(new SimpleSectionedRecyclerViewAdapter.Section(fUpdateRepos.size(), getString(R.string.installed)));
|
|
||||||
}
|
|
||||||
if (!fOthersRepos.isEmpty()) {
|
|
||||||
sections.add(new SimpleSectionedRecyclerViewAdapter.Section(fUpdateRepos.size() + fInstalledRepos.size(), getString(R.string.not_installed)));
|
|
||||||
}
|
|
||||||
SimpleSectionedRecyclerViewAdapter.Section[] array = sections.toArray(new SimpleSectionedRecyclerViewAdapter.Section[sections.size()]);
|
|
||||||
mSectionedAdapter.setSections(array);
|
|
||||||
emptyTv.setVisibility(View.GONE);
|
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class FilterApps extends Async.NormalTask<String, Void, Void> {
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(String... strings) {
|
|
||||||
String newText = strings[0];
|
|
||||||
fUpdateRepos.clear();
|
|
||||||
fInstalledRepos.clear();
|
|
||||||
fOthersRepos.clear();
|
|
||||||
for (Repo repo: mUpdateRepos) {
|
|
||||||
if (repo.getName().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
|| repo.getAuthor().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
|| repo.getDescription().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
) {
|
|
||||||
fUpdateRepos.add(repo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Repo repo: mInstalledRepos) {
|
|
||||||
if (repo.getName().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
|| repo.getAuthor().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
|| repo.getDescription().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
) {
|
|
||||||
fInstalledRepos.add(repo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Repo repo: mOthersRepos) {
|
|
||||||
if (repo.getName().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
|| repo.getAuthor().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
|| repo.getDescription().toLowerCase().contains(newText.toLowerCase())
|
|
||||||
) {
|
|
||||||
fOthersRepos.add(repo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void v) {
|
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.PreferenceFragment;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.ModuleHelper;
|
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class SettingsActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
@BindView(R.id.toolbar) Toolbar toolbar;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
String theme = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("theme", "");
|
|
||||||
Logger.dev("AboutActivity: Theme is " + theme);
|
|
||||||
if (Utils.isDarkTheme) {
|
|
||||||
setTheme(R.style.AppTheme_dh);
|
|
||||||
}
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_container);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
toolbar.setNavigationOnClickListener(view -> finish());
|
|
||||||
|
|
||||||
ActionBar ab = getSupportActionBar();
|
|
||||||
if (ab != null) {
|
|
||||||
ab.setTitle(R.string.settings);
|
|
||||||
ab.setDisplayHomeAsUpEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
setFloating();
|
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
|
||||||
getFragmentManager().beginTransaction().add(R.id.container, new SettingsFragment()).commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFloating() {
|
|
||||||
boolean isTablet = getResources().getBoolean(R.bool.isTablet);
|
|
||||||
if (isTablet) {
|
|
||||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
|
||||||
params.height = getResources().getDimensionPixelSize(R.dimen.floating_height);
|
|
||||||
params.width = getResources().getDimensionPixelSize(R.dimen.floating_width);
|
|
||||||
params.alpha = 1.0f;
|
|
||||||
params.dimAmount = 0.6f;
|
|
||||||
params.flags |= 2;
|
|
||||||
getWindow().setAttributes(params);
|
|
||||||
setFinishOnTouchOutside(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SettingsFragment extends PreferenceFragment
|
|
||||||
implements SharedPreferences.OnSharedPreferenceChangeListener {
|
|
||||||
|
|
||||||
private ListPreference themePreference;
|
|
||||||
private SharedPreferences prefs;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.app_settings);
|
|
||||||
PreferenceManager.setDefaultValues(getActivity(), R.xml.app_settings, false);
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
|
||||||
|
|
||||||
themePreference = (ListPreference) findPreference("theme");
|
|
||||||
CheckBoxPreference busyboxPreference = (CheckBoxPreference) findPreference("busybox");
|
|
||||||
CheckBoxPreference magiskhidePreference = (CheckBoxPreference) findPreference("magiskhide");
|
|
||||||
CheckBoxPreference hostsPreference = (CheckBoxPreference) findPreference("hosts");
|
|
||||||
Preference clear = findPreference("clear");
|
|
||||||
|
|
||||||
clear.setOnPreferenceClickListener((pref) -> {
|
|
||||||
SharedPreferences repoMap = getActivity().getSharedPreferences(ModuleHelper.FILE_KEY, Context.MODE_PRIVATE);
|
|
||||||
repoMap.edit()
|
|
||||||
.putString(ModuleHelper.ETAG_KEY, "")
|
|
||||||
.putInt(ModuleHelper.VERSION_KEY, 0)
|
|
||||||
.apply();
|
|
||||||
new Async.LoadRepos(getActivity()).exec();
|
|
||||||
Toast.makeText(getActivity(), R.string.repo_cache_cleared, Toast.LENGTH_LONG).show();
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (Utils.isDarkTheme) {
|
|
||||||
themePreference.setSummary(R.string.theme_dark);
|
|
||||||
} else {
|
|
||||||
themePreference.setSummary(R.string.theme_default);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StatusFragment.magiskVersion < 9) {
|
|
||||||
hostsPreference.setEnabled(false);
|
|
||||||
busyboxPreference.setEnabled(false);
|
|
||||||
} else if (StatusFragment.magiskVersion < 8) {
|
|
||||||
magiskhidePreference.setEnabled(false);
|
|
||||||
} else if (! Shell.rootAccess()) {
|
|
||||||
busyboxPreference.setEnabled(false);
|
|
||||||
magiskhidePreference.setEnabled(false);
|
|
||||||
hostsPreference.setEnabled(false);
|
|
||||||
} else {
|
|
||||||
busyboxPreference.setEnabled(true);
|
|
||||||
magiskhidePreference.setEnabled(true);
|
|
||||||
hostsPreference.setEnabled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
prefs.unregisterOnSharedPreferenceChangeListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
|
|
||||||
Logger.dev("Settings: Prefs change " + key);
|
|
||||||
boolean checked;
|
|
||||||
|
|
||||||
switch (key) {
|
|
||||||
case "theme":
|
|
||||||
String theme = prefs.getString("theme", getString(R.string.theme_default_value));
|
|
||||||
if (Utils.isDarkTheme != theme.equalsIgnoreCase(getString(R.string.theme_dark_value))) {
|
|
||||||
Utils.isDarkTheme = !Utils.isDarkTheme;
|
|
||||||
getActivity().recreate();
|
|
||||||
MainActivity.recreate.trigger();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "magiskhide":
|
|
||||||
checked = prefs.getBoolean("magiskhide", false);
|
|
||||||
new Async.RootTask<Void, Void, Void>() {
|
|
||||||
private boolean enable = checked;
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params) {
|
|
||||||
if (enable) {
|
|
||||||
Utils.createFile("/magisk/.core/magiskhide/enable");
|
|
||||||
} else {
|
|
||||||
Utils.removeItem("/magisk/.core/magiskhide/enable");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
Toast.makeText(getActivity(), R.string.settings_reboot_toast, Toast.LENGTH_LONG).show();
|
|
||||||
break;
|
|
||||||
case "busybox":
|
|
||||||
checked = prefs.getBoolean("busybox", false);
|
|
||||||
new Async.RootTask<Void, Void, Void>() {
|
|
||||||
private boolean enable = checked;
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params) {
|
|
||||||
if (enable) {
|
|
||||||
Utils.createFile("/magisk/.core/busybox/enable");
|
|
||||||
} else {
|
|
||||||
Utils.removeItem("/magisk/.core/busybox/enable");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
Toast.makeText(getActivity(), R.string.settings_reboot_toast, Toast.LENGTH_LONG).show();
|
|
||||||
break;
|
|
||||||
case "hosts":
|
|
||||||
checked = prefs.getBoolean("hosts", false);
|
|
||||||
new Async.RootTask<Void, Void, Void>() {
|
|
||||||
private boolean enable = checked;
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... voids) {
|
|
||||||
if (enable) {
|
|
||||||
Shell.su("cp -af /system/etc/hosts /magisk/.core/hosts",
|
|
||||||
"mount -o bind /magisk/.core/hosts /system/etc/hosts");
|
|
||||||
} else {
|
|
||||||
Shell.su("umount -l /system/etc/hosts",
|
|
||||||
"rm -f /magisk/.core/hosts");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
break;
|
|
||||||
case "developer_logging":
|
|
||||||
Logger.devLog = prefs.getBoolean("developer_logging", false);
|
|
||||||
break;
|
|
||||||
case "shell_logging":
|
|
||||||
Logger.logShell = prefs.getBoolean("shell_logging", false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
public class SplashActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplication());
|
|
||||||
|
|
||||||
String theme = prefs.getString("theme", getString(R.string.theme_default_value));
|
|
||||||
Utils.isDarkTheme = theme.equalsIgnoreCase(getString(R.string.theme_dark_value));
|
|
||||||
|
|
||||||
if (Utils.isDarkTheme) {
|
|
||||||
setTheme(R.style.AppTheme_dh);
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.devLog = prefs.getBoolean("developer_logging", false);
|
|
||||||
Logger.logShell = prefs.getBoolean("shell_logging", false);
|
|
||||||
|
|
||||||
// Initialize prefs
|
|
||||||
prefs.edit()
|
|
||||||
.putBoolean("magiskhide", Utils.itemExist(false, "/magisk/.core/magiskhide/enable"))
|
|
||||||
.putBoolean("busybox", Utils.commandExists("busybox"))
|
|
||||||
.putBoolean("hosts", Utils.itemExist(false, "/magisk/.core/hosts"))
|
|
||||||
.apply();
|
|
||||||
|
|
||||||
// Start all async tasks
|
|
||||||
new Async.GetBootBlocks().exec();
|
|
||||||
new Async.CheckUpdates().exec();
|
|
||||||
new Async.LoadModules() {
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void v) {
|
|
||||||
super.onPostExecute(v);
|
|
||||||
new Async.LoadRepos(getApplicationContext()).exec();
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
new Async.LoadApps(getPackageManager()).exec();
|
|
||||||
|
|
||||||
// Start main activity
|
|
||||||
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,306 +0,0 @@
|
|||||||
package com.topjohnwu.magisk;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.app.FragmentTransaction;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.CallbackHandler;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindColor;
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class StatusFragment extends Fragment implements CallbackHandler.EventListener {
|
|
||||||
|
|
||||||
public static double magiskVersion, remoteMagiskVersion = -1;
|
|
||||||
public static String magiskVersionString = "(none)", magiskLink, releaseNoteLink;
|
|
||||||
public static int SNCheckResult = -1;
|
|
||||||
|
|
||||||
private static boolean noDialog = false;
|
|
||||||
|
|
||||||
public static final CallbackHandler.Event updateCheckDone = new CallbackHandler.Event();
|
|
||||||
public static final CallbackHandler.Event safetyNetDone = new CallbackHandler.Event();
|
|
||||||
|
|
||||||
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
|
|
||||||
|
|
||||||
@BindView(R.id.magisk_status_container) View magiskStatusContainer;
|
|
||||||
@BindView(R.id.magisk_status_icon) ImageView magiskStatusIcon;
|
|
||||||
@BindView(R.id.magisk_version) TextView magiskVersionText;
|
|
||||||
@BindView(R.id.magisk_update_status) TextView magiskUpdateText;
|
|
||||||
@BindView(R.id.magisk_check_updates_progress) ProgressBar magiskCheckUpdatesProgress;
|
|
||||||
|
|
||||||
@BindView(R.id.root_status_container) View rootStatusContainer;
|
|
||||||
@BindView(R.id.root_status_icon) ImageView rootStatusIcon;
|
|
||||||
@BindView(R.id.root_status) TextView rootStatusText;
|
|
||||||
@BindView(R.id.root_info) TextView rootInfoText;
|
|
||||||
|
|
||||||
@BindView(R.id.safetyNet_container) View safetyNetContainer;
|
|
||||||
@BindView(R.id.safetyNet_icon) ImageView safetyNetIcon;
|
|
||||||
@BindView(R.id.safetyNet_status) TextView safetyNetStatusText;
|
|
||||||
@BindView(R.id.safetyNet_check_progress) ProgressBar safetyNetProgress;
|
|
||||||
|
|
||||||
@BindColor(R.color.red500) int colorBad;
|
|
||||||
@BindColor(R.color.green500) int colorOK;
|
|
||||||
@BindColor(R.color.yellow500) int colorWarn;
|
|
||||||
@BindColor(R.color.grey500) int colorNeutral;
|
|
||||||
@BindColor(R.color.blue500) int colorInfo;
|
|
||||||
@BindColor(android.R.color.transparent) int trans;
|
|
||||||
int defaultColor;
|
|
||||||
|
|
||||||
static {
|
|
||||||
checkMagiskInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private AlertDialog updateMagisk;
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
||||||
View v = inflater.inflate(R.layout.status_fragment, container, false);
|
|
||||||
ButterKnife.bind(this, v);
|
|
||||||
|
|
||||||
defaultColor = magiskUpdateText.getCurrentTextColor();
|
|
||||||
|
|
||||||
mSwipeRefreshLayout.setOnRefreshListener(() -> {
|
|
||||||
magiskStatusContainer.setBackgroundColor(trans);
|
|
||||||
magiskStatusIcon.setImageResource(0);
|
|
||||||
magiskUpdateText.setText(R.string.checking_for_updates);
|
|
||||||
magiskCheckUpdatesProgress.setVisibility(View.VISIBLE);
|
|
||||||
magiskUpdateText.setTextColor(defaultColor);
|
|
||||||
|
|
||||||
safetyNetProgress.setVisibility(View.GONE);
|
|
||||||
safetyNetContainer.setBackgroundColor(colorNeutral);
|
|
||||||
safetyNetIcon.setImageResource(R.drawable.ic_safetynet);
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_check_text);
|
|
||||||
safetyNetStatusText.setTextColor(defaultColor);
|
|
||||||
|
|
||||||
safetyNetDone.isTriggered = false;
|
|
||||||
noDialog = false;
|
|
||||||
|
|
||||||
updateUI();
|
|
||||||
new Async.CheckUpdates().exec();
|
|
||||||
});
|
|
||||||
|
|
||||||
safetyNetContainer.setOnClickListener(view -> {
|
|
||||||
safetyNetProgress.setVisibility(View.VISIBLE);
|
|
||||||
safetyNetContainer.setBackgroundColor(trans);
|
|
||||||
safetyNetIcon.setImageResource(0);
|
|
||||||
safetyNetStatusText.setText(R.string.checking_safetyNet_status);
|
|
||||||
Async.checkSafetyNet(getActivity());
|
|
||||||
});
|
|
||||||
|
|
||||||
if (magiskVersion < 0 && Shell.rootAccess() && !noDialog) {
|
|
||||||
noDialog = true;
|
|
||||||
Utils.getAlertDialogBuilder(getActivity())
|
|
||||||
.setTitle(R.string.no_magisk_title)
|
|
||||||
.setMessage(R.string.no_magisk_msg)
|
|
||||||
.setCancelable(true)
|
|
||||||
.setPositiveButton(R.string.goto_install, (dialogInterface, i) -> {
|
|
||||||
((MainActivity) getActivity()).navigationView.setCheckedItem(R.id.install);
|
|
||||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
|
||||||
transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out);
|
|
||||||
try {
|
|
||||||
transaction.replace(R.id.content_frame, new InstallFragment(), "install").commit();
|
|
||||||
} catch (IllegalStateException ignored) {}
|
|
||||||
})
|
|
||||||
.setNegativeButton(R.string.no_thanks, null)
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateUI();
|
|
||||||
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrigger(CallbackHandler.Event event) {
|
|
||||||
if (event == updateCheckDone) {
|
|
||||||
Logger.dev("StatusFragment: Update Check UI refresh triggered");
|
|
||||||
updateCheckUI();
|
|
||||||
} else if (event == safetyNetDone) {
|
|
||||||
Logger.dev("StatusFragment: SafetyNet UI refresh triggered");
|
|
||||||
updateSafetyNetUI();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
CallbackHandler.register(updateCheckDone, this);
|
|
||||||
CallbackHandler.register(safetyNetDone, this);
|
|
||||||
if (updateCheckDone.isTriggered) {
|
|
||||||
updateCheckUI();
|
|
||||||
}
|
|
||||||
if (safetyNetDone.isTriggered) {
|
|
||||||
updateSafetyNetUI();
|
|
||||||
}
|
|
||||||
getActivity().setTitle(R.string.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
CallbackHandler.unRegister(updateCheckDone, this);
|
|
||||||
CallbackHandler.unRegister(safetyNetDone, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkMagiskInfo() {
|
|
||||||
List<String> ret = Shell.sh("getprop magisk.version");
|
|
||||||
if (ret.get(0).length() == 0) {
|
|
||||||
magiskVersion = -1;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
magiskVersionString = ret.get(0);
|
|
||||||
magiskVersion = Double.parseDouble(ret.get(0));
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
// Custom version don't need to receive updates
|
|
||||||
magiskVersion = Double.POSITIVE_INFINITY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateUI() {
|
|
||||||
int image, color;
|
|
||||||
|
|
||||||
checkMagiskInfo();
|
|
||||||
|
|
||||||
if (magiskVersion < 0) {
|
|
||||||
magiskVersionText.setText(R.string.magisk_version_error);
|
|
||||||
} else {
|
|
||||||
magiskVersionText.setText(getString(R.string.magisk_version, magiskVersionString));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Shell.rootStatus == 1) {
|
|
||||||
color = colorOK;
|
|
||||||
image = R.drawable.ic_check_circle;
|
|
||||||
rootStatusText.setText(R.string.proper_root);
|
|
||||||
rootInfoText.setText(Shell.sh("su -v").get(0));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
rootInfoText.setText(R.string.root_info_warning);
|
|
||||||
if (Shell.rootStatus == 0) {
|
|
||||||
color = colorBad;
|
|
||||||
image = R.drawable.ic_cancel;
|
|
||||||
rootStatusText.setText(R.string.not_rooted);
|
|
||||||
} else {
|
|
||||||
color = colorNeutral;
|
|
||||||
image = R.drawable.ic_help;
|
|
||||||
rootStatusText.setText(R.string.root_error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rootStatusContainer.setBackgroundColor(color);
|
|
||||||
rootStatusText.setTextColor(color);
|
|
||||||
rootInfoText.setTextColor(color);
|
|
||||||
rootStatusIcon.setImageResource(image);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateCheckUI() {
|
|
||||||
int image, color;
|
|
||||||
|
|
||||||
if (remoteMagiskVersion < 0) {
|
|
||||||
color = colorNeutral;
|
|
||||||
image = R.drawable.ic_help;
|
|
||||||
magiskUpdateText.setText(R.string.cannot_check_updates);
|
|
||||||
} else if (remoteMagiskVersion > magiskVersion) {
|
|
||||||
color = colorInfo;
|
|
||||||
image = R.drawable.ic_update;
|
|
||||||
magiskUpdateText.setText(getString(R.string.magisk_update_available, remoteMagiskVersion));
|
|
||||||
} else {
|
|
||||||
color = colorOK;
|
|
||||||
image = R.drawable.ic_check_circle;
|
|
||||||
magiskUpdateText.setText(getString(R.string.up_to_date, getString(R.string.magisk)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (magiskVersion < 0) {
|
|
||||||
color = colorBad;
|
|
||||||
image = R.drawable.ic_cancel;
|
|
||||||
}
|
|
||||||
magiskStatusContainer.setBackgroundColor(color);
|
|
||||||
magiskVersionText.setTextColor(color);
|
|
||||||
magiskUpdateText.setTextColor(color);
|
|
||||||
magiskStatusIcon.setImageResource(image);
|
|
||||||
|
|
||||||
magiskCheckUpdatesProgress.setVisibility(View.GONE);
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
|
|
||||||
updateMagisk = Utils.getAlertDialogBuilder(getActivity())
|
|
||||||
.setTitle(R.string.magisk_update_title)
|
|
||||||
.setMessage(getString(R.string.magisk_update_message, remoteMagiskVersion))
|
|
||||||
.setCancelable(true)
|
|
||||||
.setPositiveButton(R.string.goto_install, (dialogInterface, i) -> {
|
|
||||||
((MainActivity) getActivity()).navigationView.setCheckedItem(R.id.install);
|
|
||||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
|
||||||
transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out);
|
|
||||||
try {
|
|
||||||
transaction.replace(R.id.content_frame, new InstallFragment(), "install").commit();
|
|
||||||
} catch (IllegalStateException ignored) {}
|
|
||||||
})
|
|
||||||
.setNeutralButton(R.string.check_release_notes, (dialog, which) -> {
|
|
||||||
getActivity().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(releaseNoteLink)));
|
|
||||||
})
|
|
||||||
.setNegativeButton(R.string.no_thanks, null)
|
|
||||||
.create();
|
|
||||||
|
|
||||||
if (magiskVersion < remoteMagiskVersion && Shell.rootAccess()) {
|
|
||||||
magiskStatusContainer.setOnClickListener(view -> updateMagisk.show());
|
|
||||||
if (!noDialog) {
|
|
||||||
noDialog = true;
|
|
||||||
updateMagisk.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateSafetyNetUI() {
|
|
||||||
int image, color;
|
|
||||||
safetyNetProgress.setVisibility(View.GONE);
|
|
||||||
switch (SNCheckResult) {
|
|
||||||
case -3:
|
|
||||||
color = colorNeutral;
|
|
||||||
image = R.drawable.ic_help;
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_connection_suspended);
|
|
||||||
break;
|
|
||||||
case -2:
|
|
||||||
color = colorNeutral;
|
|
||||||
image = R.drawable.ic_help;
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_connection_failed);
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
color = colorNeutral;
|
|
||||||
image = R.drawable.ic_help;
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_error);
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
color = colorBad;
|
|
||||||
image = R.drawable.ic_cancel;
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_fail);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
default:
|
|
||||||
color = colorOK;
|
|
||||||
image = R.drawable.ic_check_circle;
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_pass);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
safetyNetContainer.setBackgroundColor(color);
|
|
||||||
safetyNetStatusText.setTextColor(color);
|
|
||||||
safetyNetIcon.setImageResource(image);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.adapters;
|
|
||||||
|
|
||||||
import android.content.pm.ApplicationInfo;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.Filter;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class ApplicationAdapter extends RecyclerView.Adapter<ApplicationAdapter.ViewHolder> {
|
|
||||||
|
|
||||||
private List<ApplicationInfo> mOriginalList, mList;
|
|
||||||
private List<String> mHideList;
|
|
||||||
private PackageManager packageManager;
|
|
||||||
private ApplicationFilter filter;
|
|
||||||
|
|
||||||
public ApplicationAdapter(PackageManager packageManager) {
|
|
||||||
mOriginalList = mList = Collections.emptyList();
|
|
||||||
mHideList = Collections.emptyList();
|
|
||||||
this.packageManager = packageManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLists(List<ApplicationInfo> listApps, List<String> hideList) {
|
|
||||||
mOriginalList = mList = Collections.unmodifiableList(listApps);
|
|
||||||
mHideList = new ArrayList<>(hideList);
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_app, parent, false);
|
|
||||||
ButterKnife.bind(this, mView);
|
|
||||||
return new ViewHolder(mView);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
|
||||||
ApplicationInfo info = mList.get(position);
|
|
||||||
|
|
||||||
holder.appIcon.setImageDrawable(info.loadIcon(packageManager));
|
|
||||||
holder.appName.setText(info.loadLabel(packageManager));
|
|
||||||
holder.appPackage.setText(info.packageName);
|
|
||||||
|
|
||||||
holder.checkBox.setOnCheckedChangeListener(null);
|
|
||||||
holder.checkBox.setChecked(mHideList.contains(info.packageName));
|
|
||||||
holder.checkBox.setOnCheckedChangeListener((v, isChecked) -> {
|
|
||||||
if (isChecked) {
|
|
||||||
new Async.MagiskHide().add(info.packageName);
|
|
||||||
mHideList.add(info.packageName);
|
|
||||||
} else {
|
|
||||||
new Async.MagiskHide().rm(info.packageName);
|
|
||||||
mHideList.remove(info.packageName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mList.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void filter(String constraint) {
|
|
||||||
if (filter == null) {
|
|
||||||
filter = new ApplicationFilter();
|
|
||||||
}
|
|
||||||
filter.filter(constraint);
|
|
||||||
}
|
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
@BindView(R.id.app_icon) ImageView appIcon;
|
|
||||||
@BindView(R.id.app_name) TextView appName;
|
|
||||||
@BindView(R.id.app_package) TextView appPackage;
|
|
||||||
@BindView(R.id.checkbox) CheckBox checkBox;
|
|
||||||
|
|
||||||
ViewHolder(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
ButterKnife.bind(this, itemView);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ApplicationFilter extends Filter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected FilterResults performFiltering(CharSequence constraint) {
|
|
||||||
List<ApplicationInfo> filteredApps;
|
|
||||||
if (constraint == null || constraint.length() == 0) {
|
|
||||||
filteredApps = mOriginalList;
|
|
||||||
} else {
|
|
||||||
filteredApps = new ArrayList<>();
|
|
||||||
String filter = constraint.toString().toLowerCase();
|
|
||||||
for (ApplicationInfo info : mOriginalList) {
|
|
||||||
if (Utils.lowercaseContains(info.loadLabel(packageManager), filter)
|
|
||||||
|| Utils.lowercaseContains(info.packageName, filter)) {
|
|
||||||
filteredApps.add(info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FilterResults results = new FilterResults();
|
|
||||||
results.values = filteredApps;
|
|
||||||
results.count = filteredApps.size();
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
|
||||||
mList = (List<ApplicationInfo>) results.values;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.adapters;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.design.widget.Snackbar;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.module.Module;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHolder> {
|
|
||||||
|
|
||||||
private final List<Module> mList;
|
|
||||||
|
|
||||||
public ModulesAdapter(List<Module> list) {
|
|
||||||
mList = list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_module, parent, false);
|
|
||||||
ButterKnife.bind(this, view);
|
|
||||||
return new ViewHolder(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
|
||||||
Context context = holder.itemView.getContext();
|
|
||||||
final Module module = mList.get(position);
|
|
||||||
|
|
||||||
holder.title.setText(module.getName());
|
|
||||||
holder.versionName.setText(module.getVersion());
|
|
||||||
String author = module.getAuthor();
|
|
||||||
holder.author.setText(TextUtils.isEmpty(author) ? null : context.getString(R.string.author, author));
|
|
||||||
holder.description.setText(module.getDescription());
|
|
||||||
|
|
||||||
holder.checkBox.setOnCheckedChangeListener(null);
|
|
||||||
holder.checkBox.setChecked(module.isEnabled());
|
|
||||||
holder.checkBox.setOnCheckedChangeListener((v, isChecked) -> new Async.RootTask<Void, Void, Void>() {
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... voids) {
|
|
||||||
if (isChecked) {
|
|
||||||
module.removeDisableFile();
|
|
||||||
} else {
|
|
||||||
module.createDisableFile();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void v) {
|
|
||||||
int title = isChecked ? R.string.disable_file_removed : R.string.disable_file_created;
|
|
||||||
Snackbar.make(holder.title, title, Snackbar.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}.exec());
|
|
||||||
|
|
||||||
holder.delete.setOnClickListener(v -> new Async.RootTask<Void, Void, Void>() {
|
|
||||||
private final boolean removed = module.willBeRemoved();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... voids) {
|
|
||||||
if (removed) {
|
|
||||||
module.deleteRemoveFile();
|
|
||||||
} else {
|
|
||||||
module.createRemoveFile();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void v) {
|
|
||||||
int title = removed ? R.string.remove_file_deleted : R.string.remove_file_created;
|
|
||||||
Snackbar.make(holder.title, title, Snackbar.LENGTH_SHORT).show();
|
|
||||||
updateDeleteButton(holder, module);
|
|
||||||
}
|
|
||||||
}.exec());
|
|
||||||
|
|
||||||
if (module.isUpdated()) {
|
|
||||||
holder.notice.setVisibility(View.VISIBLE);
|
|
||||||
holder.notice.setText(R.string.update_file_created);
|
|
||||||
holder.delete.setEnabled(false);
|
|
||||||
} else {
|
|
||||||
updateDeleteButton(holder, module);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDeleteButton(ViewHolder holder, Module module) {
|
|
||||||
holder.notice.setVisibility(module.willBeRemoved() ? View.VISIBLE : View.GONE);
|
|
||||||
|
|
||||||
if (module.willBeRemoved()) {
|
|
||||||
holder.delete.setImageResource(R.drawable.ic_undelete);
|
|
||||||
} else {
|
|
||||||
holder.delete.setImageResource(R.drawable.ic_delete);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mList.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
@BindView(R.id.title) TextView title;
|
|
||||||
@BindView(R.id.version_name) TextView versionName;
|
|
||||||
@BindView(R.id.description) TextView description;
|
|
||||||
@BindView(R.id.notice) TextView notice;
|
|
||||||
@BindView(R.id.checkbox) CheckBox checkBox;
|
|
||||||
@BindView(R.id.author) TextView author;
|
|
||||||
@BindView(R.id.delete) ImageView delete;
|
|
||||||
|
|
||||||
ViewHolder(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
ButterKnife.bind(this, itemView);
|
|
||||||
|
|
||||||
if (!Shell.rootAccess()) {
|
|
||||||
checkBox.setEnabled(false);
|
|
||||||
delete.setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.adapters;
|
|
||||||
|
|
||||||
import android.animation.Animator;
|
|
||||||
import android.animation.ObjectAnimator;
|
|
||||||
import android.animation.ValueAnimator;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.ViewTreeObserver;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.module.Repo;
|
|
||||||
import com.topjohnwu.magisk.receivers.RepoDlReceiver;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
import com.topjohnwu.magisk.utils.WebWindow;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
|
|
||||||
public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder> {
|
|
||||||
|
|
||||||
private List<Repo> mUpdateRepos, mInstalledRepos, mOthersRepos;
|
|
||||||
private HashSet<Repo> expandList = new HashSet<>();
|
|
||||||
|
|
||||||
public ReposAdapter(List<Repo> update, List<Repo> installed, List<Repo> others) {
|
|
||||||
mUpdateRepos = update;
|
|
||||||
mInstalledRepos = installed;
|
|
||||||
mOthersRepos = others;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_repo, parent, false);
|
|
||||||
ButterKnife.bind(this, v);
|
|
||||||
return new ViewHolder(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
|
||||||
Context context = holder.itemView.getContext();
|
|
||||||
Repo repo = getItem(position);
|
|
||||||
|
|
||||||
holder.title.setText(repo.getName());
|
|
||||||
holder.versionName.setText(repo.getVersion());
|
|
||||||
String author = repo.getAuthor();
|
|
||||||
holder.author.setText(TextUtils.isEmpty(author) ? null : context.getString(R.string.author, author));
|
|
||||||
holder.description.setText(repo.getDescription());
|
|
||||||
|
|
||||||
holder.setExpanded(expandList.contains(repo));
|
|
||||||
|
|
||||||
holder.itemView.setOnClickListener(view -> {
|
|
||||||
if (holder.mExpanded) {
|
|
||||||
holder.collapse();
|
|
||||||
expandList.remove(repo);
|
|
||||||
} else {
|
|
||||||
holder.expand();
|
|
||||||
expandList.add(repo);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
holder.changeLog.setOnClickListener(view -> {
|
|
||||||
if (!TextUtils.isEmpty(repo.getLogUrl())) {
|
|
||||||
new WebWindow(context.getString(R.string.changelog), repo.getLogUrl(), context);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
holder.updateImage.setOnClickListener(view -> {
|
|
||||||
String filename = repo.getName() + "-" + repo.getVersion() + ".zip";
|
|
||||||
Utils.getAlertDialogBuilder(context)
|
|
||||||
.setTitle(context.getString(R.string.repo_install_title, repo.getName()))
|
|
||||||
.setMessage(context.getString(R.string.repo_install_msg, filename))
|
|
||||||
.setCancelable(true)
|
|
||||||
.setPositiveButton(R.string.download_install, (dialogInterface, i) -> Utils.dlAndReceive(
|
|
||||||
context,
|
|
||||||
new RepoDlReceiver(),
|
|
||||||
repo.getZipUrl(),
|
|
||||||
Utils.getLegalFilename(filename)))
|
|
||||||
.setNegativeButton(R.string.no_thanks, null)
|
|
||||||
.show();
|
|
||||||
});
|
|
||||||
holder.authorLink.setOnClickListener(view -> {
|
|
||||||
if (!TextUtils.isEmpty(repo.getDonateUrl())) {
|
|
||||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(repo.getDonateUrl())));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
holder.supportLink.setOnClickListener(view -> {
|
|
||||||
if (!TextUtils.isEmpty(repo.getSupportUrl())) {
|
|
||||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(repo.getSupportUrl())));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mUpdateRepos.size() + mInstalledRepos.size() + mOthersRepos.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
private Repo getItem(int position) {
|
|
||||||
if (position >= mUpdateRepos.size()) {
|
|
||||||
position -= mUpdateRepos.size();
|
|
||||||
if (position >= mInstalledRepos.size()) {
|
|
||||||
position -= mInstalledRepos.size();
|
|
||||||
return mOthersRepos.get(position);
|
|
||||||
} else {
|
|
||||||
return mInstalledRepos.get(position);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return mUpdateRepos.get(position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
@BindView(R.id.title) TextView title;
|
|
||||||
@BindView(R.id.version_name) TextView versionName;
|
|
||||||
@BindView(R.id.description) TextView description;
|
|
||||||
@BindView(R.id.author) TextView author;
|
|
||||||
@BindView(R.id.expand_layout) LinearLayout expandLayout;
|
|
||||||
@BindView(R.id.update) ImageView updateImage;
|
|
||||||
@BindView(R.id.changeLog) ImageView changeLog;
|
|
||||||
@BindView(R.id.authorLink) ImageView authorLink;
|
|
||||||
@BindView(R.id.supportLink) ImageView supportLink;
|
|
||||||
|
|
||||||
private ValueAnimator mAnimator;
|
|
||||||
private ObjectAnimator animY2;
|
|
||||||
private boolean mExpanded = false;
|
|
||||||
private static int expandHeight = 0;
|
|
||||||
|
|
||||||
ViewHolder(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
ButterKnife.bind(this, itemView);
|
|
||||||
expandLayout.getViewTreeObserver().addOnPreDrawListener(
|
|
||||||
new ViewTreeObserver.OnPreDrawListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onPreDraw() {
|
|
||||||
if (expandHeight == 0) {
|
|
||||||
final int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
|
||||||
final int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
|
||||||
expandLayout.measure(widthSpec, heightSpec);
|
|
||||||
expandHeight = expandLayout.getMeasuredHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
expandLayout.getViewTreeObserver().removeOnPreDrawListener(this);
|
|
||||||
expandLayout.setVisibility(View.GONE);
|
|
||||||
mAnimator = slideAnimator(0, expandHeight);
|
|
||||||
animY2 = ObjectAnimator.ofFloat(updateImage, "translationY", expandHeight / 2);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setExpanded(boolean expanded) {
|
|
||||||
mExpanded = expanded;
|
|
||||||
ViewGroup.LayoutParams layoutParams = expandLayout.getLayoutParams();
|
|
||||||
layoutParams.height = expanded ? expandHeight : 0;
|
|
||||||
expandLayout.setLayoutParams(layoutParams);
|
|
||||||
expandLayout.setVisibility(expanded ? View.VISIBLE : View.GONE);
|
|
||||||
if (expanded) {
|
|
||||||
updateImage.setTranslationY(expandHeight / 2);
|
|
||||||
} else {
|
|
||||||
updateImage.setTranslationY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void expand() {
|
|
||||||
expandLayout.setVisibility(View.VISIBLE);
|
|
||||||
mAnimator.start();
|
|
||||||
animY2.start();
|
|
||||||
mExpanded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void collapse() {
|
|
||||||
if (!mExpanded) return;
|
|
||||||
int finalHeight = expandLayout.getHeight();
|
|
||||||
ValueAnimator mAnimator = slideAnimator(finalHeight, 0);
|
|
||||||
mAnimator.addListener(new Animator.AnimatorListener() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animator) {
|
|
||||||
expandLayout.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationStart(Animator animator) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationCancel(Animator animator) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationRepeat(Animator animator) {}
|
|
||||||
});
|
|
||||||
mAnimator.start();
|
|
||||||
animY2.reverse();
|
|
||||||
mExpanded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ValueAnimator slideAnimator(int start, int end) {
|
|
||||||
|
|
||||||
ValueAnimator animator = ValueAnimator.ofInt(start, end);
|
|
||||||
|
|
||||||
animator.addUpdateListener(valueAnimator -> {
|
|
||||||
int value = (Integer) valueAnimator.getAnimatedValue();
|
|
||||||
ViewGroup.LayoutParams layoutParams = expandLayout.getLayoutParams();
|
|
||||||
layoutParams.height = value;
|
|
||||||
expandLayout.setLayoutParams(layoutParams);
|
|
||||||
});
|
|
||||||
return animator;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.adapters;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.util.SparseArray;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
|
||||||
|
|
||||||
public class SimpleSectionedRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
|
||||||
|
|
||||||
private final Context mContext;
|
|
||||||
private static final int SECTION_TYPE = 0;
|
|
||||||
|
|
||||||
private boolean mValid = true;
|
|
||||||
private int mSectionResourceId;
|
|
||||||
private int mTextResourceId;
|
|
||||||
private LayoutInflater mLayoutInflater;
|
|
||||||
private RecyclerView.Adapter mBaseAdapter;
|
|
||||||
private SparseArray<Section> mSections = new SparseArray<Section>();
|
|
||||||
|
|
||||||
|
|
||||||
public SimpleSectionedRecyclerViewAdapter(Context context, int sectionResourceId, int textResourceId,
|
|
||||||
RecyclerView.Adapter baseAdapter) {
|
|
||||||
|
|
||||||
mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
||||||
mSectionResourceId = sectionResourceId;
|
|
||||||
mTextResourceId = textResourceId;
|
|
||||||
mBaseAdapter = baseAdapter;
|
|
||||||
mContext = context;
|
|
||||||
|
|
||||||
mBaseAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
|
||||||
@Override
|
|
||||||
public void onChanged() {
|
|
||||||
mValid = mBaseAdapter.getItemCount()>0;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeChanged(int positionStart, int itemCount) {
|
|
||||||
mValid = mBaseAdapter.getItemCount()>0;
|
|
||||||
notifyItemRangeChanged(positionStart, itemCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeInserted(int positionStart, int itemCount) {
|
|
||||||
mValid = mBaseAdapter.getItemCount()>0;
|
|
||||||
notifyItemRangeInserted(positionStart, itemCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeRemoved(int positionStart, int itemCount) {
|
|
||||||
mValid = mBaseAdapter.getItemCount()>0;
|
|
||||||
notifyItemRangeRemoved(positionStart, itemCount);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static class SectionViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
public TextView title;
|
|
||||||
|
|
||||||
public SectionViewHolder(View view, int mTextResourceid) {
|
|
||||||
super(view);
|
|
||||||
title = (TextView) view.findViewById(mTextResourceid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int typeView) {
|
|
||||||
if (typeView == SECTION_TYPE) {
|
|
||||||
final View view = LayoutInflater.from(mContext).inflate(mSectionResourceId, parent, false);
|
|
||||||
return new SectionViewHolder(view,mTextResourceId);
|
|
||||||
}else{
|
|
||||||
return mBaseAdapter.onCreateViewHolder(parent, typeView -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(RecyclerView.ViewHolder sectionViewHolder, int position) {
|
|
||||||
if (isSectionHeaderPosition(position)) {
|
|
||||||
((SectionViewHolder)sectionViewHolder).title.setText(mSections.get(position).title);
|
|
||||||
}else{
|
|
||||||
mBaseAdapter.onBindViewHolder(sectionViewHolder,sectionedPositionToPosition(position));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemViewType(int position) {
|
|
||||||
return isSectionHeaderPosition(position)
|
|
||||||
? SECTION_TYPE
|
|
||||||
: mBaseAdapter.getItemViewType(sectionedPositionToPosition(position)) +1 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static class Section {
|
|
||||||
int firstPosition;
|
|
||||||
int sectionedPosition;
|
|
||||||
CharSequence title;
|
|
||||||
|
|
||||||
public Section(int firstPosition, CharSequence title) {
|
|
||||||
this.firstPosition = firstPosition;
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CharSequence getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setSections(Section[] sections) {
|
|
||||||
mSections.clear();
|
|
||||||
|
|
||||||
Arrays.sort(sections, new Comparator<Section>() {
|
|
||||||
@Override
|
|
||||||
public int compare(Section o, Section o1) {
|
|
||||||
return (o.firstPosition == o1.firstPosition)
|
|
||||||
? 0
|
|
||||||
: ((o.firstPosition < o1.firstPosition) ? -1 : 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
int offset = 0; // offset positions for the headers we're adding
|
|
||||||
for (Section section : sections) {
|
|
||||||
section.sectionedPosition = section.firstPosition + offset;
|
|
||||||
mSections.append(section.sectionedPosition, section);
|
|
||||||
++offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int positionToSectionedPosition(int position) {
|
|
||||||
int offset = 0;
|
|
||||||
for (int i = 0; i < mSections.size(); i++) {
|
|
||||||
if (mSections.valueAt(i).firstPosition > position) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
++offset;
|
|
||||||
}
|
|
||||||
return position + offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int sectionedPositionToPosition(int sectionedPosition) {
|
|
||||||
if (isSectionHeaderPosition(sectionedPosition)) {
|
|
||||||
return RecyclerView.NO_POSITION;
|
|
||||||
}
|
|
||||||
|
|
||||||
int offset = 0;
|
|
||||||
for (int i = 0; i < mSections.size(); i++) {
|
|
||||||
if (mSections.valueAt(i).sectionedPosition > sectionedPosition) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
--offset;
|
|
||||||
}
|
|
||||||
return sectionedPosition + offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSectionHeaderPosition(int position) {
|
|
||||||
return mSections.get(position) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getItemId(int position) {
|
|
||||||
return isSectionHeaderPosition(position)
|
|
||||||
? Integer.MAX_VALUE - mSections.indexOfKey(position)
|
|
||||||
: mBaseAdapter.getItemId(sectionedPositionToPosition(position));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return (mValid ? mBaseAdapter.getItemCount() + mSections.size() : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,190 @@
|
|||||||
|
package com.topjohnwu.magisk.data.database;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.Config;
|
||||||
|
import com.topjohnwu.magisk.Const;
|
||||||
|
import com.topjohnwu.magisk.model.entity.Policy;
|
||||||
|
import com.topjohnwu.magisk.model.entity.SuLogEntry;
|
||||||
|
import com.topjohnwu.magisk.utils.LocaleManager;
|
||||||
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class MagiskDB {
|
||||||
|
|
||||||
|
private static final String POLICY_TABLE = "policies";
|
||||||
|
private static final String LOG_TABLE = "logs";
|
||||||
|
private static final String SETTINGS_TABLE = "settings";
|
||||||
|
private static final String STRINGS_TABLE = "strings";
|
||||||
|
|
||||||
|
private PackageManager pm;
|
||||||
|
|
||||||
|
public MagiskDB(Context context) {
|
||||||
|
pm = context.getPackageManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deletePolicy(Policy policy) {
|
||||||
|
deletePolicy(policy.uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> rawSQL(String fmt, Object... args) {
|
||||||
|
return Shell.su("magisk --sqlite '" + Utils.fmt(fmt, args) + "'").exec().getOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<ContentValues> SQL(String fmt, Object... args) {
|
||||||
|
List<ContentValues> list = new ArrayList<>();
|
||||||
|
for (String raw : rawSQL(fmt, args)) {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
String[] cols = raw.split("\\|");
|
||||||
|
for (String col : cols) {
|
||||||
|
String[] pair = col.split("=", 2);
|
||||||
|
if (pair.length != 2)
|
||||||
|
continue;
|
||||||
|
values.put(pair[0], pair[1]);
|
||||||
|
}
|
||||||
|
list.add(values);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String toSQL(ContentValues values) {
|
||||||
|
StringBuilder keys = new StringBuilder(), vals = new StringBuilder();
|
||||||
|
keys.append('(');
|
||||||
|
vals.append("VALUES(");
|
||||||
|
boolean first = true;
|
||||||
|
for (Map.Entry<String, Object> entry : values.valueSet()) {
|
||||||
|
if (!first) {
|
||||||
|
keys.append(',');
|
||||||
|
vals.append(',');
|
||||||
|
} else {
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
keys.append(entry.getKey());
|
||||||
|
vals.append('"');
|
||||||
|
vals.append(entry.getValue());
|
||||||
|
vals.append('"');
|
||||||
|
}
|
||||||
|
keys.append(')');
|
||||||
|
vals.append(')');
|
||||||
|
keys.append(vals);
|
||||||
|
return keys.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearOutdated() {
|
||||||
|
rawSQL(
|
||||||
|
"DELETE FROM %s WHERE until > 0 AND until < %d;" +
|
||||||
|
"DELETE FROM %s WHERE time < %d",
|
||||||
|
POLICY_TABLE, System.currentTimeMillis() / 1000,
|
||||||
|
LOG_TABLE, System.currentTimeMillis() - Config.suLogTimeout * 86400000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deletePolicy(String pkg) {
|
||||||
|
rawSQL("DELETE FROM %s WHERE package_name=\"%s\"", POLICY_TABLE, pkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deletePolicy(int uid) {
|
||||||
|
rawSQL("DELETE FROM %s WHERE uid=%d", POLICY_TABLE, uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Policy getPolicy(int uid) {
|
||||||
|
List<ContentValues> res =
|
||||||
|
SQL("SELECT * FROM %s WHERE uid=%d", POLICY_TABLE, uid);
|
||||||
|
if (!res.isEmpty()) {
|
||||||
|
try {
|
||||||
|
return new Policy(res.get(0), pm);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
deletePolicy(uid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updatePolicy(Policy policy) {
|
||||||
|
rawSQL("REPLACE INTO %s %s", POLICY_TABLE, toSQL(policy.getContentValues()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Policy> getPolicyList() {
|
||||||
|
List<Policy> list = new ArrayList<>();
|
||||||
|
for (ContentValues values : SQL("SELECT * FROM %s WHERE uid/100000=%d", POLICY_TABLE, Const.USER_ID)) {
|
||||||
|
try {
|
||||||
|
list.add(new Policy(values, pm));
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
deletePolicy(values.getAsInteger("uid"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.sort(list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<SuLogEntry>> getLogs() {
|
||||||
|
List<List<SuLogEntry>> ret = new ArrayList<>();
|
||||||
|
List<SuLogEntry> list = null;
|
||||||
|
String dateString = null, newString;
|
||||||
|
for (ContentValues values : SQL("SELECT * FROM %s ORDER BY time DESC", LOG_TABLE)) {
|
||||||
|
Date date = new Date(values.getAsLong("time"));
|
||||||
|
newString = DateFormat.getDateInstance(DateFormat.MEDIUM, LocaleManager.locale).format(date);
|
||||||
|
if (!TextUtils.equals(dateString, newString)) {
|
||||||
|
dateString = newString;
|
||||||
|
list = new ArrayList<>();
|
||||||
|
ret.add(list);
|
||||||
|
}
|
||||||
|
list.add(new SuLogEntry(values));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addLog(SuLogEntry log) {
|
||||||
|
rawSQL("INSERT INTO %s %s", LOG_TABLE, toSQL(log.getContentValues()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearLogs() {
|
||||||
|
rawSQL("DELETE FROM %s", LOG_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void rmSettings(String key) {
|
||||||
|
rawSQL("DELETE FROM %s WHERE key=\"%s\"", SETTINGS_TABLE, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSettings(String key, int value) {
|
||||||
|
ContentValues data = new ContentValues();
|
||||||
|
data.put("key", key);
|
||||||
|
data.put("value", value);
|
||||||
|
rawSQL("REPLACE INTO %s %s", SETTINGS_TABLE, toSQL(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSettings(String key, int defaultValue) {
|
||||||
|
List<ContentValues> res = SQL("SELECT value FROM %s WHERE key=\"%s\"", SETTINGS_TABLE, key);
|
||||||
|
if (res.isEmpty())
|
||||||
|
return defaultValue;
|
||||||
|
return res.get(0).getAsInteger("value");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStrings(String key, String value) {
|
||||||
|
if (value == null) {
|
||||||
|
rawSQL("DELETE FROM %s WHERE key=\"%s\"", STRINGS_TABLE, key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ContentValues data = new ContentValues();
|
||||||
|
data.put("key", key);
|
||||||
|
data.put("value", value);
|
||||||
|
rawSQL("REPLACE INTO %s %s", STRINGS_TABLE, toSQL(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStrings(String key, String defaultValue) {
|
||||||
|
List<ContentValues> res = SQL("SELECT value FROM %s WHERE key=\"%s\"", STRINGS_TABLE, key);
|
||||||
|
if (res.isEmpty())
|
||||||
|
return defaultValue;
|
||||||
|
return res.get(0).getAsString("value");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.topjohnwu.magisk.data.database;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.Config;
|
||||||
|
import com.topjohnwu.magisk.model.entity.Repo;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
|
private static final int DATABASE_VER = 5;
|
||||||
|
private static final String TABLE_NAME = "repos";
|
||||||
|
|
||||||
|
private SQLiteDatabase mDb;
|
||||||
|
|
||||||
|
public RepoDatabaseHelper(Context context) {
|
||||||
|
super(context, "repo.db", null, DATABASE_VER);
|
||||||
|
mDb = getWritableDatabase();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(SQLiteDatabase db) {
|
||||||
|
onUpgrade(db, 0, DATABASE_VER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
|
if (oldVersion != newVersion) {
|
||||||
|
// Nuke old DB and create new table
|
||||||
|
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
|
||||||
|
db.execSQL(
|
||||||
|
"CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " " +
|
||||||
|
"(id TEXT, name TEXT, version TEXT, versionCode INT, " +
|
||||||
|
"author TEXT, description TEXT, last_update INT, PRIMARY KEY(id))");
|
||||||
|
Config.remove(Config.Key.ETAG_KEY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
|
onUpgrade(db, 0, DATABASE_VER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearRepo() {
|
||||||
|
mDb.delete(TABLE_NAME, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void removeRepo(String id) {
|
||||||
|
mDb.delete(TABLE_NAME, "id=?", new String[] { id });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeRepo(Repo repo) {
|
||||||
|
removeRepo(repo.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeRepo(Iterable<String> list) {
|
||||||
|
for (String id : list) {
|
||||||
|
if (id == null) continue;
|
||||||
|
mDb.delete(TABLE_NAME, "id=?", new String[] { id });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addRepo(Repo repo) {
|
||||||
|
mDb.replace(TABLE_NAME, null, repo.getContentValues());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Repo getRepo(String id) {
|
||||||
|
try (Cursor c = mDb.query(TABLE_NAME, null, "id=?", new String[] { id }, null, null, null)) {
|
||||||
|
if (c.moveToNext()) {
|
||||||
|
return new Repo(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor getRawCursor() {
|
||||||
|
return mDb.query(TABLE_NAME, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor getRepoCursor() {
|
||||||
|
String orderBy = null;
|
||||||
|
switch ((int) Config.get(Config.Key.REPO_ORDER)) {
|
||||||
|
case Config.Value.ORDER_NAME:
|
||||||
|
orderBy = "name COLLATE NOCASE";
|
||||||
|
break;
|
||||||
|
case Config.Value.ORDER_DATE:
|
||||||
|
orderBy = "last_update DESC";
|
||||||
|
}
|
||||||
|
return mDb.query(TABLE_NAME, null, null, null, null, null, orderBy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getRepoIDSet() {
|
||||||
|
HashSet<String> set = new HashSet<>(300);
|
||||||
|
try (Cursor c = mDb.query(TABLE_NAME, null, null, null, null, null, null)) {
|
||||||
|
while (c.moveToNext()) {
|
||||||
|
set.add(c.getString(c.getColumnIndex("id")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
|
import com.skoumal.teanity.rxbus.RxBus
|
||||||
|
import com.topjohnwu.magisk.App
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
val applicationModule = module {
|
||||||
|
single { RxBus() }
|
||||||
|
factory { get<Context>().resources }
|
||||||
|
factory { get<Context>() as App }
|
||||||
|
factory { get<Context>().packageManager }
|
||||||
|
single(SUTimeout) {
|
||||||
|
get<App>().protectedContext.getSharedPreferences("su_timeout", 0)
|
||||||
|
}
|
||||||
|
single { PreferenceManager.getDefaultSharedPreferences(get<App>().protectedContext) }
|
||||||
|
}
|
||||||
12
app/src/main/java/com/topjohnwu/magisk/di/DatabaseModule.kt
Normal file
12
app/src/main/java/com/topjohnwu/magisk/di/DatabaseModule.kt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App
|
||||||
|
import com.topjohnwu.magisk.data.database.MagiskDB
|
||||||
|
import com.topjohnwu.magisk.data.database.RepoDatabaseHelper
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
val databaseModule = module {
|
||||||
|
single { MagiskDB(get<App>().protectedContext) }
|
||||||
|
single { RepoDatabaseHelper(get()) }
|
||||||
|
}
|
||||||
10
app/src/main/java/com/topjohnwu/magisk/di/MiscModule.kt
Normal file
10
app/src/main/java/com/topjohnwu/magisk/di/MiscModule.kt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
val miscModule = module {
|
||||||
|
|
||||||
|
// define miscs here
|
||||||
|
|
||||||
|
}
|
||||||
10
app/src/main/java/com/topjohnwu/magisk/di/Modules.kt
Normal file
10
app/src/main/java/com/topjohnwu/magisk/di/Modules.kt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
val koinModules = listOf(
|
||||||
|
applicationModule,
|
||||||
|
networkingModule,
|
||||||
|
databaseModule,
|
||||||
|
repositoryModule,
|
||||||
|
viewModelModules,
|
||||||
|
miscModule
|
||||||
|
)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import org.koin.core.qualifier.named
|
||||||
|
|
||||||
|
val SUTimeout = named("su_timeout")
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
val networkingModule = module {}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
val repositoryModule = module {}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
|
import com.topjohnwu.magisk.ui.MainViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.flash.FlashViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.hide.HideViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.home.HomeViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.log.LogViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.module.ModuleViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.superuser.SuperuserViewModel
|
||||||
|
import com.topjohnwu.magisk.ui.surequest.SuRequestViewModel
|
||||||
|
import org.koin.androidx.viewmodel.dsl.viewModel
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
val viewModelModules = module {
|
||||||
|
viewModel { MainViewModel() }
|
||||||
|
viewModel { HomeViewModel(get()) }
|
||||||
|
viewModel { SuperuserViewModel(get(), get(), get(), get()) }
|
||||||
|
viewModel { HideViewModel(get(), get()) }
|
||||||
|
viewModel { ModuleViewModel(get(), get()) }
|
||||||
|
viewModel { LogViewModel(get(), get()) }
|
||||||
|
viewModel { (action: String, uri: Uri?) -> FlashViewModel(action, uri, get()) }
|
||||||
|
viewModel { SuRequestViewModel(get(), get(), get(SUTimeout), get()) }
|
||||||
|
}
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
package com.topjohnwu.magisk.model.download;
|
||||||
|
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.IBinder;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App;
|
||||||
|
import com.topjohnwu.magisk.ClassMap;
|
||||||
|
import com.topjohnwu.magisk.Const;
|
||||||
|
import com.topjohnwu.magisk.model.entity.Repo;
|
||||||
|
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||||
|
import com.topjohnwu.magisk.view.Notifications;
|
||||||
|
import com.topjohnwu.magisk.view.ProgressNotification;
|
||||||
|
import com.topjohnwu.net.Networking;
|
||||||
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
import com.topjohnwu.superuser.ShellUtils;
|
||||||
|
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
public class DownloadModuleService extends Service {
|
||||||
|
|
||||||
|
private List<ProgressNotification> notifications;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
notifications = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
Shell.EXECUTOR.execute(() -> {
|
||||||
|
Repo repo = intent.getParcelableExtra("repo");
|
||||||
|
boolean install = intent.getBooleanExtra("install", false);
|
||||||
|
dlProcessInstall(repo, install);
|
||||||
|
});
|
||||||
|
return START_REDELIVER_INTENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void onTaskRemoved(Intent rootIntent) {
|
||||||
|
for (ProgressNotification n : notifications) {
|
||||||
|
Notifications.mgr.cancel(n.hashCode());
|
||||||
|
}
|
||||||
|
notifications.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void addNotification(ProgressNotification n) {
|
||||||
|
if (notifications.isEmpty()) {
|
||||||
|
// Start foreground
|
||||||
|
startForeground(n.hashCode(), n.getNotification());
|
||||||
|
}
|
||||||
|
notifications.add(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void removeNotification(ProgressNotification n) {
|
||||||
|
notifications.remove(n);
|
||||||
|
if (notifications.isEmpty()) {
|
||||||
|
// No more tasks, stop service
|
||||||
|
stopForeground(true);
|
||||||
|
stopSelf();
|
||||||
|
} else {
|
||||||
|
// Pick another notification as our foreground notification
|
||||||
|
n = notifications.get(0);
|
||||||
|
startForeground(n.hashCode(), n.getNotification());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dlProcessInstall(Repo repo, boolean install) {
|
||||||
|
File output = new File(Const.EXTERNAL_PATH, repo.getDownloadFilename());
|
||||||
|
ProgressNotification progress = new ProgressNotification(output.getName());
|
||||||
|
addNotification(progress);
|
||||||
|
try {
|
||||||
|
InputStream in = Networking.get(repo.getZipUrl())
|
||||||
|
.setDownloadProgressListener(progress)
|
||||||
|
.execForInputStream().getResult();
|
||||||
|
OutputStream out = new BufferedOutputStream(new FileOutputStream(output));
|
||||||
|
processZip(in, out);
|
||||||
|
Intent intent = new Intent(this, ClassMap.get(FlashActivity.class));
|
||||||
|
intent.setData(Uri.fromFile(output))
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_ZIP);
|
||||||
|
synchronized (getApplication()) {
|
||||||
|
if (install && App.foreground() != null &&
|
||||||
|
!(App.foreground() instanceof FlashActivity)) {
|
||||||
|
/* Only start flashing if there is a foreground activity and the
|
||||||
|
* user is not also flashing another module at the same time */
|
||||||
|
App.foreground().startActivity(intent);
|
||||||
|
} else {
|
||||||
|
/* Or else we preset a notification notifying that we are done */
|
||||||
|
PendingIntent pi = PendingIntent.getActivity(this, progress.hashCode(), intent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
progress.dlDone(pi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
progress.dlFail();
|
||||||
|
}
|
||||||
|
removeNotification(progress);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processZip(InputStream in, OutputStream out)
|
||||||
|
throws IOException {
|
||||||
|
try (ZipInputStream zin = new ZipInputStream(in);
|
||||||
|
ZipOutputStream zout = new ZipOutputStream(out)) {
|
||||||
|
|
||||||
|
// Inject latest module-installer.sh as update-binary
|
||||||
|
zout.putNextEntry(new ZipEntry("META-INF/"));
|
||||||
|
zout.putNextEntry(new ZipEntry("META-INF/com/"));
|
||||||
|
zout.putNextEntry(new ZipEntry("META-INF/com/google/"));
|
||||||
|
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/"));
|
||||||
|
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/update-binary"));
|
||||||
|
try (InputStream update_bin = Networking.get(Const.Url.MODULE_INSTALLER)
|
||||||
|
.execForInputStream().getResult()) {
|
||||||
|
ShellUtils.pump(update_bin, zout);
|
||||||
|
}
|
||||||
|
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/updater-script"));
|
||||||
|
zout.write("#MAGISK\n".getBytes("UTF-8"));
|
||||||
|
|
||||||
|
int off = -1;
|
||||||
|
ZipEntry entry;
|
||||||
|
while ((entry = zin.getNextEntry()) != null) {
|
||||||
|
if (off < 0)
|
||||||
|
off = entry.getName().indexOf('/') + 1;
|
||||||
|
String path = entry.getName().substring(off);
|
||||||
|
if (path.isEmpty())
|
||||||
|
continue;
|
||||||
|
if (path.startsWith("META-INF"))
|
||||||
|
continue;
|
||||||
|
zout.putNextEntry(new ZipEntry(path));
|
||||||
|
if (!entry.isDirectory())
|
||||||
|
ShellUtils.pump(zin, zout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||||
|
|
||||||
|
private String mId, mName, mVersion, mAuthor, mDescription;
|
||||||
|
private int mVersionCode = -1;
|
||||||
|
|
||||||
|
protected BaseModule() {
|
||||||
|
mId = mName = mVersion = mAuthor = mDescription = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BaseModule(Cursor c) {
|
||||||
|
mId = nonNull(c.getString(c.getColumnIndex("id")));
|
||||||
|
mName = nonNull(c.getString(c.getColumnIndex("name")));
|
||||||
|
mVersion = nonNull(c.getString(c.getColumnIndex("version")));
|
||||||
|
mVersionCode = c.getInt(c.getColumnIndex("versionCode"));
|
||||||
|
mAuthor = nonNull(c.getString(c.getColumnIndex("author")));
|
||||||
|
mDescription = nonNull(c.getString(c.getColumnIndex("description")));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BaseModule(Parcel p) {
|
||||||
|
mId = p.readString();
|
||||||
|
mName = p.readString();
|
||||||
|
mVersion = p.readString();
|
||||||
|
mAuthor = p.readString();
|
||||||
|
mDescription = p.readString();
|
||||||
|
mVersionCode = p.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(@NonNull BaseModule module) {
|
||||||
|
return this.getName().toLowerCase().compareTo(module.getName().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(mId);
|
||||||
|
dest.writeString(mName);
|
||||||
|
dest.writeString(mVersion);
|
||||||
|
dest.writeString(mAuthor);
|
||||||
|
dest.writeString(mDescription);
|
||||||
|
dest.writeInt(mVersionCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String nonNull(String s) {
|
||||||
|
return s == null ? "" : s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentValues getContentValues() {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put("id", mId);
|
||||||
|
values.put("name", mName);
|
||||||
|
values.put("version", mVersion);
|
||||||
|
values.put("versionCode", mVersionCode);
|
||||||
|
values.put("author", mAuthor);
|
||||||
|
values.put("description", mDescription);
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void parseProps(List<String> props) { parseProps(props.toArray(new String[0])); }
|
||||||
|
|
||||||
|
protected void parseProps(String[] props) throws NumberFormatException {
|
||||||
|
for (String line : props) {
|
||||||
|
String[] prop = line.split("=", 2);
|
||||||
|
if (prop.length != 2)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
String key = prop[0].trim();
|
||||||
|
String value = prop[1].trim();
|
||||||
|
if (key.isEmpty() || key.charAt(0) == '#')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
switch (key) {
|
||||||
|
case "id":
|
||||||
|
mId = value;
|
||||||
|
break;
|
||||||
|
case "name":
|
||||||
|
mName = value;
|
||||||
|
break;
|
||||||
|
case "version":
|
||||||
|
mVersion = value;
|
||||||
|
break;
|
||||||
|
case "versionCode":
|
||||||
|
mVersionCode = Integer.parseInt(value);
|
||||||
|
break;
|
||||||
|
case "author":
|
||||||
|
mAuthor = value;
|
||||||
|
break;
|
||||||
|
case "description":
|
||||||
|
mDescription = value;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return mVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor() {
|
||||||
|
return mAuthor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return mId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
mId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return mDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVersionCode() {
|
||||||
|
return mVersionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity
|
||||||
|
|
||||||
|
import android.content.pm.ApplicationInfo
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import com.topjohnwu.magisk.utils.packageInfo
|
||||||
|
import com.topjohnwu.magisk.utils.processes
|
||||||
|
|
||||||
|
class HideAppInfo(
|
||||||
|
val info: ApplicationInfo,
|
||||||
|
val name: String,
|
||||||
|
val icon: Drawable
|
||||||
|
) {
|
||||||
|
|
||||||
|
val processes = info.packageInfo?.processes?.distinct() ?: listOf(info.packageName)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity
|
||||||
|
|
||||||
|
class HideTarget(line: String) {
|
||||||
|
|
||||||
|
private val split = line.split(Regex("\\|"), 2)
|
||||||
|
|
||||||
|
val packageName = split[0]
|
||||||
|
val process = split.getOrElse(1) { packageName }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
import com.topjohnwu.superuser.io.SuFile;
|
||||||
|
|
||||||
|
public class Module extends BaseModule {
|
||||||
|
|
||||||
|
private SuFile mRemoveFile, mDisableFile, mUpdateFile;
|
||||||
|
private boolean mEnable, mRemove, mUpdated;
|
||||||
|
|
||||||
|
public Module(String path) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
parseProps(Shell.su("dos2unix < " + path + "/module.prop").exec().getOut());
|
||||||
|
} catch (NumberFormatException ignored) {}
|
||||||
|
|
||||||
|
mRemoveFile = new SuFile(path, "remove");
|
||||||
|
mDisableFile = new SuFile(path, "disable");
|
||||||
|
mUpdateFile = new SuFile(path, "update");
|
||||||
|
|
||||||
|
if (getId().isEmpty()) {
|
||||||
|
int sep = path.lastIndexOf('/');
|
||||||
|
setId(path.substring(sep + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getName().isEmpty()) {
|
||||||
|
setName(getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
mEnable = !mDisableFile.exists();
|
||||||
|
mRemove = mRemoveFile.exists();
|
||||||
|
mUpdated = mUpdateFile.exists();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<Module> CREATOR = new Creator<Module>() {
|
||||||
|
/* It won't be used at any place */
|
||||||
|
@Override
|
||||||
|
public Module createFromParcel(Parcel source) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Module[] newArray(int size) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public void createDisableFile() {
|
||||||
|
mEnable = !mDisableFile.createNewFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeDisableFile() {
|
||||||
|
mEnable = mDisableFile.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return mEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createRemoveFile() {
|
||||||
|
mRemove = mRemoveFile.createNewFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteRemoveFile() {
|
||||||
|
mRemove = !mRemoveFile.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean willBeRemoved() {
|
||||||
|
return mRemove;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpdated() {
|
||||||
|
return mUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
|
||||||
|
public class Policy implements Comparable<Policy>{
|
||||||
|
public static final int INTERACTIVE = 0;
|
||||||
|
public static final int DENY = 1;
|
||||||
|
public static final int ALLOW = 2;
|
||||||
|
|
||||||
|
public int uid, policy = INTERACTIVE;
|
||||||
|
public long until;
|
||||||
|
public boolean logging = true, notification = true;
|
||||||
|
public String packageName, appName;
|
||||||
|
public ApplicationInfo info;
|
||||||
|
|
||||||
|
public Policy(int uid, PackageManager pm) throws PackageManager.NameNotFoundException {
|
||||||
|
String[] pkgs = pm.getPackagesForUid(uid);
|
||||||
|
if (pkgs == null || pkgs.length == 0)
|
||||||
|
throw new PackageManager.NameNotFoundException();
|
||||||
|
this.uid = uid;
|
||||||
|
packageName = pkgs[0];
|
||||||
|
info = pm.getApplicationInfo(packageName, 0);
|
||||||
|
appName = Utils.getAppLabel(info, pm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Policy(ContentValues values, PackageManager pm) throws PackageManager.NameNotFoundException {
|
||||||
|
uid = values.getAsInteger("uid");
|
||||||
|
packageName = values.getAsString("package_name");
|
||||||
|
policy = values.getAsInteger("policy");
|
||||||
|
until = values.getAsInteger("until");
|
||||||
|
logging = values.getAsInteger("logging") != 0;
|
||||||
|
notification = values.getAsInteger("notification") != 0;
|
||||||
|
info = pm.getApplicationInfo(packageName, 0);
|
||||||
|
if (info.uid != uid)
|
||||||
|
throw new PackageManager.NameNotFoundException();
|
||||||
|
appName = info.loadLabel(pm).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentValues getContentValues() {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put("uid", uid);
|
||||||
|
values.put("package_name", packageName);
|
||||||
|
values.put("policy", policy);
|
||||||
|
values.put("until", until);
|
||||||
|
values.put("logging", logging ? 1 : 0);
|
||||||
|
values.put("notification", notification ? 1 : 0);
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(@NonNull Policy policy) {
|
||||||
|
return appName.toLowerCase().compareTo(policy.appName.toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
109
app/src/main/java/com/topjohnwu/magisk/model/entity/Repo.java
Normal file
109
app/src/main/java/com/topjohnwu/magisk/model/entity/Repo.java
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.Const;
|
||||||
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class Repo extends BaseModule {
|
||||||
|
|
||||||
|
private Date mLastUpdate;
|
||||||
|
|
||||||
|
public Repo(String id) {
|
||||||
|
setId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Repo(Cursor c) {
|
||||||
|
super(c);
|
||||||
|
mLastUpdate = new Date(c.getLong(c.getColumnIndex("last_update")));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Repo(Parcel p) {
|
||||||
|
super(p);
|
||||||
|
mLastUpdate = new Date(p.readLong());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<Repo> CREATOR = new Parcelable.Creator<Repo>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Repo createFromParcel(Parcel source) {
|
||||||
|
return new Repo(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Repo[] newArray(int size) {
|
||||||
|
return new Repo[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
dest.writeLong(mLastUpdate.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update() throws IllegalRepoException {
|
||||||
|
String props[] = Utils.dlString(getPropUrl()).split("\\n");
|
||||||
|
try {
|
||||||
|
parseProps(props);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
throw new IllegalRepoException("Repo [" + getId() + "] parse error: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getVersionCode() < 0) {
|
||||||
|
throw new IllegalRepoException("Repo [" + getId() + "] does not contain versionCode");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(Date lastUpdate) throws IllegalRepoException {
|
||||||
|
mLastUpdate = lastUpdate;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContentValues getContentValues() {
|
||||||
|
ContentValues values = super.getContentValues();
|
||||||
|
values.put("last_update", mLastUpdate.getTime());
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZipUrl() {
|
||||||
|
return String.format(Const.Url.ZIP_URL, getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPropUrl() {
|
||||||
|
return getFileUrl("module.prop");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetailUrl() {
|
||||||
|
return getFileUrl("README.md");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileUrl(String file) {
|
||||||
|
return String.format(Const.Url.FILE_URL, getId(), file);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastUpdateString() {
|
||||||
|
return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(mLastUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLastUpdate() {
|
||||||
|
return mLastUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadFilename() {
|
||||||
|
return Utils.getLegalFilename(getName() + "-" + getVersion() + ".zip");
|
||||||
|
}
|
||||||
|
|
||||||
|
public class IllegalRepoException extends Exception {
|
||||||
|
IllegalRepoException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.utils.LocaleManager;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class SuLogEntry {
|
||||||
|
|
||||||
|
public int fromUid, toUid, fromPid;
|
||||||
|
public String packageName, appName, command;
|
||||||
|
public boolean action;
|
||||||
|
public Date date;
|
||||||
|
|
||||||
|
public SuLogEntry(Policy policy) {
|
||||||
|
fromUid = policy.uid;
|
||||||
|
packageName = policy.packageName;
|
||||||
|
appName = policy.appName;
|
||||||
|
action = policy.policy == Policy.ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SuLogEntry(ContentValues values) {
|
||||||
|
fromUid = values.getAsInteger("from_uid");
|
||||||
|
packageName = values.getAsString("package_name");
|
||||||
|
appName = values.getAsString("app_name");
|
||||||
|
fromPid = values.getAsInteger("from_pid");
|
||||||
|
command = values.getAsString("command");
|
||||||
|
toUid = values.getAsInteger("to_uid");
|
||||||
|
action = values.getAsInteger("action") != 0;
|
||||||
|
date = new Date(values.getAsLong("time"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentValues getContentValues() {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put("from_uid", fromUid);
|
||||||
|
values.put("package_name", packageName);
|
||||||
|
values.put("app_name", appName);
|
||||||
|
values.put("from_pid", fromPid);
|
||||||
|
values.put("command", command);
|
||||||
|
values.put("to_uid", toUid);
|
||||||
|
values.put("action", action ? 1 : 0);
|
||||||
|
values.put("time", date.getTime());
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDateString() {
|
||||||
|
return DateFormat.getDateInstance(DateFormat.MEDIUM, LocaleManager.locale).format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimeString() {
|
||||||
|
return new SimpleDateFormat("h:mm a", LocaleManager.locale).format(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
|
||||||
|
class ConsoleRvItem(val item: String) : ComparableRvItem<ConsoleRvItem>() {
|
||||||
|
override val layoutRes: Int = R.layout.item_console
|
||||||
|
|
||||||
|
override fun contentSameAs(other: ConsoleRvItem) = itemSameAs(other)
|
||||||
|
override fun itemSameAs(other: ConsoleRvItem) = item == other.item
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.skoumal.teanity.extensions.addOnPropertyChangedCallback
|
||||||
|
import com.skoumal.teanity.rxbus.RxBus
|
||||||
|
import com.skoumal.teanity.util.DiffObservableList
|
||||||
|
import com.skoumal.teanity.util.KObservableField
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
import com.topjohnwu.magisk.model.entity.HideAppInfo
|
||||||
|
import com.topjohnwu.magisk.model.entity.HideTarget
|
||||||
|
import com.topjohnwu.magisk.model.entity.state.IndeterminateState
|
||||||
|
import com.topjohnwu.magisk.model.events.HideProcessEvent
|
||||||
|
import com.topjohnwu.magisk.utils.inject
|
||||||
|
import com.topjohnwu.magisk.utils.toggle
|
||||||
|
|
||||||
|
class HideRvItem(val item: HideAppInfo, targets: List<HideTarget>) :
|
||||||
|
ComparableRvItem<HideRvItem>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.item_hide_app
|
||||||
|
|
||||||
|
val packageName = item.info.packageName.orEmpty()
|
||||||
|
val items = DiffObservableList(callback).also {
|
||||||
|
val items = item.processes.map {
|
||||||
|
val isHidden = targets.any { target ->
|
||||||
|
packageName == target.packageName && it == target.process
|
||||||
|
}
|
||||||
|
HideProcessRvItem(packageName, it, isHidden)
|
||||||
|
}
|
||||||
|
it.update(items)
|
||||||
|
}
|
||||||
|
val isHiddenState = KObservableField(currentState)
|
||||||
|
val isExpanded = KObservableField(false)
|
||||||
|
|
||||||
|
private val itemsProcess get() = items.filterIsInstance<HideProcessRvItem>()
|
||||||
|
|
||||||
|
private val currentState
|
||||||
|
get() = when (itemsProcess.count { it.isHidden.value }) {
|
||||||
|
items.size -> IndeterminateState.CHECKED
|
||||||
|
in 1 until items.size -> IndeterminateState.INDETERMINATE
|
||||||
|
else -> IndeterminateState.UNCHECKED
|
||||||
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
itemsProcess.forEach {
|
||||||
|
it.isHidden.addOnPropertyChangedCallback { isHiddenState.value = currentState }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggle() {
|
||||||
|
val desiredState = when (isHiddenState.value) {
|
||||||
|
IndeterminateState.INDETERMINATE,
|
||||||
|
IndeterminateState.UNCHECKED -> true
|
||||||
|
IndeterminateState.CHECKED -> false
|
||||||
|
}
|
||||||
|
itemsProcess.forEach { it.isHidden.value = desiredState }
|
||||||
|
isHiddenState.value = currentState
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggleExpansion() {
|
||||||
|
if (items.size <= 1) return
|
||||||
|
isExpanded.toggle()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun contentSameAs(other: HideRvItem): Boolean = items.all { other.items.contains(it) }
|
||||||
|
override fun itemSameAs(other: HideRvItem): Boolean = item.info == other.item.info
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class HideProcessRvItem(
|
||||||
|
val packageName: String,
|
||||||
|
val process: String,
|
||||||
|
isHidden: Boolean
|
||||||
|
) : ComparableRvItem<HideProcessRvItem>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.item_hide_process
|
||||||
|
|
||||||
|
val isHidden = KObservableField(isHidden)
|
||||||
|
|
||||||
|
private val rxBus: RxBus by inject()
|
||||||
|
|
||||||
|
init {
|
||||||
|
this.isHidden.addOnPropertyChangedCallback {
|
||||||
|
rxBus.post(HideProcessEvent(this@HideProcessRvItem))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggle() = isHidden.toggle()
|
||||||
|
|
||||||
|
override fun contentSameAs(other: HideProcessRvItem): Boolean = itemSameAs(other)
|
||||||
|
override fun itemSameAs(other: HideProcessRvItem): Boolean =
|
||||||
|
packageName == other.packageName && process == other.process
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableList
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.skoumal.teanity.util.DiffObservableList
|
||||||
|
import com.skoumal.teanity.util.KObservableField
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
import com.topjohnwu.magisk.model.entity.SuLogEntry
|
||||||
|
import com.topjohnwu.magisk.utils.toggle
|
||||||
|
|
||||||
|
class LogRvItem : ComparableRvItem<LogRvItem>() {
|
||||||
|
override val layoutRes: Int = R.layout.item_page_log
|
||||||
|
|
||||||
|
val items = DiffObservableList(callback)
|
||||||
|
|
||||||
|
fun update(list: List<LogItemRvItem>) {
|
||||||
|
list.firstOrNull()?.isExpanded?.value = true
|
||||||
|
items.update(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
//two of these will never be present, safe to assume it's unique
|
||||||
|
override fun contentSameAs(other: LogRvItem): Boolean = false
|
||||||
|
|
||||||
|
override fun itemSameAs(other: LogRvItem): Boolean = false
|
||||||
|
}
|
||||||
|
|
||||||
|
class LogItemRvItem(
|
||||||
|
val items: ObservableList<ComparableRvItem<*>>
|
||||||
|
) : ComparableRvItem<LogItemRvItem>() {
|
||||||
|
override val layoutRes: Int = R.layout.item_superuser_log
|
||||||
|
|
||||||
|
val date = items.filterIsInstance<LogItemEntryRvItem>().firstOrNull()
|
||||||
|
?.item?.dateString.orEmpty()
|
||||||
|
val isExpanded = KObservableField(false)
|
||||||
|
|
||||||
|
fun toggle() = isExpanded.toggle()
|
||||||
|
|
||||||
|
override fun contentSameAs(other: LogItemRvItem): Boolean = items
|
||||||
|
.any { !other.items.contains(it) }
|
||||||
|
|
||||||
|
override fun itemSameAs(other: LogItemRvItem): Boolean = date == other.date
|
||||||
|
}
|
||||||
|
|
||||||
|
class LogItemEntryRvItem(val item: SuLogEntry) : ComparableRvItem<LogItemEntryRvItem>() {
|
||||||
|
override val layoutRes: Int = R.layout.item_superuser_log_entry
|
||||||
|
|
||||||
|
val isExpanded = KObservableField(false)
|
||||||
|
|
||||||
|
fun toggle() = isExpanded.toggle()
|
||||||
|
|
||||||
|
override fun contentSameAs(other: LogItemEntryRvItem) = item.fromUid == other.item.fromUid &&
|
||||||
|
item.toUid == other.item.toUid &&
|
||||||
|
item.fromPid == other.item.fromPid &&
|
||||||
|
item.packageName == other.item.packageName &&
|
||||||
|
item.command == other.item.command &&
|
||||||
|
item.action == other.item.action &&
|
||||||
|
item.date == other.item.date
|
||||||
|
|
||||||
|
override fun itemSameAs(other: LogItemEntryRvItem) = item.appName == other.item.appName
|
||||||
|
}
|
||||||
|
|
||||||
|
class MagiskLogRvItem : ComparableRvItem<MagiskLogRvItem>() {
|
||||||
|
override val layoutRes: Int = R.layout.item_page_magisk_log
|
||||||
|
|
||||||
|
val items = DiffObservableList(callback)
|
||||||
|
|
||||||
|
fun update(list: List<ConsoleRvItem>) {
|
||||||
|
items.update(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
//two of these will never be present, safe to assume it's unique
|
||||||
|
override fun contentSameAs(other: MagiskLogRvItem): Boolean = false
|
||||||
|
|
||||||
|
override fun itemSameAs(other: MagiskLogRvItem): Boolean = false
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import android.content.res.Resources
|
||||||
|
import androidx.annotation.StringRes
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.skoumal.teanity.extensions.addOnPropertyChangedCallback
|
||||||
|
import com.skoumal.teanity.util.KObservableField
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
import com.topjohnwu.magisk.model.entity.Module
|
||||||
|
import com.topjohnwu.magisk.model.entity.Repo
|
||||||
|
import com.topjohnwu.magisk.utils.get
|
||||||
|
import com.topjohnwu.magisk.utils.toggle
|
||||||
|
|
||||||
|
class ModuleRvItem(val item: Module) : ComparableRvItem<ModuleRvItem>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.item_module
|
||||||
|
|
||||||
|
val lastActionNotice = KObservableField("")
|
||||||
|
val isChecked = KObservableField(item.isEnabled)
|
||||||
|
val isDeletable = KObservableField(item.willBeRemoved())
|
||||||
|
|
||||||
|
init {
|
||||||
|
isChecked.addOnPropertyChangedCallback {
|
||||||
|
when (it) {
|
||||||
|
true -> item.removeDisableFile().notice(R.string.disable_file_removed)
|
||||||
|
false -> item.createDisableFile().notice(R.string.disable_file_created)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isDeletable.addOnPropertyChangedCallback {
|
||||||
|
when (it) {
|
||||||
|
true -> item.createRemoveFile().notice(R.string.remove_file_created)
|
||||||
|
false -> item.deleteRemoveFile().notice(R.string.remove_file_deleted)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
when {
|
||||||
|
item.isUpdated -> notice(R.string.update_file_created)
|
||||||
|
item.willBeRemoved() -> notice(R.string.remove_file_created)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toggle() = isChecked.toggle()
|
||||||
|
fun toggleDelete() = isDeletable.toggle()
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
private fun Any.notice(@StringRes info: Int) {
|
||||||
|
lastActionNotice.value = get<Resources>().getString(info)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun contentSameAs(other: ModuleRvItem): Boolean = item.version == other.item.version
|
||||||
|
&& item.versionCode == other.item.versionCode
|
||||||
|
&& item.description == other.item.description
|
||||||
|
|
||||||
|
override fun itemSameAs(other: ModuleRvItem): Boolean = item.name == other.item.name
|
||||||
|
}
|
||||||
|
|
||||||
|
class RepoRvItem(val item: Repo) : ComparableRvItem<RepoRvItem>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.item_repo
|
||||||
|
|
||||||
|
override fun contentSameAs(other: RepoRvItem): Boolean = item.version == other.item.version
|
||||||
|
&& item.lastUpdate == other.item.lastUpdate
|
||||||
|
&& item.versionCode == other.item.versionCode
|
||||||
|
&& item.description == other.item.description
|
||||||
|
|
||||||
|
override fun itemSameAs(other: RepoRvItem): Boolean = item.detailUrl == other.item.detailUrl
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.skoumal.teanity.extensions.addOnPropertyChangedCallback
|
||||||
|
import com.skoumal.teanity.rxbus.RxBus
|
||||||
|
import com.skoumal.teanity.util.KObservableField
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
import com.topjohnwu.magisk.model.entity.Policy
|
||||||
|
import com.topjohnwu.magisk.model.events.PolicyEnableEvent
|
||||||
|
import com.topjohnwu.magisk.model.events.PolicyUpdateEvent
|
||||||
|
import com.topjohnwu.magisk.utils.inject
|
||||||
|
import com.topjohnwu.magisk.utils.toggle
|
||||||
|
|
||||||
|
class PolicyRvItem(val item: Policy, val icon: Drawable) : ComparableRvItem<PolicyRvItem>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.item_policy
|
||||||
|
|
||||||
|
val isExpanded = KObservableField(false)
|
||||||
|
val isEnabled = KObservableField(item.policy == Policy.ALLOW)
|
||||||
|
val shouldNotify = KObservableField(item.notification)
|
||||||
|
val shouldLog = KObservableField(item.logging)
|
||||||
|
|
||||||
|
fun toggle() = isExpanded.toggle()
|
||||||
|
|
||||||
|
private val rxBus: RxBus by inject()
|
||||||
|
|
||||||
|
init {
|
||||||
|
isEnabled.addOnPropertyChangedCallback {
|
||||||
|
it ?: return@addOnPropertyChangedCallback
|
||||||
|
rxBus.post(PolicyEnableEvent(this@PolicyRvItem, it))
|
||||||
|
}
|
||||||
|
shouldNotify.addOnPropertyChangedCallback {
|
||||||
|
it ?: return@addOnPropertyChangedCallback
|
||||||
|
item.notification = it
|
||||||
|
rxBus.post(PolicyUpdateEvent.Notification(this@PolicyRvItem))
|
||||||
|
}
|
||||||
|
shouldLog.addOnPropertyChangedCallback {
|
||||||
|
it ?: return@addOnPropertyChangedCallback
|
||||||
|
item.logging = it
|
||||||
|
rxBus.post(PolicyUpdateEvent.Log(this@PolicyRvItem))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun contentSameAs(other: PolicyRvItem): Boolean = itemSameAs(other)
|
||||||
|
override fun itemSameAs(other: PolicyRvItem): Boolean = item.uid == other.item.uid
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
|
||||||
|
class SectionRvItem(val text: String) : ComparableRvItem<SectionRvItem>() {
|
||||||
|
override val layoutRes: Int = R.layout.item_section
|
||||||
|
|
||||||
|
override fun contentSameAs(other: SectionRvItem) = itemSameAs(other)
|
||||||
|
override fun itemSameAs(other: SectionRvItem) = text == other.text
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.recycler
|
||||||
|
|
||||||
|
import com.skoumal.teanity.databinding.ComparableRvItem
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
|
||||||
|
class SpinnerRvItem(val item: String) : ComparableRvItem<SpinnerRvItem>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.item_spinner
|
||||||
|
|
||||||
|
override fun contentSameAs(other: SpinnerRvItem) = itemSameAs(other)
|
||||||
|
override fun itemSameAs(other: SpinnerRvItem) = item == other.item
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.topjohnwu.magisk.model.entity.state
|
||||||
|
|
||||||
|
enum class IndeterminateState {
|
||||||
|
CHECKED, INDETERMINATE, UNCHECKED
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.topjohnwu.magisk.model.events
|
||||||
|
|
||||||
|
import com.skoumal.teanity.rxbus.RxBus
|
||||||
|
import com.topjohnwu.magisk.model.entity.recycler.HideProcessRvItem
|
||||||
|
import com.topjohnwu.magisk.model.entity.recycler.ModuleRvItem
|
||||||
|
import com.topjohnwu.magisk.model.entity.recycler.PolicyRvItem
|
||||||
|
|
||||||
|
class HideProcessEvent(val item: HideProcessRvItem) : RxBus.Event
|
||||||
|
|
||||||
|
class PolicyEnableEvent(val item: PolicyRvItem, val enable: Boolean) : RxBus.Event
|
||||||
|
sealed class PolicyUpdateEvent(val item: PolicyRvItem) : RxBus.Event {
|
||||||
|
class Notification(item: PolicyRvItem) : PolicyUpdateEvent(item)
|
||||||
|
class Log(item: PolicyRvItem) : PolicyUpdateEvent(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
class ModuleUpdatedEvent(val item: ModuleRvItem) : RxBus.Event
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.topjohnwu.magisk.model.events
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import com.skoumal.teanity.viewevents.ViewEvent
|
||||||
|
import com.topjohnwu.magisk.model.entity.Policy
|
||||||
|
import com.topjohnwu.magisk.model.entity.Repo
|
||||||
|
import io.reactivex.subjects.PublishSubject
|
||||||
|
|
||||||
|
|
||||||
|
data class OpenLinkEvent(val url: String) : ViewEvent()
|
||||||
|
|
||||||
|
class ManagerInstallEvent : ViewEvent()
|
||||||
|
class MagiskInstallEvent : ViewEvent()
|
||||||
|
|
||||||
|
class ManagerChangelogEvent : ViewEvent()
|
||||||
|
class MagiskChangelogEvent : ViewEvent()
|
||||||
|
|
||||||
|
class UninstallEvent : ViewEvent()
|
||||||
|
class EnvFixEvent : ViewEvent()
|
||||||
|
|
||||||
|
class UpdateSafetyNetEvent : ViewEvent()
|
||||||
|
|
||||||
|
class ViewActionEvent(val action: Activity.() -> Unit) : ViewEvent()
|
||||||
|
|
||||||
|
class OpenFilePickerEvent : ViewEvent()
|
||||||
|
|
||||||
|
class OpenChangelogEvent(val item: Repo) : ViewEvent()
|
||||||
|
class InstallModuleEvent(val item: Repo) : ViewEvent()
|
||||||
|
|
||||||
|
class PageChangedEvent : ViewEvent()
|
||||||
|
|
||||||
|
class PermissionEvent(
|
||||||
|
val permissions: List<String>,
|
||||||
|
val callback: PublishSubject<Boolean>
|
||||||
|
) : ViewEvent()
|
||||||
|
|
||||||
|
class BackPressEvent : ViewEvent()
|
||||||
|
|
||||||
|
class SuDialogEvent(val policy: Policy) : ViewEvent()
|
||||||
|
class DieEvent : ViewEvent()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.topjohnwu.magisk.model.flash
|
||||||
|
|
||||||
|
interface FlashResultListener {
|
||||||
|
|
||||||
|
fun onResult(isSuccess: Boolean)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.topjohnwu.magisk.model.flash
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.net.Uri
|
||||||
|
import androidx.core.os.postDelayed
|
||||||
|
import com.topjohnwu.magisk.tasks.FlashZip
|
||||||
|
import com.topjohnwu.magisk.utils.Utils
|
||||||
|
import com.topjohnwu.magisk.utils.inject
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
import com.topjohnwu.superuser.internal.UiThreadHandler
|
||||||
|
|
||||||
|
sealed class Flashing(
|
||||||
|
uri: Uri,
|
||||||
|
private val console: MutableList<String>,
|
||||||
|
log: MutableList<String>,
|
||||||
|
private val resultListener: FlashResultListener
|
||||||
|
) : FlashZip(uri, console, log) {
|
||||||
|
|
||||||
|
override fun onResult(success: Boolean) {
|
||||||
|
if (!success) {
|
||||||
|
console.add("! Installation failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
resultListener.onResult(success)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Install(
|
||||||
|
uri: Uri,
|
||||||
|
console: MutableList<String>,
|
||||||
|
log: MutableList<String>,
|
||||||
|
resultListener: FlashResultListener
|
||||||
|
) : Flashing(uri, console, log, resultListener) {
|
||||||
|
|
||||||
|
override fun onResult(success: Boolean) {
|
||||||
|
if (success) {
|
||||||
|
Utils.loadModules()
|
||||||
|
}
|
||||||
|
super.onResult(success)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Uninstall(
|
||||||
|
uri: Uri,
|
||||||
|
console: MutableList<String>,
|
||||||
|
log: MutableList<String>,
|
||||||
|
resultListener: FlashResultListener
|
||||||
|
) : Flashing(uri, console, log, resultListener) {
|
||||||
|
|
||||||
|
private val context: Context by inject()
|
||||||
|
|
||||||
|
override fun onResult(success: Boolean) {
|
||||||
|
if (success) {
|
||||||
|
UiThreadHandler.handler.postDelayed(3000) {
|
||||||
|
Shell.su("pm uninstall " + context.packageName).exec()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.onResult(success)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.topjohnwu.magisk.model.flash
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
|
import com.topjohnwu.magisk.tasks.MagiskInstaller
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
|
||||||
|
sealed class Patching(
|
||||||
|
private val console: MutableList<String>,
|
||||||
|
logs: MutableList<String>,
|
||||||
|
private val resultListener: FlashResultListener
|
||||||
|
) : MagiskInstaller(console, logs) {
|
||||||
|
|
||||||
|
override fun onResult(success: Boolean) {
|
||||||
|
if (success) {
|
||||||
|
console.add("- All done!")
|
||||||
|
} else {
|
||||||
|
Shell.sh("rm -rf $installDir").submit()
|
||||||
|
console.add("! Installation failed")
|
||||||
|
}
|
||||||
|
resultListener.onResult(success)
|
||||||
|
}
|
||||||
|
|
||||||
|
class File(
|
||||||
|
private val uri: Uri,
|
||||||
|
console: MutableList<String>,
|
||||||
|
logs: MutableList<String>,
|
||||||
|
resultListener: FlashResultListener
|
||||||
|
) : Patching(console, logs, resultListener) {
|
||||||
|
override fun operations() =
|
||||||
|
extractZip() && handleFile(uri) && patchBoot() && storeBoot()
|
||||||
|
}
|
||||||
|
|
||||||
|
class SecondSlot(
|
||||||
|
console: MutableList<String>,
|
||||||
|
logs: MutableList<String>,
|
||||||
|
resultListener: FlashResultListener
|
||||||
|
) : Patching(console, logs, resultListener) {
|
||||||
|
override fun operations() =
|
||||||
|
findSecondaryImage() && extractZip() && patchBoot() && flashBoot() && postOTA()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Direct(
|
||||||
|
console: MutableList<String>,
|
||||||
|
logs: MutableList<String>,
|
||||||
|
resultListener: FlashResultListener
|
||||||
|
) : Patching(console, logs, resultListener) {
|
||||||
|
override fun operations() =
|
||||||
|
findImage() && extractZip() && patchBoot() && flashBoot()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.topjohnwu.magisk.model.navigation
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.annotation.AnimRes
|
||||||
|
import androidx.annotation.AnimatorRes
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.skoumal.teanity.viewevents.NavigationDslMarker
|
||||||
|
import com.skoumal.teanity.viewevents.ViewEvent
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
class MagiskNavigationEvent(
|
||||||
|
val navDirections: MagiskNavDirectionsBuilder,
|
||||||
|
val navOptions: MagiskNavOptions,
|
||||||
|
val animOptions: MagiskAnimBuilder
|
||||||
|
) : ViewEvent() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
operator fun invoke(builder: Builder.() -> Unit) = Builder().apply(builder).build()
|
||||||
|
}
|
||||||
|
|
||||||
|
@NavigationDslMarker
|
||||||
|
class Builder {
|
||||||
|
|
||||||
|
private var animOptions: MagiskAnimBuilder = MagiskAnimBuilder()
|
||||||
|
private var navOptions: MagiskNavOptions = MagiskNavOptions()
|
||||||
|
private val directionsBuilder = MagiskNavDirectionsBuilder()
|
||||||
|
|
||||||
|
fun args(builder: Bundle.() -> Unit) = directionsBuilder.args(builder)
|
||||||
|
|
||||||
|
fun navAnim(builder: MagiskAnimBuilder.() -> Unit) {
|
||||||
|
animOptions = MagiskAnimBuilder().apply(builder)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun navOptions(builder: MagiskNavOptions.() -> Unit) {
|
||||||
|
navOptions = MagiskNavOptions().apply(builder)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun navDirections(builder: MagiskNavDirectionsBuilder.() -> Unit) {
|
||||||
|
directionsBuilder.apply(builder)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun build() = MagiskNavigationEvent(directionsBuilder, navOptions, animOptions)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NavigationDslMarker
|
||||||
|
class MagiskNavDirectionsBuilder {
|
||||||
|
|
||||||
|
var destination: KClass<out Fragment>? = null
|
||||||
|
var isActivity: Boolean = false
|
||||||
|
val args: Bundle = Bundle()
|
||||||
|
|
||||||
|
fun args(builder: Bundle.() -> Unit) = args.apply(builder)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NavigationDslMarker
|
||||||
|
class MagiskNavOptions {
|
||||||
|
var popUpTo: KClass<*>? = null
|
||||||
|
var inclusive: Boolean = false
|
||||||
|
var clearTask: Boolean = false
|
||||||
|
var singleTop: Boolean = false
|
||||||
|
}
|
||||||
|
|
||||||
|
@NavigationDslMarker
|
||||||
|
class MagiskAnimBuilder {
|
||||||
|
@AnimRes
|
||||||
|
@AnimatorRes
|
||||||
|
var enter = 0
|
||||||
|
|
||||||
|
@AnimRes
|
||||||
|
@AnimatorRes
|
||||||
|
var exit = 0
|
||||||
|
|
||||||
|
@AnimRes
|
||||||
|
@AnimatorRes
|
||||||
|
var popEnter = 0
|
||||||
|
|
||||||
|
@AnimRes
|
||||||
|
@AnimatorRes
|
||||||
|
var popExit = 0
|
||||||
|
|
||||||
|
val anySet: Boolean get() = enter != 0 || exit != 0 || popEnter != 0 || popExit != 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.topjohnwu.magisk.model.navigation
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.ui.hide.MagiskHideFragment
|
||||||
|
import com.topjohnwu.magisk.ui.home.HomeFragment
|
||||||
|
import com.topjohnwu.magisk.ui.log.LogFragment
|
||||||
|
import com.topjohnwu.magisk.ui.module.ModulesFragment
|
||||||
|
import com.topjohnwu.magisk.ui.module.ReposFragment
|
||||||
|
import com.topjohnwu.magisk.ui.settings.SettingsFragment
|
||||||
|
import com.topjohnwu.magisk.ui.superuser.SuperuserFragment
|
||||||
|
|
||||||
|
|
||||||
|
object Navigation {
|
||||||
|
|
||||||
|
fun home() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = HomeFragment::class }
|
||||||
|
navOptions { popUpTo = HomeFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun superuser() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = SuperuserFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun modules() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = ModulesFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun repos() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = ReposFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun hide() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = MagiskHideFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun log() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = LogFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun settings() = MagiskNavigationEvent {
|
||||||
|
navDirections { destination = SettingsFragment::class }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun fromSection(section: String) = when (section) {
|
||||||
|
"superuser" -> superuser()
|
||||||
|
"modules" -> modules()
|
||||||
|
"downloads" -> repos()
|
||||||
|
"magiskhide" -> hide()
|
||||||
|
"log" -> log()
|
||||||
|
"settings" -> settings()
|
||||||
|
else -> home()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
object Main {
|
||||||
|
const val OPEN_NAV = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.topjohnwu.magisk.model.navigation
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
interface Navigator {
|
||||||
|
|
||||||
|
//TODO Elevate Fragment to MagiskFragment<*,*> once everything is on board with it
|
||||||
|
val baseFragments: List<KClass<out Fragment>>
|
||||||
|
|
||||||
|
fun navigateTo(event: MagiskNavigationEvent)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.topjohnwu.magisk.model.observer
|
||||||
|
|
||||||
|
import androidx.databinding.Observable
|
||||||
|
import androidx.databinding.ObservableField
|
||||||
|
import java.io.Serializable
|
||||||
|
|
||||||
|
|
||||||
|
class Observer<T>(vararg dependencies: Observable, private val observer: () -> T) :
|
||||||
|
ObservableField<T>(*dependencies), Serializable {
|
||||||
|
|
||||||
|
val value: T get() = observer()
|
||||||
|
|
||||||
|
@Deprecated(
|
||||||
|
message = "Use KObservableField.value syntax from code",
|
||||||
|
replaceWith = ReplaceWith("value")
|
||||||
|
)
|
||||||
|
override fun get(): T {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated(
|
||||||
|
message = "Observer cannot be set",
|
||||||
|
level = DeprecationLevel.HIDDEN
|
||||||
|
)
|
||||||
|
override fun set(newValue: T) {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return "Observer(value=$value)"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.topjohnwu.magisk.model.permissions
|
||||||
|
|
||||||
|
typealias SimpleCallback = () -> Unit
|
||||||
|
typealias PermissionRationaleCallback = (List<String>) -> Unit
|
||||||
|
|
||||||
|
class PermissionRequestBuilder {
|
||||||
|
|
||||||
|
private var onSuccessCallback: SimpleCallback = {}
|
||||||
|
private var onFailureCallback: SimpleCallback = {}
|
||||||
|
private var onShowRationaleCallback: PermissionRationaleCallback = {}
|
||||||
|
|
||||||
|
fun onSuccess(callback: SimpleCallback) {
|
||||||
|
onSuccessCallback = callback
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onFailure(callback: SimpleCallback) {
|
||||||
|
onFailureCallback = callback
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onShowRationale(callback: PermissionRationaleCallback) {
|
||||||
|
onShowRationaleCallback = callback
|
||||||
|
}
|
||||||
|
|
||||||
|
fun build(): PermissionRequest {
|
||||||
|
return PermissionRequest(onSuccessCallback, onFailureCallback, onShowRationaleCallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class PermissionRequest(
|
||||||
|
private val onSuccessCallback: SimpleCallback,
|
||||||
|
private val onFailureCallback: SimpleCallback,
|
||||||
|
private val onShowRationaleCallback: PermissionRationaleCallback
|
||||||
|
) {
|
||||||
|
|
||||||
|
fun onSuccess() = onSuccessCallback()
|
||||||
|
fun onFailure() = onFailureCallback()
|
||||||
|
fun onShowRationale(permissions: List<String>) = onShowRationaleCallback(permissions)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package com.topjohnwu.magisk.model.receiver
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import com.topjohnwu.magisk.ClassMap
|
||||||
|
import com.topjohnwu.magisk.Config
|
||||||
|
import com.topjohnwu.magisk.Const
|
||||||
|
import com.topjohnwu.magisk.data.database.MagiskDB
|
||||||
|
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity
|
||||||
|
import com.topjohnwu.magisk.utils.DownloadApp
|
||||||
|
import com.topjohnwu.magisk.utils.RootUtils
|
||||||
|
import com.topjohnwu.magisk.utils.SuLogger
|
||||||
|
import com.topjohnwu.magisk.utils.get
|
||||||
|
import com.topjohnwu.magisk.view.Notifications
|
||||||
|
import com.topjohnwu.magisk.view.Shortcuts
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
|
||||||
|
open class GeneralReceiver : BroadcastReceiver() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val REQUEST = "request"
|
||||||
|
const val LOG = "log"
|
||||||
|
const val NOTIFY = "notify"
|
||||||
|
const val TEST = "test"
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getPkg(intent: Intent): String {
|
||||||
|
return intent.data?.encodedSchemeSpecificPart ?: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onReceive(context: Context, intent: Intent?) {
|
||||||
|
if (intent == null)
|
||||||
|
return
|
||||||
|
val mDB: MagiskDB = get()
|
||||||
|
var action: String? = intent.action ?: return
|
||||||
|
when (action) {
|
||||||
|
Intent.ACTION_REBOOT, Intent.ACTION_BOOT_COMPLETED -> {
|
||||||
|
action = intent.getStringExtra("action")
|
||||||
|
if (action == null) {
|
||||||
|
// Actual boot completed event
|
||||||
|
Shell.su("mm_patch_dtbo").submit { result ->
|
||||||
|
if (result.isSuccess)
|
||||||
|
Notifications.dtboPatched()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
when (action) {
|
||||||
|
REQUEST -> {
|
||||||
|
val i = Intent(context, ClassMap.get<Any>(SuRequestActivity::class.java))
|
||||||
|
.setAction(action)
|
||||||
|
.putExtra("socket", intent.getStringExtra("socket"))
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
||||||
|
context.startActivity(i)
|
||||||
|
}
|
||||||
|
LOG -> SuLogger.handleLogs(intent)
|
||||||
|
NOTIFY -> SuLogger.handleNotify(intent)
|
||||||
|
TEST -> Shell.su("magisk --use-broadcast").submit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Intent.ACTION_PACKAGE_REPLACED ->
|
||||||
|
// This will only work pre-O
|
||||||
|
if (Config.get<Boolean>(Config.Key.SU_REAUTH)!!) {
|
||||||
|
mDB.deletePolicy(getPkg(intent))
|
||||||
|
}
|
||||||
|
Intent.ACTION_PACKAGE_FULLY_REMOVED -> {
|
||||||
|
val pkg = getPkg(intent)
|
||||||
|
mDB.deletePolicy(pkg)
|
||||||
|
Shell.su("magiskhide --rm $pkg").submit()
|
||||||
|
}
|
||||||
|
Intent.ACTION_LOCALE_CHANGED -> Shortcuts.setup(context)
|
||||||
|
Const.Key.BROADCAST_MANAGER_UPDATE -> {
|
||||||
|
Config.managerLink = intent.getStringExtra(Const.Key.INTENT_SET_LINK)
|
||||||
|
DownloadApp.upgrade(intent.getStringExtra(Const.Key.INTENT_SET_NAME))
|
||||||
|
}
|
||||||
|
Const.Key.BROADCAST_REBOOT -> RootUtils.reboot()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.topjohnwu.magisk.model.update;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.work.ListenableWorker;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App;
|
||||||
|
import com.topjohnwu.magisk.BuildConfig;
|
||||||
|
import com.topjohnwu.magisk.Config;
|
||||||
|
import com.topjohnwu.magisk.model.worker.DelegateWorker;
|
||||||
|
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||||
|
import com.topjohnwu.magisk.view.Notifications;
|
||||||
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
|
||||||
|
public class UpdateCheckService extends DelegateWorker {
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ListenableWorker.Result doWork() {
|
||||||
|
if (App.foreground() == null) {
|
||||||
|
Shell.getShell();
|
||||||
|
CheckUpdates.check(this::onCheckDone);
|
||||||
|
}
|
||||||
|
return ListenableWorker.Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onCheckDone() {
|
||||||
|
if (BuildConfig.VERSION_CODE < Config.remoteManagerVersionCode) {
|
||||||
|
Notifications.managerUpdate();
|
||||||
|
} else if (Config.magiskVersionCode < Config.remoteMagiskVersionCode) {
|
||||||
|
Notifications.magiskUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.topjohnwu.magisk.model.worker;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.Network;
|
||||||
|
import android.net.Uri;
|
||||||
|
|
||||||
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import androidx.annotation.MainThread;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.work.Data;
|
||||||
|
import androidx.work.ListenableWorker;
|
||||||
|
|
||||||
|
public abstract class DelegateWorker {
|
||||||
|
|
||||||
|
private ListenableWorker worker;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public abstract ListenableWorker.Result doWork();
|
||||||
|
|
||||||
|
public void onStopped() {}
|
||||||
|
|
||||||
|
public void setActualWorker(ListenableWorker w) {
|
||||||
|
worker = w;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public Context getApplicationContext() {
|
||||||
|
return worker.getApplicationContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public UUID getId() {
|
||||||
|
return worker.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public Data getInputData() {
|
||||||
|
return worker.getInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public Set<String> getTags() {
|
||||||
|
return worker.getTags();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@RequiresApi(24)
|
||||||
|
public List<Uri> getTriggeredContentUris() {
|
||||||
|
return worker.getTriggeredContentUris();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@RequiresApi(24)
|
||||||
|
public List<String> getTriggeredContentAuthorities() {
|
||||||
|
return worker.getTriggeredContentAuthorities();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@RequiresApi(28)
|
||||||
|
public Network getNetwork() {
|
||||||
|
return worker.getNetwork();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRunAttemptCount() {
|
||||||
|
return worker.getRunAttemptCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@MainThread
|
||||||
|
public ListenableFuture<ListenableWorker.Result> startWork() {
|
||||||
|
return worker.startWork();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStopped() {
|
||||||
|
return worker.isStopped();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.module;
|
|
||||||
|
|
||||||
|
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public abstract class BaseModule implements Comparable<BaseModule> {
|
|
||||||
|
|
||||||
protected String mId, mName, mVersion, mAuthor, mDescription, mSupportUrl, mDonateUrl;
|
|
||||||
protected boolean mIsCacheModule = false;
|
|
||||||
protected int mVersionCode = 0;
|
|
||||||
|
|
||||||
protected void parseProps(List<String> props) throws CacheModException { parseProps(props.toArray(new String[props.size()])); }
|
|
||||||
|
|
||||||
protected void parseProps(String[] props) throws CacheModException {
|
|
||||||
for (String line : props) {
|
|
||||||
String[] prop = line.split("=", 2);
|
|
||||||
if (prop.length != 2) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
String key = prop[0].trim();
|
|
||||||
if (key.charAt(0) == '#') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (key) {
|
|
||||||
case "id":
|
|
||||||
this.mId = prop[1];
|
|
||||||
break;
|
|
||||||
case "name":
|
|
||||||
this.mName = prop[1];
|
|
||||||
break;
|
|
||||||
case "version":
|
|
||||||
this.mVersion = prop[1];
|
|
||||||
break;
|
|
||||||
case "versionCode":
|
|
||||||
try {
|
|
||||||
this.mVersionCode = Integer.parseInt(prop[1]);
|
|
||||||
} catch (NumberFormatException ignored) {}
|
|
||||||
break;
|
|
||||||
case "author":
|
|
||||||
this.mAuthor = prop[1];
|
|
||||||
break;
|
|
||||||
case "description":
|
|
||||||
this.mDescription = prop[1];
|
|
||||||
break;
|
|
||||||
case "support":
|
|
||||||
this.mSupportUrl = prop[1];
|
|
||||||
break;
|
|
||||||
case "donate":
|
|
||||||
this.mDonateUrl = prop[1];
|
|
||||||
break;
|
|
||||||
case "cacheModule":
|
|
||||||
this.mIsCacheModule = Boolean.parseBoolean(prop[1]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mIsCacheModule)
|
|
||||||
throw new CacheModException(mId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return mName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersion() {
|
|
||||||
return mVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuthor() {
|
|
||||||
return mAuthor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {return mId; }
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return mDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getVersionCode() {
|
|
||||||
return mVersionCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDonateUrl() {
|
|
||||||
return mDonateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSupportUrl() {
|
|
||||||
return mSupportUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CacheModException extends Exception {
|
|
||||||
public CacheModException(String id) {
|
|
||||||
Logger.dev("Cache mods are no longer supported! id: " + id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compareTo(@NonNull BaseModule o) {
|
|
||||||
return this.getName().toLowerCase().compareTo(o.getName().toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.module;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
public class Module extends BaseModule {
|
|
||||||
|
|
||||||
private String mRemoveFile, mDisableFile, mUpdateFile;
|
|
||||||
private boolean mEnable, mRemove, mUpdated;
|
|
||||||
|
|
||||||
public Module(String path) throws CacheModException {
|
|
||||||
|
|
||||||
parseProps(Utils.readFile(path + "/module.prop"));
|
|
||||||
|
|
||||||
mRemoveFile = path + "/remove";
|
|
||||||
mDisableFile = path + "/disable";
|
|
||||||
mUpdateFile = path + "/update";
|
|
||||||
|
|
||||||
if (mId == null) {
|
|
||||||
int sep = path.lastIndexOf('/');
|
|
||||||
mId = path.substring(sep + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mName == null)
|
|
||||||
mName = mId;
|
|
||||||
|
|
||||||
Logger.dev("Creating Module, id: " + mId);
|
|
||||||
|
|
||||||
mEnable = !Utils.itemExist(mDisableFile);
|
|
||||||
mRemove = Utils.itemExist(mRemoveFile);
|
|
||||||
mUpdated = Utils.itemExist(mUpdateFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void createDisableFile() {
|
|
||||||
mEnable = !Utils.createFile(mDisableFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeDisableFile() {
|
|
||||||
mEnable = Utils.removeItem(mDisableFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabled() {
|
|
||||||
return mEnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void createRemoveFile() {
|
|
||||||
mRemove = Utils.createFile(mRemoveFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteRemoveFile() {
|
|
||||||
mRemove = !Utils.removeItem(mRemoveFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean willBeRemoved() {
|
|
||||||
return mRemove;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUpdated() {
|
|
||||||
return mUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.module;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.WebService;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class Repo extends BaseModule {
|
|
||||||
private String mLogUrl, mManifestUrl, mZipUrl;
|
|
||||||
private Date mLastUpdate;
|
|
||||||
|
|
||||||
public Repo(Context context, String name, Date lastUpdate) throws CacheModException {
|
|
||||||
mLastUpdate = lastUpdate;
|
|
||||||
mLogUrl = context.getString(R.string.file_url, name, "changelog.txt");
|
|
||||||
mManifestUrl = context.getString(R.string.file_url, name, "module.prop");
|
|
||||||
mZipUrl = context.getString(R.string.zip_url, name);
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update() throws CacheModException {
|
|
||||||
Logger.dev("Repo: Re-fetch prop");
|
|
||||||
String props = WebService.request(mManifestUrl, WebService.GET, true);
|
|
||||||
String lines[] = props.split("\\n");
|
|
||||||
parseProps(lines);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(Date lastUpdate) throws CacheModException {
|
|
||||||
Logger.dev("Repo: Old: " + mLastUpdate);
|
|
||||||
Logger.dev("Repo: New: " + lastUpdate);
|
|
||||||
if (mIsCacheModule)
|
|
||||||
throw new CacheModException(mId);
|
|
||||||
if (lastUpdate.after(mLastUpdate)) {
|
|
||||||
mLastUpdate = lastUpdate;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getZipUrl() {
|
|
||||||
return mZipUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLogUrl() {
|
|
||||||
return mLogUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getManifestUrl() {
|
|
||||||
return mManifestUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return mLastUpdate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.receivers;
|
|
||||||
|
|
||||||
import android.app.DownloadManager;
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
|
||||||
|
|
||||||
public abstract class DownloadReceiver extends BroadcastReceiver {
|
|
||||||
public Context mContext;
|
|
||||||
public String mFilename;
|
|
||||||
long downloadID;
|
|
||||||
|
|
||||||
public DownloadReceiver() {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
mContext = context;
|
|
||||||
DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
|
||||||
String action = intent.getAction();
|
|
||||||
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) {
|
|
||||||
DownloadManager.Query query = new DownloadManager.Query();
|
|
||||||
query.setFilterById(downloadID);
|
|
||||||
Cursor c = downloadManager.query(query);
|
|
||||||
if (c.moveToFirst()) {
|
|
||||||
int columnIndex = c.getColumnIndex(DownloadManager.COLUMN_STATUS);
|
|
||||||
int status = c.getInt(columnIndex);
|
|
||||||
switch (status) {
|
|
||||||
case DownloadManager.STATUS_SUCCESSFUL:
|
|
||||||
Uri uri = Uri.parse(c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
|
|
||||||
onDownloadDone(uri);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Toast.makeText(context, R.string.download_file_error, Toast.LENGTH_LONG).show();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
context.unregisterReceiver(this);
|
|
||||||
}
|
|
||||||
c.close();
|
|
||||||
}
|
|
||||||
Utils.isDownloading = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDownloadID(long id) {
|
|
||||||
downloadID = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFilename(String filename) {
|
|
||||||
mFilename = filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void onDownloadDone(Uri uri);
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.receivers;
|
|
||||||
|
|
||||||
import android.net.Uri;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.StatusFragment;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
|
||||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class MagiskDlReceiver extends DownloadReceiver {
|
|
||||||
|
|
||||||
String mBoot;
|
|
||||||
boolean mEnc, mVerity;
|
|
||||||
|
|
||||||
public MagiskDlReceiver(String bootImage, boolean keepEnc, boolean keepVerity) {
|
|
||||||
mBoot = bootImage;
|
|
||||||
mEnc = keepEnc;
|
|
||||||
mVerity = keepVerity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDownloadDone(Uri uri) {
|
|
||||||
new Async.FlashZIP(mContext, uri, mFilename) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void preProcessing() throws Throwable {
|
|
||||||
Shell.su(
|
|
||||||
"echo \"BOOTIMAGE=/dev/block/" + mBoot + "\" > /dev/.magisk",
|
|
||||||
"echo \"KEEPFORCEENCRYPT=" + String.valueOf(mEnc) + "\" >> /dev/.magisk",
|
|
||||||
"echo \"KEEPVERITY=" + String.valueOf(mVerity) + "\" >> /dev/.magisk"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean unzipAndCheck() {
|
|
||||||
publishProgress(mContext.getString(R.string.zip_install_unzip_zip_msg));
|
|
||||||
if (Shell.rootAccess()) {
|
|
||||||
// We might not have busybox yet, unzip with Java
|
|
||||||
// We will have complete busybox after Magisk installation
|
|
||||||
ZipUtils.unzip(mCachedFile, new File(mCachedFile.getParent(), "magisk"));
|
|
||||||
Shell.su(
|
|
||||||
"mkdir -p " + Async.TMP_FOLDER_PATH + "/magisk",
|
|
||||||
"cp -af " + mCachedFile.getParent() + "/magisk/. " + Async.TMP_FOLDER_PATH + "/magisk",
|
|
||||||
"mv -f " + mCachedFile.getParent() + "/magisk/META-INF " + mCachedFile.getParent() + "/META-INF"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onSuccess() {
|
|
||||||
new Async.RootTask<Void, Void, Void>() {
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params) {
|
|
||||||
Shell.su("setprop magisk.version "
|
|
||||||
+ String.valueOf(StatusFragment.remoteMagiskVersion));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
super.onSuccess();
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.topjohnwu.magisk.receivers;
|
|
||||||
|
|
||||||
import android.net.Uri;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils.ByteArrayInOutStream;
|
|
||||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
|
||||||
|
|
||||||
import java.io.OutputStream;
|
|
||||||
|
|
||||||
public class RepoDlReceiver extends DownloadReceiver {
|
|
||||||
@Override
|
|
||||||
public void onDownloadDone(Uri uri) {
|
|
||||||
// Flash the zip
|
|
||||||
new Async.FlashZIP(mContext, uri, mFilename){
|
|
||||||
@Override
|
|
||||||
protected void preProcessing() throws Throwable {
|
|
||||||
// Process and sign the zip
|
|
||||||
publishProgress(mContext.getString(R.string.zip_install_process_zip_msg));
|
|
||||||
ByteArrayInOutStream buffer = new ByteArrayInOutStream();
|
|
||||||
|
|
||||||
// First remove top folder (the folder with the repo name) in Github source zip
|
|
||||||
ZipUtils.removeTopFolder(mContext.getContentResolver().openInputStream(mUri), buffer);
|
|
||||||
|
|
||||||
// Then sign the zip for the first time
|
|
||||||
ZipUtils.signZip(mContext, buffer.getInputStream(), buffer, false);
|
|
||||||
|
|
||||||
// Adjust the zip to prevent unzip issues
|
|
||||||
ZipUtils.adjustZip(buffer);
|
|
||||||
|
|
||||||
// Finally, sign the whole zip file again
|
|
||||||
ZipUtils.signZip(mContext, buffer.getInputStream(), buffer, true);
|
|
||||||
|
|
||||||
// Write it back to the downloaded zip
|
|
||||||
OutputStream out = mContext.getContentResolver().openOutputStream(mUri);
|
|
||||||
buffer.writeTo(out);
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
}.exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
132
app/src/main/java/com/topjohnwu/magisk/tasks/CheckUpdates.java
Normal file
132
app/src/main/java/com/topjohnwu/magisk/tasks/CheckUpdates.java
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
package com.topjohnwu.magisk.tasks;
|
||||||
|
|
||||||
|
import android.os.SystemClock;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.Config;
|
||||||
|
import com.topjohnwu.magisk.Const;
|
||||||
|
import com.topjohnwu.magisk.utils.Event;
|
||||||
|
import com.topjohnwu.net.Networking;
|
||||||
|
import com.topjohnwu.net.Request;
|
||||||
|
import com.topjohnwu.net.ResponseListener;
|
||||||
|
import com.topjohnwu.superuser.ShellUtils;
|
||||||
|
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class CheckUpdates {
|
||||||
|
|
||||||
|
private static Request getRequest() {
|
||||||
|
String url;
|
||||||
|
switch ((int) Config.get(Config.Key.UPDATE_CHANNEL)) {
|
||||||
|
case Config.Value.BETA_CHANNEL:
|
||||||
|
url = Const.Url.BETA_URL;
|
||||||
|
break;
|
||||||
|
case Config.Value.CUSTOM_CHANNEL:
|
||||||
|
url = Config.get(Config.Key.CUSTOM_CHANNEL);
|
||||||
|
break;
|
||||||
|
case Config.Value.CANARY_CHANNEL:
|
||||||
|
url = Const.Url.CANARY_URL;
|
||||||
|
break;
|
||||||
|
case Config.Value.CANARY_DEBUG_CHANNEL:
|
||||||
|
url = Const.Url.CANARY_DEBUG_URL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
url = Const.Url.STABLE_URL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return Networking.get(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void check() {
|
||||||
|
check(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void check(Runnable cb) {
|
||||||
|
Request request = getRequest();
|
||||||
|
UpdateListener listener = new UpdateListener(cb);
|
||||||
|
if (ShellUtils.onMainThread()) {
|
||||||
|
request.getAsJSONObject(listener);
|
||||||
|
} else {
|
||||||
|
JSONObject json = request.execForJSONObject().getResult();
|
||||||
|
if (json != null)
|
||||||
|
listener.onResponse(json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class UpdateListener implements ResponseListener<JSONObject> {
|
||||||
|
|
||||||
|
private Runnable cb;
|
||||||
|
private long start;
|
||||||
|
|
||||||
|
UpdateListener(Runnable callback) {
|
||||||
|
cb = callback;
|
||||||
|
start = SystemClock.uptimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getInt(JSONObject json, String name, int defValue) {
|
||||||
|
if (json == null)
|
||||||
|
return defValue;
|
||||||
|
try {
|
||||||
|
return json.getInt(name);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getString(JSONObject json, String name, String defValue) {
|
||||||
|
if (json == null)
|
||||||
|
return defValue;
|
||||||
|
try {
|
||||||
|
return json.getString(name);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject getJson(JSONObject json, String name) {
|
||||||
|
try {
|
||||||
|
return json.getJSONObject(name);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(JSONObject json) {
|
||||||
|
JSONObject magisk = getJson(json, "magisk");
|
||||||
|
Config.remoteMagiskVersionCode = getInt(magisk, "versionCode", -1);
|
||||||
|
|
||||||
|
if ((int) Config.get(Config.Key.UPDATE_CHANNEL) == Config.Value.DEFAULT_CHANNEL) {
|
||||||
|
if (Config.magiskVersionCode > Config.remoteMagiskVersionCode) {
|
||||||
|
// If we are newer than current stable channel, switch to beta
|
||||||
|
Config.set(Config.Key.UPDATE_CHANNEL, Config.Value.BETA_CHANNEL);
|
||||||
|
check(cb);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
Config.set(Config.Key.UPDATE_CHANNEL, Config.Value.STABLE_CHANNEL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Config.remoteMagiskVersionString = getString(magisk, "version", null);
|
||||||
|
Config.magiskLink = getString(magisk, "link", null);
|
||||||
|
Config.magiskNoteLink = getString(magisk, "note", null);
|
||||||
|
Config.magiskMD5 = getString(magisk, "md5", null);
|
||||||
|
|
||||||
|
JSONObject manager = getJson(json, "app");
|
||||||
|
Config.remoteManagerVersionString = getString(manager, "version", null);
|
||||||
|
Config.remoteManagerVersionCode = getInt(manager, "versionCode", -1);
|
||||||
|
Config.managerLink = getString(manager, "link", null);
|
||||||
|
Config.managerNoteLink = getString(manager, "note", null);
|
||||||
|
|
||||||
|
JSONObject uninstaller = getJson(json, "uninstaller");
|
||||||
|
Config.uninstallerLink = getString(uninstaller, "link", null);
|
||||||
|
|
||||||
|
UiThreadHandler.handler.postAtTime(() -> Event.trigger(Event.UPDATE_CHECK_DONE),
|
||||||
|
start + 1000 /* Add artificial delay to let UI behave correctly */);
|
||||||
|
|
||||||
|
if (cb != null)
|
||||||
|
cb.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
96
app/src/main/java/com/topjohnwu/magisk/tasks/FlashZip.kt
Normal file
96
app/src/main/java/com/topjohnwu/magisk/tasks/FlashZip.kt
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
package com.topjohnwu.magisk.tasks
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
|
import com.skoumal.teanity.extensions.subscribeK
|
||||||
|
import com.topjohnwu.magisk.App
|
||||||
|
import com.topjohnwu.magisk.Const
|
||||||
|
import com.topjohnwu.magisk.utils.fileName
|
||||||
|
import com.topjohnwu.magisk.utils.inject
|
||||||
|
import com.topjohnwu.magisk.utils.readUri
|
||||||
|
import com.topjohnwu.magisk.utils.unzip
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
import io.reactivex.Single
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileNotFoundException
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
|
abstract class FlashZip(
|
||||||
|
private val mUri: Uri,
|
||||||
|
private val console: MutableList<String>,
|
||||||
|
private val logs: MutableList<String>
|
||||||
|
) {
|
||||||
|
|
||||||
|
private val app: App by inject()
|
||||||
|
private val tmpFile: File = File(app.cacheDir, "install.zip")
|
||||||
|
|
||||||
|
@Throws(IOException::class)
|
||||||
|
private fun unzipAndCheck(): Boolean {
|
||||||
|
val parentFile = tmpFile.parentFile ?: return false
|
||||||
|
tmpFile.unzip(parentFile, "META-INF/com/google/android", true)
|
||||||
|
|
||||||
|
val updaterScript = File(parentFile, "updater-script")
|
||||||
|
return Shell
|
||||||
|
.su("grep -q '#MAGISK' $updaterScript")
|
||||||
|
.exec()
|
||||||
|
.isSuccess
|
||||||
|
}
|
||||||
|
|
||||||
|
@Throws(IOException::class)
|
||||||
|
private fun flash(): Boolean {
|
||||||
|
console.add("- Copying zip to temp directory")
|
||||||
|
|
||||||
|
runCatching {
|
||||||
|
app.readUri(mUri).use { input ->
|
||||||
|
tmpFile.outputStream().use { out -> input.copyTo(out) }
|
||||||
|
}
|
||||||
|
}.getOrElse {
|
||||||
|
when (it) {
|
||||||
|
is FileNotFoundException -> console.add("! Invalid Uri")
|
||||||
|
is IOException -> console.add("! Cannot copy to cache")
|
||||||
|
}
|
||||||
|
throw it
|
||||||
|
}
|
||||||
|
|
||||||
|
val isMagiskModule = runCatching {
|
||||||
|
unzipAndCheck()
|
||||||
|
}.getOrElse {
|
||||||
|
console.add("! Unzip error")
|
||||||
|
throw it
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isMagiskModule) {
|
||||||
|
console.add("! This zip is not a Magisk Module!")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
console.add("- Installing ${mUri.fileName}")
|
||||||
|
|
||||||
|
val parentFile = tmpFile.parent ?: return false
|
||||||
|
|
||||||
|
return Shell
|
||||||
|
.su(
|
||||||
|
"cd $parentFile",
|
||||||
|
"BOOTMODE=true sh update-binary dummy 1 $tmpFile"
|
||||||
|
)
|
||||||
|
.to(console, logs)
|
||||||
|
.exec().isSuccess
|
||||||
|
}
|
||||||
|
|
||||||
|
fun exec() = Single
|
||||||
|
.fromCallable {
|
||||||
|
runCatching {
|
||||||
|
flash()
|
||||||
|
}.getOrElse {
|
||||||
|
it.printStackTrace()
|
||||||
|
false
|
||||||
|
}.apply {
|
||||||
|
Shell.su("cd /", "rm -rf ${tmpFile.parent} ${Const.TMP_FOLDER_PATH}")
|
||||||
|
.submit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.subscribeK(onError = { onResult(false) }) { onResult(it) }
|
||||||
|
.let { Unit } // ignores result disposable
|
||||||
|
|
||||||
|
|
||||||
|
protected abstract fun onResult(success: Boolean)
|
||||||
|
}
|
||||||
@@ -0,0 +1,380 @@
|
|||||||
|
package com.topjohnwu.magisk.tasks;
|
||||||
|
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.MainThread;
|
||||||
|
import androidx.annotation.WorkerThread;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App;
|
||||||
|
import com.topjohnwu.magisk.Config;
|
||||||
|
import com.topjohnwu.magisk.Const;
|
||||||
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
import com.topjohnwu.net.DownloadProgressListener;
|
||||||
|
import com.topjohnwu.net.Networking;
|
||||||
|
import com.topjohnwu.signing.SignBoot;
|
||||||
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
import com.topjohnwu.superuser.ShellUtils;
|
||||||
|
import com.topjohnwu.superuser.internal.NOPList;
|
||||||
|
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||||
|
import com.topjohnwu.superuser.io.SuFile;
|
||||||
|
import com.topjohnwu.superuser.io.SuFileInputStream;
|
||||||
|
import com.topjohnwu.superuser.io.SuFileOutputStream;
|
||||||
|
|
||||||
|
import org.kamranzafar.jtar.TarEntry;
|
||||||
|
import org.kamranzafar.jtar.TarHeader;
|
||||||
|
import org.kamranzafar.jtar.TarInputStream;
|
||||||
|
import org.kamranzafar.jtar.TarOutputStream;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
|
public abstract class MagiskInstaller {
|
||||||
|
|
||||||
|
protected String srcBoot;
|
||||||
|
protected File destFile;
|
||||||
|
protected File installDir;
|
||||||
|
|
||||||
|
private List<String> console, logs;
|
||||||
|
private boolean isTar = false;
|
||||||
|
|
||||||
|
private class ProgressLog implements DownloadProgressListener {
|
||||||
|
|
||||||
|
private int prev = -1;
|
||||||
|
private int location;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProgress(long bytesDownloaded, long totalBytes) {
|
||||||
|
if (prev < 0) {
|
||||||
|
location = console.size();
|
||||||
|
console.add("... 0%");
|
||||||
|
}
|
||||||
|
int curr = (int) (100 * bytesDownloaded / totalBytes);
|
||||||
|
if (prev != curr) {
|
||||||
|
prev = curr;
|
||||||
|
console.set(location, "... " + prev + "%");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MagiskInstaller() {
|
||||||
|
console = NOPList.getInstance();
|
||||||
|
logs = NOPList.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MagiskInstaller(List<String> out, List<String> err) {
|
||||||
|
console = out;
|
||||||
|
logs = err;
|
||||||
|
installDir = new File(App.deContext.getFilesDir().getParent(), "install");
|
||||||
|
Shell.sh("rm -rf " + installDir).exec();
|
||||||
|
installDir.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean findImage() {
|
||||||
|
srcBoot = ShellUtils.fastCmd("find_boot_image", "echo \"$BOOTIMAGE\"");
|
||||||
|
if (srcBoot.isEmpty()) {
|
||||||
|
console.add("! Unable to detect target image");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
console.add("- Target image: " + srcBoot);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean findSecondaryImage() {
|
||||||
|
String slot = ShellUtils.fastCmd("echo $SLOT");
|
||||||
|
String target = (TextUtils.equals(slot, "_a") ? "_b" : "_a");
|
||||||
|
console.add("- Target slot: " + target);
|
||||||
|
srcBoot = ShellUtils.fastCmd(
|
||||||
|
"SLOT=" + target,
|
||||||
|
"find_boot_image",
|
||||||
|
"SLOT=" + slot,
|
||||||
|
"echo \"$BOOTIMAGE\""
|
||||||
|
);
|
||||||
|
if (srcBoot.isEmpty()) {
|
||||||
|
console.add("! Unable to detect target image");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
console.add("- Target image: " + srcBoot);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean extractZip() {
|
||||||
|
String arch;
|
||||||
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
|
List<String> abis = Arrays.asList(Build.SUPPORTED_ABIS);
|
||||||
|
arch = abis.contains("x86") ? "x86" : "arm";
|
||||||
|
} else {
|
||||||
|
arch = TextUtils.equals(Build.CPU_ABI, "x86") ? "x86" : "arm";
|
||||||
|
}
|
||||||
|
|
||||||
|
console.add("- Device platform: " + Build.CPU_ABI);
|
||||||
|
|
||||||
|
File zip = new File(App.self.getCacheDir(), "magisk.zip");
|
||||||
|
|
||||||
|
if (!ShellUtils.checkSum("MD5", zip, Config.magiskMD5)) {
|
||||||
|
console.add("- Downloading zip");
|
||||||
|
Networking.get(Config.magiskLink)
|
||||||
|
.setDownloadProgressListener(new ProgressLog())
|
||||||
|
.execForFile(zip);
|
||||||
|
} else {
|
||||||
|
console.add("- Existing zip found");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ZipInputStream zi = new ZipInputStream(new BufferedInputStream(
|
||||||
|
new FileInputStream(zip), (int) zip.length()));
|
||||||
|
ZipEntry ze;
|
||||||
|
while ((ze = zi.getNextEntry()) != null) {
|
||||||
|
if (ze.isDirectory())
|
||||||
|
continue;
|
||||||
|
String name = null;
|
||||||
|
String[] names = { arch + "/", "common/", "META-INF/com/google/android/update-binary" };
|
||||||
|
for (String n : names) {
|
||||||
|
if (ze.getName().startsWith(n)) {
|
||||||
|
name = ze.getName().substring(ze.getName().lastIndexOf('/') + 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name == null && ze.getName().startsWith("chromeos/"))
|
||||||
|
name = ze.getName();
|
||||||
|
if (name == null)
|
||||||
|
continue;
|
||||||
|
File dest = (installDir instanceof SuFile) ?
|
||||||
|
new SuFile(installDir, name) :
|
||||||
|
new File(installDir, name);
|
||||||
|
dest.getParentFile().mkdirs();
|
||||||
|
try (OutputStream out = new SuFileOutputStream(dest)) {
|
||||||
|
ShellUtils.pump(zi, out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
console.add("! Cannot unzip zip");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
File init64 = SuFile.open(installDir, "magiskinit64");
|
||||||
|
if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_64_BIT_ABIS.length != 0) {
|
||||||
|
init64.renameTo(SuFile.open(installDir, "magiskinit"));
|
||||||
|
} else {
|
||||||
|
init64.delete();
|
||||||
|
}
|
||||||
|
Shell.sh("cd " + installDir, "chmod 755 *").exec();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private TarEntry newEntry(String name, long size) {
|
||||||
|
console.add("-- Writing: " + name);
|
||||||
|
return new TarEntry(TarHeader.createHeader(name, size, 0, false, 0644));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleTar(InputStream in) throws IOException {
|
||||||
|
console.add("- Processing tar file");
|
||||||
|
boolean vbmeta = false;
|
||||||
|
try (TarInputStream tarIn = new TarInputStream(in);
|
||||||
|
TarOutputStream tarOut = new TarOutputStream(destFile)) {
|
||||||
|
TarEntry entry;
|
||||||
|
while ((entry = tarIn.getNextEntry()) != null) {
|
||||||
|
if (entry.getName().contains("boot.img")
|
||||||
|
|| entry.getName().contains("recovery.img")) {
|
||||||
|
String name = entry.getName();
|
||||||
|
console.add("-- Extracting: " + name);
|
||||||
|
File extract = new File(installDir, name);
|
||||||
|
try (FileOutputStream fout = new FileOutputStream(extract)) {
|
||||||
|
ShellUtils.pump(tarIn, fout);
|
||||||
|
}
|
||||||
|
if (name.contains(".lz4")) {
|
||||||
|
console.add("-- Decompressing: " + name);
|
||||||
|
Shell.sh("./magiskboot --decompress " + extract).to(console).exec();
|
||||||
|
}
|
||||||
|
} else if (entry.getName().contains("vbmeta.img")) {
|
||||||
|
vbmeta = true;
|
||||||
|
ByteBuffer buf = ByteBuffer.allocate(256);
|
||||||
|
buf.put("AVB0".getBytes()); // magic
|
||||||
|
buf.putInt(1); // required_libavb_version_major
|
||||||
|
buf.putInt(120, 2); // flags
|
||||||
|
buf.position(128); // release_string
|
||||||
|
buf.put("avbtool 1.1.0".getBytes());
|
||||||
|
tarOut.putNextEntry(newEntry("vbmeta.img", 256));
|
||||||
|
tarOut.write(buf.array());
|
||||||
|
} else {
|
||||||
|
console.add("-- Writing: " + entry.getName());
|
||||||
|
tarOut.putNextEntry(entry);
|
||||||
|
ShellUtils.pump(tarIn, tarOut);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
File boot = SuFile.open(installDir, "boot.img");
|
||||||
|
File recovery = SuFile.open(installDir, "recovery.img");
|
||||||
|
if (vbmeta && recovery.exists() && boot.exists()) {
|
||||||
|
// Install Magisk to recovery
|
||||||
|
srcBoot = recovery.getPath();
|
||||||
|
// Repack boot image to prevent restore
|
||||||
|
Shell.sh(
|
||||||
|
"./magiskboot --unpack boot.img",
|
||||||
|
"./magiskboot --repack boot.img",
|
||||||
|
"./magiskboot --cleanup",
|
||||||
|
"mv new-boot.img boot.img").exec();
|
||||||
|
try (InputStream sin = new SuFileInputStream(boot)) {
|
||||||
|
tarOut.putNextEntry(newEntry("boot.img", boot.length()));
|
||||||
|
ShellUtils.pump(sin, tarOut);
|
||||||
|
}
|
||||||
|
boot.delete();
|
||||||
|
} else {
|
||||||
|
if (!boot.exists()) {
|
||||||
|
console.add("! No boot image found");
|
||||||
|
throw new IOException();
|
||||||
|
}
|
||||||
|
srcBoot = boot.getPath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean handleFile(Uri uri) {
|
||||||
|
try (InputStream in = new BufferedInputStream(App.self.getContentResolver().openInputStream(uri))) {
|
||||||
|
in.mark(500);
|
||||||
|
byte[] magic = new byte[5];
|
||||||
|
if (in.skip(257) != 257 || in.read(magic) != magic.length) {
|
||||||
|
console.add("! Invalid file");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
in.reset();
|
||||||
|
if (Arrays.equals(magic, "ustar".getBytes())) {
|
||||||
|
isTar = true;
|
||||||
|
destFile = new File(Const.EXTERNAL_PATH, "magisk_patched.tar");
|
||||||
|
handleTar(in);
|
||||||
|
} else {
|
||||||
|
// Raw image
|
||||||
|
srcBoot = new File(installDir, "boot.img").getPath();
|
||||||
|
destFile = new File(Const.EXTERNAL_PATH, "magisk_patched.img");
|
||||||
|
console.add("- Copying image to cache");
|
||||||
|
try (OutputStream out = new FileOutputStream(srcBoot)) {
|
||||||
|
ShellUtils.pump(in, out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
console.add("! Process error");
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean patchBoot() {
|
||||||
|
boolean isSigned;
|
||||||
|
try (InputStream in = new SuFileInputStream(srcBoot)) {
|
||||||
|
isSigned = SignBoot.verifySignature(in, null);
|
||||||
|
if (isSigned) {
|
||||||
|
console.add("- Boot image is signed with AVB 1.0");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
console.add("! Unable to check signature");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Shell.sh(Utils.fmt(
|
||||||
|
"KEEPFORCEENCRYPT=%b KEEPVERITY=%b RECOVERYMODE=%b " +
|
||||||
|
"sh update-binary sh boot_patch.sh %s",
|
||||||
|
Config.keepEnc, Config.keepVerity, Config.recovery, srcBoot))
|
||||||
|
.to(console, logs).exec().isSuccess())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Shell.Job job = Shell.sh("./magiskboot --cleanup",
|
||||||
|
"mv bin/busybox busybox",
|
||||||
|
"rm -rf magisk.apk bin boot.img update-binary",
|
||||||
|
"cd /");
|
||||||
|
|
||||||
|
File patched = new File(installDir, "new-boot.img");
|
||||||
|
if (isSigned) {
|
||||||
|
console.add("- Signing boot image with test keys");
|
||||||
|
File signed = new File(installDir, "signed.img");
|
||||||
|
try (InputStream in = new SuFileInputStream(patched);
|
||||||
|
OutputStream out = new BufferedOutputStream(new FileOutputStream(signed))) {
|
||||||
|
SignBoot.doSignature("/boot", in, out, null, null);
|
||||||
|
} catch (IOException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
job.add("mv -f " + signed + " " + patched);
|
||||||
|
}
|
||||||
|
job.exec();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean flashBoot() {
|
||||||
|
if (!Shell.su(Utils.fmt("direct_install %s %s", installDir, srcBoot))
|
||||||
|
.to(console, logs).exec().isSuccess())
|
||||||
|
return false;
|
||||||
|
if (!Config.keepVerity)
|
||||||
|
Shell.su("patch_dtbo_image").to(console, logs).exec();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean storeBoot() {
|
||||||
|
File patched = SuFile.open(installDir, "new-boot.img");
|
||||||
|
try {
|
||||||
|
OutputStream os;
|
||||||
|
if (isTar) {
|
||||||
|
os = new TarOutputStream(destFile, true);
|
||||||
|
((TarOutputStream) os).putNextEntry(newEntry(
|
||||||
|
srcBoot.contains("recovery") ? "recovery.img" : "boot.img",
|
||||||
|
patched.length()));
|
||||||
|
} else {
|
||||||
|
os = new BufferedOutputStream(new FileOutputStream(destFile));
|
||||||
|
}
|
||||||
|
try (InputStream in = new SuFileInputStream(patched);
|
||||||
|
OutputStream out = os) {
|
||||||
|
ShellUtils.pump(in, out);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
console.add("! Failed to output to " + destFile);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
patched.delete();
|
||||||
|
console.add("");
|
||||||
|
console.add("****************************");
|
||||||
|
console.add(" Output file is placed in ");
|
||||||
|
console.add(" " + destFile + " ");
|
||||||
|
console.add("****************************");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean postOTA() {
|
||||||
|
SuFile bootctl = new SuFile("/data/adb/bootctl");
|
||||||
|
try (InputStream in = Networking.get(Const.Url.BOOTCTL_URL).execForInputStream().getResult();
|
||||||
|
OutputStream out = new SuFileOutputStream(bootctl)) {
|
||||||
|
ShellUtils.pump(in, out);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Shell.su("post_ota " + bootctl.getParent()).exec();
|
||||||
|
console.add("***************************************");
|
||||||
|
console.add(" Next reboot will boot to second slot!");
|
||||||
|
console.add("***************************************");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@WorkerThread
|
||||||
|
protected abstract boolean operations();
|
||||||
|
|
||||||
|
@MainThread
|
||||||
|
protected abstract void onResult(boolean success);
|
||||||
|
|
||||||
|
public void exec() {
|
||||||
|
App.THREAD_POOL.execute(() -> {
|
||||||
|
boolean b = operations();
|
||||||
|
UiThreadHandler.run(() -> onResult(b));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
176
app/src/main/java/com/topjohnwu/magisk/tasks/UpdateRepos.java
Normal file
176
app/src/main/java/com/topjohnwu/magisk/tasks/UpdateRepos.java
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
package com.topjohnwu.magisk.tasks;
|
||||||
|
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.util.Pair;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App;
|
||||||
|
import com.topjohnwu.magisk.Config;
|
||||||
|
import com.topjohnwu.magisk.Const;
|
||||||
|
import com.topjohnwu.magisk.model.entity.Repo;
|
||||||
|
import com.topjohnwu.magisk.utils.Event;
|
||||||
|
import com.topjohnwu.magisk.utils.Logger;
|
||||||
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
import com.topjohnwu.net.Networking;
|
||||||
|
import com.topjohnwu.net.Request;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Queue;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
public class UpdateRepos {
|
||||||
|
private static final DateFormat DATE_FORMAT;
|
||||||
|
|
||||||
|
private final App app = App.self;
|
||||||
|
private Set<String> cached;
|
||||||
|
private Queue<Pair<String, Date>> moduleQueue;
|
||||||
|
|
||||||
|
static {
|
||||||
|
DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
|
||||||
|
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runTasks(Runnable task) {
|
||||||
|
Future[] futures = new Future[App.THREAD_POOL.getMaximumPoolSize() - 1];
|
||||||
|
for (int i = 0; i < futures.length; ++i) {
|
||||||
|
futures[i] = App.THREAD_POOL.submit(task);
|
||||||
|
}
|
||||||
|
for (Future f : futures) {
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
f.get();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
continue;
|
||||||
|
} catch (ExecutionException ignored) {}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We sort repos by last push, which means that we only need to check whether the
|
||||||
|
* first page is updated to determine whether the online repo database is changed
|
||||||
|
*/
|
||||||
|
private boolean parsePage(int page) {
|
||||||
|
Request req = Networking.get(Utils.fmt(Const.Url.REPO_URL, page + 1));
|
||||||
|
if (page == 0) {
|
||||||
|
String etag = Config.get(Config.Key.ETAG_KEY);
|
||||||
|
if (etag != null)
|
||||||
|
req.addHeaders(Const.Key.IF_NONE_MATCH, etag);
|
||||||
|
}
|
||||||
|
Request.Result<JSONArray> res = req.execForJSONArray();
|
||||||
|
// JSON not updated
|
||||||
|
if (res.getCode() == HttpURLConnection.HTTP_NOT_MODIFIED)
|
||||||
|
return false;
|
||||||
|
// Network error
|
||||||
|
if (res.getResult() == null) {
|
||||||
|
cached.clear();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Current page is the last page
|
||||||
|
if (res.getResult().length() == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < res.getResult().length(); i++) {
|
||||||
|
JSONObject rawRepo = res.getResult().getJSONObject(i);
|
||||||
|
String id = rawRepo.getString("name");
|
||||||
|
Date date = DATE_FORMAT.parse(rawRepo.getString("pushed_at"));
|
||||||
|
moduleQueue.offer(new Pair<>(id, date));
|
||||||
|
}
|
||||||
|
} catch (JSONException | ParseException e) {
|
||||||
|
// Should not happen, but if exception occurs, page load fails
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update ETAG
|
||||||
|
if (page == 0) {
|
||||||
|
String etag = res.getConnection().getHeaderField(Config.Key.ETAG_KEY);
|
||||||
|
if (etag != null) {
|
||||||
|
etag = etag.substring(etag.indexOf('\"'), etag.lastIndexOf('\"') + 1);
|
||||||
|
Config.set(Config.Key.ETAG_KEY, etag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String links = res.getConnection().getHeaderField(Const.Key.LINK_KEY);
|
||||||
|
return links == null || !links.contains("next") || parsePage(page + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean loadPages() {
|
||||||
|
if (!parsePage(0))
|
||||||
|
return false;
|
||||||
|
runTasks(() -> {
|
||||||
|
while (true) {
|
||||||
|
Pair<String, Date> pair = moduleQueue.poll();
|
||||||
|
if (pair == null)
|
||||||
|
return;
|
||||||
|
Repo repo = app.getRepoDB().getRepo(pair.first);
|
||||||
|
try {
|
||||||
|
if (repo == null)
|
||||||
|
repo = new Repo(pair.first);
|
||||||
|
else
|
||||||
|
cached.remove(pair.first);
|
||||||
|
repo.update(pair.second);
|
||||||
|
app.getRepoDB().addRepo(repo);
|
||||||
|
} catch (Repo.IllegalRepoException e) {
|
||||||
|
Logger.debug(e.getMessage());
|
||||||
|
app.getRepoDB().removeRepo(pair.first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fullReload() {
|
||||||
|
Cursor c = app.getRepoDB().getRawCursor();
|
||||||
|
runTasks(() -> {
|
||||||
|
while (true) {
|
||||||
|
Repo repo;
|
||||||
|
synchronized (c) {
|
||||||
|
if (!c.moveToNext())
|
||||||
|
return;
|
||||||
|
repo = new Repo(c);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
repo.update();
|
||||||
|
app.getRepoDB().addRepo(repo);
|
||||||
|
} catch (Repo.IllegalRepoException e) {
|
||||||
|
Logger.debug(e.getMessage());
|
||||||
|
app.getRepoDB().removeRepo(repo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void exec(boolean force) {
|
||||||
|
Event.reset(Event.REPO_LOAD_DONE);
|
||||||
|
App.THREAD_POOL.execute(() -> {
|
||||||
|
cached = Collections.synchronizedSet(app.getRepoDB().getRepoIDSet());
|
||||||
|
moduleQueue = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
|
if (loadPages()) {
|
||||||
|
// The leftover cached means they are removed from online repo
|
||||||
|
app.getRepoDB().removeRepo(cached);
|
||||||
|
} else if (force) {
|
||||||
|
fullReload();
|
||||||
|
}
|
||||||
|
Event.trigger(Event.REPO_LOAD_DONE);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void exec() {
|
||||||
|
exec(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
118
app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt
Normal file
118
app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
package com.topjohnwu.magisk.ui
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.core.view.GravityCompat
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.topjohnwu.magisk.ClassMap
|
||||||
|
import com.topjohnwu.magisk.Config
|
||||||
|
import com.topjohnwu.magisk.Const.Key.OPEN_SECTION
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
import com.topjohnwu.magisk.databinding.ActivityMainBinding
|
||||||
|
import com.topjohnwu.magisk.model.navigation.Navigation
|
||||||
|
import com.topjohnwu.magisk.ui.base.MagiskActivity
|
||||||
|
import com.topjohnwu.magisk.ui.hide.MagiskHideFragment
|
||||||
|
import com.topjohnwu.magisk.ui.home.HomeFragment
|
||||||
|
import com.topjohnwu.magisk.ui.log.LogFragment
|
||||||
|
import com.topjohnwu.magisk.ui.module.ModulesFragment
|
||||||
|
import com.topjohnwu.magisk.ui.module.ReposFragment
|
||||||
|
import com.topjohnwu.magisk.ui.settings.SettingsFragment
|
||||||
|
import com.topjohnwu.magisk.ui.superuser.SuperuserFragment
|
||||||
|
import com.topjohnwu.magisk.utils.Utils
|
||||||
|
import com.topjohnwu.net.Networking
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
import org.koin.androidx.viewmodel.ext.android.viewModel
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
|
||||||
|
open class MainActivity : MagiskActivity<MainViewModel, ActivityMainBinding>() {
|
||||||
|
|
||||||
|
override val layoutRes: Int = R.layout.activity_main
|
||||||
|
override val viewModel: MainViewModel by viewModel()
|
||||||
|
override val navHostId: Int = R.id.main_nav_host
|
||||||
|
override val defaultPosition: Int = 0
|
||||||
|
|
||||||
|
override val baseFragments: List<KClass<out Fragment>> = listOf(
|
||||||
|
HomeFragment::class,
|
||||||
|
SuperuserFragment::class,
|
||||||
|
MagiskHideFragment::class,
|
||||||
|
ModulesFragment::class,
|
||||||
|
ReposFragment::class,
|
||||||
|
LogFragment::class,
|
||||||
|
SettingsFragment::class
|
||||||
|
)
|
||||||
|
|
||||||
|
/*override fun getDarkTheme(): Int {
|
||||||
|
return R.style.AppTheme_Dark
|
||||||
|
}*/
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
if (!SplashActivity.DONE) {
|
||||||
|
startActivity(Intent(this, ClassMap.get<Any>(SplashActivity::class.java)))
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
checkHideSection()
|
||||||
|
setSupportActionBar(binding.mainInclude.mainToolbar)
|
||||||
|
|
||||||
|
if (savedInstanceState == null) {
|
||||||
|
intent.getStringExtra(OPEN_SECTION)?.let {
|
||||||
|
onEventDispatched(Navigation.fromSection(it))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setTitle(title: CharSequence?) {
|
||||||
|
supportActionBar?.title = title
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setTitle(titleId: Int) {
|
||||||
|
supportActionBar?.setTitle(titleId)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onTabTransaction(fragment: Fragment?, index: Int) {
|
||||||
|
val fragmentId = when (fragment) {
|
||||||
|
is HomeFragment -> R.id.magiskFragment
|
||||||
|
is SuperuserFragment -> R.id.superuserFragment
|
||||||
|
is MagiskHideFragment -> R.id.magiskHideFragment
|
||||||
|
is ModulesFragment -> R.id.modulesFragment
|
||||||
|
is ReposFragment -> R.id.reposFragment
|
||||||
|
is LogFragment -> R.id.logFragment
|
||||||
|
is SettingsFragment -> R.id.settings
|
||||||
|
else -> return
|
||||||
|
}
|
||||||
|
binding.navView.setCheckedItem(fragmentId)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (binding.drawerLayout.isDrawerOpen(binding.navView)) {
|
||||||
|
binding.drawerLayout.closeDrawer(binding.navView)
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSimpleEventDispatched(event: Int) {
|
||||||
|
super.onSimpleEventDispatched(event)
|
||||||
|
when (event) {
|
||||||
|
Navigation.Main.OPEN_NAV -> openNav()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun openNav() = binding.drawerLayout.openDrawer(GravityCompat.START)
|
||||||
|
|
||||||
|
private fun checkHideSection() {
|
||||||
|
val menu = binding.navView.menu
|
||||||
|
menu.findItem(R.id.magiskHideFragment).isVisible =
|
||||||
|
Shell.rootAccess() && Config.get<Any>(Config.Key.MAGISKHIDE) as Boolean
|
||||||
|
menu.findItem(R.id.modulesFragment).isVisible =
|
||||||
|
Shell.rootAccess() && Config.magiskVersionCode >= 0
|
||||||
|
menu.findItem(R.id.reposFragment).isVisible =
|
||||||
|
(Networking.checkNetworkStatus(this) && Shell.rootAccess() && Config.magiskVersionCode >= 0)
|
||||||
|
menu.findItem(R.id.logFragment).isVisible =
|
||||||
|
Shell.rootAccess()
|
||||||
|
menu.findItem(R.id.superuserFragment).isVisible =
|
||||||
|
Utils.showSuperUser()
|
||||||
|
}
|
||||||
|
}
|
||||||
27
app/src/main/java/com/topjohnwu/magisk/ui/MainViewModel.kt
Normal file
27
app/src/main/java/com/topjohnwu/magisk/ui/MainViewModel.kt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package com.topjohnwu.magisk.ui
|
||||||
|
|
||||||
|
import android.view.MenuItem
|
||||||
|
import com.topjohnwu.magisk.R
|
||||||
|
import com.topjohnwu.magisk.model.navigation.Navigation
|
||||||
|
import com.topjohnwu.magisk.ui.base.MagiskViewModel
|
||||||
|
|
||||||
|
|
||||||
|
class MainViewModel : MagiskViewModel() {
|
||||||
|
|
||||||
|
fun navPressed() = Navigation.Main.OPEN_NAV.publish()
|
||||||
|
|
||||||
|
fun navigationItemPressed(item: MenuItem): Boolean {
|
||||||
|
when (item.itemId) {
|
||||||
|
R.id.magiskFragment -> Navigation.home()
|
||||||
|
R.id.superuserFragment -> Navigation.superuser()
|
||||||
|
R.id.magiskHideFragment -> Navigation.hide()
|
||||||
|
R.id.modulesFragment -> Navigation.modules()
|
||||||
|
R.id.reposFragment -> Navigation.repos()
|
||||||
|
R.id.logFragment -> Navigation.log()
|
||||||
|
R.id.settings -> Navigation.settings()
|
||||||
|
else -> null
|
||||||
|
}?.publish()?.let { return@navigationItemPressed true }
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
87
app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
Normal file
87
app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
package com.topjohnwu.magisk.ui
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.TextUtils
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.topjohnwu.magisk.*
|
||||||
|
import com.topjohnwu.magisk.tasks.CheckUpdates
|
||||||
|
import com.topjohnwu.magisk.tasks.UpdateRepos
|
||||||
|
import com.topjohnwu.magisk.utils.LocaleManager
|
||||||
|
import com.topjohnwu.magisk.utils.Utils
|
||||||
|
import com.topjohnwu.magisk.view.Notifications
|
||||||
|
import com.topjohnwu.magisk.view.Shortcuts
|
||||||
|
import com.topjohnwu.net.Networking
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
|
||||||
|
open class SplashActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
Shell.getShell {
|
||||||
|
if (Config.magiskVersionCode > 0 && Config.magiskVersionCode < Const.MAGISK_VER.MIN_SUPPORT) {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.unsupport_magisk_title)
|
||||||
|
.setMessage(R.string.unsupport_magisk_message)
|
||||||
|
.setNegativeButton(R.string.ok, null)
|
||||||
|
.setOnDismissListener { finish() }
|
||||||
|
.show()
|
||||||
|
} else {
|
||||||
|
initAndStart()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initAndStart() {
|
||||||
|
val pkg = Config.get<String>(Config.Key.SU_MANAGER)
|
||||||
|
if (pkg != null && packageName == BuildConfig.APPLICATION_ID) {
|
||||||
|
Config.remove(Config.Key.SU_MANAGER)
|
||||||
|
Shell.su("pm uninstall $pkg").submit()
|
||||||
|
}
|
||||||
|
if (TextUtils.equals(pkg, packageName)) {
|
||||||
|
runCatching {
|
||||||
|
// We are the manager, remove com.topjohnwu.magisk as it could be malware
|
||||||
|
packageManager.getApplicationInfo(BuildConfig.APPLICATION_ID, 0)
|
||||||
|
Shell.su("pm uninstall " + BuildConfig.APPLICATION_ID).submit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dynamic detect all locales
|
||||||
|
LocaleManager.loadAvailableLocales(R.string.app_changelog)
|
||||||
|
|
||||||
|
// Set default configs
|
||||||
|
Config.initialize()
|
||||||
|
|
||||||
|
// Create notification channel on Android O
|
||||||
|
Notifications.setup(this)
|
||||||
|
|
||||||
|
// Schedule periodic update checks
|
||||||
|
Utils.scheduleUpdateCheck()
|
||||||
|
CheckUpdates.check()
|
||||||
|
|
||||||
|
// Setup shortcuts
|
||||||
|
Shortcuts.setup(this)
|
||||||
|
|
||||||
|
// Magisk working as expected
|
||||||
|
if (Shell.rootAccess() && Config.magiskVersionCode > 0) {
|
||||||
|
// Load modules
|
||||||
|
Utils.loadModules(false)
|
||||||
|
// Load repos
|
||||||
|
if (Networking.checkNetworkStatus(this))
|
||||||
|
UpdateRepos().exec()
|
||||||
|
}
|
||||||
|
|
||||||
|
val intent = Intent(this, ClassMap.get<Any>(MainActivity::class.java))
|
||||||
|
intent.putExtra(Const.Key.OPEN_SECTION, getIntent().getStringExtra(Const.Key.OPEN_SECTION))
|
||||||
|
DONE = true
|
||||||
|
startActivity(intent)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
var DONE = false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.base
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
|
||||||
|
interface ActivityResultListener {
|
||||||
|
fun onActivityResult(resultCode: Int, data: Intent?)
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.base;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.topjohnwu.magisk.App;
|
||||||
|
import com.topjohnwu.magisk.R;
|
||||||
|
import com.topjohnwu.magisk.utils.Event;
|
||||||
|
|
||||||
|
import androidx.preference.Preference;
|
||||||
|
import androidx.preference.PreferenceCategory;
|
||||||
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
import androidx.preference.PreferenceGroupAdapter;
|
||||||
|
import androidx.preference.PreferenceScreen;
|
||||||
|
import androidx.preference.PreferenceViewHolder;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
public abstract class BasePreferenceFragment extends PreferenceFragmentCompat
|
||||||
|
implements SharedPreferences.OnSharedPreferenceChangeListener, Event.AutoListener {
|
||||||
|
|
||||||
|
public App app = App.self;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
View v = super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
app.getPrefs().registerOnSharedPreferenceChangeListener(this);
|
||||||
|
Event.register(this);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
app.getPrefs().unregisterOnSharedPreferenceChangeListener(this);
|
||||||
|
Event.unregister(this);
|
||||||
|
super.onDestroyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getListeningEvents() {
|
||||||
|
return new int[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
|
||||||
|
return new PreferenceGroupAdapter(preferenceScreen) {
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(PreferenceViewHolder holder, int position) {
|
||||||
|
super.onBindViewHolder(holder, position);
|
||||||
|
Preference preference = getItem(position);
|
||||||
|
if (preference instanceof PreferenceCategory)
|
||||||
|
setZeroPaddingToLayoutChildren(holder.itemView);
|
||||||
|
else {
|
||||||
|
View iconFrame = holder.itemView.findViewById(R.id.icon_frame);
|
||||||
|
if (iconFrame != null) {
|
||||||
|
iconFrame.setVisibility(preference.getIcon() == null ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setZeroPaddingToLayoutChildren(View view) {
|
||||||
|
if (!(view instanceof ViewGroup))
|
||||||
|
return;
|
||||||
|
ViewGroup viewGroup = (ViewGroup) view;
|
||||||
|
int childCount = viewGroup.getChildCount();
|
||||||
|
for (int i = 0; i < childCount; i++) {
|
||||||
|
setZeroPaddingToLayoutChildren(viewGroup.getChildAt(i));
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||||
|
viewGroup.setPaddingRelative(0, viewGroup.getPaddingTop(), viewGroup.getPaddingEnd(), viewGroup.getPaddingBottom());
|
||||||
|
else
|
||||||
|
viewGroup.setPadding(0, viewGroup.getPaddingTop(), viewGroup.getPaddingRight(), viewGroup.getPaddingBottom());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.base
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
|
||||||
|
interface IBaseLeanback {
|
||||||
|
|
||||||
|
fun runWithExternalRW(callback: Runnable)
|
||||||
|
fun runWithPermissions(vararg permissions: String, callback: Runnable)
|
||||||
|
fun startActivityForResult(intent: Intent, requestCode: Int, listener: ActivityResultListener)
|
||||||
|
|
||||||
|
}
|
||||||
210
app/src/main/java/com/topjohnwu/magisk/ui/base/MagiskActivity.kt
Normal file
210
app/src/main/java/com/topjohnwu/magisk/ui/base/MagiskActivity.kt
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.base
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.res.Configuration
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.annotation.CallSuper
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import androidx.databinding.ViewDataBinding
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.FragmentTransaction
|
||||||
|
import com.karumi.dexter.Dexter
|
||||||
|
import com.karumi.dexter.MultiplePermissionsReport
|
||||||
|
import com.karumi.dexter.PermissionToken
|
||||||
|
import com.karumi.dexter.listener.PermissionRequest
|
||||||
|
import com.karumi.dexter.listener.multi.MultiplePermissionsListener
|
||||||
|
import com.ncapdevi.fragnav.FragNavController
|
||||||
|
import com.ncapdevi.fragnav.FragNavTransactionOptions
|
||||||
|
import com.skoumal.teanity.viewevents.ViewEvent
|
||||||
|
import com.topjohnwu.magisk.Config
|
||||||
|
import com.topjohnwu.magisk.model.events.BackPressEvent
|
||||||
|
import com.topjohnwu.magisk.model.events.PermissionEvent
|
||||||
|
import com.topjohnwu.magisk.model.events.ViewActionEvent
|
||||||
|
import com.topjohnwu.magisk.model.navigation.MagiskAnimBuilder
|
||||||
|
import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent
|
||||||
|
import com.topjohnwu.magisk.model.navigation.Navigator
|
||||||
|
import com.topjohnwu.magisk.model.permissions.PermissionRequestBuilder
|
||||||
|
import com.topjohnwu.magisk.utils.LocaleManager
|
||||||
|
import com.topjohnwu.magisk.utils.Utils
|
||||||
|
import timber.log.Timber
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
|
||||||
|
abstract class MagiskActivity<ViewModel : MagiskViewModel, Binding : ViewDataBinding> :
|
||||||
|
MagiskLeanbackActivity<ViewModel, Binding>(), FragNavController.RootFragmentListener,
|
||||||
|
Navigator, FragNavController.TransactionListener {
|
||||||
|
|
||||||
|
override val numberOfRootFragments: Int get() = baseFragments.size
|
||||||
|
override val baseFragments: List<KClass<out Fragment>> = listOf()
|
||||||
|
|
||||||
|
protected open val defaultPosition: Int = 0
|
||||||
|
|
||||||
|
protected val navigationController get() = if (navHostId == 0) null else _navigationController
|
||||||
|
private val _navigationController by lazy {
|
||||||
|
if (navHostId == 0) throw IllegalStateException("Did you forget to override \"navHostId\"?")
|
||||||
|
FragNavController(supportFragmentManager, navHostId)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val isRootFragment
|
||||||
|
get() = navigationController?.let { it.currentStackIndex != defaultPosition } ?: false
|
||||||
|
|
||||||
|
init {
|
||||||
|
val isDarkTheme = Config.get<Boolean>(Config.Key.DARK_THEME)
|
||||||
|
val theme = if (isDarkTheme) {
|
||||||
|
AppCompatDelegate.MODE_NIGHT_YES
|
||||||
|
} else {
|
||||||
|
AppCompatDelegate.MODE_NIGHT_NO
|
||||||
|
}
|
||||||
|
AppCompatDelegate.setDefaultNightMode(theme)
|
||||||
|
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun applyOverrideConfiguration(config: Configuration?) {
|
||||||
|
// Force applying our preferred local
|
||||||
|
config?.setLocale(LocaleManager.locale)
|
||||||
|
super.applyOverrideConfiguration(config)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
navigationController?.apply {
|
||||||
|
rootFragmentListener = this@MagiskActivity
|
||||||
|
transactionListener = this@MagiskActivity
|
||||||
|
initialize(defaultPosition, savedInstanceState)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
navigationController?.onSaveInstanceState(outState)
|
||||||
|
}
|
||||||
|
|
||||||
|
@CallSuper
|
||||||
|
override fun onEventDispatched(event: ViewEvent) {
|
||||||
|
super.onEventDispatched(event)
|
||||||
|
when (event) {
|
||||||
|
is BackPressEvent -> onBackPressed()
|
||||||
|
is MagiskNavigationEvent -> navigateTo(event)
|
||||||
|
is ViewActionEvent -> event.action(this)
|
||||||
|
is PermissionEvent -> withPermissions(*event.permissions.toTypedArray()) {
|
||||||
|
onSuccess { event.callback.onNext(true) }
|
||||||
|
onFailure {
|
||||||
|
event.callback.onNext(false)
|
||||||
|
event.callback.onError(SecurityException("User refused permissions"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getRootFragment(index: Int) = baseFragments[index].java.newInstance()
|
||||||
|
|
||||||
|
override fun navigateTo(event: MagiskNavigationEvent) {
|
||||||
|
val directions = event.navDirections
|
||||||
|
|
||||||
|
navigationController?.defaultTransactionOptions = FragNavTransactionOptions.newBuilder()
|
||||||
|
.customAnimations(event.animOptions)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
navigationController?.currentStack
|
||||||
|
?.indexOfFirst { it.javaClass == event.navOptions.popUpTo }
|
||||||
|
?.let { if (it == -1) null else it } // invalidate if class is not found
|
||||||
|
?.let { if (event.navOptions.inclusive) it + 1 else it }
|
||||||
|
?.let { navigationController?.popFragments(it) }
|
||||||
|
|
||||||
|
when (directions.isActivity) {
|
||||||
|
true -> navigateToActivity(event)
|
||||||
|
else -> navigateToFragment(event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun navigateToActivity(event: MagiskNavigationEvent) {
|
||||||
|
val destination = event.navDirections.destination?.java ?: let {
|
||||||
|
Timber.e("Cannot navigate to null destination")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val options = event.navOptions
|
||||||
|
|
||||||
|
Intent(this, destination)
|
||||||
|
.putExtras(event.navDirections.args)
|
||||||
|
.apply {
|
||||||
|
if (options.singleTop) addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||||
|
if (options.clearTask) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
||||||
|
}
|
||||||
|
.let { startActivity(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun navigateToFragment(event: MagiskNavigationEvent) {
|
||||||
|
val destination = event.navDirections.destination?.java ?: let {
|
||||||
|
Timber.e("Cannot navigate to null destination")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
when (val index = baseFragments.indexOfFirst { it.java.name == destination.name }) {
|
||||||
|
-1 -> destination.newInstance()
|
||||||
|
.apply { arguments = event.navDirections.args }
|
||||||
|
.let { navigationController?.pushFragment(it) }
|
||||||
|
// When it's desired that fragments of same class are put on top of one another edit this
|
||||||
|
else -> navigationController?.switchTab(index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
val fragment = navigationController?.currentFrag as? MagiskFragment<*, *>
|
||||||
|
|
||||||
|
if (fragment?.onBackPressed() == true) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
navigationController?.popFragment() ?: throw UnsupportedOperationException()
|
||||||
|
} catch (e: UnsupportedOperationException) {
|
||||||
|
when {
|
||||||
|
isRootFragment -> {
|
||||||
|
val options = FragNavTransactionOptions.newBuilder()
|
||||||
|
.transition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
|
||||||
|
.build()
|
||||||
|
navigationController?.switchTab(defaultPosition, options)
|
||||||
|
}
|
||||||
|
else -> super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFragmentTransaction(
|
||||||
|
fragment: Fragment?,
|
||||||
|
transactionType: FragNavController.TransactionType
|
||||||
|
) = Unit
|
||||||
|
|
||||||
|
override fun onTabTransaction(fragment: Fragment?, index: Int) = Unit
|
||||||
|
|
||||||
|
fun openUrl(url: String) = Utils.openLink(this, url.toUri())
|
||||||
|
|
||||||
|
fun withPermissions(vararg permissions: String, builder: PermissionRequestBuilder.() -> Unit) {
|
||||||
|
val request = PermissionRequestBuilder().apply(builder).build()
|
||||||
|
Dexter.withActivity(this)
|
||||||
|
.withPermissions(*permissions)
|
||||||
|
.withListener(object : MultiplePermissionsListener {
|
||||||
|
override fun onPermissionsChecked(report: MultiplePermissionsReport?) =
|
||||||
|
if (report?.areAllPermissionsGranted() == true) {
|
||||||
|
request.onSuccess()
|
||||||
|
} else {
|
||||||
|
request.onFailure()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPermissionRationaleShouldBeShown(
|
||||||
|
permissions: MutableList<PermissionRequest>?,
|
||||||
|
token: PermissionToken?
|
||||||
|
) = request.onShowRationale(permissions.orEmpty().map { it.name })
|
||||||
|
})
|
||||||
|
.check()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun FragNavTransactionOptions.Builder.customAnimations(options: MagiskAnimBuilder) =
|
||||||
|
customAnimations(options.enter, options.exit, options.popEnter, options.popExit).apply {
|
||||||
|
if (!options.anySet) {
|
||||||
|
transition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.base
|
||||||
|
|
||||||
|
import androidx.annotation.CallSuper
|
||||||
|
import androidx.databinding.ViewDataBinding
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.skoumal.teanity.view.TeanityFragment
|
||||||
|
import com.skoumal.teanity.viewevents.ViewEvent
|
||||||
|
import com.topjohnwu.magisk.model.events.BackPressEvent
|
||||||
|
import com.topjohnwu.magisk.model.events.PermissionEvent
|
||||||
|
import com.topjohnwu.magisk.model.events.ViewActionEvent
|
||||||
|
import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent
|
||||||
|
import com.topjohnwu.magisk.model.navigation.Navigator
|
||||||
|
import com.topjohnwu.magisk.model.permissions.PermissionRequestBuilder
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
|
||||||
|
abstract class MagiskFragment<ViewModel : MagiskViewModel, Binding : ViewDataBinding> :
|
||||||
|
TeanityFragment<ViewModel, Binding>(), Navigator {
|
||||||
|
|
||||||
|
protected val magiskActivity get() = activity as MagiskActivity<*, *>
|
||||||
|
|
||||||
|
// We don't need nested fragments
|
||||||
|
override val baseFragments: List<KClass<Fragment>> = listOf()
|
||||||
|
|
||||||
|
override fun navigateTo(event: MagiskNavigationEvent) = magiskActivity.navigateTo(event)
|
||||||
|
|
||||||
|
@CallSuper
|
||||||
|
override fun onEventDispatched(event: ViewEvent) {
|
||||||
|
super.onEventDispatched(event)
|
||||||
|
when (event) {
|
||||||
|
is BackPressEvent -> magiskActivity.onBackPressed()
|
||||||
|
is MagiskNavigationEvent -> navigateTo(event)
|
||||||
|
is ViewActionEvent -> event.action(requireActivity())
|
||||||
|
is PermissionEvent -> magiskActivity.withPermissions(*event.permissions.toTypedArray()) {
|
||||||
|
onSuccess { event.callback.onNext(true) }
|
||||||
|
onFailure {
|
||||||
|
event.callback.onNext(false)
|
||||||
|
event.callback.onError(SecurityException("User refused permissions"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun withPermissions(vararg permissions: String, builder: PermissionRequestBuilder.() -> Unit) {
|
||||||
|
magiskActivity.withPermissions(*permissions, builder = builder)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun openLink(url: String) = magiskActivity.openUrl(url)
|
||||||
|
|
||||||
|
open fun onBackPressed(): Boolean = false
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.topjohnwu.magisk.ui.base
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.collection.SparseArrayCompat
|
||||||
|
import androidx.databinding.ViewDataBinding
|
||||||
|
import com.karumi.dexter.Dexter
|
||||||
|
import com.karumi.dexter.MultiplePermissionsReport
|
||||||
|
import com.karumi.dexter.PermissionToken
|
||||||
|
import com.karumi.dexter.listener.PermissionRequest
|
||||||
|
import com.karumi.dexter.listener.multi.MultiplePermissionsListener
|
||||||
|
import com.skoumal.teanity.view.TeanityActivity
|
||||||
|
import com.topjohnwu.magisk.Const
|
||||||
|
|
||||||
|
abstract class MagiskLeanbackActivity<ViewModel : MagiskViewModel, Binding : ViewDataBinding> :
|
||||||
|
TeanityActivity<ViewModel, Binding>(), IBaseLeanback {
|
||||||
|
|
||||||
|
private val resultListeners = SparseArrayCompat<ActivityResultListener>()
|
||||||
|
|
||||||
|
@Deprecated("Permissions will be checked in a different streamlined way")
|
||||||
|
fun runWithExternalRW(callback: () -> Unit) = runWithExternalRW(Runnable { callback() })
|
||||||
|
|
||||||
|
@Deprecated("Permissions will be checked in a different streamlined way")
|
||||||
|
override fun runWithExternalRW(callback: Runnable) {
|
||||||
|
runWithPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE, callback = callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated("Permissions will be checked in a different streamlined way")
|
||||||
|
override fun runWithPermissions(vararg permissions: String, callback: Runnable) {
|
||||||
|
Dexter.withActivity(this)
|
||||||
|
.withPermissions(*permissions)
|
||||||
|
.withListener(object : MultiplePermissionsListener {
|
||||||
|
override fun onPermissionsChecked(report: MultiplePermissionsReport?) {
|
||||||
|
if (report?.areAllPermissionsGranted() == true) {
|
||||||
|
Const.EXTERNAL_PATH.mkdirs()
|
||||||
|
callback.run()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPermissionRationaleShouldBeShown(
|
||||||
|
permissions: MutableList<PermissionRequest>?,
|
||||||
|
token: PermissionToken?
|
||||||
|
) = Unit
|
||||||
|
})
|
||||||
|
.check()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
resultListeners.get(requestCode)?.apply {
|
||||||
|
resultListeners.remove(requestCode)
|
||||||
|
onActivityResult(resultCode, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun startActivityForResult(
|
||||||
|
intent: Intent,
|
||||||
|
requestCode: Int,
|
||||||
|
listener: ActivityResultListener
|
||||||
|
) {
|
||||||
|
resultListeners.put(requestCode, listener)
|
||||||
|
startActivityForResult(intent, requestCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user