Compare commits
1495 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1730260343 | ||
|
|
27506e9ed8 | ||
|
|
dc64a186d5 | ||
|
|
3163e09b98 | ||
|
|
dcb9978bb1 | ||
|
|
4a94a0a5c5 | ||
|
|
8a2d20403e | ||
|
|
ec706e95cc | ||
|
|
bd3b14a27f | ||
|
|
082d9e852c | ||
|
|
36da519b26 | ||
|
|
06ffdde892 | ||
|
|
1ec57c080c | ||
|
|
a635f27c68 | ||
|
|
ee3d7a9a35 | ||
|
|
9a1c869efe | ||
|
|
837ed76f85 | ||
|
|
b46589cd14 | ||
|
|
d04e4606d2 | ||
|
|
385bd0eb8a | ||
|
|
089656e5c4 | ||
|
|
84ec6dd458 | ||
|
|
322c139c26 | ||
|
|
babe1833bb | ||
|
|
9effa47dd8 | ||
|
|
7ef57cc0cf | ||
|
|
97420aae1b | ||
|
|
415e6309f9 | ||
|
|
83e63ff854 | ||
|
|
de7f103130 | ||
|
|
2cb912681d | ||
|
|
04bdf94b78 | ||
|
|
c7389ddaa7 | ||
|
|
e778ab2e3a | ||
|
|
533d86607f | ||
|
|
cb2096670f | ||
|
|
284f221a9d | ||
|
|
bc639dd438 | ||
|
|
1baddbb40e | ||
|
|
f784dab868 | ||
|
|
85192aaa21 | ||
|
|
054c705fe2 | ||
|
|
07b0d8cf6e | ||
|
|
597d16f566 | ||
|
|
0ca2c781c3 | ||
|
|
f642de9c41 | ||
|
|
8965388d05 | ||
|
|
58c4582f15 | ||
|
|
44bc1b5cc0 | ||
|
|
714ebb3e08 | ||
|
|
8f871c2e3a | ||
|
|
5cdc5bc441 | ||
|
|
8d060837ad | ||
|
|
1d230d4cd6 | ||
|
|
3636ae7667 | ||
|
|
9ffb5112c6 | ||
|
|
ca5d574cd7 | ||
|
|
c80283dbcc | ||
|
|
3fcaddf2d3 | ||
|
|
6ecff5bce9 | ||
|
|
a103c7dcb6 | ||
|
|
63746bbb47 | ||
|
|
ed0be6fc9a | ||
|
|
26404ff5d7 | ||
|
|
adf1674877 | ||
|
|
ab2235fc88 | ||
|
|
441a6d3fe7 | ||
|
|
e00397620a | ||
|
|
38fa58c0a3 | ||
|
|
b40fd7b243 | ||
|
|
ae34877496 | ||
|
|
599cf1e5cb | ||
|
|
474963dcf1 | ||
|
|
e22384b6b4 | ||
|
|
fb00652396 | ||
|
|
a5dbb5d91f | ||
|
|
e75a03b6f8 | ||
|
|
eb7fe7f3e0 | ||
|
|
3179808f17 | ||
|
|
fde9f05bd0 | ||
|
|
8de4290c5b | ||
|
|
19c74c8872 | ||
|
|
50edb5d1f4 | ||
|
|
c6ccfd7e75 | ||
|
|
3796ce69e4 | ||
|
|
9835e31b46 | ||
|
|
a35040c909 | ||
|
|
a4c94638ca | ||
|
|
e70a8ae6a0 | ||
|
|
100359e38d | ||
|
|
cd995aca56 | ||
|
|
3a4bae88ca | ||
|
|
e60eae27fb | ||
|
|
cd6c01e230 | ||
|
|
0af264429f | ||
|
|
a6d3862350 | ||
|
|
3fca4850dd | ||
|
|
ba7e41d9a6 | ||
|
|
fe33ce3413 | ||
|
|
4e25e8aaa2 | ||
|
|
91be826c7d | ||
|
|
fdfe0cddb8 | ||
|
|
e8ef62116f | ||
|
|
caf8bb39d8 | ||
|
|
222ba6ee53 | ||
|
|
8dcda73072 | ||
|
|
810365d334 | ||
|
|
4b31510589 | ||
|
|
dfce9a34b8 | ||
|
|
dc9370c32b | ||
|
|
8dbc721c08 | ||
|
|
6448b84430 | ||
|
|
93d6ce40c3 | ||
|
|
ce5be2c1be | ||
|
|
20fe837022 | ||
|
|
e3ce18fa3e | ||
|
|
864a1d5e93 | ||
|
|
9cf7eec247 | ||
|
|
d9c15621f6 | ||
|
|
fea14218a9 | ||
|
|
dbbded5250 | ||
|
|
d65cfc7981 | ||
|
|
dc9124f291 | ||
|
|
4cd433b6bc | ||
|
|
f9a9ee6b0c | ||
|
|
1741f7ed58 | ||
|
|
d459c751be | ||
|
|
34ef8b52f6 | ||
|
|
5ae96905bb | ||
|
|
b1fdbc0151 | ||
|
|
a5ad27b5f2 | ||
|
|
efcd5052a2 | ||
|
|
f2b10c0ba8 | ||
|
|
f182be2d79 | ||
|
|
41b10630bb | ||
|
|
45915bed90 | ||
|
|
a2c2ab428a | ||
|
|
a05f74d302 | ||
|
|
74e94f3a97 | ||
|
|
15ee8c6cac | ||
|
|
18957b1f41 | ||
|
|
29930cac41 | ||
|
|
e3338dc3ff | ||
|
|
97b7b4a501 | ||
|
|
b471a72856 | ||
|
|
fed7d911a3 | ||
|
|
ca442970a3 | ||
|
|
9dbb77c10a | ||
|
|
1116502bc0 | ||
|
|
edaf17bdd4 | ||
|
|
c61d731358 | ||
|
|
a8415a3484 | ||
|
|
cd2467085e | ||
|
|
64efb3d2a4 | ||
|
|
e05f137bd8 | ||
|
|
0c73ddc08b | ||
|
|
19cc43c442 | ||
|
|
7108fc81a9 | ||
|
|
5943b9d7d6 | ||
|
|
0271e4c918 | ||
|
|
9dc33eff3a | ||
|
|
5aef1c8a68 | ||
|
|
c608a05270 | ||
|
|
e2cfd247c3 | ||
|
|
97eb9154b2 | ||
|
|
d7ff635445 | ||
|
|
aff57fb54e | ||
|
|
e89285a219 | ||
|
|
706f43caa8 | ||
|
|
dc4faf57cb | ||
|
|
7baf8052a2 | ||
|
|
d3c59585fd | ||
|
|
859bb8dc79 | ||
|
|
58cd2e07ba | ||
|
|
a5a6fb590a | ||
|
|
3619993e68 | ||
|
|
88e12c78fa | ||
|
|
5c285b4ac6 | ||
|
|
c6b729c470 | ||
|
|
890014759e | ||
|
|
68c1c43381 | ||
|
|
d0dfcaaad5 | ||
|
|
3cffaddc0a | ||
|
|
bf4cac0c82 | ||
|
|
f680749a00 | ||
|
|
13a67980d9 | ||
|
|
f110d595d2 | ||
|
|
9c8857352b | ||
|
|
c09a1fdba8 | ||
|
|
cdc7033a51 | ||
|
|
fa30c759d7 | ||
|
|
d040be2df0 | ||
|
|
935c831a7f | ||
|
|
867e95eef1 | ||
|
|
2ee04bd1b6 | ||
|
|
75d567e555 | ||
|
|
d8a489971c | ||
|
|
19ce5b5c76 | ||
|
|
7c70ea4d3e | ||
|
|
2784285d47 | ||
|
|
c946a7a1d5 | ||
|
|
3e60b49b8b | ||
|
|
4e7331bbb8 | ||
|
|
b8c7e86223 | ||
|
|
3b925f8674 | ||
|
|
f1f6d41c73 | ||
|
|
29ef1cb1be | ||
|
|
4296085d65 | ||
|
|
c797b09228 | ||
|
|
a870ef0030 | ||
|
|
43ed9e7310 | ||
|
|
bcd27355f9 | ||
|
|
6a14dc69c0 | ||
|
|
ed9acd25f9 | ||
|
|
7b24e66ed3 | ||
|
|
abd3d4b546 | ||
|
|
4040c4240a | ||
|
|
1ee747f3ef | ||
|
|
f88874bec8 | ||
|
|
ed440a2150 | ||
|
|
2fd46b196b | ||
|
|
12dfcaf7e7 | ||
|
|
f4a199f621 | ||
|
|
bb708e0aa3 | ||
|
|
d625740ca4 | ||
|
|
250402e9b9 | ||
|
|
1d2ffe56fb | ||
|
|
d16c0d2887 | ||
|
|
b3555f2f94 | ||
|
|
83a638fc6d | ||
|
|
f1534a710f | ||
|
|
a16845340b | ||
|
|
ffa4725f8e | ||
|
|
7792c66c64 | ||
|
|
1a3985d709 | ||
|
|
4714895c59 | ||
|
|
1e37951701 | ||
|
|
e8be1ad752 | ||
|
|
e316a70b6c | ||
|
|
40a8d21c15 | ||
|
|
28d5ca7ed9 | ||
|
|
110b18545f | ||
|
|
a478605da4 | ||
|
|
f5f1589813 | ||
|
|
0c332b6adb | ||
|
|
ba712ce357 | ||
|
|
2d2395accf | ||
|
|
8634289b7a | ||
|
|
45043fb9a8 | ||
|
|
0449795725 | ||
|
|
a96093f1b7 | ||
|
|
bd4f7691e9 | ||
|
|
e12acbae70 | ||
|
|
48dc4eac10 | ||
|
|
a869c92eee | ||
|
|
4fefd14538 | ||
|
|
c09dbfa47c | ||
|
|
d3c9f66de6 | ||
|
|
01d7694108 | ||
|
|
1425b651d4 | ||
|
|
b1befbeefc | ||
|
|
3a9a84a0b1 | ||
|
|
368284cccc | ||
|
|
ef777f4db9 | ||
|
|
a8e4e8e882 | ||
|
|
cf93760d00 | ||
|
|
dd8b9ff8fb | ||
|
|
bfed03b7b5 | ||
|
|
860f06ec9e | ||
|
|
b58376920f | ||
|
|
4ace075ddf | ||
|
|
dda98a474d | ||
|
|
f1c0df7d87 | ||
|
|
c78e098cb4 | ||
|
|
a3438c4f8d | ||
|
|
92ecf2d5de | ||
|
|
f18b653725 | ||
|
|
5128438cfb | ||
|
|
f29f25822b | ||
|
|
ecfe218840 | ||
|
|
dd33d2b5d0 | ||
|
|
12a8d4e10b | ||
|
|
c5c2fb31b1 | ||
|
|
343b7faf98 | ||
|
|
18aa8bbf60 | ||
|
|
a358d1630f | ||
|
|
01375b321c | ||
|
|
d2739d52e0 | ||
|
|
4668510106 | ||
|
|
ffcd311c90 | ||
|
|
b94a636542 | ||
|
|
a7aec6bfbc | ||
|
|
190ca9eddd | ||
|
|
2cf9eb69eb | ||
|
|
ffcb90da52 | ||
|
|
878b0c9275 | ||
|
|
5505cb0dea | ||
|
|
7ac14dccda | ||
|
|
6cffd0a723 | ||
|
|
220ebf93c7 | ||
|
|
d0681a5592 | ||
|
|
09d167c16d | ||
|
|
477bb45df7 | ||
|
|
e006306036 | ||
|
|
065cbcf0f9 | ||
|
|
7a6b958bbe | ||
|
|
ef6a5b6599 | ||
|
|
cdae919b5e | ||
|
|
12889f4549 | ||
|
|
089d59b691 | ||
|
|
b3e247e9cc | ||
|
|
56392b87f7 | ||
|
|
1b1a4aeb38 | ||
|
|
16147e0c08 | ||
|
|
139317cf1b | ||
|
|
72b94127fb | ||
|
|
1f1fc94d22 | ||
|
|
a574fe026c | ||
|
|
aa82083d30 | ||
|
|
08d5df70c2 | ||
|
|
29b8fa5897 | ||
|
|
e96faf31d4 | ||
|
|
157a73aa99 | ||
|
|
bdd298c8a0 | ||
|
|
3f7dd21186 | ||
|
|
086b708cf7 | ||
|
|
57e0e57f48 | ||
|
|
4b7efbfdc0 | ||
|
|
7dc2653042 | ||
|
|
e428453835 | ||
|
|
f84c8229de | ||
|
|
a73427d68d | ||
|
|
e4456bb236 | ||
|
|
06eadd0c15 | ||
|
|
3c90dfa660 | ||
|
|
ace1b8ee71 | ||
|
|
676356e800 | ||
|
|
f732e54c22 | ||
|
|
cdc2e74f68 | ||
|
|
724f3e872b | ||
|
|
d63e5165eb | ||
|
|
9892c4392e | ||
|
|
5ced1a775c | ||
|
|
761de1318e | ||
|
|
02508512d5 | ||
|
|
6e6105af05 | ||
|
|
d569419e13 | ||
|
|
93f1641803 | ||
|
|
ff52bf93fa | ||
|
|
a039275a0c | ||
|
|
a98d10104d | ||
|
|
8924bc59b1 | ||
|
|
eefe60a9c9 | ||
|
|
fe1cb3d904 | ||
|
|
0448278a78 | ||
|
|
99c0c2ff4c | ||
|
|
b369b734ca | ||
|
|
57150a20fd | ||
|
|
1634d7d531 | ||
|
|
d563de4207 | ||
|
|
5cd4b82ed0 | ||
|
|
5f728d348c | ||
|
|
596c4b6e40 | ||
|
|
36d1e7c44a | ||
|
|
25c17082f2 | ||
|
|
810ccf8e94 | ||
|
|
c8ed0b19f0 | ||
|
|
9e09444c65 | ||
|
|
5923fa0cd5 | ||
|
|
b2d4c5d14b | ||
|
|
0bb9c1d650 | ||
|
|
fbfa3abffd | ||
|
|
b5656aa5dd | ||
|
|
d53fd6a109 | ||
|
|
b0650b926b | ||
|
|
845f6a0a93 | ||
|
|
d8daa83c79 | ||
|
|
7bb0199e83 | ||
|
|
f014dadf06 | ||
|
|
393e54ce91 | ||
|
|
fdf4ad9543 | ||
|
|
5f0d384c9e | ||
|
|
4271700046 | ||
|
|
e153b0ab78 | ||
|
|
26868ae668 | ||
|
|
17c0364eda | ||
|
|
b28ac7af8c | ||
|
|
2dcaa21a44 | ||
|
|
33cc8363f9 | ||
|
|
9b61e1c85c | ||
|
|
6f53fdc02d | ||
|
|
6f850f5a55 | ||
|
|
a482a4b1f4 | ||
|
|
3664e6f96d | ||
|
|
dda8808173 | ||
|
|
63a24c23cc | ||
|
|
1ec3a72f79 | ||
|
|
566285ec0e | ||
|
|
d5ba82338d | ||
|
|
cbecd2a2fc | ||
|
|
3772dd40ac | ||
|
|
f69a0f0261 | ||
|
|
cb323ffb84 | ||
|
|
0db73e71a0 | ||
|
|
eeb0c838db | ||
|
|
dc48ee5aed | ||
|
|
c0acfa57a9 | ||
|
|
3e166ef927 | ||
|
|
4942d83de5 | ||
|
|
4c30b39e71 | ||
|
|
e55f4fe6b6 | ||
|
|
aff74cffa0 | ||
|
|
8b29bb8664 | ||
|
|
3cee57b6c2 | ||
|
|
857f4a4fc8 | ||
|
|
a942293a74 | ||
|
|
550b121990 | ||
|
|
cc84901a49 | ||
|
|
9d3764c5d9 | ||
|
|
0950235ccd | ||
|
|
8ed7fc894e | ||
|
|
e504ffa225 | ||
|
|
9c63b37bb4 | ||
|
|
5c110ca359 | ||
|
|
1ab61beeb9 | ||
|
|
8e45a546c9 | ||
|
|
745a7f76ea | ||
|
|
8cb9ab3204 | ||
|
|
12533d1414 | ||
|
|
bd1c164d57 | ||
|
|
7446c2096d | ||
|
|
8ce5c4b885 | ||
|
|
ab76112f5f | ||
|
|
9c54e39eae | ||
|
|
61eab44474 | ||
|
|
f6285ec710 | ||
|
|
ed878ec4b4 | ||
|
|
e38d41d67a | ||
|
|
3d237d72bd | ||
|
|
8044d2390c | ||
|
|
6b82e6b5ac | ||
|
|
842e6a93e2 | ||
|
|
f140f054e5 | ||
|
|
5cd4726e23 | ||
|
|
bccc58d693 | ||
|
|
e25f1c1481 | ||
|
|
fc4e690996 | ||
|
|
dadb2f9d37 | ||
|
|
5bf15b0587 | ||
|
|
5f9c0c3204 | ||
|
|
dfa4f0c309 | ||
|
|
f0063b4b0d | ||
|
|
5dc51c34ea | ||
|
|
5bf7a55bfa | ||
|
|
eb9ae8d5dc | ||
|
|
2a133587cc | ||
|
|
0e4a19c368 | ||
|
|
813c820227 | ||
|
|
870cee5707 | ||
|
|
4e55d2d941 | ||
|
|
8e962bf992 | ||
|
|
0815715f7b | ||
|
|
85e4697b7f | ||
|
|
16fdb9bf4c | ||
|
|
46f3d50a54 | ||
|
|
3a38240fb2 | ||
|
|
662f0b8fb6 | ||
|
|
96ce42ae91 | ||
|
|
93f587b851 | ||
|
|
89a940ec81 | ||
|
|
a33771b15d | ||
|
|
9a566e5559 | ||
|
|
6e75d42a92 | ||
|
|
575413cac9 | ||
|
|
6a9476c6d0 | ||
|
|
5468f1705c | ||
|
|
5ea132e712 | ||
|
|
8128fcf8bc | ||
|
|
e89655f793 | ||
|
|
2db2b068c4 | ||
|
|
a59e214317 | ||
|
|
ae2b6e4d7a | ||
|
|
b10fc6a0b0 | ||
|
|
70977e5228 | ||
|
|
4482391574 | ||
|
|
bd078fc883 | ||
|
|
644af87782 | ||
|
|
1ce36c1069 | ||
|
|
0a71005ecc | ||
|
|
698618a4b3 | ||
|
|
f9642dd79f | ||
|
|
85d1a3c016 | ||
|
|
38c74c81a6 | ||
|
|
4c04991b70 | ||
|
|
293a339fed | ||
|
|
5255a527f9 | ||
|
|
9440dfb66c | ||
|
|
7a019eee19 | ||
|
|
93f56a5dc8 | ||
|
|
68264228b8 | ||
|
|
66c1b8e26c | ||
|
|
5776c048ea | ||
|
|
76dd09bc50 | ||
|
|
73d18d3abd | ||
|
|
c1c9d0c8a3 | ||
|
|
64420ead7c | ||
|
|
6d035c6888 | ||
|
|
833ca8cce9 | ||
|
|
d02d506b13 | ||
|
|
f306056e5d | ||
|
|
58ec669d15 | ||
|
|
d1b61bfed3 | ||
|
|
325e0c6781 | ||
|
|
8d66cd52b5 | ||
|
|
4b9277629c | ||
|
|
6515a6188b | ||
|
|
8b3ca52502 | ||
|
|
fae003e085 | ||
|
|
4b961d2d8f | ||
|
|
e27fc512b4 | ||
|
|
8f0f600b6b | ||
|
|
5950610690 | ||
|
|
fce3df0c82 | ||
|
|
e2021231c6 | ||
|
|
f61dd7509e | ||
|
|
db2b64e58c | ||
|
|
d70999c386 | ||
|
|
eb6ecc59ab | ||
|
|
1e0e2fadfd | ||
|
|
4325f714b9 | ||
|
|
137cd45497 | ||
|
|
f3dbe4416f | ||
|
|
7fb55c0f51 | ||
|
|
fdc6cbc507 | ||
|
|
072085ae82 | ||
|
|
04a8996348 | ||
|
|
c26dcc2618 | ||
|
|
a4dc340bbc | ||
|
|
3c069fb588 | ||
|
|
1fe38f5ed1 | ||
|
|
841c9424e9 | ||
|
|
9c44a0c7d3 | ||
|
|
2883d2eb31 | ||
|
|
f5aade943e | ||
|
|
d17c3f39d0 | ||
|
|
9ac9ace6b8 | ||
|
|
c9d2cef58d | ||
|
|
a9e30eefdc | ||
|
|
1a895db9bd | ||
|
|
a955bc3b9b | ||
|
|
96e888a4f5 | ||
|
|
99ff0c1e3c | ||
|
|
599e89b1f9 | ||
|
|
33c527f15e | ||
|
|
eb02dacfdc | ||
|
|
e6a0e5b858 | ||
|
|
545ba80697 | ||
|
|
1e250ee95c | ||
|
|
5a12eedc2c | ||
|
|
5605fde777 | ||
|
|
9ac142688a | ||
|
|
2791790bf5 | ||
|
|
1752972be9 | ||
|
|
c877aba09f | ||
|
|
70e33518a9 | ||
|
|
cb81a9f783 | ||
|
|
b6b499d865 | ||
|
|
6704ad8193 | ||
|
|
942628a261 | ||
|
|
4ea8bac10d | ||
|
|
eafccc5721 | ||
|
|
a01bec3a11 | ||
|
|
3868175b85 | ||
|
|
904cb01067 | ||
|
|
5c0cb425a6 | ||
|
|
9dbb2ef630 | ||
|
|
bafd2817ee | ||
|
|
3380293923 | ||
|
|
a549c1ec8b | ||
|
|
ad84997ce0 | ||
|
|
42e2576813 | ||
|
|
31b995fa98 | ||
|
|
0364bec995 | ||
|
|
aa39f3d0a3 | ||
|
|
db545f43ea | ||
|
|
bbe003a454 | ||
|
|
819f0f68f6 | ||
|
|
8c0160937b | ||
|
|
6de789dfe3 | ||
|
|
afa2bb3bf5 | ||
|
|
89e66c0741 | ||
|
|
0dc4afba99 | ||
|
|
152578e576 | ||
|
|
63d6ab6fa7 | ||
|
|
75c8c59d78 | ||
|
|
87a59b6a9b | ||
|
|
2001fa86cf | ||
|
|
52747782a7 | ||
|
|
66f2668326 | ||
|
|
b262efc24c | ||
|
|
ce7ad76447 | ||
|
|
9e98b6616e | ||
|
|
f4c9eaa904 | ||
|
|
f8a0988e5f | ||
|
|
bf919207ed | ||
|
|
dac6b5c992 | ||
|
|
7f8043777e | ||
|
|
854b3feb36 | ||
|
|
22447e6ddb | ||
|
|
be2ec36e1f | ||
|
|
98cf16479d | ||
|
|
584735cbd0 | ||
|
|
3741493cb7 | ||
|
|
4ea861fe5c | ||
|
|
cd3df4d3c1 | ||
|
|
881a1edccb | ||
|
|
1b7b574289 | ||
|
|
d1d7498447 | ||
|
|
50c18727e7 | ||
|
|
e9bfde470a | ||
|
|
68f718a210 | ||
|
|
c3e528ad4b | ||
|
|
28af97c400 | ||
|
|
c2e4c343ab | ||
|
|
8a78589c2f | ||
|
|
841ee18435 | ||
|
|
71f54701d2 | ||
|
|
1c99939dfa | ||
|
|
50462cecd0 | ||
|
|
aa6a32f023 | ||
|
|
c4dc9064e3 | ||
|
|
bc5be10a0e | ||
|
|
98d9b57379 | ||
|
|
021a16050a | ||
|
|
555104aff0 | ||
|
|
95d63b78f4 | ||
|
|
80f9e1f4f1 | ||
|
|
a77997a4de | ||
|
|
ec4eb8e2a9 | ||
|
|
1bdeade71e | ||
|
|
629ba105cb | ||
|
|
891a1af995 | ||
|
|
0fbc6ac151 | ||
|
|
a6384d1b73 | ||
|
|
2fb9514890 | ||
|
|
fe89794505 | ||
|
|
08800c9faf | ||
|
|
469a4700d2 | ||
|
|
6707f974a5 | ||
|
|
c122cada2b | ||
|
|
96f02d8c95 | ||
|
|
dd717b60b8 | ||
|
|
3c20c7f4b4 | ||
|
|
1a09e70a04 | ||
|
|
027453bbd2 | ||
|
|
b621efa4a5 | ||
|
|
2915e4698c | ||
|
|
b687b1a4c5 | ||
|
|
b53827f32b | ||
|
|
d9641128a8 | ||
|
|
dfb5562142 | ||
|
|
d467c04749 | ||
|
|
3d7cffef2b | ||
|
|
f2fe81d9b5 | ||
|
|
cf98a22269 | ||
|
|
49f75d7036 | ||
|
|
ce940235b0 | ||
|
|
f5626f678d | ||
|
|
b3a59c3946 | ||
|
|
93c390c4fc | ||
|
|
941ab5a98f | ||
|
|
2ecdf803c0 | ||
|
|
5b2a399392 | ||
|
|
a9ea1d7606 | ||
|
|
1ce8ac2de6 | ||
|
|
e2019579fb | ||
|
|
fb3c6e56ee | ||
|
|
3fad007ae0 | ||
|
|
8891b6c930 | ||
|
|
400c592acf | ||
|
|
e13f3254ad | ||
|
|
bf40a07bb9 | ||
|
|
8f3a6b8479 | ||
|
|
7642b7cc72 | ||
|
|
e12ea60d85 | ||
|
|
0b13c4aed6 | ||
|
|
47919382e9 | ||
|
|
d60d67ee7e | ||
|
|
559aa687a5 | ||
|
|
bc0761f002 | ||
|
|
c0c2fc0eba | ||
|
|
44fe43c74c | ||
|
|
53a2a5d693 | ||
|
|
2334c26cbb | ||
|
|
0b6dde46d9 | ||
|
|
98d9d81aff | ||
|
|
736a62b632 | ||
|
|
cea6a83d8a | ||
|
|
2751fd7efc | ||
|
|
2822042eeb | ||
|
|
dc46d88ddd | ||
|
|
e04f76b558 | ||
|
|
a758056494 | ||
|
|
1ecdea5db3 | ||
|
|
e1bb773d85 | ||
|
|
7e934eff5d | ||
|
|
cfdf5603af | ||
|
|
45bfb8c6b6 | ||
|
|
65608a51b8 | ||
|
|
b6314597fe | ||
|
|
20a588199a | ||
|
|
59916f1e95 | ||
|
|
8b91f8f9e7 | ||
|
|
cbc3cce66f | ||
|
|
b4b63b5860 | ||
|
|
b9ae15a890 | ||
|
|
d955389c46 | ||
|
|
975eb885c1 | ||
|
|
a3aed96757 | ||
|
|
dc70bfabaf | ||
|
|
6932340671 | ||
|
|
f6637b7caf | ||
|
|
4f4be44caa | ||
|
|
7832497ba7 | ||
|
|
7d06e2395f | ||
|
|
3a479d7eef | ||
|
|
8fe8a1e9ee | ||
|
|
2d8b2e7fb0 | ||
|
|
9c0365f92c | ||
|
|
b48abb08d2 | ||
|
|
d8f3e032c7 | ||
|
|
8dbcb255ad | ||
|
|
db06cbbc86 | ||
|
|
98ab23c1a3 | ||
|
|
d0ca9ba6a6 | ||
|
|
b242368675 | ||
|
|
664527ce63 | ||
|
|
99e4f80be0 | ||
|
|
702dae9fcd | ||
|
|
48fe1ba559 | ||
|
|
382ac7ba0d | ||
|
|
a46f47f352 | ||
|
|
e984d8a42c | ||
|
|
554bad6b8d | ||
|
|
ed13c97ad7 | ||
|
|
d33873d59a | ||
|
|
1234899ea1 | ||
|
|
13027dc44b | ||
|
|
5b4d74b7fe | ||
|
|
18c7bc2b5b | ||
|
|
bbbee0f372 | ||
|
|
cf9d090154 | ||
|
|
718471917f | ||
|
|
bb97407cde | ||
|
|
92ce678e29 | ||
|
|
e100aea2c7 | ||
|
|
fea3b6cb4a | ||
|
|
afbc132faa | ||
|
|
b27198286d | ||
|
|
ac93d81032 | ||
|
|
9981e5ca76 | ||
|
|
7dd3efeb53 | ||
|
|
d38d702adf | ||
|
|
04a000a8a8 | ||
|
|
3bbf0741ee | ||
|
|
e9a336100b | ||
|
|
fb600e9829 | ||
|
|
4a455ff958 | ||
|
|
707e238e5c | ||
|
|
90f22a4b66 | ||
|
|
b4f134adf7 | ||
|
|
1e00fc6149 | ||
|
|
f52133a69c | ||
|
|
91b142e0d9 | ||
|
|
26a9dd98c1 | ||
|
|
99e38e1d23 | ||
|
|
a2d8a25fd9 | ||
|
|
d86d625bcc | ||
|
|
18e3fb6609 | ||
|
|
da33ba0ed5 | ||
|
|
66f021d01a | ||
|
|
40231ea45f | ||
|
|
cd80a47c04 | ||
|
|
1033bd7bda | ||
|
|
b4f60f3acb | ||
|
|
bed3b571cc | ||
|
|
c8dd4e5254 | ||
|
|
514048171b | ||
|
|
32e9901592 | ||
|
|
d83f86a469 | ||
|
|
403d53586c | ||
|
|
6acae58694 | ||
|
|
a3f9737e63 | ||
|
|
263af7c139 | ||
|
|
7f2439f1e9 | ||
|
|
ae87d23003 | ||
|
|
3192cc0aac | ||
|
|
6102e9aa72 | ||
|
|
f4a152b0fe | ||
|
|
2b11bca7dc | ||
|
|
07d19f38e3 | ||
|
|
cd228c439e | ||
|
|
7a859c8961 | ||
|
|
543f38c75d | ||
|
|
f7b150f2d2 | ||
|
|
11328f643f | ||
|
|
f270a6b8c4 | ||
|
|
3fec23fd36 | ||
|
|
e01838e996 | ||
|
|
f70e41e7cd | ||
|
|
c4ec0c9897 | ||
|
|
989b071a6d | ||
|
|
c39751f9db | ||
|
|
dbf74a2234 | ||
|
|
837230d72d | ||
|
|
f544ec4126 | ||
|
|
79dbf85c1e | ||
|
|
61fe6cc961 | ||
|
|
70c88b68e2 | ||
|
|
d70c33d20f | ||
|
|
6b2e000e61 | ||
|
|
b9f11dafff | ||
|
|
9b32eaeb8a | ||
|
|
a99c0d438e | ||
|
|
c634c24afb | ||
|
|
2ddd1437cf | ||
|
|
9da309ca48 | ||
|
|
cfcd451db7 | ||
|
|
5ab72fd1a9 | ||
|
|
daace9bd1a | ||
|
|
69adcd1d69 | ||
|
|
0711a22188 | ||
|
|
3a06412cd8 | ||
|
|
51c82702e2 | ||
|
|
1b01196ec6 | ||
|
|
1cd6b58ece | ||
|
|
ea8e13b1c8 | ||
|
|
f392229393 | ||
|
|
a299bafe89 | ||
|
|
d2bf539504 | ||
|
|
903c3989b9 | ||
|
|
00996f0d7a | ||
|
|
4aded3a436 | ||
|
|
9acdc37729 | ||
|
|
d4cdcbe54f | ||
|
|
6fa2a0f411 | ||
|
|
558a8e4a14 | ||
|
|
8947b82034 | ||
|
|
56551025e9 | ||
|
|
befb4939d5 | ||
|
|
289f7aba63 | ||
|
|
28bd245b96 | ||
|
|
c5e7300df2 | ||
|
|
fe25d941bb | ||
|
|
4cda267f3b | ||
|
|
82ba7e2b8b | ||
|
|
41ebaf3938 | ||
|
|
090c400037 | ||
|
|
12b1232ac0 | ||
|
|
204a84c522 | ||
|
|
526afd539b | ||
|
|
d708984abd | ||
|
|
9d39db6428 | ||
|
|
67a8ec0d39 | ||
|
|
297a7d0ef8 | ||
|
|
4712833853 | ||
|
|
11d17f7496 | ||
|
|
36df3f234f | ||
|
|
098b298646 | ||
|
|
2f9320989a | ||
|
|
ec8d5defd4 | ||
|
|
981676c7f8 | ||
|
|
7c5ae57784 | ||
|
|
fc7be87468 | ||
|
|
e55d8007fc | ||
|
|
43b7aa2d52 | ||
|
|
cd1bad0718 | ||
|
|
6b47618351 | ||
|
|
b6d384120d | ||
|
|
1268b26c1f | ||
|
|
f1233bfddc | ||
|
|
1aa3e6afea | ||
|
|
ce21eb241a | ||
|
|
f96fb72eb1 | ||
|
|
207c467c6b | ||
|
|
9d1d9e33ed | ||
|
|
e4a76c0690 | ||
|
|
124c3e25e9 | ||
|
|
5cb1201903 | ||
|
|
bb6ca80d5a | ||
|
|
dc7c54a1f8 | ||
|
|
23401440bf | ||
|
|
f8f959e05a | ||
|
|
edbd4d2d03 | ||
|
|
a0b4065be3 | ||
|
|
1b2f964f32 | ||
|
|
eaf5280d99 | ||
|
|
d435da980f | ||
|
|
8d3a91f3a4 | ||
|
|
b80c339c5a | ||
|
|
34159fc9da | ||
|
|
b509ee9ee0 | ||
|
|
a6819448b9 | ||
|
|
f2847f9aa5 | ||
|
|
8f01e5e1c3 | ||
|
|
acb2f43620 | ||
|
|
62ac65e4d8 | ||
|
|
8f183bdcdc | ||
|
|
3d135d155e | ||
|
|
090c811391 | ||
|
|
2a9e8dc525 | ||
|
|
cb0b22cf2c | ||
|
|
5aba3517ce | ||
|
|
726f665388 | ||
|
|
e2ac55e9ac | ||
|
|
fa5729bac6 | ||
|
|
e714cb6423 | ||
|
|
35a0162d5c | ||
|
|
76740adc3f | ||
|
|
1c814141a2 | ||
|
|
5545daf992 | ||
|
|
d300615d90 | ||
|
|
908a5260c2 | ||
|
|
7aac6644c3 | ||
|
|
3b673c07a0 | ||
|
|
d726da822c | ||
|
|
7894f72b0f | ||
|
|
4c5822ac67 | ||
|
|
b917cccbee | ||
|
|
01d2d05d8e | ||
|
|
4de86cb6cf | ||
|
|
8861ad76ed | ||
|
|
ef86372635 | ||
|
|
ccff7b1148 | ||
|
|
ed0825112d | ||
|
|
b8df90531f | ||
|
|
f099c3591c | ||
|
|
ed33e048ad | ||
|
|
7fd3bfa30c | ||
|
|
07a492a32c | ||
|
|
11fffbd79e | ||
|
|
eff564ad88 | ||
|
|
d3d53e6099 | ||
|
|
53d122ed55 | ||
|
|
1778c1ef7d | ||
|
|
a510bc74e6 | ||
|
|
a9ecdbdfec | ||
|
|
06ab3cf013 | ||
|
|
3db5da1c8d | ||
|
|
5937a50b6d | ||
|
|
b4191ee5cc | ||
|
|
c63e42715e | ||
|
|
26e582d806 | ||
|
|
ee9270845a | ||
|
|
6cf33897c0 | ||
|
|
2161bbb8fa | ||
|
|
b75088874e | ||
|
|
9ac1897880 | ||
|
|
36c43ed2fa | ||
|
|
8084822f16 | ||
|
|
959718618f | ||
|
|
75f3fe0cec | ||
|
|
b800477365 | ||
|
|
b191341c57 | ||
|
|
88a40be901 | ||
|
|
3fef58057e | ||
|
|
b156e4a79a | ||
|
|
30ac264cd3 | ||
|
|
a9b00e1cd3 | ||
|
|
d94fc4bc13 | ||
|
|
40b5339ef8 | ||
|
|
86f0456e8c | ||
|
|
48a693793f | ||
|
|
ff28d72db6 | ||
|
|
456857bbbd | ||
|
|
7f17b66a6c | ||
|
|
310ec8f296 | ||
|
|
0c2afa9438 | ||
|
|
c3832cf8b1 | ||
|
|
a2de8a2a05 | ||
|
|
3b601896d2 | ||
|
|
e1a90bcb00 | ||
|
|
2b65916344 | ||
|
|
f149005026 | ||
|
|
5eb663aa1b | ||
|
|
12b7d6c0e3 | ||
|
|
723639d928 | ||
|
|
e0502c24e1 | ||
|
|
358d6333c3 | ||
|
|
0b279d1df3 | ||
|
|
8e0fba7992 | ||
|
|
d5419ec9fa | ||
|
|
33e3f78be6 | ||
|
|
3c5ad519dd | ||
|
|
17c5b858b5 | ||
|
|
f6f6496c9c | ||
|
|
b1d725e23a | ||
|
|
a74622997e | ||
|
|
b1a200001e | ||
|
|
3b1041fa1f | ||
|
|
a83ccc18bb | ||
|
|
618b1b5ace | ||
|
|
14858adc88 | ||
|
|
c07f35f3aa | ||
|
|
87eab27996 | ||
|
|
b7296a4fe3 | ||
|
|
3fb9ae1fb4 | ||
|
|
9705939489 | ||
|
|
eca67b1204 | ||
|
|
c59fc3581a | ||
|
|
e00f8c94ff | ||
|
|
4186153f0c | ||
|
|
6c01807f4f | ||
|
|
9d35fb397b | ||
|
|
c9f2f57427 | ||
|
|
c862ab0c56 | ||
|
|
7aaaa57c14 | ||
|
|
11b6394a87 | ||
|
|
bdd48fd2df | ||
|
|
e99af75400 | ||
|
|
321440e13f | ||
|
|
0556d984e0 | ||
|
|
0ba1f66136 | ||
|
|
7562555687 | ||
|
|
668ccfcd12 | ||
|
|
9c0337c4ef | ||
|
|
3fde06ab0f | ||
|
|
73959f328a | ||
|
|
cca85bfee3 | ||
|
|
575caa53d3 | ||
|
|
33874a8866 | ||
|
|
b8e909a134 | ||
|
|
5193a5d309 | ||
|
|
7db288b9aa | ||
|
|
9f033e64aa | ||
|
|
5a15ba97dc | ||
|
|
ce6ec72683 | ||
|
|
eedbcdd564 | ||
|
|
0ca2848e01 | ||
|
|
208275b6a9 | ||
|
|
4bdcaa72cd | ||
|
|
8c6001fa5a | ||
|
|
c4e88abce1 | ||
|
|
eea7174f1d | ||
|
|
3f7d0688fc | ||
|
|
6d319618c6 | ||
|
|
4250fa707b | ||
|
|
7734cd2c8f | ||
|
|
57467bb338 | ||
|
|
8ad61a52b9 | ||
|
|
9742a212a2 | ||
|
|
fd21fc1a31 | ||
|
|
1b5a0ab9f3 | ||
|
|
f466fef20a | ||
|
|
9bc70adbbd | ||
|
|
6f39f9849a | ||
|
|
5bc950ed28 | ||
|
|
b80d460a8f | ||
|
|
3f555ce5e2 | ||
|
|
9513b476ef | ||
|
|
8f9e79ae37 | ||
|
|
53b681ef67 | ||
|
|
9a8094cb8a | ||
|
|
00ee6d0bbd | ||
|
|
83f6640bd3 | ||
|
|
2afb939ee6 | ||
|
|
7c442865c5 | ||
|
|
b3d57edb24 | ||
|
|
6d6e017c71 | ||
|
|
fc6b5c1d7c | ||
|
|
6ecd3b59fd | ||
|
|
456bcf3d57 | ||
|
|
f12a9b9ac7 | ||
|
|
00b6a222bd | ||
|
|
b8ccc4453e | ||
|
|
dbb31420af | ||
|
|
35f4f3f81e | ||
|
|
acbfff89d3 | ||
|
|
6b37675a81 | ||
|
|
a471ffa6d8 | ||
|
|
7bf090fdab | ||
|
|
4e0279200f | ||
|
|
78055e3ccb | ||
|
|
f5e6fd6340 | ||
|
|
2d60d5fb1f | ||
|
|
c6dd25a119 | ||
|
|
68d29d9a0f | ||
|
|
1d63970a25 | ||
|
|
2b1ffac564 | ||
|
|
e2d3a43593 | ||
|
|
8e13403cca | ||
|
|
3c6a7b76ca | ||
|
|
428128651e | ||
|
|
326678f214 | ||
|
|
1f994495f8 | ||
|
|
fb1637006d | ||
|
|
37a35e8f70 | ||
|
|
1290d0ead9 | ||
|
|
ef0f26b64c | ||
|
|
485d211768 | ||
|
|
f1ea035197 | ||
|
|
6f961ade74 | ||
|
|
b8e17e0116 | ||
|
|
040e1fe8f6 | ||
|
|
e9c92bdf51 | ||
|
|
48c33f3dcd | ||
|
|
6b2bc924dd | ||
|
|
a65c4f90f4 | ||
|
|
04bb4b351a | ||
|
|
e02e4d52b4 | ||
|
|
6f3c4434f6 | ||
|
|
711715ca1e | ||
|
|
d6000af843 | ||
|
|
9b0954a898 | ||
|
|
42a2c33fd7 | ||
|
|
a4d18a18d9 | ||
|
|
bf32409d4e | ||
|
|
e38aec225f | ||
|
|
995b7a4712 | ||
|
|
9fe3026941 | ||
|
|
520658e1b8 | ||
|
|
f822d8eddb | ||
|
|
2f879ce4d6 | ||
|
|
24528bf101 | ||
|
|
822682caba | ||
|
|
5dc3cc65a8 | ||
|
|
0f80caffb5 | ||
|
|
6c428b2777 | ||
|
|
c9be37b84a | ||
|
|
87ea2f86c0 | ||
|
|
7e80be5ca0 | ||
|
|
989a818a67 | ||
|
|
af2e17df9e | ||
|
|
728ec1c16d | ||
|
|
f859c5b1b5 | ||
|
|
ab600d7df1 | ||
|
|
4644f64fd6 | ||
|
|
c274312265 | ||
|
|
f8e63098a2 | ||
|
|
264d353ec2 | ||
|
|
2b58dcbe7f | ||
|
|
dc791487c5 | ||
|
|
5637f132d4 | ||
|
|
9e6cca1cd0 | ||
|
|
640c82d517 | ||
|
|
20d1a93b09 | ||
|
|
f5d1b11bda | ||
|
|
66c7f8bcb2 | ||
|
|
d8fa46c558 | ||
|
|
10bfc8a753 | ||
|
|
9848599807 | ||
|
|
2e38ebcfbb | ||
|
|
f875623cd0 | ||
|
|
e6f9cb9929 | ||
|
|
6aac3baa55 | ||
|
|
a860315587 | ||
|
|
a73a73e42c | ||
|
|
a3358e5b21 | ||
|
|
7e9e2fead2 | ||
|
|
0269a3eb6f | ||
|
|
f449a45912 | ||
|
|
f69d4ccd22 | ||
|
|
0e2df2adbb | ||
|
|
d46894e5db | ||
|
|
951a61117a | ||
|
|
7a038ab09d | ||
|
|
707a2aca0a | ||
|
|
624837fcf1 | ||
|
|
e3ea36c76f | ||
|
|
453996c374 | ||
|
|
8add9ba0a6 | ||
|
|
da11b56eab | ||
|
|
19377c2132 | ||
|
|
b2bff39fe1 | ||
|
|
5f7075d39a | ||
|
|
40d9d663ec | ||
|
|
31f9b77c32 | ||
|
|
690a66a093 | ||
|
|
e7e7d36774 | ||
|
|
f95a37956c | ||
|
|
1e2a27f902 | ||
|
|
d90e3dc210 | ||
|
|
5df4b56c0d | ||
|
|
436da1cb32 | ||
|
|
4d0dbbc6cd | ||
|
|
033bf77cbb | ||
|
|
1068c3ca7e | ||
|
|
df4422369d | ||
|
|
a62183c9e0 | ||
|
|
de48cf8243 | ||
|
|
acd4fc4518 | ||
|
|
da59ed019f | ||
|
|
e73b174d1d | ||
|
|
2753a22e3a | ||
|
|
79fc33630b | ||
|
|
bf5331ba6e | ||
|
|
3be47d3e54 | ||
|
|
f9de131017 | ||
|
|
f1f505d41c | ||
|
|
51603be5ec | ||
|
|
2152b4a2cd | ||
|
|
a70023a32b | ||
|
|
5038210d78 | ||
|
|
28bbfd88b2 | ||
|
|
d05a71c8fe | ||
|
|
245b0a7e50 | ||
|
|
ceb9e4aee2 | ||
|
|
d2e94dad7e | ||
|
|
240b2108f3 | ||
|
|
f68d99d16d | ||
|
|
44e845c875 | ||
|
|
d8e2368a18 | ||
|
|
172a43679d | ||
|
|
82305ce2b3 | ||
|
|
eaf73edcad | ||
|
|
543a4ee177 | ||
|
|
fd2a464bae | ||
|
|
b06152ba58 | ||
|
|
c24d285cd3 | ||
|
|
be39cd653e | ||
|
|
6813f47bc1 | ||
|
|
8e795c4177 | ||
|
|
9c96afee09 | ||
|
|
d507be0ab0 | ||
|
|
75a52f801a | ||
|
|
d3b123f3a9 | ||
|
|
da3cdd984b | ||
|
|
6184e5f828 | ||
|
|
133bd44b85 | ||
|
|
0c254c9621 | ||
|
|
1faf196f82 | ||
|
|
81c7887d47 | ||
|
|
e62e630987 | ||
|
|
739e38a047 | ||
|
|
8c23b17517 | ||
|
|
fda8f3e1ce | ||
|
|
9e5f64c431 | ||
|
|
dc689d325b | ||
|
|
0a883dc234 | ||
|
|
3824e90997 | ||
|
|
5158a15379 | ||
|
|
1bae79af5b | ||
|
|
58b7612987 | ||
|
|
9506da6dd3 | ||
|
|
4ea886d05a | ||
|
|
7a52fccfd1 | ||
|
|
f79d308a9f | ||
|
|
5aa64641d2 | ||
|
|
ae594a0400 | ||
|
|
eeece55b45 | ||
|
|
9fbc50d26f | ||
|
|
16ebf0556a | ||
|
|
bb104b5763 | ||
|
|
9bac88697b | ||
|
|
7ab240643e | ||
|
|
70d5b798b2 | ||
|
|
4e7a92637c | ||
|
|
2e19d0459b | ||
|
|
0970fd7040 | ||
|
|
81532cad95 | ||
|
|
dcb5f7b211 | ||
|
|
40fd7ca332 | ||
|
|
7f867a6185 | ||
|
|
23e55ac5f7 | ||
|
|
455974cb05 | ||
|
|
66a668f55b | ||
|
|
7ecb50a3fe | ||
|
|
f10d1eac61 | ||
|
|
b92c389a5b | ||
|
|
9dfc57c462 | ||
|
|
3ea1492d67 | ||
|
|
c041614d1f | ||
|
|
d9c5907ea9 | ||
|
|
0b6a52277d | ||
|
|
944adb5d7c | ||
|
|
ac4129c1e1 | ||
|
|
0220a88ea5 | ||
|
|
6d33763ec9 | ||
|
|
3cedadbb97 | ||
|
|
5a6d339a89 | ||
|
|
905d8a4f33 | ||
|
|
917d312ea0 | ||
|
|
ddc01b539f | ||
|
|
38e4733433 | ||
|
|
cbd7160e23 | ||
|
|
f2b3acb0c9 | ||
|
|
49c7b5c442 | ||
|
|
7b7d180207 | ||
|
|
21cf390d0e | ||
|
|
5e59f77f83 | ||
|
|
62814490b3 | ||
|
|
e5fedb8163 | ||
|
|
cfc74c1080 | ||
|
|
eaf53ad3b9 | ||
|
|
a1f0c198a7 | ||
|
|
6b1e48e485 | ||
|
|
83ea919434 | ||
|
|
c94e93b916 | ||
|
|
49d418bb39 | ||
|
|
23adda1817 | ||
|
|
7c729c2c4e | ||
|
|
ecf7a416eb | ||
|
|
2f87f2bb62 | ||
|
|
39f4102e81 | ||
|
|
4fcd6b15ed | ||
|
|
8f9ed4bc40 | ||
|
|
73dedd79d2 | ||
|
|
2754b397d5 | ||
|
|
7d949ee8fd | ||
|
|
28e2f22550 | ||
|
|
eaa1760511 | ||
|
|
53dfd3f4c0 | ||
|
|
ed2b049ad4 | ||
|
|
092fb40333 | ||
|
|
36a4225858 | ||
|
|
e551ea8bd9 | ||
|
|
5a28b1bf1c | ||
|
|
4cd1129c92 | ||
|
|
a5d7bc4efc | ||
|
|
1ff5b2af2a | ||
|
|
82446ce30a | ||
|
|
6465248483 | ||
|
|
48e7f82466 | ||
|
|
6fef21ebc0 | ||
|
|
837e594607 | ||
|
|
ab0cb55b80 | ||
|
|
2d24c8c525 | ||
|
|
40383f3733 | ||
|
|
e14861d79d | ||
|
|
b29b3d0432 | ||
|
|
c21d4861c0 | ||
|
|
a6786e5c2b | ||
|
|
77caa9e9d4 | ||
|
|
835ef02872 | ||
|
|
279dcb1428 | ||
|
|
4a8c312e0a | ||
|
|
c2bc376f87 | ||
|
|
73160d4d26 | ||
|
|
1dd2a4e9c5 | ||
|
|
ed0c4b8de5 | ||
|
|
4f921d761d | ||
|
|
37f85d6deb | ||
|
|
e1b75c78ab | ||
|
|
5e83206e6e | ||
|
|
1ea6838db6 | ||
|
|
fb82420376 | ||
|
|
109d67956f | ||
|
|
9f7b2e2cfd | ||
|
|
22f9bfeceb | ||
|
|
ef4c7e96da | ||
|
|
02865f99a9 | ||
|
|
ef6019f13b | ||
|
|
33d02bb7b8 | ||
|
|
d34df2c1cf | ||
|
|
7fdf540742 | ||
|
|
f916aabb98 | ||
|
|
4ae7d56db4 | ||
|
|
e3878ffde7 | ||
|
|
5221b6fb43 | ||
|
|
5e0fe86858 | ||
|
|
c86ced0911 | ||
|
|
0aad82d3d7 | ||
|
|
ce86adab82 | ||
|
|
b543f727be | ||
|
|
8de7e0f198 | ||
|
|
866dacf198 | ||
|
|
3589fa381d | ||
|
|
5d54ebfaa0 | ||
|
|
fea2b6253f | ||
|
|
ba6e1ab15a | ||
|
|
1d9fff3c98 | ||
|
|
526adce603 | ||
|
|
e7f568e162 | ||
|
|
7d15c602a6 | ||
|
|
bdb30ebc48 | ||
|
|
a31da7616d | ||
|
|
f1147c10ee | ||
|
|
544a5386ad | ||
|
|
2d502213e4 | ||
|
|
55e9f8722f | ||
|
|
b8602ee004 | ||
|
|
e37c4b1f87 | ||
|
|
f7a3bb2ae8 | ||
|
|
7d70ea78cd | ||
|
|
3907ec8b51 | ||
|
|
f2b9bf0b8c | ||
|
|
fadcc606f8 | ||
|
|
92e97e61c1 | ||
|
|
4b5b9fbde8 | ||
|
|
711d22a0ed | ||
|
|
06757153b3 | ||
|
|
38597aea00 | ||
|
|
b10ce080a9 | ||
|
|
72e10ac597 | ||
|
|
5b591364ba | ||
|
|
ace1855797 | ||
|
|
ddedf73939 | ||
|
|
538014935e | ||
|
|
5e9bbf1200 | ||
|
|
29d6d3c041 | ||
|
|
53ab303fd9 | ||
|
|
24103ee856 | ||
|
|
20e368ab5e | ||
|
|
05763191ce | ||
|
|
f6685fb9c9 | ||
|
|
dbdf9602c2 | ||
|
|
6173f7049c | ||
|
|
4adacf4b98 | ||
|
|
8cb6ed26a1 | ||
|
|
fd7aa9ccfa | ||
|
|
e2a48d1714 | ||
|
|
a5c4c1e0a6 | ||
|
|
b29d03e872 | ||
|
|
dff11092ec | ||
|
|
5e9c4e8fa3 | ||
|
|
c346f32762 | ||
|
|
d2d450aff2 | ||
|
|
09af858be8 | ||
|
|
9c8a99c79c | ||
|
|
c6b9855198 | ||
|
|
c142928fad | ||
|
|
fc0cfd5188 | ||
|
|
d9c78e5c3e | ||
|
|
b449fceca0 | ||
|
|
f0d15c0bce | ||
|
|
8f031f61ea | ||
|
|
502e8559f0 | ||
|
|
8cf6f7e936 | ||
|
|
0ef01cc620 | ||
|
|
930828ef86 | ||
|
|
9ebe920195 | ||
|
|
0df36047e7 | ||
|
|
94604921f9 | ||
|
|
284fe294ac | ||
|
|
ffa01d491a | ||
|
|
1d9513e743 | ||
|
|
277c9e22f1 | ||
|
|
4e7b4da941 | ||
|
|
7e72c9c33b | ||
|
|
e0e2c3a3f5 | ||
|
|
3b5e444e76 | ||
|
|
02006e3ff5 | ||
|
|
8083596f19 | ||
|
|
6551689a0c | ||
|
|
3fbf21a34e | ||
|
|
b598431237 | ||
|
|
3b5d9a2cae | ||
|
|
3bd8aa8a86 | ||
|
|
fe5fca8eaf | ||
|
|
848101a783 | ||
|
|
d7c350f987 | ||
|
|
4c526f0b3c | ||
|
|
876ffb5b13 | ||
|
|
0b14cf3d6a | ||
|
|
c2044b36b1 | ||
|
|
f970b4acfa | ||
|
|
e69c0af613 | ||
|
|
42e2dd8b30 | ||
|
|
4fd6e7b033 | ||
|
|
3580816eac | ||
|
|
f1c2e5f194 | ||
|
|
b6d59f1d46 | ||
|
|
a3521681e7 | ||
|
|
ca10e1136c | ||
|
|
282fb2af0e | ||
|
|
1f5a597d50 | ||
|
|
a32666817c | ||
|
|
b9bd3f2b4c | ||
|
|
4173efbe5a | ||
|
|
8121c8bd41 | ||
|
|
6ca8218d55 | ||
|
|
653afbdd46 | ||
|
|
4453d1752f | ||
|
|
5782c8a58b | ||
|
|
3e041befc8 | ||
|
|
6d3847c26f | ||
|
|
4bdfc37bc1 | ||
|
|
28afe0d829 | ||
|
|
04dddd3378 | ||
|
|
23a14583fe | ||
|
|
19c83de510 | ||
|
|
e94d4b64cf | ||
|
|
7380c99f3a | ||
|
|
2961a372c3 | ||
|
|
5e2a4fb058 | ||
|
|
a16242b9f8 | ||
|
|
acfba9ac96 | ||
|
|
006343460e | ||
|
|
1cc8634cc7 | ||
|
|
9f8a110428 | ||
|
|
07b4279d0b | ||
|
|
6a33b231e3 | ||
|
|
b38d02061d | ||
|
|
f832a36a5e | ||
|
|
911ca7c29d |
16
.github/workflows/android.yml
vendored
@@ -1,6 +1,12 @@
|
||||
name: Android CI
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- '4.**'
|
||||
- '5.**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -9,9 +15,17 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
|
||||
- name: Install NDK
|
||||
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew qa
|
||||
|
||||
18
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Reproducible Build Check
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build image
|
||||
run: cd reproducible-builds && docker build -t signal-android . && cd ..
|
||||
|
||||
- name: Test build
|
||||
run: docker run --rm -v $(pwd):/project -w /project signal-android ./gradlew clean assembleRelease
|
||||
2
.gitignore
vendored
@@ -23,5 +23,5 @@ ffpr
|
||||
test/androidTestEspresso/res/values/arrays.xml
|
||||
obj/
|
||||
jni/libspeex/.deps/
|
||||
*.sh
|
||||
pkcs11.password
|
||||
dev.keystore
|
||||
|
||||
10
.tx/config
@@ -1,10 +0,0 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = da_DK:da-rDK,he:iw,id:in,kn_IN:kn-rIN,pt_BR:pt-rBR,pt_PT:pt,qu_EC:qu-rEC,sv_SE:sv-rSE,zh_CN:zh-rCN,zh_HK:zh-rHK,zh_TW:zh-rTW
|
||||
|
||||
[signal-android.master]
|
||||
file_filter = res/values-<lang>/strings.xml
|
||||
source_file = res/values/strings.xml
|
||||
source_lang = en
|
||||
type = ANDROID
|
||||
|
||||
@@ -1,730 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.thoughtcrime.securesms">
|
||||
|
||||
<uses-sdk tools:overrideLibrary="androidx.camera.core,androidx.camera.camera2"/>
|
||||
|
||||
<permission android:name="org.thoughtcrime.securesms.ACCESS_SECRETS"
|
||||
android:label="Access to TextSecure Secrets"
|
||||
android:protectionLevel="signature" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.location" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.wifi" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.portrait" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
||||
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
|
||||
<uses-permission android:name="org.thoughtcrime.securesms.ACCESS_SECRETS"/>
|
||||
<uses-permission android:name="android.permission.READ_PROFILE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_PROFILE"/>
|
||||
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"
|
||||
tools:ignore="ProtectedPermissions"/>
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_MMS"/>
|
||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
||||
<uses-permission android:name="android.permission.SEND_SMS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_SMS"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.READ_CALL_STATE"/>
|
||||
|
||||
<!-- For sending/receiving events -->
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR"/>
|
||||
|
||||
|
||||
<!-- Normal -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
|
||||
<!-- So we can add a TextSecure 'Account' -->
|
||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
|
||||
|
||||
<!-- For conversation 'shortcuts' on the desktop -->
|
||||
<uses-permission android:name="android.permission.INSTALL_SHORTCUT"/>
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||
|
||||
<!-- For fixing MMS -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
|
||||
|
||||
<!-- Set image as wallpaper -->
|
||||
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
|
||||
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.RAISED_THREAD_PRIORITY" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
|
||||
|
||||
<application android:name=".ApplicationContext"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
tools:replace="android:allowBackup"
|
||||
android:allowBackup="false"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:largeHeap="true">
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U"/>
|
||||
|
||||
<meta-data android:name="com.google.android.gms.version"
|
||||
android:value="@integer/google_play_services_version" />
|
||||
|
||||
<meta-data android:name="com.google.android.gms.car.application"
|
||||
android:resource="@xml/automotive_app_desc" />
|
||||
|
||||
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
|
||||
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
|
||||
<meta-data android:name="firebase_messaging_auto_init_enabled" android:value="false" />
|
||||
|
||||
<activity android:name="org.thoughtcrime.securesms.WebRtcCallActivity"
|
||||
android:theme="@style/TextSecure.LightTheme.WebRTCCall"
|
||||
android:excludeFromRecents="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|fontScale"
|
||||
android:launchMode="singleTask"/>
|
||||
|
||||
<activity android:name=".InviteActivity"
|
||||
android:theme="@style/Signal.Light.NoActionBar.Invite"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.thoughtcrime.securesms.MainActivity" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".PromptMmsActivity"
|
||||
android:label="Configure MMS Settings"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DeviceProvisioningActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="tsdevice"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".preferences.MmsPreferencesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ShareActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity=""
|
||||
android:noHistory="true"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:mimeType="audio/*" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="text/plain" />
|
||||
<data android:mimeType="video/*" />
|
||||
<data android:mimeType="application/*"/>
|
||||
<data android:mimeType="text/*"/>
|
||||
<data android:mimeType="*/*"/>
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.service.chooser.chooser_target_service"
|
||||
android:value=".service.DirectShareService" />
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".stickers.StickerPackPreviewActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:noHistory="true"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="sgnl"
|
||||
android:host="addstickers" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity-alias android:name=".RoutingActivity"
|
||||
android:targetActivity=".MainActivity"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data android:name="com.sec.minimode.icon.portrait.normal"
|
||||
android:resource="@mipmap/ic_launcher" />
|
||||
<meta-data android:name="com.sec.minimode.icon.landscape.normal"
|
||||
android:resource="@mipmap/ic_launcher" />
|
||||
|
||||
</activity-alias>
|
||||
|
||||
<activity android:name=".conversation.ConversationActivity"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:parentActivityName=".MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.thoughtcrime.securesms.MainActivity" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".longmessage.LongMessageActivity" />
|
||||
|
||||
<activity android:name=".conversation.ConversationPopupActivity"
|
||||
android:windowSoftInputMode="stateVisible"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity=""
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/TextSecure.LightTheme.Popup"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
|
||||
|
||||
<activity android:name=".MessageDetailsActivity"
|
||||
android:label="@string/AndroidManifest__message_details"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".GroupCreateActivity"
|
||||
android:windowSoftInputMode="stateVisible"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DatabaseMigrationActivity"
|
||||
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".migrations.ApplicationMigrationActivity"
|
||||
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ExperienceUpgradeActivity"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphraseCreateActivity"
|
||||
android:label="@string/AndroidManifest__create_passphrase"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphrasePromptActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightIntroTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".NewConversationActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysVisible"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PushContactSelectionActivity"
|
||||
android:label="@string/AndroidManifest__select_contacts"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".giph.ui.GiphyActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".mediasend.MediaSendActivity"
|
||||
android:theme="@style/TextSecure.FullScreenMedia"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTop"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphraseChangeActivity"
|
||||
android:label="@string/AndroidManifest__change_passphrase"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".VerifyIdentityActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ApplicationPreferencesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".registration.RegistrationNavigationActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".revealable.ViewOnceMessageActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.FullScreenMedia"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:excludeFromRecents="true"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".stickers.StickerManagementActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DeviceActivity"
|
||||
android:label="@string/AndroidManifest__linked_devices"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".LogSubmitActivity"
|
||||
android:label="@string/AndroidManifest__log_submit"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".MediaPreviewActivity"
|
||||
android:label="@string/AndroidManifest__media_preview"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".mediaoverview.MediaOverviewActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DummyActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay"
|
||||
android:enabled="true"
|
||||
android:allowTaskReparenting="true"
|
||||
android:noHistory="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:alwaysRetainTaskState="false"
|
||||
android:stateNotNeeded="true"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:finishOnTaskLaunch="true" />
|
||||
|
||||
<activity android:name=".PlayServicesProblemActivity"
|
||||
android:theme="@style/TextSecure.DialogActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".SmsSendtoActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SENDTO" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="sms" />
|
||||
<data android:scheme="smsto" />
|
||||
<data android:scheme="mms" />
|
||||
<data android:scheme="mmsto" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="vnd.android.cursor.item/vnd.org.thoughtcrime.securesms.contact" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="org.thoughtcrime.securesms.webrtc.VoiceCallShare"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/NoAnimation.Theme.BlackScreen"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="vnd.android.cursor.item/vnd.org.thoughtcrime.securesms.call" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".RecipientPreferenceActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".BlockedContactsActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".scribbles.StickerSelectActivity"
|
||||
android:theme="@style/TextSecure.DarkTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".scribbles.NewStickerSelectActivity"
|
||||
android:theme="@style/TextSecure.DarkTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
|
||||
android:theme="@style/TextSecure.DarkTheme"/>
|
||||
|
||||
<activity android:name=".CreateProfileActivity"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateVisible"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ClearProfileAvatarActivity"
|
||||
android:theme="@style/Theme.AppCompat.Dialog.Alert"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:icon="@drawable/clear_profile_avatar"
|
||||
android:label="@string/AndroidManifest_remove_photo">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.action.CLEAR_PROFILE_PHOTO"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".contactshare.ContactShareEditActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.ContactNameEditActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.SharedContactDetailsActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ShortcutLauncherActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:exported="true"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity
|
||||
android:name=".maps.PlacePickerActivity"
|
||||
android:label="@string/PlacePickerActivity_title"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity
|
||||
android:name=".usernames.ProfileEditActivityV2"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
|
||||
<activity android:name=".MainActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
|
||||
|
||||
<service android:enabled="true" android:name="org.thoughtcrime.securesms.service.WebRtcCallService"/>
|
||||
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
|
||||
<service android:enabled="true" android:exported="false" android:name=".service.KeyCachingService"/>
|
||||
<service android:enabled="true" android:name=".service.IncomingMessageObserver$ForegroundService"/>
|
||||
|
||||
<service android:name=".service.QuickResponseService"
|
||||
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:scheme="sms" />
|
||||
<data android:scheme="smsto" />
|
||||
<data android:scheme="mms" />
|
||||
<data android:scheme="mmsto" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".service.AccountAuthenticatorService" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/authenticator" />
|
||||
</service>
|
||||
|
||||
<service android:name=".service.ContactsSyncAdapterService" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.content.SyncAdapter"/>
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.content.SyncAdapter" android:resource="@xml/syncadapter" />
|
||||
<meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contactsformat" />
|
||||
</service>
|
||||
|
||||
<service android:name=".service.DirectShareService"
|
||||
android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.chooser.ChooserTargetService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".service.GenericForegroundService"/>
|
||||
|
||||
<service android:name=".gcm.FcmService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name=".service.SmsListener"
|
||||
android:permission="android.permission.BROADCAST_SMS"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter android:priority="1001">
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SMS_DELIVER"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.SmsDeliveryListener"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.services.MESSAGE_SENT"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.MmsListener"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BROADCAST_WAP_PUSH">
|
||||
<intent-filter android:priority="1001">
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"/>
|
||||
<data android:mimeType="application/vnd.wap.mms-message" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER"/>
|
||||
<data android:mimeType="application/vnd.wap.mms-message" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.MarkReadReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.CLEAR"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.RemoteReplyReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.WEAR_REPLY"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.AndroidAutoHeardReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.ANDROID_AUTO_HEARD"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.AndroidAutoReplyReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.ANDROID_AUTO_REPLY"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.ExpirationListener" />
|
||||
|
||||
<receiver android:name=".revealable.ViewOnceMessageManager$ViewOnceAlarm" />
|
||||
|
||||
<provider android:name=".providers.PartProvider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false"
|
||||
android:authorities="org.thoughtcrime.provider.securesms" />
|
||||
|
||||
<provider android:name=".providers.MmsBodyProvider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false"
|
||||
android:authorities="org.thoughtcrime.provider.securesms.mms" />
|
||||
|
||||
<provider android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="org.thoughtcrime.securesms.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_provider_paths" />
|
||||
|
||||
</provider>
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$Conversation"
|
||||
android:authorities="org.thoughtcrime.securesms.database.conversation"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$ConversationList"
|
||||
android:authorities="org.thoughtcrime.securesms.database.conversationlist"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$Attachment"
|
||||
android:authorities="org.thoughtcrime.securesms.database.attachment"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$Sticker"
|
||||
android:authorities="org.thoughtcrime.securesms.database.sticker"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$StickerPack"
|
||||
android:authorities="org.thoughtcrime.securesms.database.stickerpack"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name="androidx.camera.camera2.impl.Camera2Initializer"
|
||||
android:authorities="${applicationId}.camerax-init"
|
||||
android:exported="false"
|
||||
android:enabled="false" />
|
||||
|
||||
<receiver android:name=".service.BootReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
<action android:name="org.thoughtcrime.securesms.RESTART"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.DirectoryRefreshListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.RotateSignedPreKeyListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.RotateSenderCertificateListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.LocalBackupListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.PersistentConnectionBootListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.LocaleChangedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.LOCALE_CHANGED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.MessageNotifier$ReminderReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.MessageNotifier.REMINDER_ACTION"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.DeleteNotificationReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.DELETE_NOTIFICATION"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".ExperienceUpgradeActivity$AppUpgradeReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
|
||||
<data android:scheme="package" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.ExperienceUpgradeActivity.DISMISS_ACTION"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".service.PanicResponderListener"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="info.guardianproject.panic.action.TRIGGER" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name=".gcm.FcmJobService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
android:enabled="@bool/enable_job_service"
|
||||
tools:targetApi="26" />
|
||||
|
||||
<service
|
||||
android:name=".jobmanager.JobSchedulerScheduler$SystemService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
android:enabled="@bool/enable_job_service"
|
||||
tools:targetApi="26" />
|
||||
|
||||
<service
|
||||
android:name=".jobmanager.KeepAliveService"
|
||||
android:enabled="@bool/enable_alarm_manager" />
|
||||
|
||||
<receiver
|
||||
android:name=".jobmanager.AlarmManagerScheduler$RetryReceiver"
|
||||
android:enabled="@bool/enable_alarm_manager" />
|
||||
|
||||
<!-- Probably don't need this one -->
|
||||
<receiver
|
||||
android:name=".jobmanager.BootReceiver"
|
||||
android:enabled="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||
|
||||
<uses-library android:name="com.sec.android.app.multiwindow" android:required="false"/>
|
||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598.0dip" />
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
74
BUILDING.md
@@ -1,74 +0,0 @@
|
||||
Building Signal
|
||||
===============
|
||||
|
||||
Basics
|
||||
------
|
||||
|
||||
Signal uses [Gradle](http://gradle.org) to build the project and to maintain
|
||||
dependencies. However, you needn't install it yourself; the
|
||||
"gradle wrapper" `gradlew`, mentioned below, will do that for you.
|
||||
|
||||
Building Signal
|
||||
---------------
|
||||
|
||||
The following steps should help you (re)build Signal from the command line.
|
||||
|
||||
1. Checkout the Signal-Android project source with the command:
|
||||
|
||||
git clone https://github.com/signalapp/Signal-Android.git
|
||||
|
||||
2. Make sure you have the [Android SDK](https://developer.android.com/sdk/index.html) installed.
|
||||
3. Ensure that the following packages are installed from the Android SDK manager:
|
||||
* Android SDK Build Tools (see buildToolsVersion in build.gradle)
|
||||
* SDK Platform (All API levels)
|
||||
* Android Support Repository
|
||||
* Google Repository
|
||||
4. Create a local.properties file at the root of your source checkout and add an sdk.dir entry to it. For example:
|
||||
|
||||
sdk.dir=/Application/android-sdk-macosx
|
||||
|
||||
5. Using Java 8
|
||||
|
||||
6. Execute Gradle:
|
||||
|
||||
./gradlew build
|
||||
|
||||
Visual assets
|
||||
----------------------
|
||||
|
||||
Source assets tend to be large binary blobs, which are best stored outside of git repositories. Some source files are SVGs that can be auto-colored and sized using a tool like [android-res-utils](https://github.com/sebkur/android-res-utils).
|
||||
|
||||
Sample command for generating our audio placeholder image:
|
||||
|
||||
```bash
|
||||
pngs_from_svg.py ic_audio.svg /path/to/Signal/res/ 150 --color #000 --opacity 0.54 --suffix _light
|
||||
pngs_from_svg.py ic_audio.svg /path/to/Signal/res/ 150 --color #fff --opacity 1.00 --suffix _light
|
||||
```
|
||||
|
||||
Setting up a development environment
|
||||
------------------------------------
|
||||
|
||||
[Android Studio](https://developer.android.com/sdk/installing/studio.html) is the recommended development environment.
|
||||
|
||||
1. Install Android Studio.
|
||||
2. Open Android Studio. On a new installation, the Quickstart panel will appear. If you have open projects, close them using "File > Close Project" to see the Quickstart panel.
|
||||
3. From the Quickstart panel, choose "Configure" then "SDK Manager".
|
||||
4. In the SDK Tools tab of the SDK Manager, make sure that the "Android Support Repository" is installed, and that the latest "Android SDK build-tools" are installed. Click "OK" to return to the Quickstart panel.
|
||||
5. From the Quickstart panel, choose "Checkout from Version Control" then "git".
|
||||
6. Paste the URL for the Signal-Android project when prompted (https://github.com/signalapp/Signal-Android.git).
|
||||
7. Android studio should detect the presence of a project file and ask you whether to open it. Click "yes".
|
||||
9. Default config options should be good enough.
|
||||
9. Project initialisation and build should proceed.
|
||||
|
||||
Contributing code
|
||||
-----------------
|
||||
|
||||
Code contributions should be sent via github as pull requests, from feature branches [as explained here](https://help.github.com/articles/using-pull-requests).
|
||||
|
||||
Mailing list
|
||||
------------
|
||||
|
||||
Development discussion happens on the whispersystems mailing list.
|
||||
[To join](https://lists.riseup.net/www/info/whispersystems)
|
||||
Send emails to whispersystems@lists.riseup.net
|
||||
|
||||
@@ -83,7 +83,7 @@ There are several other ways to get involved:
|
||||
* Try to reproduce issues and help with troubleshooting.
|
||||
* Discover solutions to open issues and post any relevant findings.
|
||||
* Test other people's pull requests.
|
||||
* Contribute to Signal via the [Freedom of the Press Foundation's donation page](https://freedom.press/crowdfunding/signal/).
|
||||
* [Donate to Signal.](https://signal.org/donate/)
|
||||
* Share Signal with your friends and family.
|
||||
|
||||
Signal is made for you. Thank you for your feedback and support.
|
||||
|
||||
25
Dockerfile
@@ -1,25 +0,0 @@
|
||||
FROM ubuntu:17.10
|
||||
|
||||
RUN dpkg --add-architecture i386 && \
|
||||
apt-get update -y && \
|
||||
apt-get install -y software-properties-common && \
|
||||
apt-get update -y && \
|
||||
apt-get install -y libc6:i386=2.26-0ubuntu2.1 libncurses5:i386=6.0+20160625-1ubuntu1 libstdc++6:i386=7.2.0-8ubuntu3.2 lib32z1=1:1.2.11.dfsg-0ubuntu2 wget openjdk-8-jdk=8u171-b11-0ubuntu0.17.10.1 git unzip opensc pcscd && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean
|
||||
|
||||
ENV ANDROID_SDK_FILENAME android-sdk_r24.4.1-linux.tgz
|
||||
ENV ANDROID_SDK_URL https://dl.google.com/android/${ANDROID_SDK_FILENAME}
|
||||
ENV ANDROID_API_LEVELS android-28
|
||||
ENV ANDROID_BUILD_TOOLS_VERSION 28.0.3
|
||||
ENV ANDROID_HOME /usr/local/android-sdk-linux
|
||||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
|
||||
RUN cd /usr/local/ && \
|
||||
wget -q ${ANDROID_SDK_URL} && \
|
||||
tar -xzf ${ANDROID_SDK_FILENAME} && \
|
||||
rm ${ANDROID_SDK_FILENAME}
|
||||
RUN echo y | android update sdk --no-ui -a --filter ${ANDROID_API_LEVELS}
|
||||
RUN echo y | android update sdk --no-ui -a --filter extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository
|
||||
RUN echo y | android update sdk --no-ui -a --filter tools,platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION}
|
||||
RUN rm -rf ${ANDROID_HOME}/tools && unzip ${ANDROID_HOME}/temp/*.zip -d ${ANDROID_HOME}
|
||||
@@ -27,7 +27,6 @@ Interested in helping to translate Signal? Contribute here:
|
||||
https://www.transifex.com/projects/p/signal-android/
|
||||
|
||||
## Contributing Code
|
||||
Instructions on how to setup your development environment and build Signal can be found in [BUILDING.md](https://github.com/signalapp/Signal-Android/blob/master/BUILDING.md).
|
||||
|
||||
If you're new to the Signal codebase, we recommend going through our issues and picking out a simple bug to fix (check the "easy" label in our issues) in order to get yourself familiar. Also please have a look at the [CONTRIBUTING.md](https://github.com/signalapp/Signal-Android/blob/master/CONTRIBUTING.md), that might answer some of your questions.
|
||||
|
||||
@@ -60,9 +59,7 @@ The form and manner of this distribution makes it eligible for export under the
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2011 Whisper Systems
|
||||
|
||||
Copyright 2013-2017 Open Whisper Systems
|
||||
Copyright 2013-2020 Signal
|
||||
|
||||
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
# Reproducible Builds
|
||||
|
||||
|
||||
## TL;DR
|
||||
|
||||
You can just use these [instructions](https://signal.org/blog/reproducible-android/) from the official announcement at Open Whisper Systems's blog:
|
||||
```
|
||||
# Clone the Signal Android source repository
|
||||
$ git clone https://github.com/signalapp/Signal-Android.git && cd Signal-Android
|
||||
|
||||
# Check out the release tag for the version you'd like to compare
|
||||
$ git checkout v[the version number]
|
||||
|
||||
# Build using the Docker environment
|
||||
$ docker run --rm -v $(pwd):/project -w /project whispersystems/signal-android:1.3 ./gradlew clean assembleRelease
|
||||
|
||||
# Verify the APKs
|
||||
$ python3 apkdiff/apkdiff.py build/outputs/apks/project-release-unsigned.apk path/to/SignalFromPlay.apk
|
||||
```
|
||||
|
||||
Note that the instructions above use a pre-built Signal Docker image from [Docker Hub](https://hub.docker.com/u/whispersystems/). If you wish to compile the image yourself, continue reading the longer version below.
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
## Introduction
|
||||
|
||||
Since version 3.15.0 Signal for Android has supported reproducible builds. This is achieved by replicating the build environment as a Docker image. You'll need to build the image, run a container instance of it, compile Signal inside the container and finally compare the resulted APK to the APK that is distributed in the Google Play Store.
|
||||
|
||||
The command line parts in this guide are written for Linux but with some little modifications you can adapt them to macOS (OS X) and Windows. In the following sections we will use `3.15.2` as an example Signal version. You'll just need to replace all occurrences of `3.15.2` with the version number you are about to verify.
|
||||
|
||||
|
||||
## Setting up directories
|
||||
|
||||
First let's create a new directory for this whole reproducible builds project. In your home folder (`~`), create a new directory called `reproducible-signal`.
|
||||
```
|
||||
user@host:$ mkdir ~/reproducible-signal
|
||||
```
|
||||
|
||||
Next create another directory inside `reproducible-signal` called `apk-from-google-play-store`.
|
||||
```
|
||||
user@host:$ mkdir ~/reproducible-signal/apk-from-google-play-store
|
||||
```
|
||||
|
||||
We will use this directory to share APKs between the host OS and the Docker container.
|
||||
|
||||
Finally create one more directory inside `reproducible-signal` called `image-build-context`.
|
||||
```
|
||||
user@host:$ mkdir ~/reproducible-signal/image-build-context
|
||||
```
|
||||
|
||||
This directory will be used later to build our Docker image.
|
||||
|
||||
|
||||
## Getting the Google Play Store version of Signal APK
|
||||
|
||||
To compare the APKs we of course need a version of Signal from the Google Play Store.
|
||||
|
||||
First make sure that the Signal version you want to verify is installed on your Android device. You'll need `adb` for this part.
|
||||
|
||||
Plug your device to your computer and run this command to pull the APK from the device:
|
||||
|
||||
```
|
||||
user@host:$ adb pull $(adb shell pm path org.thoughtcrime.securesms | grep /base.apk | awk -F':' '{print $2}') ~/reproducible-signal/apk-from-google-play-store/Signal-$(adb shell dumpsys package org.thoughtcrime.securesms | grep versionName | awk -F'=' '{print $2}').apk
|
||||
```
|
||||
|
||||
This will pull a file into `~/reproducible-signal/apk-from-google-play-store/` with the name `Signal-<version>.apk`
|
||||
|
||||
Alternatively, you can do this step-by-step:
|
||||
|
||||
```
|
||||
user@host:$ adb shell pm path org.thoughtcrime.securesms
|
||||
```
|
||||
This will output something like:
|
||||
```
|
||||
package:/data/app/org.thoughtcrime.securesms-aWRzcGlzcG9wZA==/base.apk
|
||||
```
|
||||
|
||||
The output will tell you where the Signal APK is located in your device. (In this example the path is `/data/app/org.thoughtcrime.securesms-aWRzcGlzcG9wZA==/base.apk`)
|
||||
|
||||
Now using this information, pull the APK from your device to the `reproducible-signal/apk-from-google-play-store` directory you created before:
|
||||
```
|
||||
user@host:$ adb pull \
|
||||
/data/app/org.thoughtcrime.securesms-aWRzcGlzcG9wZA==/base.apk \
|
||||
~/reproducible-signal/apk-from-google-play-store/Signal-3.15.2.apk
|
||||
```
|
||||
|
||||
We will use this APK in the final part when we compare it with the self-built APK from GitHub.
|
||||
|
||||
## Identifying the ABI
|
||||
|
||||
Since v4.37.0, the APKs have been split by ABI, the CPU architecture of the target device. Google play will serve the correct one to you for your device.
|
||||
|
||||
To identify which ABIs the google play APK supports, we can look inside the APK, which is just a zip file:
|
||||
|
||||
```
|
||||
user@host:$ unzip -l ~/reproducible-signal/apk-from-google-play-store/Signal-*.apk | grep lib/
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
1214348 00-00-1980 00:00 lib/armeabi-v7a/libconscrypt_jni.so
|
||||
151980 00-00-1980 00:00 lib/armeabi-v7a/libcurve25519.so
|
||||
4164320 00-00-1980 00:00 lib/armeabi-v7a/libjingle_peerconnection_so.so
|
||||
13948 00-00-1980 00:00 lib/armeabi-v7a/libnative-utils.so
|
||||
2357812 00-00-1980 00:00 lib/armeabi-v7a/libsqlcipher.so
|
||||
```
|
||||
|
||||
As there is just one sub directory of `lib/` called `armeabi-v7a`, that is your ABI. Make a note of that for later. If you see more than one subdirectory of `lib/`:
|
||||
|
||||
```
|
||||
1214348 00-00-1980 00:00 lib/armeabi-v7a/libconscrypt_jni.so
|
||||
151980 00-00-1980 00:00 lib/armeabi-v7a/libcurve25519.so
|
||||
4164320 00-00-1980 00:00 lib/armeabi-v7a/libjingle_peerconnection_so.so
|
||||
13948 00-00-1980 00:00 lib/armeabi-v7a/libnative-utils.so
|
||||
2357812 00-00-1980 00:00 lib/armeabi-v7a/libsqlcipher.so
|
||||
2111376 00-00-1980 00:00 lib/x86/libconscrypt_jni.so
|
||||
201056 00-00-1980 00:00 lib/x86/libcurve25519.so
|
||||
7303888 00-00-1980 00:00 lib/x86/libjingle_peerconnection_so.so
|
||||
5596 00-00-1980 00:00 lib/x86/libnative-utils.so
|
||||
3977636 00-00-1980 00:00 lib/x86/libsqlcipher.so
|
||||
```
|
||||
|
||||
Then that means you have the `universal` APK.
|
||||
|
||||
## Installing Docker
|
||||
|
||||
Install Docker by following the instructions for your platform at https://docs.docker.com/engine/installation/
|
||||
|
||||
Your platform might also have its own preferred way of installing Docker. E.g. Ubuntu has its own Docker package (`docker.io`) if you do not want to follow Docker's instructions.
|
||||
|
||||
In the following sections we will assume that your Docker installation works without issues. So after installing, please make sure that everything is running smoothly before continuing.
|
||||
|
||||
|
||||
## Building a Docker image for Signal
|
||||
|
||||
#### Grabbing the `Dockerfile`
|
||||
|
||||
First you will need the `Dockerfile` for Signal Android. It comes bundled with Signal's source code. The `Dockerfile` contains instructions on how to automatically build a Docker image for Signal. You just need to run it and it builds itself.
|
||||
|
||||
Download the `Dockerfile` to the `image-build-context` directory.
|
||||
|
||||
```
|
||||
user@host:$ wget -O ~/reproducible-signal/image-build-context/Dockerfile_v3.15.2 \
|
||||
https://raw.githubusercontent.com/signalapp/Signal-Android/v3.15.2/Dockerfile
|
||||
```
|
||||
|
||||
Note that the `Dockerfile` is specific to the Signal version you want to compare to. Again you have to adjust the URL above to match the right version. (Though sometimes the file might not be up to date, see the [Troubleshooting section](#troubleshooting))
|
||||
|
||||
|
||||
#### Building the image
|
||||
|
||||
Now we have everything we need to build the Docker image for Signal. Go to the `image-build-context` directory:
|
||||
|
||||
```
|
||||
user@host:$ cd ~/reproducible-signal/image-build-context
|
||||
```
|
||||
|
||||
And list the contents.
|
||||
```
|
||||
user@host:$ ls
|
||||
```
|
||||
The output should look like this:
|
||||
```
|
||||
Dockerfile_v3.15.2
|
||||
```
|
||||
|
||||
Now in this directory build the image using `Dockerfile_v3.15.2`:
|
||||
```
|
||||
user@host:$ docker build --file Dockerfile_v3.15.2 --tag signal-android .
|
||||
```
|
||||
|
||||
(Note that there is a dot at the end of that command!)
|
||||
|
||||
Wait a few years for the build to finish... :construction_worker:
|
||||
|
||||
(Depending on your computer and network connection, this may take several minutes.)
|
||||
|
||||
:calendar: :sleeping:
|
||||
|
||||
After the build has finished, you may wish to list all your Docker images to see that it's really there:
|
||||
```
|
||||
user@host:$ docker images
|
||||
```
|
||||
Output should look something like this:
|
||||
```
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
signal-android latest c6b84450b896 46 seconds ago 2.94 GB
|
||||
ubuntu 14.04.3 8693db7e8a00 9 weeks ago 187.9 MB
|
||||
```
|
||||
|
||||
|
||||
## Compiling Signal inside a container
|
||||
|
||||
Next we will run a container of the image we just built, grab Signal's source code and compile Signal.
|
||||
|
||||
First go to the `reproducible-signal` directory:
|
||||
|
||||
```
|
||||
user@host:$ cd ~/reproducible-signal/
|
||||
```
|
||||
|
||||
To run a new ephemeral container with an interactive terminal session execute the following long command:
|
||||
```
|
||||
user@host:$ docker run \
|
||||
--name signal \
|
||||
--rm \
|
||||
--interactive \
|
||||
--tty \
|
||||
--volume $(pwd)/apk-from-google-play-store:/signal-build/apk-from-google-play-store \
|
||||
--workdir /signal-build \
|
||||
signal-android
|
||||
```
|
||||
Now you are inside the container.
|
||||
|
||||
Grab Signal's source code from GitHub and go to the repository directory:
|
||||
```
|
||||
root@container:# git clone https://github.com/signalapp/Signal-Android.git
|
||||
root@container:# cd Signal-Android
|
||||
```
|
||||
|
||||
Before you can compile, you **must** ensure that you are at the right commit. In other words you **must** checkout the version you wish to verify (here we are verifying 3.15.2):
|
||||
```
|
||||
root@container:# git checkout --quiet v3.15.2
|
||||
```
|
||||
|
||||
Now you may compile the release APK by running:
|
||||
```
|
||||
root@container:# ./gradlew clean assemblePlayRelease --exclude-task signProductionPlayRelease
|
||||
```
|
||||
This will take a few minutes :sleeping:
|
||||
|
||||
|
||||
#### Checking if the APKs match
|
||||
|
||||
After the build has completed successfully we can finally compare if the APKs match. For the comparison we need of course the Google Play Store version of Signal APK which you copied to the `apk-from-google-play-store` directory in the beginning of this guide. Because we used that directory as a `--volume` parameter for our container, we can see all the files in that directory within our container.
|
||||
|
||||
So now we can compare the APKs using the `apkdiff.py` tool.
|
||||
|
||||
The above build step produced several APKs, one for each supported ABI and one universal one. You will need to determine the correct APK to compare.
|
||||
|
||||
Currently, the most common ABI is `armeabi-v7a`. Other options at this time include `x86` and `universal`. In the future it will also include 64-bit options, such as `x86_64` and `arm64-v8a`.
|
||||
|
||||
See [Identifying the ABI](#identifying-the-abi) above if you don't know the ABI of your play store APK.
|
||||
|
||||
Once you have determined the ABI, add an `abi` environment variable. For example, suppose we determine that `armeabi-v7a` is the ABI google play has served:
|
||||
|
||||
```
|
||||
root@container:# export abi=armeabi-v7a
|
||||
```
|
||||
|
||||
And the diff script to compare:
|
||||
```
|
||||
root@container:# python3 apkdiff/apkdiff.py \
|
||||
build/outputs/apk/play/release/*play-$abi-release-unsigned*.apk \
|
||||
../apk-from-google-play-store/Signal-3.15.2.apk
|
||||
```
|
||||
Output:
|
||||
```
|
||||
APKs match!
|
||||
```
|
||||
|
||||
If you get `APKs match!`, you have successfully verified that the Google Play release matches with your own self-built version of Signal. Congratulations! Your APKs are a match made in heaven! :sparkles:
|
||||
|
||||
If you get `APKs don't match!`, you did something wrong in the previous steps. See the [Troubleshooting section](#troubleshooting) for more info.
|
||||
|
||||
|
||||
## Comparing next time
|
||||
|
||||
If the build environment (i.e. `Dockerfile`) has not changed, you don't need to build the image again to verify a newer APK. You can just [run the container again](#compiling-signal-inside-a-container).
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you cannot get things to work, please do not open an issue or comment on an existing issue at GitHub. Instead, ask for help at https://community.signalusers.org/c/development
|
||||
|
||||
Some common issues why things may not work:
|
||||
- some pinned packages in the `Dockerfile` are not available anymore and building of the Docker image fails
|
||||
- the Android packages in the Docker image are outdated and compiling Signal fails
|
||||
- you built the Docker image with a wrong version of the `Dockerfile`
|
||||
- you didn't checkout the correct Signal version tag with Git before compiling
|
||||
- the ABI you selected is not the correct ABI, particularly if you see an error along the lines of `Sorted manifests don't match, lib/x86/libcurve25519.so vs lib/armeabi-v7a/libcurve25519.so`.
|
||||
- this guide is outdated
|
||||
- you are in a dream
|
||||
- if you run into this issue: https://issuetracker.google.com/issues/110237303 try to add `resources.arsc` to the list of ignored files and compare again
|
||||
10
app/.tx/config
Normal file
@@ -0,0 +1,10 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = da_DK:da-rDK,fil:tl,he:iw,id:in,kn_IN:kn-rIN,pa_PK:pa-rPK,pt_BR:pt-rBR,pt_PT:pt,qu_EC:qu-rEC,sv_SE:sv-rSE,zh_CN:zh-rCN,zh_HK:zh-rHK,zh_TW:zh-rTW
|
||||
|
||||
[signal-android.master]
|
||||
file_filter = src/main/res/values-<lang>/strings.xml
|
||||
source_file = src/main/res/values/strings.xml
|
||||
source_lang = en
|
||||
type = ANDROID
|
||||
|
||||
343
app/build.gradle
@@ -15,7 +15,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.1'
|
||||
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
|
||||
}
|
||||
@@ -80,122 +80,8 @@ protobuf {
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.preference:preference:1.0.0'
|
||||
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.1.0'
|
||||
implementation 'androidx.navigation:navigation-ui:2.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0-alpha05'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0'
|
||||
implementation "androidx.camera:camera-core:1.0.0-alpha06"
|
||||
implementation "androidx.camera:camera-camera2:1.0.0-alpha06"
|
||||
|
||||
implementation('com.google.firebase:firebase-messaging:17.3.4') {
|
||||
exclude group: 'com.google.firebase', module: 'firebase-core'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
||||
}
|
||||
|
||||
implementation 'com.google.android.gms:play-services-maps:16.1.0'
|
||||
implementation 'com.google.android.gms:play-services-auth:16.0.1'
|
||||
|
||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'
|
||||
|
||||
implementation 'org.conscrypt:conscrypt-android:2.0.0'
|
||||
implementation 'org.signal:aesgcmprovider:0.0.3'
|
||||
|
||||
implementation project(':libsignal-service')
|
||||
|
||||
implementation 'org.signal:ringrtc-android:0.2.0'
|
||||
|
||||
implementation "me.leolin:ShortcutBadger:1.1.16"
|
||||
implementation 'se.emilsjolander:stickylistheaders:2.7.0'
|
||||
implementation 'com.jpardogo.materialtabstrip:library:1.0.9'
|
||||
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
||||
implementation 'com.github.bumptech.glide:glide:4.9.0'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
|
||||
annotationProcessor 'androidx.annotation:annotation:1.1.0'
|
||||
implementation 'com.makeramen:roundedimageview:2.1.0'
|
||||
implementation 'com.pnikosis:materialish-progress:1.5'
|
||||
implementation 'org.greenrobot:eventbus:3.0.0'
|
||||
implementation 'pl.tajchert:waitingdots:0.1.0'
|
||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||
implementation 'com.melnykov:floatingactionbutton:1.3.0'
|
||||
implementation 'com.google.zxing:android-integration:3.1.0'
|
||||
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
||||
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||
implementation 'com.google.zxing:core:3.2.1'
|
||||
implementation ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
}
|
||||
implementation ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
}
|
||||
implementation ('com.tomergoldst.android:tooltips:1.0.6') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
}
|
||||
implementation ('com.klinkerapps:android-smsmms:4.0.1') {
|
||||
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
||||
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
||||
}
|
||||
implementation 'com.annimon:stream:1.1.8'
|
||||
implementation ('com.takisoft.fix:colorpicker:0.9.1') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
exclude group: 'com.android.support', module: 'recyclerview-v7'
|
||||
}
|
||||
|
||||
implementation 'com.airbnb.android:lottie:3.0.7'
|
||||
|
||||
implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
||||
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
||||
implementation 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
||||
implementation ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
||||
exclude group: 'com.fasterxml.jackson.core'
|
||||
exclude group: 'org.freemarker'
|
||||
}
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
testImplementation 'org.assertj:assertj-core:3.11.1'
|
||||
testImplementation 'org.mockito:mockito-core:1.9.5'
|
||||
testImplementation 'org.powermock:powermock-api-mockito:1.6.1'
|
||||
testImplementation 'org.powermock:powermock-module-junit4:1.6.1'
|
||||
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.1'
|
||||
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.1'
|
||||
|
||||
testImplementation 'androidx.test:core:1.2.0'
|
||||
androidTestImplementation 'androidx.multidex:multidex:2.0.1'
|
||||
androidTestImplementation 'androidx.multidex:multidex-instrumentation:2.0.0'
|
||||
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
|
||||
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
|
||||
androidTestImplementation ('org.assertj:assertj-core:1.7.1') {
|
||||
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
||||
}
|
||||
androidTestImplementation ('com.squareup.assertj:assertj-android:1.1.1') {
|
||||
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
}
|
||||
testImplementation 'org.robolectric:robolectric:4.2'
|
||||
testImplementation 'org.robolectric:shadows-multidex:4.2'
|
||||
}
|
||||
|
||||
dependencyVerification {
|
||||
configuration = '(play|website)(Debug|Release)RuntimeClasspath'
|
||||
}
|
||||
|
||||
def canonicalVersionCode = 574
|
||||
def canonicalVersionName = "4.51.1"
|
||||
def canonicalVersionCode = 723
|
||||
def canonicalVersionName = "4.74.2"
|
||||
|
||||
def postFixSize = 10
|
||||
def abiPostFix = ['universal' : 0,
|
||||
@@ -206,20 +92,29 @@ def abiPostFix = ['universal' : 0,
|
||||
|
||||
android {
|
||||
flavorDimensions "none"
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion '28.0.3'
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.3'
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
|
||||
dexOptions {
|
||||
javaMaxHeapSize "4g"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
staging {
|
||||
storeFile file("${project.rootDir}/dev.keystore")
|
||||
storePassword 'android'
|
||||
keyAlias 'staging'
|
||||
keyPassword 'android'
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode canonicalVersionCode * postFixSize
|
||||
versionName canonicalVersionName
|
||||
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 28
|
||||
targetSdkVersion 29
|
||||
multiDexEnabled true
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
@@ -229,17 +124,20 @@ android {
|
||||
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service.whispersystems.org\""
|
||||
buildConfigField "String", "STORAGE_URL", "\"https://storage.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://cdn.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_CDN2_URL", "\"https://cdn2.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_CONTACT_DISCOVERY_URL", "\"https://api.directory.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"uptime.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_KEY_BACKUP_URL", "\"https://api.backup.signal.org\""
|
||||
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
|
||||
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
|
||||
buildConfigField "String", "USER_AGENT", "\"OWA\""
|
||||
buildConfigField "boolean", "DEV_BUILD", "false"
|
||||
buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\""
|
||||
buildConfigField "String", "KEY_BACKUP_ENCLAVE_NAME", "\"f2e2a5004794a6c1bac5c4949eadbc243dd02e02d1a93f10fe24584fb70815d8\""
|
||||
buildConfigField "String", "KEY_BACKUP_MRENCLAVE", "\"f51f435802ada769e67aaf5744372bb7e7d519eecf996d335eb5b46b872b5789\""
|
||||
buildConfigField "String", "SIGNAL_AGENT", "\"OWA\""
|
||||
buildConfigField "String", "CDS_MRENCLAVE", "\"c98e00a4e3ff977a56afefe7362a27e4961e4f19e211febfbb19b897e6b80b15\""
|
||||
buildConfigField "KbsEnclave", "KBS_ENCLAVE", "new KbsEnclave(\"fe7c1bfae98f9b073d220366ea31163ee82f6d04bead774f71ca8e5c40847bfe\"," +
|
||||
"\"fe7c1bfae98f9b073d220366ea31163ee82f6d04bead774f71ca8e5c40847bfe\", " +
|
||||
"\"a3baab19ef6ce6f34ab9ebb25ba722725ae44a8872dc0ff08ad6d83a9489de87\")";
|
||||
buildConfigField "KbsEnclave[]", "KBS_FALLBACKS", "new KbsEnclave[0]"
|
||||
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\""
|
||||
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"AMhf5ywVwITZMsff/eCyudZx9JDmkkkbV6PInzG4p8x3VqVJSFiMvnvlEKWuRob/1eaIetR31IYeAbm0NdOuHH8Qi+Rexi1wLlpzIo1gstHWBfZzy1+qHRV5A4TqPp15YzBPm0WSggW6PbSn+F4lf57VCnHF7p8SvzAA2ZZJPYJURt8X7bbg+H3i+PEjH9DXItNEqs2sNcug37xZQDLm7X0=\""
|
||||
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
|
||||
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"
|
||||
|
||||
@@ -257,6 +155,8 @@ android {
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@@ -274,6 +174,10 @@ android {
|
||||
exclude 'META-INF/proguard/androidx-annotations.pro'
|
||||
}
|
||||
|
||||
aaptOptions {
|
||||
ignoreAssetsPattern '!contours.tfl:!LMprec_600.emd:!blazeface.tfl'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
minifyEnabled true
|
||||
@@ -301,15 +205,26 @@ android {
|
||||
}
|
||||
staging {
|
||||
initWith debug
|
||||
applicationIdSuffix ".staging"
|
||||
signingConfig signingConfigs.staging
|
||||
|
||||
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
|
||||
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://cdn-staging.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_CDN2_URL", "\"https://cdn2-staging.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_CONTACT_DISCOVERY_URL", "\"https://api-staging.directory.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_KEY_BACKUP_URL", "\"https://api-staging.backup.signal.org\""
|
||||
buildConfigField "String", "MRENCLAVE", "\"ba4ebb438bc07713819ee6c98d94037747006d7df63fc9e44d2d6f1fec962a79\""
|
||||
buildConfigField "String", "KEY_BACKUP_ENCLAVE_NAME", "\"b5a865941f95887018c86725cc92308d34a3084dc2b4e7bd2de5e5e1690b50c6\""
|
||||
buildConfigField "String", "CDS_MRENCLAVE", "\"bd123560b01c8fa92935bc5ae15cd2064e5c45215f23f0bd40364d521329d2ad\""
|
||||
buildConfigField "KbsEnclave", "KBS_ENCLAVE", "new KbsEnclave(\"823a3b2c037ff0cbe305cc48928cfcc97c9ed4a8ca6d49af6f7d6981fb60a4e9\", " +
|
||||
"\"038c40bbbacdc873caa81ac793bb75afde6dfe436a99ab1f15e3f0cbb7434ced\", " +
|
||||
"\"a3baab19ef6ce6f34ab9ebb25ba722725ae44a8872dc0ff08ad6d83a9489de87\")"
|
||||
buildConfigField "KbsEnclave[]", "KBS_FALLBACKS", "new KbsEnclave[0]"
|
||||
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx\""
|
||||
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"ABSY21VckQcbSXVNCGRYJcfWHiAMZmpTtTELcDmxgdFbtp/bWsSxZdMKzfCp8rvIs8ocCU3B37fT3r4Mi5qAemeGeR2X+/YmOGR5ofui7tD5mDQfstAI9i+4WpMtIe8KC3wU5w3Inq3uNWVmoGtpKndsNfwJrCg0Hd9zmObhypUnSkfYn2ooMOOnBpfdanRtrvetZUayDMSC5iSRcXKpdls=\""
|
||||
}
|
||||
flipper {
|
||||
initWith debug
|
||||
minifyEnabled false
|
||||
}
|
||||
release {
|
||||
minifyEnabled true
|
||||
@@ -345,32 +260,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile '../AndroidManifest.xml'
|
||||
java.srcDirs = ['../src']
|
||||
resources.srcDirs = ['../src']
|
||||
aidl.srcDirs = ['../src']
|
||||
renderscript.srcDirs = ['../src']
|
||||
res.srcDirs = ['../res']
|
||||
assets.srcDirs = ['../assets']
|
||||
jniLibs.srcDirs = ['../libs']
|
||||
proto.srcDir '../protobuf'
|
||||
}
|
||||
androidTest {
|
||||
java.srcDirs = ['../test/androidTest/java']
|
||||
}
|
||||
test {
|
||||
java.srcDirs = ['../test/unitTest/java']
|
||||
resources.srcDirs = ['../test/unitTest/resources']
|
||||
}
|
||||
staging {
|
||||
res.srcDirs = ['../staging/res']
|
||||
}
|
||||
|
||||
website.manifest.srcFile '../website/AndroidManifest.xml'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError true
|
||||
baseline file("lint-baseline.xml")
|
||||
@@ -384,6 +273,134 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
lintChecks project(':lintchecks')
|
||||
|
||||
implementation('androidx.appcompat:appcompat:1.1.0-beta01') {
|
||||
force = true
|
||||
}
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.preference:preference:1.0.0'
|
||||
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.1.0'
|
||||
implementation 'androidx.navigation:navigation-ui:2.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0-alpha05'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0'
|
||||
implementation "androidx.camera:camera-core:1.0.0-beta01"
|
||||
implementation "androidx.camera:camera-camera2:1.0.0-beta01"
|
||||
implementation "androidx.camera:camera-lifecycle:1.0.0-beta01"
|
||||
implementation "androidx.concurrent:concurrent-futures:1.0.0"
|
||||
implementation "androidx.autofill:autofill:1.0.0"
|
||||
implementation "androidx.paging:paging-common:2.1.2"
|
||||
implementation "androidx.paging:paging-runtime:2.1.2"
|
||||
implementation 'com.google.firebase:firebase-ml-vision:24.0.3'
|
||||
implementation 'com.google.firebase:firebase-ml-vision-face-model:20.0.1'
|
||||
|
||||
implementation ('com.google.firebase:firebase-messaging:20.2.0') {
|
||||
exclude group: 'com.google.firebase', module: 'firebase-core'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
||||
}
|
||||
|
||||
implementation 'com.google.android.gms:play-services-maps:16.1.0'
|
||||
implementation 'com.google.android.gms:play-services-auth:16.0.1'
|
||||
|
||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'
|
||||
implementation 'com.google.android.exoplayer:extension-mediasession:2.9.1'
|
||||
|
||||
implementation 'org.conscrypt:conscrypt-android:2.0.0'
|
||||
implementation 'org.signal:aesgcmprovider:0.0.3'
|
||||
|
||||
implementation project(':libsignal-service')
|
||||
implementation 'org.signal:zkgroup-android:0.7.0'
|
||||
|
||||
implementation 'org.signal:argon2:13.1@aar'
|
||||
|
||||
implementation 'org.signal:ringrtc-android:2.7.0'
|
||||
|
||||
implementation "me.leolin:ShortcutBadger:1.1.16"
|
||||
implementation 'se.emilsjolander:stickylistheaders:2.7.0'
|
||||
implementation 'com.jpardogo.materialtabstrip:library:1.0.9'
|
||||
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
||||
annotationProcessor 'androidx.annotation:annotation:1.1.0'
|
||||
implementation 'com.makeramen:roundedimageview:2.1.0'
|
||||
implementation 'com.pnikosis:materialish-progress:1.5'
|
||||
implementation 'org.greenrobot:eventbus:3.0.0'
|
||||
implementation 'pl.tajchert:waitingdots:0.1.0'
|
||||
implementation 'com.melnykov:floatingactionbutton:1.3.0'
|
||||
implementation 'com.google.zxing:android-integration:3.1.0'
|
||||
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
||||
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||
implementation 'com.google.zxing:core:3.2.1'
|
||||
implementation ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
}
|
||||
implementation ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
}
|
||||
implementation ('com.tomergoldst.android:tooltips:1.0.6') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
}
|
||||
implementation ('com.klinkerapps:android-smsmms:4.0.1') {
|
||||
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
||||
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
||||
}
|
||||
implementation 'com.annimon:stream:1.1.8'
|
||||
implementation ('com.takisoft.fix:colorpicker:0.9.1') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
exclude group: 'com.android.support', module: 'recyclerview-v7'
|
||||
}
|
||||
|
||||
implementation 'com.airbnb.android:lottie:3.0.7'
|
||||
|
||||
implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
||||
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
||||
implementation 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
||||
implementation ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
||||
exclude group: 'com.fasterxml.jackson.core'
|
||||
exclude group: 'org.freemarker'
|
||||
}
|
||||
implementation 'dnsjava:dnsjava:2.1.9'
|
||||
|
||||
flipperImplementation 'com.facebook.flipper:flipper:0.32.2'
|
||||
flipperImplementation 'com.facebook.soloader:soloader:0.8.2'
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
testImplementation 'org.assertj:assertj-core:3.11.1'
|
||||
testImplementation 'org.mockito:mockito-core:2.8.9'
|
||||
testImplementation 'org.powermock:powermock-api-mockito2:1.7.4'
|
||||
testImplementation 'org.powermock:powermock-module-junit4:1.7.4'
|
||||
testImplementation 'org.powermock:powermock-module-junit4-rule:1.7.4'
|
||||
testImplementation 'org.powermock:powermock-classloading-xstream:1.7.4'
|
||||
|
||||
testImplementation 'androidx.test:core:1.2.0'
|
||||
testImplementation ('org.robolectric:robolectric:4.4') {
|
||||
exclude group: 'com.google.protobuf', module: 'protobuf-java'
|
||||
}
|
||||
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
||||
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||||
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
}
|
||||
|
||||
dependencyVerification {
|
||||
configuration = '(play|website)(Debug|Release)RuntimeClasspath'
|
||||
}
|
||||
|
||||
|
||||
def assembleWebsiteDescriptor = { variant, file ->
|
||||
if (file.exists()) {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-256");
|
||||
@@ -439,16 +456,6 @@ task signProductionWebsiteRelease {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.whenTaskAdded { task ->
|
||||
if (task.name.equals("assemblePlayRelease")) {
|
||||
task.finalizedBy signProductionPlayRelease
|
||||
}
|
||||
|
||||
if (task.name.equals("assembleWebsiteRelease")) {
|
||||
task.finalizedBy signProductionWebsiteRelease
|
||||
}
|
||||
}
|
||||
|
||||
def getLastCommitTimestamp() {
|
||||
new ByteArrayOutputStream().withStream { os ->
|
||||
def result = exec {
|
||||
@@ -460,3 +467,13 @@ def getLastCommitTimestamp() {
|
||||
return os.toString() + "000"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
testLogging {
|
||||
events "failed"
|
||||
exceptionFormat "full"
|
||||
showCauses true
|
||||
showExceptions true
|
||||
showStackTraces true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
errorLine1=" List<SubscriptionInfo> list = subscriptionManager.getActiveSubscriptionInfoList();"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/org/thoughtcrime/securesms/util/dualsim/SubscriptionManagerCompat.java"
|
||||
file="src/main/java/org/thoughtcrime/securesms/util/dualsim/SubscriptionManagerCompat.java"
|
||||
line="101"
|
||||
column="35"/>
|
||||
</issue>
|
||||
@@ -18,7 +18,7 @@
|
||||
errorLine1=" drawables.getColor(1, 0xff000000);"
|
||||
errorLine2=" ~">
|
||||
<location
|
||||
file="src/org/thoughtcrime/securesms/contacts/ContactSelectionListAdapter.java"
|
||||
file="src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListAdapter.java"
|
||||
line="187"
|
||||
column="36"/>
|
||||
</issue>
|
||||
|
||||
19
app/lint.xml
@@ -1,15 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
|
||||
<!-- Wont pass lint or qa with a STOPSHIP in a comment -->
|
||||
<issue id="StopShip" severity="fatal" />
|
||||
|
||||
<!-- L10N errors -->
|
||||
<!-- This is a runtime crash so we don't want to ship with this. -->
|
||||
<issue id="StringFormatMatches" severity="error" />
|
||||
|
||||
<!-- L10N warnings -->
|
||||
<issue id="MissingTranslation" severity="warning" />
|
||||
<issue id="MissingTranslation" severity="ignore" />
|
||||
<issue id="MissingQuantity" severity="warning" />
|
||||
<issue id="MissingDefaultResource" severity="error">
|
||||
<ignore path="*/res/values-*/strings.xml" /> <!-- Ignore for non-English, excludeNonTranslatables task will remove these -->
|
||||
</issue>
|
||||
<issue id="ExtraTranslation" severity="warning" />
|
||||
<issue id="ImpliedQuantity" severity="warning" />
|
||||
<issue id="TypographyDashes" severity="error" >
|
||||
<ignore path="*/res/values-*/strings.xml" /> <!-- Ignore for non-English -->
|
||||
</issue>
|
||||
|
||||
<issue id="CanvasSize" severity="error" />
|
||||
<issue id="HardcodedText" severity="error" />
|
||||
@@ -17,9 +26,17 @@
|
||||
<issue id="ButtonOrder" severity="error" />
|
||||
<issue id="ExtraTranslation" severity="warning" />
|
||||
|
||||
<!-- Custom lints -->
|
||||
<issue id="LogNotSignal" severity="error" />
|
||||
<issue id="LogNotAppSignal" severity="error" />
|
||||
<issue id="LogTagInlined" severity="error" />
|
||||
|
||||
<issue id="RestrictedApi" severity="error">
|
||||
<ignore path="*/org/thoughtcrime/securesms/mediasend/camerax/VideoCapture.java" />
|
||||
<ignore path="*/org/thoughtcrime/securesms/mediasend/camerax/CameraXModule.java" />
|
||||
<ignore path="*/org/thoughtcrime/securesms/conversation/*.java" />
|
||||
<ignore path="*/org/thoughtcrime/securesms/lock/v2/CreateKbsPinViewModel.java" />
|
||||
<ignore path="*/org/thoughtcrime/securesms/jobs/StickerPackDownloadJob.java" />
|
||||
</issue>
|
||||
|
||||
</lint>
|
||||
|
||||
29
app/sampledata/contacts.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"name": "Ottttooooooooo Ocataaaaaaaavius",
|
||||
"number": "+1 (555) 555-5555",
|
||||
"label": "Mobile"
|
||||
},
|
||||
{
|
||||
"name": "Victor Von Doom Phd",
|
||||
"number": "+1 (555) 123-4567",
|
||||
"label": "Home"
|
||||
},
|
||||
{
|
||||
"name": "Flash Thompson",
|
||||
"number": "+1 (555) 435-1261",
|
||||
"label": "Work"
|
||||
},
|
||||
{
|
||||
"name": "Dr. Curtis Connors",
|
||||
"number": "+1 (555) 992-1567",
|
||||
"label": "Mobile"
|
||||
},
|
||||
{
|
||||
"name": "Billy Russo",
|
||||
"number": "+1 (555) 234-1516",
|
||||
"label": "Mobile"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.thoughtcrime.securesms.lock;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.thoughtcrime.securesms.util.Hex;
|
||||
import org.whispersystems.signalservice.api.kbs.HashedPin;
|
||||
import org.whispersystems.signalservice.api.kbs.KbsData;
|
||||
import org.whispersystems.signalservice.api.kbs.MasterKey;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public final class PinHashing_hashPin_Test {
|
||||
|
||||
@Test
|
||||
public void argon2_hashed_pin_password() throws IOException {
|
||||
String pin = "password";
|
||||
byte[] backupId = Hex.fromStringCondensed("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f");
|
||||
MasterKey masterKey = new MasterKey(Hex.fromStringCondensed("202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"));
|
||||
|
||||
HashedPin hashedPin = PinHashing.hashPin(pin, () -> backupId);
|
||||
KbsData kbsData = hashedPin.createNewKbsData(masterKey);
|
||||
|
||||
assertArrayEquals(hashedPin.getKbsAccessKey(), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("ab7e8499d21f80a6600b3b9ee349ac6d72c07e3359fe885a934ba7aa844429f8"), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("3f33ce58eb25b40436592a30eae2a8fabab1899095f4e2fba6e2d0dc43b4a2d9cac5a3931748522393951e0e54dec769"), kbsData.getCipherText());
|
||||
assertEquals(masterKey, kbsData.getMasterKey());
|
||||
|
||||
String localPinHash = PinHashing.localPinHash(pin);
|
||||
assertTrue(PinHashing.verifyLocalPinHash(localPinHash, pin));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void argon2_hashed_pin_another_password() throws IOException {
|
||||
String pin = "anotherpassword";
|
||||
byte[] backupId = Hex.fromStringCondensed("202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f");
|
||||
MasterKey masterKey = new MasterKey(Hex.fromStringCondensed("88a787415a2ecd79da0d1016a82a27c5c695c9a19b88b0aa1d35683280aa9a67"));
|
||||
|
||||
HashedPin hashedPin = PinHashing.hashPin(pin, () -> backupId);
|
||||
KbsData kbsData = hashedPin.createNewKbsData(masterKey);
|
||||
|
||||
assertArrayEquals(hashedPin.getKbsAccessKey(), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("301d9dd1e96f20ce51083f67d3298fd37b97525de8324d5e12ed2d407d3d927b"), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("9d9b05402ea39c17ff1c9298c8a0e86784a352aa02a74943bf8bcf07ec0f4b574a5b786ad0182c8d308d9eb06538b8c9"), kbsData.getCipherText());
|
||||
assertEquals(masterKey, kbsData.getMasterKey());
|
||||
|
||||
String localPinHash = PinHashing.localPinHash(pin);
|
||||
assertTrue(PinHashing.verifyLocalPinHash(localPinHash, pin));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void argon2_hashed_pin_password_with_spaces_diacritics_and_non_arabic_numerals() throws IOException {
|
||||
String pin = " Pass६örd ";
|
||||
byte[] backupId = Hex.fromStringCondensed("cba811749042b303a6a7efa5ccd160aea5e3ea243c8d2692bd13d515732f51a8");
|
||||
MasterKey masterKey = new MasterKey(Hex.fromStringCondensed("9571f3fde1e58588ba49bcf82be1b301ca3859a6f59076f79a8f47181ef952bf"));
|
||||
|
||||
HashedPin hashedPin = PinHashing.hashPin(pin, () -> backupId);
|
||||
KbsData kbsData = hashedPin.createNewKbsData(masterKey);
|
||||
|
||||
assertArrayEquals(hashedPin.getKbsAccessKey(), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("ab645acdccc1652a48a34b2ac6926340ff35c03034013f68760f20013f028dd8"), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("11c0ba1834db15e47c172f6c987c64bd4cfc69c6047dd67a022afeec0165a10943f204d5b8f37b3cb7bab21c6dfc39c8"), kbsData.getCipherText());
|
||||
assertEquals(masterKey, kbsData.getMasterKey());
|
||||
|
||||
assertEquals("577939bccb2b6638c39222d5a97998a867c5e154e30b82cc120f2dd07a3de987", kbsData.getMasterKey().deriveRegistrationLock());
|
||||
|
||||
String localPinHash = PinHashing.localPinHash(pin);
|
||||
assertTrue(PinHashing.verifyLocalPinHash(localPinHash, pin));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void argon2_hashed_pin_password_with_just_non_arabic_numerals() throws IOException {
|
||||
String pin = " ६१८ ";
|
||||
byte[] backupId = Hex.fromStringCondensed("717dc111a98423a57196512606822fca646c653facd037c10728f14ba0be2ab3");
|
||||
MasterKey masterKey = new MasterKey(Hex.fromStringCondensed("0432d735b32f66d0e3a70d4f9cc821a8529521a4937d26b987715d8eff4e4c54"));
|
||||
|
||||
HashedPin hashedPin = PinHashing.hashPin(pin, () -> backupId);
|
||||
KbsData kbsData = hashedPin.createNewKbsData(masterKey);
|
||||
|
||||
|
||||
assertArrayEquals(hashedPin.getKbsAccessKey(), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("d2fedabd0d4c17a371491c9722578843a26be3b4923e28d452ab2fc5491e794b"), kbsData.getKbsAccessKey());
|
||||
assertArrayEquals(Hex.fromStringCondensed("877ef871ef1fc668401c717ef21aa12e8523579fb1ff4474b76f28c2293537c80cc7569996c9e0229bea7f378e3a824e"), kbsData.getCipherText());
|
||||
assertEquals(masterKey, kbsData.getMasterKey());
|
||||
|
||||
assertEquals("23a75cb1df1a87df45cc2ed167c2bdc85ab1220b847c88761b0005cac907fce5", kbsData.getMasterKey().deriveRegistrationLock());
|
||||
|
||||
String localPinHash = PinHashing.localPinHash(pin);
|
||||
assertTrue(PinHashing.verifyLocalPinHash(localPinHash, pin));
|
||||
}
|
||||
}
|
||||
16
app/src/flipper/AndroidManifest.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.thoughtcrime.securesms">
|
||||
|
||||
<application
|
||||
android:name=".FlipperApplicationContext"
|
||||
tools:replace="android:name">
|
||||
|
||||
<activity
|
||||
android:name="com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity"
|
||||
android:exported="true" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import com.facebook.flipper.android.AndroidFlipperClient;
|
||||
import com.facebook.flipper.core.FlipperClient;
|
||||
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
||||
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
||||
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
||||
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
import org.thoughtcrime.securesms.database.FlipperSqlCipherAdapter;
|
||||
|
||||
public class FlipperApplicationContext extends ApplicationContext {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
SoLoader.init(this, false);
|
||||
|
||||
FlipperClient client = AndroidFlipperClient.getInstance(this);
|
||||
client.addPlugin(new InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()));
|
||||
client.addPlugin(new DatabasesFlipperPlugin(new FlipperSqlCipherAdapter(this)));
|
||||
client.addPlugin(new SharedPreferencesFlipperPlugin(this));
|
||||
client.start();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
package org.thoughtcrime.securesms.database;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.facebook.flipper.plugins.databases.DatabaseDescriptor;
|
||||
import com.facebook.flipper.plugins.databases.DatabaseDriver;
|
||||
|
||||
import net.sqlcipher.DatabaseUtils;
|
||||
import net.sqlcipher.database.SQLiteDatabase;
|
||||
import net.sqlcipher.database.SQLiteStatement;
|
||||
|
||||
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A lot of this code is taken from {@link com.facebook.flipper.plugins.databases.impl.SqliteDatabaseDriver}
|
||||
* and made to work with SqlCipher. Unfortunately I couldn't use it directly, nor subclass it.
|
||||
*/
|
||||
public class FlipperSqlCipherAdapter extends DatabaseDriver<FlipperSqlCipherAdapter.Descriptor> {
|
||||
|
||||
private static final String TAG = Log.tag(FlipperSqlCipherAdapter.class);
|
||||
|
||||
public FlipperSqlCipherAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Descriptor> getDatabases() {
|
||||
try {
|
||||
Field databaseHelperField = DatabaseFactory.class.getDeclaredField("databaseHelper");
|
||||
databaseHelperField.setAccessible(true);
|
||||
SQLCipherOpenHelper sqlCipherOpenHelper = (SQLCipherOpenHelper) databaseHelperField.get(DatabaseFactory.getInstance(getContext()));
|
||||
return Collections.singletonList(new Descriptor(sqlCipherOpenHelper));
|
||||
} catch (Exception e) {
|
||||
Log.i(TAG, "Unable to use reflection to access raw database.", e);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableNames(Descriptor descriptor) {
|
||||
SQLiteDatabase db = descriptor.getReadable();
|
||||
List<String> tableNames = new ArrayList<>();
|
||||
|
||||
try (Cursor cursor = db.rawQuery("SELECT name FROM sqlite_master WHERE type IN (?, ?)", new String[] { "table", "view" })) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
tableNames.add(cursor.getString(0));
|
||||
}
|
||||
}
|
||||
|
||||
return tableNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseGetTableDataResponse getTableData(Descriptor descriptor, String table, String order, boolean reverse, int start, int count) {
|
||||
SQLiteDatabase db = descriptor.getReadable();
|
||||
|
||||
long total = DatabaseUtils.queryNumEntries(db, table);
|
||||
String orderBy = order != null ? order + (reverse ? " DESC" : " ASC") : null;
|
||||
String limitBy = start + ", " + count;
|
||||
|
||||
try (Cursor cursor = db.query(table, null, null, null, null, null, orderBy, limitBy)) {
|
||||
String[] columnNames = cursor.getColumnNames();
|
||||
List<List<Object>> rows = cursorToList(cursor);
|
||||
|
||||
return new DatabaseGetTableDataResponse(Arrays.asList(columnNames), rows, start, rows.size(), total);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseGetTableStructureResponse getTableStructure(Descriptor descriptor, String table) {
|
||||
SQLiteDatabase db = descriptor.getReadable();
|
||||
|
||||
Map<String, String> foreignKeyValues = new HashMap<>();
|
||||
|
||||
try(Cursor cursor = db.rawQuery("PRAGMA foreign_key_list(" + table + ")", null)) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
String from = cursor.getString(cursor.getColumnIndex("from"));
|
||||
String to = cursor.getString(cursor.getColumnIndex("to"));
|
||||
String tableName = cursor.getString(cursor.getColumnIndex("table")) + "(" + to + ")";
|
||||
|
||||
foreignKeyValues.put(from, tableName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<String> structureColumns = Arrays.asList("column_name", "data_type", "nullable", "default", "primary_key", "foreign_key");
|
||||
List<List<Object>> structureValues = new ArrayList<>();
|
||||
|
||||
try (Cursor cursor = db.rawQuery("PRAGMA table_info(" + table + ")", null)) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
String columnName = cursor.getString(cursor.getColumnIndex("name"));
|
||||
String foreignKey = foreignKeyValues.containsKey(columnName) ? foreignKeyValues.get(columnName) : null;
|
||||
|
||||
structureValues.add(Arrays.asList(columnName,
|
||||
cursor.getString(cursor.getColumnIndex("type")),
|
||||
cursor.getInt(cursor.getColumnIndex("notnull")) == 0,
|
||||
getObjectFromColumnIndex(cursor, cursor.getColumnIndex("dflt_value")),
|
||||
cursor.getInt(cursor.getColumnIndex("pk")) == 1,
|
||||
foreignKey));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<String> indexesColumns = Arrays.asList("index_name", "unique", "indexed_column_name");
|
||||
List<List<Object>> indexesValues = new ArrayList<>();
|
||||
|
||||
try (Cursor indexesCursor = db.rawQuery("PRAGMA index_list(" + table + ")", null)) {
|
||||
List<String> indexedColumnNames = new ArrayList<>();
|
||||
String indexName = indexesCursor.getString(indexesCursor.getColumnIndex("name"));
|
||||
|
||||
try(Cursor indexInfoCursor = db.rawQuery("PRAGMA index_info(" + indexName + ")", null)) {
|
||||
while (indexInfoCursor.moveToNext()) {
|
||||
indexedColumnNames.add(indexInfoCursor.getString(indexInfoCursor.getColumnIndex("name")));
|
||||
}
|
||||
}
|
||||
|
||||
indexesValues.add(Arrays.asList(indexName,
|
||||
indexesCursor.getInt(indexesCursor.getColumnIndex("unique")) == 1,
|
||||
TextUtils.join(",", indexedColumnNames)));
|
||||
|
||||
}
|
||||
|
||||
return new DatabaseGetTableStructureResponse(structureColumns, structureValues, indexesColumns, indexesValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseGetTableInfoResponse getTableInfo(Descriptor databaseDescriptor, String table) {
|
||||
SQLiteDatabase db = databaseDescriptor.getReadable();
|
||||
|
||||
try (Cursor cursor = db.rawQuery("SELECT sql FROM sqlite_master WHERE name = ?", new String[] { table })) {
|
||||
cursor.moveToFirst();
|
||||
return new DatabaseGetTableInfoResponse(cursor.getString(cursor.getColumnIndex("sql")));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseExecuteSqlResponse executeSQL(Descriptor descriptor, String query) {
|
||||
SQLiteDatabase db = descriptor.getWritable();
|
||||
|
||||
String firstWordUpperCase = getFirstWord(query).toUpperCase();
|
||||
|
||||
switch (firstWordUpperCase) {
|
||||
case "UPDATE":
|
||||
case "DELETE":
|
||||
return executeUpdateDelete(db, query);
|
||||
case "INSERT":
|
||||
return executeInsert(db, query);
|
||||
case "SELECT":
|
||||
case "PRAGMA":
|
||||
case "EXPLAIN":
|
||||
return executeSelect(db, query);
|
||||
default:
|
||||
return executeRawQuery(db, query);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getFirstWord(String s) {
|
||||
s = s.trim();
|
||||
int firstSpace = s.indexOf(' ');
|
||||
return firstSpace >= 0 ? s.substring(0, firstSpace) : s;
|
||||
}
|
||||
|
||||
private static DatabaseExecuteSqlResponse executeUpdateDelete(SQLiteDatabase database, String query) {
|
||||
SQLiteStatement statement = database.compileStatement(query);
|
||||
int count = statement.executeUpdateDelete();
|
||||
|
||||
return DatabaseExecuteSqlResponse.successfulUpdateDelete(count);
|
||||
}
|
||||
|
||||
private static DatabaseExecuteSqlResponse executeInsert(SQLiteDatabase database, String query) {
|
||||
SQLiteStatement statement = database.compileStatement(query);
|
||||
long insertedId = statement.executeInsert();
|
||||
|
||||
return DatabaseExecuteSqlResponse.successfulInsert(insertedId);
|
||||
}
|
||||
|
||||
private static DatabaseExecuteSqlResponse executeSelect(SQLiteDatabase database, String query) {
|
||||
try (Cursor cursor = database.rawQuery(query, null)) {
|
||||
String[] columnNames = cursor.getColumnNames();
|
||||
List<List<Object>> rows = cursorToList(cursor);
|
||||
|
||||
return DatabaseExecuteSqlResponse.successfulSelect(Arrays.asList(columnNames), rows);
|
||||
}
|
||||
}
|
||||
|
||||
private static DatabaseExecuteSqlResponse executeRawQuery(SQLiteDatabase database, String query) {
|
||||
database.execSQL(query);
|
||||
return DatabaseExecuteSqlResponse.successfulRawQuery();
|
||||
}
|
||||
|
||||
private static @NonNull List<List<Object>> cursorToList(Cursor cursor) {
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
int numColumns = cursor.getColumnCount();
|
||||
|
||||
while (cursor.moveToNext()) {
|
||||
List<Object> values = new ArrayList<>(numColumns);
|
||||
|
||||
for (int column = 0; column < numColumns; column++) {
|
||||
values.add(getObjectFromColumnIndex(cursor, column));
|
||||
}
|
||||
|
||||
rows.add(values);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
private static @Nullable Object getObjectFromColumnIndex(Cursor cursor, int column) {
|
||||
switch (cursor.getType(column)) {
|
||||
case Cursor.FIELD_TYPE_NULL:
|
||||
return null;
|
||||
case Cursor.FIELD_TYPE_INTEGER:
|
||||
return cursor.getLong(column);
|
||||
case Cursor.FIELD_TYPE_FLOAT:
|
||||
return cursor.getDouble(column);
|
||||
case Cursor.FIELD_TYPE_BLOB:
|
||||
return cursor.getBlob(column);
|
||||
case Cursor.FIELD_TYPE_STRING:
|
||||
default:
|
||||
return cursor.getString(column);
|
||||
}
|
||||
}
|
||||
|
||||
static class Descriptor implements DatabaseDescriptor {
|
||||
private final SQLCipherOpenHelper sqlCipherOpenHelper;
|
||||
|
||||
Descriptor(@NonNull SQLCipherOpenHelper sqlCipherOpenHelper) {
|
||||
this.sqlCipherOpenHelper = sqlCipherOpenHelper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return sqlCipherOpenHelper.getDatabaseName();
|
||||
}
|
||||
|
||||
public @NonNull SQLiteDatabase getReadable() {
|
||||
return sqlCipherOpenHelper.getReadableDatabase();
|
||||
}
|
||||
|
||||
public @NonNull SQLiteDatabase getWritable() {
|
||||
return sqlCipherOpenHelper.getWritableDatabase();
|
||||
}
|
||||
}
|
||||
}
|
||||
4
app/src/flipper/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<string name="app_name">Signal (Flipper)</string>
|
||||
</resources>
|
||||
808
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,808 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.thoughtcrime.securesms">
|
||||
|
||||
<uses-sdk tools:overrideLibrary="androidx.camera.core,androidx.camera.camera2,androidx.camera.lifecycle" />
|
||||
|
||||
<permission android:name="${applicationId}.ACCESS_SECRETS"
|
||||
android:label="Access to TextSecure Secrets"
|
||||
android:protectionLevel="signature" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.location" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.wifi" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.portrait" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
||||
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
|
||||
<uses-permission android:name="org.thoughtcrime.securesms.ACCESS_SECRETS"/>
|
||||
<uses-permission android:name="android.permission.READ_PROFILE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_PROFILE"/>
|
||||
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"
|
||||
tools:ignore="ProtectedPermissions"/>
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_MMS"/>
|
||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
||||
<uses-permission android:name="android.permission.SEND_SMS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_SMS"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="28" />
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.READ_CALL_STATE"/>
|
||||
|
||||
<!-- For sending/receiving events -->
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR"/>
|
||||
|
||||
|
||||
<!-- Normal -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
|
||||
<!-- So we can add a TextSecure 'Account' -->
|
||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
|
||||
|
||||
<!-- For conversation 'shortcuts' on the desktop -->
|
||||
<uses-permission android:name="android.permission.INSTALL_SHORTCUT"/>
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||
|
||||
<!-- For fixing MMS -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
|
||||
|
||||
<!-- Set image as wallpaper -->
|
||||
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
|
||||
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.RAISED_THREAD_PRIORITY" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
|
||||
|
||||
<application android:name=".ApplicationContext"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
tools:replace="android:allowBackup"
|
||||
android:allowBackup="false"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:largeHeap="true">
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U"/>
|
||||
|
||||
<meta-data android:name="com.google.android.gms.version"
|
||||
android:value="@integer/google_play_services_version" />
|
||||
|
||||
<meta-data android:name="com.google.android.gms.car.application"
|
||||
android:resource="@xml/automotive_app_desc" />
|
||||
|
||||
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
|
||||
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
|
||||
<meta-data android:name="firebase_messaging_auto_init_enabled" android:value="false" />
|
||||
|
||||
<activity android:name=".WebRtcCallActivity"
|
||||
android:theme="@style/TextSecure.LightTheme.WebRTCCall"
|
||||
android:excludeFromRecents="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
|
||||
android:taskAffinity=".calling"
|
||||
android:launchMode="singleTask"/>
|
||||
|
||||
<activity android:name=".messagerequests.CalleeMustAcceptMessageRequestActivity"
|
||||
android:theme="@style/TextSecure.DarkNoActionBar"
|
||||
android:screenOrientation="portrait"
|
||||
android:noHistory="true"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".InviteActivity"
|
||||
android:theme="@style/Signal.Light.NoActionBar.Invite"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".MainActivity" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".PromptMmsActivity"
|
||||
android:label="Configure MMS Settings"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DeviceProvisioningActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="tsdevice"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".preferences.MmsPreferencesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".sharing.ShareActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity=""
|
||||
android:noHistory="true"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:mimeType="audio/*" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="text/plain" />
|
||||
<data android:mimeType="video/*" />
|
||||
<data android:mimeType="application/*"/>
|
||||
<data android:mimeType="text/*"/>
|
||||
<data android:mimeType="*/*"/>
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.service.chooser.chooser_target_service"
|
||||
android:value=".service.DirectShareService" />
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".stickers.StickerPackPreviewActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:noHistory="true"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="sgnl"
|
||||
android:host="addstickers" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https"
|
||||
android:host="signal.art"
|
||||
android:pathPrefix="/addstickers"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity-alias android:name=".RoutingActivity"
|
||||
android:targetActivity=".MainActivity"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="sgnl"
|
||||
android:host="signal.group" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter android:autoVerify="true"
|
||||
tools:targetApi="23">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https"
|
||||
android:host="signal.group"/>
|
||||
</intent-filter>
|
||||
|
||||
<meta-data android:name="com.sec.minimode.icon.portrait.normal"
|
||||
android:resource="@mipmap/ic_launcher" />
|
||||
<meta-data android:name="com.sec.minimode.icon.landscape.normal"
|
||||
android:resource="@mipmap/ic_launcher" />
|
||||
|
||||
</activity-alias>
|
||||
|
||||
<activity android:name=".conversation.ConversationActivity"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:parentActivityName=".MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.thoughtcrime.securesms.MainActivity" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".longmessage.LongMessageActivity" />
|
||||
|
||||
<activity android:name=".conversation.ConversationPopupActivity"
|
||||
android:windowSoftInputMode="stateVisible"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity=""
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/TextSecure.LightTheme.Popup"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
|
||||
|
||||
<activity android:name=".messagedetails.MessageDetailsActivity"
|
||||
android:label="@string/AndroidManifest__message_details"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".groups.ui.pendingmemberinvites.PendingMemberInvitesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar" />
|
||||
|
||||
<activity android:name=".groups.ui.invitesandrequests.ManagePendingAndRequestingMembersActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar" />
|
||||
|
||||
<activity android:name=".groups.ui.managegroup.ManageGroupActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".recipients.ui.managerecipient.ManageRecipientActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DatabaseMigrationActivity"
|
||||
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".migrations.ApplicationMigrationActivity"
|
||||
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphraseCreateActivity"
|
||||
android:label="@string/AndroidManifest__create_passphrase"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphrasePromptActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightIntroTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".NewConversationActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysVisible"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PushContactSelectionActivity"
|
||||
android:label="@string/AndroidManifest__select_contacts"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".giph.ui.GiphyActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".mediasend.MediaSendActivity"
|
||||
android:theme="@style/TextSecure.FullScreenMedia"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTop"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphraseChangeActivity"
|
||||
android:label="@string/AndroidManifest__change_passphrase"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".VerifyIdentityActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ApplicationPreferencesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".registration.RegistrationNavigationActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".revealable.ViewOnceMessageActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.FullScreenMedia"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:excludeFromRecents="true"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".stickers.StickerManagementActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DeviceActivity"
|
||||
android:label="@string/AndroidManifest__linked_devices"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".logsubmit.SubmitDebugLogActivity"
|
||||
android:label="@string/AndroidManifest__log_submit"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".MediaPreviewActivity"
|
||||
android:label="@string/AndroidManifest__media_preview"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".AvatarPreviewActivity"
|
||||
android:label="@string/AndroidManifest__media_preview"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".mediaoverview.MediaOverviewActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DummyActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay"
|
||||
android:enabled="true"
|
||||
android:allowTaskReparenting="true"
|
||||
android:noHistory="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:alwaysRetainTaskState="false"
|
||||
android:stateNotNeeded="true"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:finishOnTaskLaunch="true" />
|
||||
|
||||
<activity android:name=".PlayServicesProblemActivity"
|
||||
android:theme="@style/TextSecure.DialogActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".SmsSendtoActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SENDTO" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="sms" />
|
||||
<data android:scheme="smsto" />
|
||||
<data android:scheme="mms" />
|
||||
<data android:scheme="mmsto" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="vnd.android.cursor.item/vnd.org.thoughtcrime.securesms.contact" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="org.thoughtcrime.securesms.webrtc.VoiceCallShare"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/NoAnimation.Theme.BlackScreen"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="vnd.android.cursor.item/vnd.org.thoughtcrime.securesms.call" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".mediasend.AvatarSelectionActivity"
|
||||
android:theme="@style/TextSecure.FullScreenMedia"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".BlockedContactsActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".scribbles.ImageEditorStickerSelectActivity"
|
||||
android:theme="@style/TextSecure.DarkTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".profiles.edit.EditProfileActivity"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
|
||||
<activity android:name=".lock.v2.CreateKbsPinActivity"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".lock.v2.KbsMigrationActivity"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ClearProfileAvatarActivity"
|
||||
android:theme="@style/Theme.AppCompat.Dialog.Alert"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:icon="@drawable/clear_profile_avatar"
|
||||
android:label="@string/AndroidManifest_remove_photo">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.action.CLEAR_PROFILE_PHOTO"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".contacts.TurnOffContactJoinedNotificationsActivity"
|
||||
android:theme="@style/Theme.AppCompat.Dialog.Alert" />
|
||||
|
||||
<activity android:name=".messagerequests.MessageRequestMegaphoneActivity"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.ContactShareEditActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.ContactNameEditActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.SharedContactDetailsActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ShortcutLauncherActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:exported="true"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity
|
||||
android:name=".maps.PlacePickerActivity"
|
||||
android:label="@string/PlacePickerActivity_title"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".MainActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
|
||||
|
||||
<activity android:name=".pin.PinRestoreActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
|
||||
|
||||
<activity android:name=".groups.ui.creategroup.CreateGroupActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar" />
|
||||
|
||||
<activity android:name=".groups.ui.addtogroup.AddToGroupsActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar" />
|
||||
|
||||
<activity android:name=".groups.ui.addmembers.AddMembersActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar" />
|
||||
|
||||
<activity android:name=".groups.ui.creategroup.details.AddGroupDetailsActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar" />
|
||||
|
||||
<activity android:name=".groups.ui.chooseadmin.ChooseNewAdminActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
|
||||
|
||||
<activity android:name=".megaphone.ClientDeprecatedActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:launchMode="singleTask" />
|
||||
|
||||
<service android:enabled="true" android:name=".service.WebRtcCallService"/>
|
||||
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
|
||||
<service android:enabled="true" android:exported="false" android:name=".service.KeyCachingService"/>
|
||||
<service android:enabled="true" android:name=".messages.IncomingMessageObserver$ForegroundService"/>
|
||||
|
||||
<service android:name=".components.voice.VoiceNotePlaybackService">
|
||||
<intent-filter>
|
||||
<action android:name="android.media.browse.MediaBrowserService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name="androidx.media.session.MediaButtonReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service android:name=".service.QuickResponseService"
|
||||
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:scheme="sms" />
|
||||
<data android:scheme="smsto" />
|
||||
<data android:scheme="mms" />
|
||||
<data android:scheme="mmsto" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".service.AccountAuthenticatorService" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/authenticator" />
|
||||
</service>
|
||||
|
||||
<service android:name=".service.ContactsSyncAdapterService" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.content.SyncAdapter"/>
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.content.SyncAdapter" android:resource="@xml/syncadapter" />
|
||||
<meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contactsformat" />
|
||||
</service>
|
||||
|
||||
<service android:name=".service.DirectShareService"
|
||||
android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.chooser.ChooserTargetService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".service.GenericForegroundService"/>
|
||||
|
||||
<service android:name=".gcm.FcmFetchService" />
|
||||
|
||||
<service android:name=".gcm.FcmReceiveService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name=".service.SmsListener"
|
||||
android:permission="android.permission.BROADCAST_SMS"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter android:priority="1001">
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SMS_DELIVER"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.SmsDeliveryListener"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.services.MESSAGE_SENT"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.MmsListener"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BROADCAST_WAP_PUSH">
|
||||
<intent-filter android:priority="1001">
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"/>
|
||||
<data android:mimeType="application/vnd.wap.mms-message" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER"/>
|
||||
<data android:mimeType="application/vnd.wap.mms-message" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.MarkReadReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.CLEAR"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.RemoteReplyReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.WEAR_REPLY"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.AndroidAutoHeardReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.ANDROID_AUTO_HEARD"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.AndroidAutoReplyReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.notifications.ANDROID_AUTO_REPLY"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.ExpirationListener" />
|
||||
|
||||
<receiver android:name=".revealable.ViewOnceMessageManager$ViewOnceAlarm" />
|
||||
|
||||
<receiver android:name=".service.TrimThreadsByDateManager$TrimThreadsByDateAlarm" />
|
||||
|
||||
<provider android:name=".providers.PartProvider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false"
|
||||
android:authorities="${applicationId}.part" />
|
||||
|
||||
<provider android:name=".providers.MmsBodyProvider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false"
|
||||
android:authorities="${applicationId}.mms" />
|
||||
|
||||
<provider android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_provider_paths" />
|
||||
|
||||
</provider>
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$Conversation"
|
||||
android:authorities="${applicationId}.database.conversation"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$ConversationList"
|
||||
android:authorities="${applicationId}.database.conversationlist"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$Attachment"
|
||||
android:authorities="${applicationId}.database.attachment"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$Sticker"
|
||||
android:authorities="${applicationId}.database.sticker"
|
||||
android:exported="false" />
|
||||
|
||||
<provider android:name=".database.DatabaseContentProviders$StickerPack"
|
||||
android:authorities="${applicationId}.database.stickerpack"
|
||||
android:exported="false" />
|
||||
|
||||
<receiver android:name=".service.BootReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
<action android:name="org.thoughtcrime.securesms.RESTART"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.DirectoryRefreshListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.RotateSignedPreKeyListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.RotateSenderCertificateListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.LocalBackupListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.PersistentConnectionBootListener">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.LocaleChangedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.LOCALE_CHANGED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".notifications.MessageNotifier$ReminderReceiver"/>
|
||||
|
||||
<receiver android:name=".notifications.DeleteNotificationReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.DELETE_NOTIFICATION"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".service.PanicResponderListener"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="info.guardianproject.panic.action.TRIGGER" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name=".gcm.FcmJobService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
android:enabled="@bool/enable_job_service"
|
||||
tools:targetApi="26" />
|
||||
|
||||
<service
|
||||
android:name=".jobmanager.JobSchedulerScheduler$SystemService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
android:enabled="@bool/enable_job_service"
|
||||
tools:targetApi="26" />
|
||||
|
||||
<service
|
||||
android:name=".jobmanager.KeepAliveService"
|
||||
android:enabled="@bool/enable_alarm_manager" />
|
||||
|
||||
<receiver
|
||||
android:name=".jobmanager.AlarmManagerScheduler$RetryReceiver"
|
||||
android:enabled="@bool/enable_alarm_manager" />
|
||||
|
||||
<!-- Probably don't need this one -->
|
||||
<receiver
|
||||
android:name=".jobmanager.BootReceiver"
|
||||
android:enabled="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||
|
||||
<uses-library android:name="com.sec.android.app.multiwindow" android:required="false"/>
|
||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:value="598.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632.0dip" />
|
||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598.0dip" />
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
BIN
app/src/main/assets/emoji/Activity.webp
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
app/src/main/assets/emoji/Flags_0.webp
Normal file
|
After Width: | Height: | Size: 415 KiB |
BIN
app/src/main/assets/emoji/Flags_1.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
app/src/main/assets/emoji/Foods.webp
Normal file
|
After Width: | Height: | Size: 344 KiB |
BIN
app/src/main/assets/emoji/Nature.webp
Normal file
|
After Width: | Height: | Size: 395 KiB |
BIN
app/src/main/assets/emoji/Objects.webp
Normal file
|
After Width: | Height: | Size: 622 KiB |
BIN
app/src/main/assets/emoji/People_0.webp
Normal file
|
After Width: | Height: | Size: 599 KiB |
BIN
app/src/main/assets/emoji/People_1.webp
Normal file
|
After Width: | Height: | Size: 559 KiB |
BIN
app/src/main/assets/emoji/People_2.webp
Normal file
|
After Width: | Height: | Size: 643 KiB |
BIN
app/src/main/assets/emoji/People_3.webp
Normal file
|
After Width: | Height: | Size: 647 KiB |
BIN
app/src/main/assets/emoji/People_4.webp
Normal file
|
After Width: | Height: | Size: 602 KiB |
BIN
app/src/main/assets/emoji/People_5.webp
Normal file
|
After Width: | Height: | Size: 589 KiB |
BIN
app/src/main/assets/emoji/People_6.webp
Normal file
|
After Width: | Height: | Size: 531 KiB |
BIN
app/src/main/assets/emoji/Places.webp
Normal file
|
After Width: | Height: | Size: 589 KiB |
BIN
app/src/main/assets/emoji/Symbols.webp
Normal file
|
After Width: | Height: | Size: 384 KiB |
BIN
app/src/main/assets/sounds/state-change_confirm-down.ogg
Executable file
BIN
app/src/main/assets/sounds/state-change_confirm-up.ogg
Executable file
58
app/src/main/java/org/signal/glide/Log.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package org.signal.glide;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public final class Log {
|
||||
|
||||
private Log() {}
|
||||
|
||||
public static void v(@NonNull String tag, @NonNull String message) {
|
||||
SignalGlideCodecs.getLogProvider().v(tag, message);
|
||||
}
|
||||
|
||||
public static void d(@NonNull String tag, @NonNull String message) {
|
||||
SignalGlideCodecs.getLogProvider().d(tag, message);
|
||||
}
|
||||
|
||||
public static void i(@NonNull String tag, @NonNull String message) {
|
||||
SignalGlideCodecs.getLogProvider().i(tag, message);
|
||||
}
|
||||
|
||||
public static void w(@NonNull String tag, @NonNull String message) {
|
||||
SignalGlideCodecs.getLogProvider().w(tag, message);
|
||||
}
|
||||
|
||||
public static void e(@NonNull String tag, @NonNull String message) {
|
||||
e(tag, message, null);
|
||||
}
|
||||
|
||||
public static void e(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable) {
|
||||
SignalGlideCodecs.getLogProvider().e(tag, message, throwable);
|
||||
}
|
||||
|
||||
public interface Provider {
|
||||
void v(@NonNull String tag, @NonNull String message);
|
||||
void d(@NonNull String tag, @NonNull String message);
|
||||
void i(@NonNull String tag, @NonNull String message);
|
||||
void w(@NonNull String tag, @NonNull String message);
|
||||
void e(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable);
|
||||
|
||||
Provider EMPTY = new Provider() {
|
||||
@Override
|
||||
public void v(@NonNull String tag, @NonNull String message) { }
|
||||
|
||||
@Override
|
||||
public void d(@NonNull String tag, @NonNull String message) { }
|
||||
|
||||
@Override
|
||||
public void i(@NonNull String tag, @NonNull String message) { }
|
||||
|
||||
@Override
|
||||
public void w(@NonNull String tag, @NonNull String message) { }
|
||||
|
||||
@Override
|
||||
public void e(@NonNull String tag, @NonNull String message, @NonNull Throwable throwable) { }
|
||||
};
|
||||
}
|
||||
}
|
||||
18
app/src/main/java/org/signal/glide/SignalGlideCodecs.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package org.signal.glide;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public final class SignalGlideCodecs {
|
||||
|
||||
private static Log.Provider logProvider = Log.Provider.EMPTY;
|
||||
|
||||
private SignalGlideCodecs() {}
|
||||
|
||||
public static void setLogProvider(@NonNull Log.Provider provider) {
|
||||
logProvider = provider;
|
||||
}
|
||||
|
||||
public static @NonNull Log.Provider getLogProvider() {
|
||||
return logProvider;
|
||||
}
|
||||
}
|
||||
52
app/src/main/java/org/signal/glide/apng/APNGDrawable.java
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import org.signal.glide.common.FrameAnimationDrawable;
|
||||
import org.signal.glide.apng.decode.APNGDecoder;
|
||||
import org.signal.glide.common.decode.FrameSeqDecoder;
|
||||
import org.signal.glide.common.loader.AssetStreamLoader;
|
||||
import org.signal.glide.common.loader.FileLoader;
|
||||
import org.signal.glide.common.loader.Loader;
|
||||
import org.signal.glide.common.loader.ResourceStreamLoader;
|
||||
|
||||
/**
|
||||
* @Description: APNGDrawable
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
public class APNGDrawable extends FrameAnimationDrawable<APNGDecoder> {
|
||||
public APNGDrawable(Loader provider) {
|
||||
super(provider);
|
||||
}
|
||||
|
||||
public APNGDrawable(APNGDecoder decoder) {
|
||||
super(decoder);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected APNGDecoder createFrameSeqDecoder(Loader streamLoader, FrameSeqDecoder.RenderListener listener) {
|
||||
return new APNGDecoder(streamLoader, listener);
|
||||
}
|
||||
|
||||
|
||||
public static APNGDrawable fromAsset(Context context, String assetPath) {
|
||||
AssetStreamLoader assetStreamLoader = new AssetStreamLoader(context, assetPath);
|
||||
return new APNGDrawable(assetStreamLoader);
|
||||
}
|
||||
|
||||
public static APNGDrawable fromFile(String filePath) {
|
||||
FileLoader fileLoader = new FileLoader(filePath);
|
||||
return new APNGDrawable(fileLoader);
|
||||
}
|
||||
|
||||
public static APNGDrawable fromResource(Context context, int resId) {
|
||||
ResourceStreamLoader resourceStreamLoader = new ResourceStreamLoader(context, resId);
|
||||
return new APNGDrawable(resourceStreamLoader);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/APNG#.27acTL.27:_The_Animation_Control_Chunk
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
class ACTLChunk extends Chunk {
|
||||
static final int ID = fourCCToInt("acTL");
|
||||
int num_frames;
|
||||
int num_plays;
|
||||
|
||||
@Override
|
||||
void innerParse(APNGReader apngReader) throws IOException {
|
||||
num_frames = apngReader.readInt();
|
||||
num_plays = apngReader.readInt();
|
||||
}
|
||||
}
|
||||
211
app/src/main/java/org/signal/glide/apng/decode/APNGDecoder.java
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
|
||||
import org.signal.glide.Log;
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
import org.signal.glide.apng.io.APNGWriter;
|
||||
import org.signal.glide.common.decode.Frame;
|
||||
import org.signal.glide.common.decode.FrameSeqDecoder;
|
||||
import org.signal.glide.common.io.Reader;
|
||||
import org.signal.glide.common.loader.Loader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: APNG4Android
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public class APNGDecoder extends FrameSeqDecoder<APNGReader, APNGWriter> {
|
||||
|
||||
private static final String TAG = APNGDecoder.class.getSimpleName();
|
||||
|
||||
private APNGWriter apngWriter;
|
||||
private int mLoopCount;
|
||||
private final Paint paint = new Paint();
|
||||
|
||||
|
||||
private class SnapShot {
|
||||
byte dispose_op;
|
||||
Rect dstRect = new Rect();
|
||||
ByteBuffer byteBuffer;
|
||||
}
|
||||
|
||||
private SnapShot snapShot = new SnapShot();
|
||||
|
||||
/**
|
||||
* @param loader webp的reader
|
||||
* @param renderListener 渲染的回调
|
||||
*/
|
||||
public APNGDecoder(Loader loader, FrameSeqDecoder.RenderListener renderListener) {
|
||||
super(loader, renderListener);
|
||||
paint.setAntiAlias(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected APNGWriter getWriter() {
|
||||
if (apngWriter == null) {
|
||||
apngWriter = new APNGWriter();
|
||||
}
|
||||
return apngWriter;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected APNGReader getReader(Reader reader) {
|
||||
return new APNGReader(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLoopCount() {
|
||||
return mLoopCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void release() {
|
||||
snapShot.byteBuffer = null;
|
||||
apngWriter = null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Rect read(APNGReader reader) throws IOException {
|
||||
List<Chunk> chunks = APNGParser.parse(reader);
|
||||
List<Chunk> otherChunks = new ArrayList<>();
|
||||
|
||||
boolean actl = false;
|
||||
APNGFrame lastFrame = null;
|
||||
byte[] ihdrData = new byte[0];
|
||||
int canvasWidth = 0, canvasHeight = 0;
|
||||
for (Chunk chunk : chunks) {
|
||||
if (chunk instanceof ACTLChunk) {
|
||||
mLoopCount = ((ACTLChunk) chunk).num_plays;
|
||||
actl = true;
|
||||
} else if (chunk instanceof FCTLChunk) {
|
||||
APNGFrame frame = new APNGFrame(reader, (FCTLChunk) chunk);
|
||||
frame.prefixChunks = otherChunks;
|
||||
frame.ihdrData = ihdrData;
|
||||
frames.add(frame);
|
||||
lastFrame = frame;
|
||||
} else if (chunk instanceof FDATChunk) {
|
||||
if (lastFrame != null) {
|
||||
lastFrame.imageChunks.add(chunk);
|
||||
}
|
||||
} else if (chunk instanceof IDATChunk) {
|
||||
if (!actl) {
|
||||
//如果为非APNG图片,则只解码PNG
|
||||
Frame frame = new StillFrame(reader);
|
||||
frame.frameWidth = canvasWidth;
|
||||
frame.frameHeight = canvasHeight;
|
||||
frames.add(frame);
|
||||
mLoopCount = 1;
|
||||
break;
|
||||
}
|
||||
if (lastFrame != null) {
|
||||
lastFrame.imageChunks.add(chunk);
|
||||
}
|
||||
|
||||
} else if (chunk instanceof IHDRChunk) {
|
||||
canvasWidth = ((IHDRChunk) chunk).width;
|
||||
canvasHeight = ((IHDRChunk) chunk).height;
|
||||
ihdrData = ((IHDRChunk) chunk).data;
|
||||
} else if (!(chunk instanceof IENDChunk)) {
|
||||
otherChunks.add(chunk);
|
||||
}
|
||||
}
|
||||
frameBuffer = ByteBuffer.allocate((canvasWidth * canvasHeight / (sampleSize * sampleSize) + 1) * 4);
|
||||
snapShot.byteBuffer = ByteBuffer.allocate((canvasWidth * canvasHeight / (sampleSize * sampleSize) + 1) * 4);
|
||||
return new Rect(0, 0, canvasWidth, canvasHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderFrame(Frame frame) {
|
||||
if (frame == null || fullRect == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Bitmap bitmap = obtainBitmap(fullRect.width() / sampleSize, fullRect.height() / sampleSize);
|
||||
Canvas canvas = cachedCanvas.get(bitmap);
|
||||
if (canvas == null) {
|
||||
canvas = new Canvas(bitmap);
|
||||
cachedCanvas.put(bitmap, canvas);
|
||||
}
|
||||
if (frame instanceof APNGFrame) {
|
||||
// 从缓存中恢复当前帧
|
||||
frameBuffer.rewind();
|
||||
bitmap.copyPixelsFromBuffer(frameBuffer);
|
||||
// 开始绘制前,处理快照中的设定
|
||||
if (this.frameIndex == 0) {
|
||||
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
|
||||
} else {
|
||||
canvas.save();
|
||||
canvas.clipRect(snapShot.dstRect);
|
||||
switch (snapShot.dispose_op) {
|
||||
// 从快照中恢复上一帧之前的显示内容
|
||||
case FCTLChunk.APNG_DISPOSE_OP_PREVIOUS:
|
||||
snapShot.byteBuffer.rewind();
|
||||
bitmap.copyPixelsFromBuffer(snapShot.byteBuffer);
|
||||
break;
|
||||
// 清空上一帧所画区域
|
||||
case FCTLChunk.APNG_DISPOSE_OP_BACKGROUND:
|
||||
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
|
||||
break;
|
||||
// 什么都不做
|
||||
case FCTLChunk.APNG_DISPOSE_OP_NON:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
// 然后根据dispose设定传递到快照信息中
|
||||
if (((APNGFrame) frame).dispose_op == FCTLChunk.APNG_DISPOSE_OP_PREVIOUS) {
|
||||
if (snapShot.dispose_op != FCTLChunk.APNG_DISPOSE_OP_PREVIOUS) {
|
||||
snapShot.byteBuffer.rewind();
|
||||
bitmap.copyPixelsToBuffer(snapShot.byteBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
snapShot.dispose_op = ((APNGFrame) frame).dispose_op;
|
||||
canvas.save();
|
||||
if (((APNGFrame) frame).blend_op == FCTLChunk.APNG_BLEND_OP_SOURCE) {
|
||||
canvas.clipRect(
|
||||
frame.frameX / sampleSize,
|
||||
frame.frameY / sampleSize,
|
||||
(frame.frameX + frame.frameWidth) / sampleSize,
|
||||
(frame.frameY + frame.frameHeight) / sampleSize);
|
||||
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
|
||||
}
|
||||
|
||||
|
||||
snapShot.dstRect.set(frame.frameX / sampleSize,
|
||||
frame.frameY / sampleSize,
|
||||
(frame.frameX + frame.frameWidth) / sampleSize,
|
||||
(frame.frameY + frame.frameHeight) / sampleSize);
|
||||
canvas.restore();
|
||||
}
|
||||
//开始真正绘制当前帧的内容
|
||||
Bitmap inBitmap = obtainBitmap(frame.frameWidth, frame.frameHeight);
|
||||
recycleBitmap(frame.draw(canvas, paint, sampleSize, inBitmap, getWriter()));
|
||||
recycleBitmap(inBitmap);
|
||||
frameBuffer.rewind();
|
||||
bitmap.copyPixelsToBuffer(frameBuffer);
|
||||
recycleBitmap(bitmap);
|
||||
} catch (Throwable t) {
|
||||
Log.e(TAG, "Failed to render!", t);
|
||||
}
|
||||
}
|
||||
}
|
||||
147
app/src/main/java/org/signal/glide/apng/decode/APNGFrame.java
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
import org.signal.glide.apng.io.APNGWriter;
|
||||
import org.signal.glide.common.decode.Frame;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.zip.CRC32;
|
||||
|
||||
/**
|
||||
* @Description: APNG4Android
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public class APNGFrame extends Frame<APNGReader, APNGWriter> {
|
||||
public final byte blend_op;
|
||||
public final byte dispose_op;
|
||||
byte[] ihdrData;
|
||||
List<Chunk> imageChunks = new ArrayList<>();
|
||||
List<Chunk> prefixChunks = new ArrayList<>();
|
||||
private static final byte[] sPNGSignatures = {(byte) 137, 80, 78, 71, 13, 10, 26, 10};
|
||||
private static final byte[] sPNGEndChunk = {0, 0, 0, 0, 0x49, 0x45, 0x4E, 0x44, (byte) 0xAE, 0x42, 0x60, (byte) 0x82};
|
||||
|
||||
private static ThreadLocal<CRC32> sCRC32 = new ThreadLocal<>();
|
||||
|
||||
private CRC32 getCRC32() {
|
||||
CRC32 crc32 = sCRC32.get();
|
||||
if (crc32 == null) {
|
||||
crc32 = new CRC32();
|
||||
sCRC32.set(crc32);
|
||||
}
|
||||
return crc32;
|
||||
}
|
||||
|
||||
public APNGFrame(APNGReader reader, FCTLChunk fctlChunk) {
|
||||
super(reader);
|
||||
blend_op = fctlChunk.blend_op;
|
||||
dispose_op = fctlChunk.dispose_op;
|
||||
frameDuration = fctlChunk.delay_num * 1000 / (fctlChunk.delay_den == 0 ? 100 : fctlChunk.delay_den);
|
||||
frameWidth = fctlChunk.width;
|
||||
frameHeight = fctlChunk.height;
|
||||
frameX = fctlChunk.x_offset;
|
||||
frameY = fctlChunk.y_offset;
|
||||
}
|
||||
|
||||
private int encode(APNGWriter apngWriter) throws IOException {
|
||||
int fileSize = 8 + 13 + 12;
|
||||
|
||||
//prefixChunks
|
||||
for (Chunk chunk : prefixChunks) {
|
||||
fileSize += chunk.length + 12;
|
||||
}
|
||||
|
||||
//imageChunks
|
||||
for (Chunk chunk : imageChunks) {
|
||||
if (chunk instanceof IDATChunk) {
|
||||
fileSize += chunk.length + 12;
|
||||
} else if (chunk instanceof FDATChunk) {
|
||||
fileSize += chunk.length + 8;
|
||||
}
|
||||
}
|
||||
fileSize += sPNGEndChunk.length;
|
||||
apngWriter.reset(fileSize);
|
||||
apngWriter.putBytes(sPNGSignatures);
|
||||
//IHDR Chunk
|
||||
apngWriter.writeInt(13);
|
||||
int start = apngWriter.position();
|
||||
apngWriter.writeFourCC(IHDRChunk.ID);
|
||||
apngWriter.writeInt(frameWidth);
|
||||
apngWriter.writeInt(frameHeight);
|
||||
apngWriter.putBytes(ihdrData);
|
||||
CRC32 crc32 = getCRC32();
|
||||
crc32.reset();
|
||||
crc32.update(apngWriter.toByteArray(), start, 17);
|
||||
apngWriter.writeInt((int) crc32.getValue());
|
||||
|
||||
//prefixChunks
|
||||
for (Chunk chunk : prefixChunks) {
|
||||
if (chunk instanceof IENDChunk) {
|
||||
continue;
|
||||
}
|
||||
reader.reset();
|
||||
reader.skip(chunk.offset);
|
||||
reader.read(apngWriter.toByteArray(), apngWriter.position(), chunk.length + 12);
|
||||
apngWriter.skip(chunk.length + 12);
|
||||
}
|
||||
//imageChunks
|
||||
for (Chunk chunk : imageChunks) {
|
||||
if (chunk instanceof IDATChunk) {
|
||||
reader.reset();
|
||||
reader.skip(chunk.offset);
|
||||
reader.read(apngWriter.toByteArray(), apngWriter.position(), chunk.length + 12);
|
||||
apngWriter.skip(chunk.length + 12);
|
||||
} else if (chunk instanceof FDATChunk) {
|
||||
apngWriter.writeInt(chunk.length - 4);
|
||||
start = apngWriter.position();
|
||||
apngWriter.writeFourCC(IDATChunk.ID);
|
||||
|
||||
reader.reset();
|
||||
// skip to fdat data position
|
||||
reader.skip(chunk.offset + 4 + 4 + 4);
|
||||
reader.read(apngWriter.toByteArray(), apngWriter.position(), chunk.length - 4);
|
||||
|
||||
apngWriter.skip(chunk.length - 4);
|
||||
crc32.reset();
|
||||
crc32.update(apngWriter.toByteArray(), start, chunk.length);
|
||||
apngWriter.writeInt((int) crc32.getValue());
|
||||
}
|
||||
}
|
||||
//endChunk
|
||||
apngWriter.putBytes(sPNGEndChunk);
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Bitmap draw(Canvas canvas, Paint paint, int sampleSize, Bitmap reusedBitmap, APNGWriter writer) {
|
||||
try {
|
||||
int length = encode(writer);
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = false;
|
||||
options.inSampleSize = sampleSize;
|
||||
options.inMutable = true;
|
||||
options.inBitmap = reusedBitmap;
|
||||
byte[] bytes = writer.toByteArray();
|
||||
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, length, options);
|
||||
assert bitmap != null;
|
||||
canvas.drawBitmap(bitmap, (float) frameX / sampleSize, (float) frameY / sampleSize, paint);
|
||||
return bitmap;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
143
app/src/main/java/org/signal/glide/apng/decode/APNGParser.java
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
import org.signal.glide.common.io.Reader;
|
||||
import org.signal.glide.common.io.StreamReader;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @link {https://www.w3.org/TR/PNG/#5PNG-file-signature}
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public class APNGParser {
|
||||
static class FormatException extends IOException {
|
||||
FormatException() {
|
||||
super("APNG Format error");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAPNG(String filePath) {
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
inputStream = new FileInputStream(filePath);
|
||||
return isAPNG(new StreamReader(inputStream));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
} finally {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAPNG(Context context, String assetPath) {
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
inputStream = context.getAssets().open(assetPath);
|
||||
return isAPNG(new StreamReader(inputStream));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
} finally {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAPNG(Context context, int resId) {
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
inputStream = context.getResources().openRawResource(resId);
|
||||
return isAPNG(new StreamReader(inputStream));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
} finally {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAPNG(Reader in) {
|
||||
APNGReader reader = (in instanceof APNGReader) ? (APNGReader) in : new APNGReader(in);
|
||||
try {
|
||||
if (!reader.matchFourCC("\u0089PNG") || !reader.matchFourCC("\r\n\u001a\n")) {
|
||||
throw new FormatException();
|
||||
}
|
||||
while (reader.available() > 0) {
|
||||
Chunk chunk = parseChunk(reader);
|
||||
if (chunk instanceof ACTLChunk) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static List<Chunk> parse(APNGReader reader) throws IOException {
|
||||
if (!reader.matchFourCC("\u0089PNG") || !reader.matchFourCC("\r\n\u001a\n")) {
|
||||
throw new FormatException();
|
||||
}
|
||||
|
||||
List<Chunk> chunks = new ArrayList<>();
|
||||
while (reader.available() > 0) {
|
||||
chunks.add(parseChunk(reader));
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
||||
private static Chunk parseChunk(APNGReader reader) throws IOException {
|
||||
int offset = reader.position();
|
||||
int size = reader.readInt();
|
||||
int fourCC = reader.readFourCC();
|
||||
Chunk chunk;
|
||||
if (fourCC == ACTLChunk.ID) {
|
||||
chunk = new ACTLChunk();
|
||||
} else if (fourCC == FCTLChunk.ID) {
|
||||
chunk = new FCTLChunk();
|
||||
} else if (fourCC == FDATChunk.ID) {
|
||||
chunk = new FDATChunk();
|
||||
} else if (fourCC == IDATChunk.ID) {
|
||||
chunk = new IDATChunk();
|
||||
} else if (fourCC == IENDChunk.ID) {
|
||||
chunk = new IENDChunk();
|
||||
} else if (fourCC == IHDRChunk.ID) {
|
||||
chunk = new IHDRChunk();
|
||||
} else {
|
||||
chunk = new Chunk();
|
||||
}
|
||||
chunk.offset = offset;
|
||||
chunk.fourcc = fourCC;
|
||||
chunk.length = size;
|
||||
chunk.parse(reader);
|
||||
chunk.crc = reader.readInt();
|
||||
return chunk;
|
||||
}
|
||||
}
|
||||
53
app/src/main/java/org/signal/glide/apng/decode/Chunk.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: Length (长度) 4字节 指定数据块中数据域的长度,其长度不超过(231-1)字节
|
||||
* Chunk Type Code (数据块类型码) 4字节 数据块类型码由ASCII字母(A-Z和a-z)组成
|
||||
* Chunk Data (数据块数据) 可变长度 存储按照Chunk Type Code指定的数据
|
||||
* CRC (循环冗余检测) 4字节 存储用来检测是否有错误的循环冗余码
|
||||
* @Link https://www.w3.org/TR/PNG
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
class Chunk {
|
||||
int length;
|
||||
int fourcc;
|
||||
int crc;
|
||||
int offset;
|
||||
|
||||
static int fourCCToInt(String fourCC) {
|
||||
if (TextUtils.isEmpty(fourCC) || fourCC.length() != 4) {
|
||||
return 0xbadeffff;
|
||||
}
|
||||
return (fourCC.charAt(0) & 0xff)
|
||||
| (fourCC.charAt(1) & 0xff) << 8
|
||||
| (fourCC.charAt(2) & 0xff) << 16
|
||||
| (fourCC.charAt(3) & 0xff) << 24
|
||||
;
|
||||
}
|
||||
|
||||
void parse(APNGReader reader) throws IOException {
|
||||
int available = reader.available();
|
||||
innerParse(reader);
|
||||
int offset = available - reader.available();
|
||||
if (offset > length) {
|
||||
throw new IOException("Out of chunk area");
|
||||
} else if (offset < length) {
|
||||
reader.skip(length - offset);
|
||||
}
|
||||
}
|
||||
|
||||
void innerParse(APNGReader reader) throws IOException {
|
||||
}
|
||||
}
|
||||
121
app/src/main/java/org/signal/glide/apng/decode/FCTLChunk.java
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
* @see {link=https://developer.mozilla.org/en-US/docs/Mozilla/Tech/APNG#.27fcTL.27:_The_Frame_Control_Chunk}
|
||||
*/
|
||||
class FCTLChunk extends Chunk {
|
||||
static final int ID = fourCCToInt("fcTL");
|
||||
int sequence_number;
|
||||
/**
|
||||
* x_offset >= 0
|
||||
* y_offset >= 0
|
||||
* width > 0
|
||||
* height > 0
|
||||
* x_offset + width <= 'IHDR' width
|
||||
* y_offset + height <= 'IHDR' height
|
||||
*/
|
||||
/**
|
||||
* Width of the following frame.
|
||||
*/
|
||||
int width;
|
||||
/**
|
||||
* Height of the following frame.
|
||||
*/
|
||||
int height;
|
||||
/**
|
||||
* X position at which to render the following frame.
|
||||
*/
|
||||
int x_offset;
|
||||
/**
|
||||
* Y position at which to render the following frame.
|
||||
*/
|
||||
int y_offset;
|
||||
|
||||
/**
|
||||
* The delay_num and delay_den parameters together specify a fraction indicating the time to
|
||||
* display the current frame, in seconds. If the denominator is 0, it is to be treated as if it
|
||||
* were 100 (that is, delay_num then specifies 1/100ths of a second).
|
||||
* If the the value of the numerator is 0 the decoder should render the next frame as quickly as
|
||||
* possible, though viewers may impose a reasonable lower bound.
|
||||
* <p>
|
||||
* Frame timings should be independent of the time required for decoding and display of each frame,
|
||||
* so that animations will run at the same rate regardless of the performance of the decoder implementation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Frame delay fraction numerator.
|
||||
*/
|
||||
short delay_num;
|
||||
|
||||
/**
|
||||
* Frame delay fraction denominator.
|
||||
*/
|
||||
short delay_den;
|
||||
|
||||
/**
|
||||
* Type of frame area disposal to be done after rendering this frame.
|
||||
* dispose_op specifies how the output buffer should be changed at the end of the delay (before rendering the next frame).
|
||||
* If the first 'fcTL' chunk uses a dispose_op of APNG_DISPOSE_OP_PREVIOUS it should be treated as APNG_DISPOSE_OP_BACKGROUND.
|
||||
*/
|
||||
byte dispose_op;
|
||||
|
||||
/**
|
||||
* Type of frame area rendering for this frame.
|
||||
*/
|
||||
byte blend_op;
|
||||
|
||||
/**
|
||||
* No disposal is done on this frame before rendering the next; the contents of the output buffer are left as is.
|
||||
*/
|
||||
static final int APNG_DISPOSE_OP_NON = 0;
|
||||
|
||||
/**
|
||||
* The frame's region of the output buffer is to be cleared to fully transparent black before rendering the next frame.
|
||||
*/
|
||||
static final int APNG_DISPOSE_OP_BACKGROUND = 1;
|
||||
|
||||
/**
|
||||
* The frame's region of the output buffer is to be reverted to the previous contents before rendering the next frame.
|
||||
*/
|
||||
static final int APNG_DISPOSE_OP_PREVIOUS = 2;
|
||||
|
||||
/**
|
||||
* blend_op<code> specifies whether the frame is to be alpha blended into the current output buffer content,
|
||||
* or whether it should completely replace its region in the output buffer.
|
||||
*/
|
||||
/**
|
||||
* All color components of the frame, including alpha, overwrite the current contents of the frame's output buffer region.
|
||||
*/
|
||||
static final int APNG_BLEND_OP_SOURCE = 0;
|
||||
|
||||
/**
|
||||
* The frame should be composited onto the output buffer based on its alpha,
|
||||
* using a simple OVER operation as described in the Alpha Channel Processing section of the Extensions
|
||||
* to the PNG Specification, Version 1.2.0. Note that the second variation of the sample code is applicable.
|
||||
*/
|
||||
static final int APNG_BLEND_OP_OVER = 1;
|
||||
|
||||
@Override
|
||||
void innerParse(APNGReader reader) throws IOException {
|
||||
sequence_number = reader.readInt();
|
||||
width = reader.readInt();
|
||||
height = reader.readInt();
|
||||
x_offset = reader.readInt();
|
||||
y_offset = reader.readInt();
|
||||
delay_num = reader.readShort();
|
||||
delay_den = reader.readShort();
|
||||
dispose_op = reader.peek();
|
||||
blend_op = reader.peek();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/APNG#.27fdAT.27:_The_Frame_Data_Chunk
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
class FDATChunk extends Chunk {
|
||||
static final int ID = fourCCToInt("fdAT");
|
||||
int sequence_number;
|
||||
|
||||
@Override
|
||||
void innerParse(APNGReader reader) throws IOException {
|
||||
sequence_number = reader.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
/**
|
||||
* @Description: 作用描述
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
class IDATChunk extends Chunk {
|
||||
static final int ID = fourCCToInt("IDAT");
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
/**
|
||||
* @Description: 作用描述
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
class IENDChunk extends Chunk {
|
||||
static final int ID = Chunk.fourCCToInt("IEND");
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* The IHDR chunk shall be the first chunk in the PNG datastream. It contains:
|
||||
* <p>
|
||||
* Width 4 bytes
|
||||
* Height 4 bytes
|
||||
* Bit depth 1 byte
|
||||
* Colour type 1 byte
|
||||
* Compression method 1 byte
|
||||
* Filter method 1 byte
|
||||
* Interlace method 1 byte
|
||||
*
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
class IHDRChunk extends Chunk {
|
||||
static final int ID = fourCCToInt("IHDR");
|
||||
/**
|
||||
* 图像宽度,以像素为单位
|
||||
*/
|
||||
int width;
|
||||
/**
|
||||
* 图像高度,以像素为单位
|
||||
*/
|
||||
int height;
|
||||
|
||||
byte[] data = new byte[5];
|
||||
|
||||
@Override
|
||||
void innerParse(APNGReader reader) throws IOException {
|
||||
width = reader.readInt();
|
||||
height = reader.readInt();
|
||||
reader.read(data, 0, data.length);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.decode;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import org.signal.glide.apng.io.APNGReader;
|
||||
import org.signal.glide.apng.io.APNGWriter;
|
||||
import org.signal.glide.common.decode.Frame;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: APNG4Android
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public class StillFrame extends Frame<APNGReader, APNGWriter> {
|
||||
|
||||
public StillFrame(APNGReader reader) {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bitmap draw(Canvas canvas, Paint paint, int sampleSize, Bitmap reusedBitmap, APNGWriter writer) {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = false;
|
||||
options.inSampleSize = sampleSize;
|
||||
options.inMutable = true;
|
||||
options.inBitmap = reusedBitmap;
|
||||
Bitmap bitmap = null;
|
||||
try {
|
||||
reader.reset();
|
||||
bitmap = BitmapFactory.decodeStream(reader.toInputStream(), null, options);
|
||||
assert bitmap != null;
|
||||
paint.setXfermode(null);
|
||||
canvas.drawBitmap(bitmap, 0, 0, paint);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
74
app/src/main/java/org/signal/glide/apng/io/APNGReader.java
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.io;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.signal.glide.common.io.FilterReader;
|
||||
import org.signal.glide.common.io.Reader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: APNGReader
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public class APNGReader extends FilterReader {
|
||||
private static ThreadLocal<byte[]> __intBytes = new ThreadLocal<>();
|
||||
|
||||
|
||||
protected static byte[] ensureBytes() {
|
||||
byte[] bytes = __intBytes.get();
|
||||
if (bytes == null) {
|
||||
bytes = new byte[4];
|
||||
__intBytes.set(bytes);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public APNGReader(Reader in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public int readInt() throws IOException {
|
||||
byte[] buf = ensureBytes();
|
||||
read(buf, 0, 4);
|
||||
return buf[3] & 0xFF |
|
||||
(buf[2] & 0xFF) << 8 |
|
||||
(buf[1] & 0xFF) << 16 |
|
||||
(buf[0] & 0xFF) << 24;
|
||||
}
|
||||
|
||||
public short readShort() throws IOException {
|
||||
byte[] buf = ensureBytes();
|
||||
read(buf, 0, 2);
|
||||
return (short) (buf[1] & 0xFF |
|
||||
(buf[0] & 0xFF) << 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return read FourCC and match chars
|
||||
*/
|
||||
public boolean matchFourCC(String chars) throws IOException {
|
||||
if (TextUtils.isEmpty(chars) || chars.length() != 4) {
|
||||
return false;
|
||||
}
|
||||
int fourCC = readFourCC();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (((fourCC >> (i * 8)) & 0xff) != chars.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public int readFourCC() throws IOException {
|
||||
byte[] buf = ensureBytes();
|
||||
read(buf, 0, 4);
|
||||
return buf[0] & 0xff | (buf[1] & 0xff) << 8 | (buf[2] & 0xff) << 16 | (buf[3] & 0xff) << 24;
|
||||
}
|
||||
}
|
||||
41
app/src/main/java/org/signal/glide/apng/io/APNGWriter.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.apng.io;
|
||||
|
||||
import org.signal.glide.common.io.ByteBufferWriter;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
/**
|
||||
* @Description: APNGWriter
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public class APNGWriter extends ByteBufferWriter {
|
||||
public APNGWriter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void writeFourCC(int val) {
|
||||
putByte((byte) (val & 0xff));
|
||||
putByte((byte) ((val >> 8) & 0xff));
|
||||
putByte((byte) ((val >> 16) & 0xff));
|
||||
putByte((byte) ((val >> 24) & 0xff));
|
||||
}
|
||||
|
||||
public void writeInt(int val) {
|
||||
putByte((byte) ((val >> 24) & 0xff));
|
||||
putByte((byte) ((val >> 16) & 0xff));
|
||||
putByte((byte) ((val >> 8) & 0xff));
|
||||
putByte((byte) (val & 0xff));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(int size) {
|
||||
super.reset(size);
|
||||
this.byteBuffer.order(ByteOrder.BIG_ENDIAN);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.DrawFilter;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PaintFlagsDrawFilter;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.vectordrawable.graphics.drawable.Animatable2Compat;
|
||||
|
||||
import org.signal.glide.Log;
|
||||
import org.signal.glide.common.decode.FrameSeqDecoder;
|
||||
import org.signal.glide.common.loader.Loader;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Description: Frame animation drawable
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
public abstract class FrameAnimationDrawable<Decoder extends FrameSeqDecoder> extends Drawable implements Animatable2Compat, FrameSeqDecoder.RenderListener {
|
||||
private static final String TAG = FrameAnimationDrawable.class.getSimpleName();
|
||||
private final Paint paint = new Paint();
|
||||
private final Decoder frameSeqDecoder;
|
||||
private DrawFilter drawFilter = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
|
||||
private Matrix matrix = new Matrix();
|
||||
private Set<AnimationCallback> animationCallbacks = new HashSet<>();
|
||||
private Bitmap bitmap;
|
||||
private static final int MSG_ANIMATION_START = 1;
|
||||
private static final int MSG_ANIMATION_END = 2;
|
||||
private Handler uiHandler = new Handler(Looper.getMainLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case MSG_ANIMATION_START:
|
||||
for (AnimationCallback animationCallback : animationCallbacks) {
|
||||
animationCallback.onAnimationStart(FrameAnimationDrawable.this);
|
||||
}
|
||||
break;
|
||||
case MSG_ANIMATION_END:
|
||||
for (AnimationCallback animationCallback : animationCallbacks) {
|
||||
animationCallback.onAnimationEnd(FrameAnimationDrawable.this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
private Runnable invalidateRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
invalidateSelf();
|
||||
}
|
||||
};
|
||||
private boolean autoPlay = true;
|
||||
|
||||
public FrameAnimationDrawable(Decoder frameSeqDecoder) {
|
||||
paint.setAntiAlias(true);
|
||||
this.frameSeqDecoder = frameSeqDecoder;
|
||||
}
|
||||
|
||||
public FrameAnimationDrawable(Loader provider) {
|
||||
paint.setAntiAlias(true);
|
||||
this.frameSeqDecoder = createFrameSeqDecoder(provider, this);
|
||||
}
|
||||
|
||||
public void setAutoPlay(boolean autoPlay) {
|
||||
this.autoPlay = autoPlay;
|
||||
}
|
||||
|
||||
protected abstract Decoder createFrameSeqDecoder(Loader streamLoader, FrameSeqDecoder.RenderListener listener);
|
||||
|
||||
/**
|
||||
* @param loopLimit <=0为无限播放,>0为实际播放次数
|
||||
*/
|
||||
public void setLoopLimit(int loopLimit) {
|
||||
frameSeqDecoder.setLoopLimit(loopLimit);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
frameSeqDecoder.reset();
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
frameSeqDecoder.pause();
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
frameSeqDecoder.resume();
|
||||
}
|
||||
|
||||
public boolean isPaused() {
|
||||
return frameSeqDecoder.isPaused();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
if (autoPlay) {
|
||||
frameSeqDecoder.start();
|
||||
} else {
|
||||
this.frameSeqDecoder.addRenderListener(this);
|
||||
if (!this.frameSeqDecoder.isRunning()) {
|
||||
this.frameSeqDecoder.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (autoPlay) {
|
||||
frameSeqDecoder.stop();
|
||||
} else {
|
||||
this.frameSeqDecoder.removeRenderListener(this);
|
||||
this.frameSeqDecoder.stopIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
return frameSeqDecoder.isRunning();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
if (bitmap == null || bitmap.isRecycled()) {
|
||||
return;
|
||||
}
|
||||
canvas.setDrawFilter(drawFilter);
|
||||
canvas.drawBitmap(bitmap, matrix, paint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBounds(int left, int top, int right, int bottom) {
|
||||
super.setBounds(left, top, right, bottom);
|
||||
boolean sampleSizeChanged = frameSeqDecoder.setDesiredSize(getBounds().width(), getBounds().height());
|
||||
matrix.setScale(
|
||||
1.0f * getBounds().width() * frameSeqDecoder.getSampleSize() / frameSeqDecoder.getBounds().width(),
|
||||
1.0f * getBounds().height() * frameSeqDecoder.getSampleSize() / frameSeqDecoder.getBounds().height());
|
||||
|
||||
if (sampleSizeChanged)
|
||||
this.bitmap = Bitmap.createBitmap(
|
||||
frameSeqDecoder.getBounds().width() / frameSeqDecoder.getSampleSize(),
|
||||
frameSeqDecoder.getBounds().height() / frameSeqDecoder.getSampleSize(),
|
||||
Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
paint.setAlpha(alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
paint.setColorFilter(colorFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return PixelFormat.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
Message.obtain(uiHandler, MSG_ANIMATION_START).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRender(ByteBuffer byteBuffer) {
|
||||
if (!isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (this.bitmap == null || this.bitmap.isRecycled()) {
|
||||
this.bitmap = Bitmap.createBitmap(
|
||||
frameSeqDecoder.getBounds().width() / frameSeqDecoder.getSampleSize(),
|
||||
frameSeqDecoder.getBounds().height() / frameSeqDecoder.getSampleSize(),
|
||||
Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
byteBuffer.rewind();
|
||||
if (byteBuffer.remaining() < this.bitmap.getByteCount()) {
|
||||
Log.e(TAG, "onRender:Buffer not large enough for pixels");
|
||||
return;
|
||||
}
|
||||
this.bitmap.copyPixelsFromBuffer(byteBuffer);
|
||||
uiHandler.post(invalidateRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnd() {
|
||||
Message.obtain(uiHandler, MSG_ANIMATION_END).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setVisible(boolean visible, boolean restart) {
|
||||
if (this.autoPlay) {
|
||||
if (visible) {
|
||||
if (!isRunning()) {
|
||||
start();
|
||||
}
|
||||
} else if (isRunning()) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
return super.setVisible(visible, restart);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicWidth() {
|
||||
try {
|
||||
return frameSeqDecoder.getBounds().width();
|
||||
} catch (Exception exception) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicHeight() {
|
||||
try {
|
||||
return frameSeqDecoder.getBounds().height();
|
||||
} catch (Exception exception) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAnimationCallback(@NonNull AnimationCallback animationCallback) {
|
||||
this.animationCallbacks.add(animationCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unregisterAnimationCallback(@NonNull AnimationCallback animationCallback) {
|
||||
return this.animationCallbacks.remove(animationCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAnimationCallbacks() {
|
||||
this.animationCallbacks.clear();
|
||||
}
|
||||
}
|
||||
33
app/src/main/java/org/signal/glide/common/decode/Frame.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.decode;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import org.signal.glide.common.io.Reader;
|
||||
import org.signal.glide.common.io.Writer;
|
||||
|
||||
/**
|
||||
* @Description: One frame in an animation
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-13
|
||||
*/
|
||||
public abstract class Frame<R extends Reader, W extends Writer> {
|
||||
protected final R reader;
|
||||
public int frameWidth;
|
||||
public int frameHeight;
|
||||
public int frameX;
|
||||
public int frameY;
|
||||
public int frameDuration;
|
||||
|
||||
public Frame(R reader) {
|
||||
this.reader = reader;
|
||||
}
|
||||
|
||||
public abstract Bitmap draw(Canvas canvas, Paint paint, int sampleSize, Bitmap reusedBitmap, W writer);
|
||||
}
|
||||
@@ -0,0 +1,539 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.decode;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import org.signal.glide.Log;
|
||||
import org.signal.glide.common.executor.FrameDecoderExecutor;
|
||||
import org.signal.glide.common.io.Reader;
|
||||
import org.signal.glide.common.io.Writer;
|
||||
import org.signal.glide.common.loader.Loader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
|
||||
/**
|
||||
* @Description: Abstract Frame Animation Decoder
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/27
|
||||
*/
|
||||
public abstract class FrameSeqDecoder<R extends Reader, W extends Writer> {
|
||||
private static final String TAG = FrameSeqDecoder.class.getSimpleName();
|
||||
private final int taskId;
|
||||
|
||||
private final Loader mLoader;
|
||||
private final Handler workerHandler;
|
||||
protected List<Frame> frames = new ArrayList<>();
|
||||
protected int frameIndex = -1;
|
||||
private int playCount;
|
||||
private Integer loopLimit = null;
|
||||
private Set<RenderListener> renderListeners = new HashSet<>();
|
||||
private AtomicBoolean paused = new AtomicBoolean(true);
|
||||
private static final Rect RECT_EMPTY = new Rect();
|
||||
private Runnable renderTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (paused.get()) {
|
||||
return;
|
||||
}
|
||||
if (canStep()) {
|
||||
long start = System.currentTimeMillis();
|
||||
long delay = step();
|
||||
long cost = System.currentTimeMillis() - start;
|
||||
workerHandler.postDelayed(this, Math.max(0, delay - cost));
|
||||
for (RenderListener renderListener : renderListeners) {
|
||||
renderListener.onRender(frameBuffer);
|
||||
}
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
protected int sampleSize = 1;
|
||||
|
||||
private Set<Bitmap> cacheBitmaps = new HashSet<>();
|
||||
protected Map<Bitmap, Canvas> cachedCanvas = new WeakHashMap<>();
|
||||
protected ByteBuffer frameBuffer;
|
||||
protected volatile Rect fullRect;
|
||||
private W mWriter = getWriter();
|
||||
private R mReader = null;
|
||||
|
||||
/**
|
||||
* If played all the needed
|
||||
*/
|
||||
private boolean finished = false;
|
||||
|
||||
private enum State {
|
||||
IDLE,
|
||||
RUNNING,
|
||||
INITIALIZING,
|
||||
FINISHING,
|
||||
}
|
||||
|
||||
private volatile State mState = State.IDLE;
|
||||
|
||||
public Loader getLoader() {
|
||||
return mLoader;
|
||||
}
|
||||
|
||||
protected abstract W getWriter();
|
||||
|
||||
protected abstract R getReader(Reader reader);
|
||||
|
||||
protected Bitmap obtainBitmap(int width, int height) {
|
||||
Bitmap ret = null;
|
||||
Iterator<Bitmap> iterator = cacheBitmaps.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
int reuseSize = width * height * 4;
|
||||
ret = iterator.next();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (ret != null && ret.getAllocationByteCount() >= reuseSize) {
|
||||
iterator.remove();
|
||||
if (ret.getWidth() != width || ret.getHeight() != height) {
|
||||
ret.reconfigure(width, height, Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
ret.eraseColor(0);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
if (ret != null && ret.getByteCount() >= reuseSize) {
|
||||
if (ret.getWidth() == width && ret.getHeight() == height) {
|
||||
iterator.remove();
|
||||
ret.eraseColor(0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Bitmap.Config config = Bitmap.Config.ARGB_8888;
|
||||
ret = Bitmap.createBitmap(width, height, config);
|
||||
} catch (OutOfMemoryError e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
protected void recycleBitmap(Bitmap bitmap) {
|
||||
if (bitmap != null && !cacheBitmaps.contains(bitmap)) {
|
||||
cacheBitmaps.add(bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码器的渲染回调
|
||||
*/
|
||||
public interface RenderListener {
|
||||
/**
|
||||
* 播放开始
|
||||
*/
|
||||
void onStart();
|
||||
|
||||
/**
|
||||
* 帧播放
|
||||
*/
|
||||
void onRender(ByteBuffer byteBuffer);
|
||||
|
||||
/**
|
||||
* 播放结束
|
||||
*/
|
||||
void onEnd();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param loader webp的reader
|
||||
* @param renderListener 渲染的回调
|
||||
*/
|
||||
public FrameSeqDecoder(Loader loader, @Nullable RenderListener renderListener) {
|
||||
this.mLoader = loader;
|
||||
if (renderListener != null) {
|
||||
this.renderListeners.add(renderListener);
|
||||
}
|
||||
this.taskId = FrameDecoderExecutor.getInstance().generateTaskId();
|
||||
this.workerHandler = new Handler(FrameDecoderExecutor.getInstance().getLooper(taskId));
|
||||
}
|
||||
|
||||
|
||||
public void addRenderListener(final RenderListener renderListener) {
|
||||
this.workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
renderListeners.add(renderListener);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void removeRenderListener(final RenderListener renderListener) {
|
||||
this.workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
renderListeners.remove(renderListener);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void stopIfNeeded() {
|
||||
this.workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (renderListeners.size() == 0) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Rect getBounds() {
|
||||
if (fullRect == null) {
|
||||
if (mState == State.FINISHING) {
|
||||
Log.e(TAG, "In finishing,do not interrupt");
|
||||
}
|
||||
final Thread thread = Thread.currentThread();
|
||||
workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if (fullRect == null) {
|
||||
if (mReader == null) {
|
||||
mReader = getReader(mLoader.obtain());
|
||||
} else {
|
||||
mReader.reset();
|
||||
}
|
||||
initCanvasBounds(read(mReader));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
fullRect = RECT_EMPTY;
|
||||
} finally {
|
||||
LockSupport.unpark(thread);
|
||||
}
|
||||
}
|
||||
});
|
||||
LockSupport.park(thread);
|
||||
}
|
||||
return fullRect;
|
||||
}
|
||||
|
||||
private void initCanvasBounds(Rect rect) {
|
||||
fullRect = rect;
|
||||
frameBuffer = ByteBuffer.allocate((rect.width() * rect.height() / (sampleSize * sampleSize) + 1) * 4);
|
||||
if (mWriter == null) {
|
||||
mWriter = getWriter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int getFrameCount() {
|
||||
return this.frames.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Loop Count defined in file
|
||||
*/
|
||||
protected abstract int getLoopCount();
|
||||
|
||||
public void start() {
|
||||
if (fullRect == RECT_EMPTY) {
|
||||
return;
|
||||
}
|
||||
if (mState == State.RUNNING || mState == State.INITIALIZING) {
|
||||
Log.i(TAG, debugInfo() + " Already started");
|
||||
return;
|
||||
}
|
||||
if (mState == State.FINISHING) {
|
||||
Log.e(TAG, debugInfo() + " Processing,wait for finish at " + mState);
|
||||
}
|
||||
mState = State.INITIALIZING;
|
||||
if (Looper.myLooper() == workerHandler.getLooper()) {
|
||||
innerStart();
|
||||
} else {
|
||||
workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
innerStart();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private void innerStart() {
|
||||
paused.compareAndSet(true, false);
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
try {
|
||||
if (frames.size() == 0) {
|
||||
try {
|
||||
if (mReader == null) {
|
||||
mReader = getReader(mLoader.obtain());
|
||||
} else {
|
||||
mReader.reset();
|
||||
}
|
||||
initCanvasBounds(read(mReader));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
Log.i(TAG, debugInfo() + " Set state to RUNNING,cost " + (System.currentTimeMillis() - start));
|
||||
mState = State.RUNNING;
|
||||
}
|
||||
if (getNumPlays() == 0 || !finished) {
|
||||
this.frameIndex = -1;
|
||||
renderTask.run();
|
||||
for (RenderListener renderListener : renderListeners) {
|
||||
renderListener.onStart();
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, debugInfo() + " No need to started");
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private void innerStop() {
|
||||
workerHandler.removeCallbacks(renderTask);
|
||||
frames.clear();
|
||||
for (Bitmap bitmap : cacheBitmaps) {
|
||||
if (bitmap != null && !bitmap.isRecycled()) {
|
||||
bitmap.recycle();
|
||||
}
|
||||
}
|
||||
cacheBitmaps.clear();
|
||||
if (frameBuffer != null) {
|
||||
frameBuffer = null;
|
||||
}
|
||||
cachedCanvas.clear();
|
||||
try {
|
||||
if (mReader != null) {
|
||||
mReader.close();
|
||||
mReader = null;
|
||||
}
|
||||
if (mWriter != null) {
|
||||
mWriter.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
release();
|
||||
mState = State.IDLE;
|
||||
for (RenderListener renderListener : renderListeners) {
|
||||
renderListener.onEnd();
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (fullRect == RECT_EMPTY) {
|
||||
return;
|
||||
}
|
||||
if (mState == State.FINISHING || mState == State.IDLE) {
|
||||
Log.i(TAG, debugInfo() + "No need to stop");
|
||||
return;
|
||||
}
|
||||
if (mState == State.INITIALIZING) {
|
||||
Log.e(TAG, debugInfo() + "Processing,wait for finish at " + mState);
|
||||
}
|
||||
mState = State.FINISHING;
|
||||
if (Looper.myLooper() == workerHandler.getLooper()) {
|
||||
innerStop();
|
||||
} else {
|
||||
workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
innerStop();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private String debugInfo() {
|
||||
return "";
|
||||
}
|
||||
|
||||
protected abstract void release();
|
||||
|
||||
public boolean isRunning() {
|
||||
return mState == State.RUNNING || mState == State.INITIALIZING;
|
||||
}
|
||||
|
||||
public boolean isPaused() {
|
||||
return paused.get();
|
||||
}
|
||||
|
||||
public void setLoopLimit(int limit) {
|
||||
this.loopLimit = limit;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
this.playCount = 0;
|
||||
this.frameIndex = -1;
|
||||
this.finished = false;
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
workerHandler.removeCallbacks(renderTask);
|
||||
paused.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
paused.compareAndSet(true, false);
|
||||
workerHandler.removeCallbacks(renderTask);
|
||||
workerHandler.post(renderTask);
|
||||
}
|
||||
|
||||
|
||||
public int getSampleSize() {
|
||||
return sampleSize;
|
||||
}
|
||||
|
||||
public boolean setDesiredSize(int width, int height) {
|
||||
boolean sampleSizeChanged = false;
|
||||
int sample = getDesiredSample(width, height);
|
||||
if (sample != this.sampleSize) {
|
||||
this.sampleSize = sample;
|
||||
sampleSizeChanged = true;
|
||||
final boolean tempRunning = isRunning();
|
||||
workerHandler.removeCallbacks(renderTask);
|
||||
workerHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
innerStop();
|
||||
try {
|
||||
initCanvasBounds(read(getReader(mLoader.obtain())));
|
||||
if (tempRunning) {
|
||||
innerStart();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return sampleSizeChanged;
|
||||
}
|
||||
|
||||
protected int getDesiredSample(int desiredWidth, int desiredHeight) {
|
||||
if (desiredWidth == 0 || desiredHeight == 0) {
|
||||
return 1;
|
||||
}
|
||||
int radio = Math.min(getBounds().width() / desiredWidth, getBounds().height() / desiredHeight);
|
||||
int sample = 1;
|
||||
while ((sample * 2) <= radio) {
|
||||
sample *= 2;
|
||||
}
|
||||
return sample;
|
||||
}
|
||||
|
||||
protected abstract Rect read(R reader) throws IOException;
|
||||
|
||||
private int getNumPlays() {
|
||||
return this.loopLimit != null ? this.loopLimit : this.getLoopCount();
|
||||
}
|
||||
|
||||
private boolean canStep() {
|
||||
if (!isRunning()) {
|
||||
return false;
|
||||
}
|
||||
if (frames.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
if (getNumPlays() <= 0) {
|
||||
return true;
|
||||
}
|
||||
if (this.playCount < getNumPlays() - 1) {
|
||||
return true;
|
||||
} else if (this.playCount == getNumPlays() - 1 && this.frameIndex < this.getFrameCount() - 1) {
|
||||
return true;
|
||||
}
|
||||
finished = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private long step() {
|
||||
this.frameIndex++;
|
||||
if (this.frameIndex >= this.getFrameCount()) {
|
||||
this.frameIndex = 0;
|
||||
this.playCount++;
|
||||
}
|
||||
Frame frame = getFrame(this.frameIndex);
|
||||
if (frame == null) {
|
||||
return 0;
|
||||
}
|
||||
renderFrame(frame);
|
||||
return frame.frameDuration;
|
||||
}
|
||||
|
||||
protected abstract void renderFrame(Frame frame);
|
||||
|
||||
private Frame getFrame(int index) {
|
||||
if (index < 0 || index >= frames.size()) {
|
||||
return null;
|
||||
}
|
||||
return frames.get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Indexed frame
|
||||
*
|
||||
* @param index <0 means reverse from last index
|
||||
*/
|
||||
public Bitmap getFrameBitmap(int index) throws IOException {
|
||||
if (mState != State.IDLE) {
|
||||
Log.e(TAG, debugInfo() + ",stop first");
|
||||
return null;
|
||||
}
|
||||
mState = State.RUNNING;
|
||||
paused.compareAndSet(true, false);
|
||||
if (frames.size() == 0) {
|
||||
if (mReader == null) {
|
||||
mReader = getReader(mLoader.obtain());
|
||||
} else {
|
||||
mReader.reset();
|
||||
}
|
||||
initCanvasBounds(read(mReader));
|
||||
}
|
||||
if (index < 0) {
|
||||
index += this.frames.size();
|
||||
}
|
||||
if (index < 0) {
|
||||
index = 0;
|
||||
}
|
||||
frameIndex = -1;
|
||||
while (frameIndex < index) {
|
||||
if (canStep()) {
|
||||
step();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
frameBuffer.rewind();
|
||||
Bitmap bitmap = Bitmap.createBitmap(getBounds().width() / getSampleSize(), getBounds().height() / getSampleSize(), Bitmap.Config.ARGB_8888);
|
||||
bitmap.copyPixelsFromBuffer(frameBuffer);
|
||||
innerStop();
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.executor;
|
||||
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @Description: com.github.penfeizhou.animation.executor
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-11-21
|
||||
*/
|
||||
public class FrameDecoderExecutor {
|
||||
private static int sPoolNumber = 4;
|
||||
private ArrayList<HandlerThread> mHandlerThreadGroup = new ArrayList<>();
|
||||
private AtomicInteger counter = new AtomicInteger(0);
|
||||
|
||||
private FrameDecoderExecutor() {
|
||||
}
|
||||
|
||||
static class Inner {
|
||||
static final FrameDecoderExecutor sInstance = new FrameDecoderExecutor();
|
||||
}
|
||||
|
||||
public void setPoolSize(int size) {
|
||||
sPoolNumber = size;
|
||||
}
|
||||
|
||||
public static FrameDecoderExecutor getInstance() {
|
||||
return Inner.sInstance;
|
||||
}
|
||||
|
||||
public Looper getLooper(int taskId) {
|
||||
int idx = taskId % sPoolNumber;
|
||||
if (idx >= mHandlerThreadGroup.size()) {
|
||||
HandlerThread handlerThread = new HandlerThread("FrameDecoderExecutor-" + idx);
|
||||
handlerThread.start();
|
||||
|
||||
mHandlerThreadGroup.add(handlerThread);
|
||||
Looper looper = handlerThread.getLooper();
|
||||
if (looper != null) {
|
||||
return looper;
|
||||
} else {
|
||||
return Looper.getMainLooper();
|
||||
}
|
||||
} else {
|
||||
if (mHandlerThreadGroup.get(idx) != null) {
|
||||
Looper looper = mHandlerThreadGroup.get(idx).getLooper();
|
||||
if (looper != null) {
|
||||
return looper;
|
||||
} else {
|
||||
return Looper.getMainLooper();
|
||||
}
|
||||
} else {
|
||||
return Looper.getMainLooper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int generateTaskId() {
|
||||
return counter.getAndIncrement();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* @Description: APNG4Android
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-14
|
||||
*/
|
||||
public class ByteBufferReader implements Reader {
|
||||
|
||||
private final ByteBuffer byteBuffer;
|
||||
|
||||
public ByteBufferReader(ByteBuffer byteBuffer) {
|
||||
this.byteBuffer = byteBuffer;
|
||||
byteBuffer.position(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long skip(long total) throws IOException {
|
||||
byteBuffer.position((int) (byteBuffer.position() + total));
|
||||
return total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte peek() throws IOException {
|
||||
return byteBuffer.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() throws IOException {
|
||||
byteBuffer.position(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int position() {
|
||||
return byteBuffer.position();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] buffer, int start, int byteCount) throws IOException {
|
||||
byteBuffer.get(buffer, start, byteCount);
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int available() throws IOException {
|
||||
return byteBuffer.limit() - byteBuffer.position();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream toInputStream() throws IOException {
|
||||
return new ByteArrayInputStream(byteBuffer.array());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
/**
|
||||
* @Description: ByteBufferWriter
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-12
|
||||
*/
|
||||
public class ByteBufferWriter implements Writer {
|
||||
|
||||
protected ByteBuffer byteBuffer;
|
||||
|
||||
public ByteBufferWriter() {
|
||||
reset(10 * 1024);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putByte(byte b) {
|
||||
byteBuffer.put(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putBytes(byte[] b) {
|
||||
byteBuffer.put(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int position() {
|
||||
return byteBuffer.position();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void skip(int length) {
|
||||
byteBuffer.position(length + position());
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] toByteArray() {
|
||||
return byteBuffer.array();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(int size) {
|
||||
if (byteBuffer == null || size > byteBuffer.capacity()) {
|
||||
byteBuffer = ByteBuffer.allocate(size);
|
||||
this.byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
}
|
||||
byteBuffer.clear();
|
||||
}
|
||||
}
|
||||
30
app/src/main/java/org/signal/glide/common/io/FileReader.java
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: FileReader
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-23
|
||||
*/
|
||||
public class FileReader extends FilterReader {
|
||||
private final File mFile;
|
||||
|
||||
public FileReader(File file) throws IOException {
|
||||
super(new StreamReader(new FileInputStream(file)));
|
||||
mFile = file;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() throws IOException {
|
||||
reader.close();
|
||||
reader = new StreamReader(new FileInputStream(mFile));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @Description: FilterReader
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-23
|
||||
*/
|
||||
public class FilterReader implements Reader {
|
||||
protected Reader reader;
|
||||
|
||||
public FilterReader(Reader in) {
|
||||
this.reader = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long skip(long total) throws IOException {
|
||||
return reader.skip(total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte peek() throws IOException {
|
||||
return reader.peek();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() throws IOException {
|
||||
reader.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int position() {
|
||||
return reader.position();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] buffer, int start, int byteCount) throws IOException {
|
||||
return reader.read(buffer, start, byteCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int available() throws IOException {
|
||||
return reader.available();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
reader.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream toInputStream() throws IOException {
|
||||
reset();
|
||||
return reader.toInputStream();
|
||||
}
|
||||
}
|
||||
35
app/src/main/java/org/signal/glide/common/io/Reader.java
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @link {https://developers.google.com/speed/webp/docs/riff_container#terminology_basics}
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-11
|
||||
*/
|
||||
public interface Reader {
|
||||
long skip(long total) throws IOException;
|
||||
|
||||
byte peek() throws IOException;
|
||||
|
||||
void reset() throws IOException;
|
||||
|
||||
int position();
|
||||
|
||||
int read(byte[] buffer, int start, int byteCount) throws IOException;
|
||||
|
||||
int available() throws IOException;
|
||||
|
||||
/**
|
||||
* close io
|
||||
*/
|
||||
void close() throws IOException;
|
||||
|
||||
InputStream toInputStream() throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-11
|
||||
*/
|
||||
public class StreamReader extends FilterInputStream implements Reader {
|
||||
private int position;
|
||||
|
||||
public StreamReader(InputStream in) {
|
||||
super(in);
|
||||
try {
|
||||
in.reset();
|
||||
} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte peek() throws IOException {
|
||||
byte ret = (byte) read();
|
||||
position++;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
int ret = super.read(b, off, len);
|
||||
position += Math.max(0, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void reset() throws IOException {
|
||||
super.reset();
|
||||
position = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long skip(long n) throws IOException {
|
||||
long ret = super.skip(n);
|
||||
position += ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int position() {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream toInputStream() throws IOException {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
29
app/src/main/java/org/signal/glide/common/io/Writer.java
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.io;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: APNG4Android
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-12
|
||||
*/
|
||||
public interface Writer {
|
||||
void reset(int size);
|
||||
|
||||
void putByte(byte b);
|
||||
|
||||
void putBytes(byte[] b);
|
||||
|
||||
int position();
|
||||
|
||||
void skip(int length);
|
||||
|
||||
byte[] toByteArray();
|
||||
|
||||
void close() throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.loader;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @Description: 从Asset中读取流
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/28
|
||||
*/
|
||||
public class AssetStreamLoader extends StreamLoader {
|
||||
|
||||
private final Context mContext;
|
||||
private final String mAssetName;
|
||||
|
||||
public AssetStreamLoader(Context context, String assetName) {
|
||||
mContext = context.getApplicationContext();
|
||||
mAssetName = assetName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InputStream getInputStream() throws IOException {
|
||||
return mContext.getAssets().open(mAssetName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.loader;
|
||||
|
||||
import org.signal.glide.common.io.ByteBufferReader;
|
||||
import org.signal.glide.common.io.Reader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* @Description: ByteBufferLoader
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-15
|
||||
*/
|
||||
public abstract class ByteBufferLoader implements Loader {
|
||||
public abstract ByteBuffer getByteBuffer();
|
||||
|
||||
@Override
|
||||
public Reader obtain() throws IOException {
|
||||
return new ByteBufferReader(getByteBuffer());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.loader;
|
||||
|
||||
import org.signal.glide.common.io.FileReader;
|
||||
import org.signal.glide.common.io.Reader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: 从文件加载流
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/28
|
||||
*/
|
||||
public class FileLoader implements Loader {
|
||||
|
||||
private final File mFile;
|
||||
private Reader mReader;
|
||||
|
||||
public FileLoader(String path) {
|
||||
mFile = new File(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Reader obtain() throws IOException {
|
||||
return new FileReader(mFile);
|
||||
}
|
||||
}
|
||||
19
app/src/main/java/org/signal/glide/common/loader/Loader.java
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.loader;
|
||||
|
||||
import org.signal.glide.common.io.Reader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: Loader
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019-05-14
|
||||
*/
|
||||
public interface Loader {
|
||||
Reader obtain() throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.loader;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @Description: 从资源加载流
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/28
|
||||
*/
|
||||
public class ResourceStreamLoader extends StreamLoader {
|
||||
private final Context mContext;
|
||||
private final int mResId;
|
||||
|
||||
|
||||
public ResourceStreamLoader(Context context, int resId) {
|
||||
mContext = context.getApplicationContext();
|
||||
mResId = resId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InputStream getInputStream() throws IOException {
|
||||
return mContext.getResources().openRawResource(mResId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2019 Zhou Pengfei
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.signal.glide.common.loader;
|
||||
|
||||
import org.signal.glide.common.io.Reader;
|
||||
import org.signal.glide.common.io.StreamReader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2019/3/28
|
||||
*/
|
||||
public abstract class StreamLoader implements Loader {
|
||||
protected abstract InputStream getInputStream() throws IOException;
|
||||
|
||||
|
||||
public final synchronized Reader obtain() throws IOException {
|
||||
return new StreamReader(getInputStream());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import org.whispersystems.signalservice.api.account.AccountAttributes;
|
||||
|
||||
public final class AppCapabilities {
|
||||
|
||||
private AppCapabilities() {
|
||||
}
|
||||
|
||||
private static final boolean UUID_CAPABLE = false;
|
||||
private static final boolean GV2_CAPABLE = true;
|
||||
|
||||
/**
|
||||
* @param storageCapable Whether or not the user can use storage service. This is another way of
|
||||
* asking if the user has set a Signal PIN or not.
|
||||
*/
|
||||
public static AccountAttributes.Capabilities getCapabilities(boolean storageCapable) {
|
||||
return new AccountAttributes.Capabilities(UUID_CAPABLE, GV2_CAPABLE, storageCapable);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.insights.InsightsOptOut;
|
||||
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
||||
import org.thoughtcrime.securesms.jobs.StickerPackDownloadJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.migrations.ApplicationMigrations;
|
||||
import org.thoughtcrime.securesms.stickers.BlessedPacks;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
/**
|
||||
* Rule of thumb: if there's something you want to do on the first app launch that involves
|
||||
* persisting state to the database, you'll almost certainly *also* want to do it post backup
|
||||
* restore, since a backup restore will wipe the current state of the database.
|
||||
*/
|
||||
public final class AppInitialization {
|
||||
|
||||
private static final String TAG = Log.tag(AppInitialization.class);
|
||||
|
||||
private AppInitialization() {}
|
||||
|
||||
public static void onFirstEverAppLaunch(@NonNull Context context) {
|
||||
Log.i(TAG, "onFirstEverAppLaunch()");
|
||||
|
||||
InsightsOptOut.userRequestedOptOut(context);
|
||||
TextSecurePreferences.setAppMigrationVersion(context, ApplicationMigrations.CURRENT_VERSION);
|
||||
TextSecurePreferences.setJobManagerVersion(context, JobManager.CURRENT_VERSION);
|
||||
TextSecurePreferences.setLastExperienceVersionCode(context, Util.getCanonicalVersionCode());
|
||||
TextSecurePreferences.setHasSeenStickerIntroTooltip(context, true);
|
||||
ApplicationDependencies.getMegaphoneRepository().onFirstEverAppLaunch();
|
||||
SignalStore.onFirstEverAppLaunch();
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.ZOZO.getPackId(), BlessedPacks.ZOZO.getPackKey(), false));
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.BANDIT.getPackId(), BlessedPacks.BANDIT.getPackKey(), false));
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_HANDS.getPackId(), BlessedPacks.SWOON_HANDS.getPackKey()));
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_FACES.getPackId(), BlessedPacks.SWOON_FACES.getPackKey()));
|
||||
}
|
||||
|
||||
public static void onPostBackupRestore(@NonNull Context context) {
|
||||
Log.i(TAG, "onPostBackupRestore()");
|
||||
|
||||
ApplicationDependencies.getMegaphoneRepository().onFirstEverAppLaunch();
|
||||
SignalStore.onFirstEverAppLaunch();
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.ZOZO.getPackId(), BlessedPacks.ZOZO.getPackKey(), false));
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.BANDIT.getPackId(), BlessedPacks.BANDIT.getPackKey(), false));
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_HANDS.getPackId(), BlessedPacks.SWOON_HANDS.getPackKey()));
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_FACES.getPackId(), BlessedPacks.SWOON_FACES.getPackKey()));
|
||||
}
|
||||
}
|
||||
@@ -17,59 +17,62 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.camera.camera2.Camera2AppConfig;
|
||||
import androidx.camera.core.CameraX;
|
||||
import androidx.lifecycle.DefaultLifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.lifecycle.DefaultLifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import com.google.android.gms.security.ProviderInstaller;
|
||||
|
||||
import org.conscrypt.Conscrypt;
|
||||
import org.signal.aesgcmprovider.AesGcmProvider;
|
||||
import org.signal.ringrtc.CallConnectionFactory;
|
||||
import org.signal.glide.SignalGlideCodecs;
|
||||
import org.signal.ringrtc.CallManager;
|
||||
import org.thoughtcrime.securesms.components.TypingStatusRepository;
|
||||
import org.thoughtcrime.securesms.components.TypingStatusSender;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencyProvider;
|
||||
import org.thoughtcrime.securesms.gcm.FcmJobService;
|
||||
import org.thoughtcrime.securesms.insights.InsightsOptOut;
|
||||
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
||||
import org.thoughtcrime.securesms.jobs.CreateSignedPreKeyJob;
|
||||
import org.thoughtcrime.securesms.jobs.FcmRefreshJob;
|
||||
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob;
|
||||
import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob;
|
||||
import org.thoughtcrime.securesms.jobs.RefreshPreKeysJob;
|
||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.logging.AndroidLogger;
|
||||
import org.thoughtcrime.securesms.logging.CustomSignalProtocolLogger;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.logging.PersistentLogger;
|
||||
import org.thoughtcrime.securesms.logging.UncaughtExceptionLogger;
|
||||
import org.thoughtcrime.securesms.mediasend.camerax.CameraXUtil;
|
||||
import org.thoughtcrime.securesms.logging.SignalUncaughtExceptionHandler;
|
||||
import org.thoughtcrime.securesms.migrations.ApplicationMigrations;
|
||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.providers.BlobProvider;
|
||||
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
|
||||
import org.thoughtcrime.securesms.registration.RegistrationUtil;
|
||||
import org.thoughtcrime.securesms.revealable.ViewOnceMessageManager;
|
||||
import org.thoughtcrime.securesms.ringrtc.RingRtcLogger;
|
||||
import org.thoughtcrime.securesms.service.DirectoryRefreshListener;
|
||||
import org.thoughtcrime.securesms.service.ExpiringMessageManager;
|
||||
import org.thoughtcrime.securesms.service.IncomingMessageObserver;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
import org.thoughtcrime.securesms.service.LocalBackupListener;
|
||||
import org.thoughtcrime.securesms.revealable.ViewOnceMessageManager;
|
||||
import org.thoughtcrime.securesms.service.RotateSenderCertificateListener;
|
||||
import org.thoughtcrime.securesms.service.RotateSignedPreKeyListener;
|
||||
import org.thoughtcrime.securesms.service.UpdateApkRefreshListener;
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
|
||||
import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageContextWrapper;
|
||||
import org.webrtc.voiceengine.WebRtcAudioManager;
|
||||
import org.webrtc.voiceengine.WebRtcAudioUtils;
|
||||
@@ -96,7 +99,6 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
private ViewOnceMessageManager viewOnceMessageManager;
|
||||
private TypingStatusRepository typingStatusRepository;
|
||||
private TypingStatusSender typingStatusSender;
|
||||
private IncomingMessageObserver incomingMessageObserver;
|
||||
private PersistentLogger persistentLogger;
|
||||
|
||||
private volatile boolean isAppVisible;
|
||||
@@ -107,13 +109,14 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
long startTime = System.currentTimeMillis();
|
||||
super.onCreate();
|
||||
Log.i(TAG, "onCreate()");
|
||||
initializeSecurityProvider();
|
||||
initializeLogging();
|
||||
Log.i(TAG, "onCreate()");
|
||||
initializeCrashHandling();
|
||||
initializeFirstEverAppLaunch();
|
||||
initializeAppDependencies();
|
||||
initializeFirstEverAppLaunch();
|
||||
initializeApplicationMigrations();
|
||||
initializeMessageRetrieval();
|
||||
initializeExpiringMessageManager();
|
||||
@@ -127,8 +130,14 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
initializeRingRtc();
|
||||
initializePendingMessages();
|
||||
initializeBlobProvider();
|
||||
initializeCameraX();
|
||||
initializeCleanup();
|
||||
initializeGlideCodecs();
|
||||
|
||||
FeatureFlags.init();
|
||||
NotificationChannels.create(this);
|
||||
RefreshPreKeysJob.scheduleIfNecessary();
|
||||
StorageSyncHelper.scheduleRoutineSync();
|
||||
RegistrationUtil.maybeMarkRegistrationComplete(this);
|
||||
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
|
||||
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
@@ -136,15 +145,21 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
}
|
||||
|
||||
ApplicationDependencies.getJobManager().beginJobLoop();
|
||||
Log.d(TAG, "onCreate() took " + (System.currentTimeMillis() - startTime) + " ms");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(@NonNull LifecycleOwner owner) {
|
||||
isAppVisible = true;
|
||||
Log.i(TAG, "App is now visible.");
|
||||
FeatureFlags.refreshIfNecessary();
|
||||
ApplicationDependencies.getRecipientCache().warmUp();
|
||||
RetrieveProfileJob.enqueueRoutineFetchIfNecessary(this);
|
||||
executePendingContactSync();
|
||||
KeyCachingService.onAppForegrounded(this);
|
||||
ApplicationDependencies.getFrameRateTracker().begin();
|
||||
ApplicationDependencies.getMegaphoneRepository().onAppForegrounded();
|
||||
checkBuildExpiration();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,7 +167,8 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
isAppVisible = false;
|
||||
Log.i(TAG, "App is no longer visible.");
|
||||
KeyCachingService.onAppBackgrounded(this);
|
||||
MessageNotifier.setVisibleThread(-1);
|
||||
ApplicationDependencies.getMessageNotifier().clearVisibleThread();
|
||||
ApplicationDependencies.getFrameRateTracker().end();
|
||||
}
|
||||
|
||||
public ExpiringMessageManager getExpiringMessageManager() {
|
||||
@@ -179,6 +195,13 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
return persistentLogger;
|
||||
}
|
||||
|
||||
public void checkBuildExpiration() {
|
||||
if (Util.getTimeUntilBuildExpiry() <= 0 && !SignalStore.misc().isClientDeprecated()) {
|
||||
Log.w(TAG, "Build expired!");
|
||||
SignalStore.misc().markClientDeprecated();
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeSecurityProvider() {
|
||||
try {
|
||||
Class.forName("org.signal.aesgcmprovider.AesGcmCipher");
|
||||
@@ -212,7 +235,7 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
|
||||
private void initializeCrashHandling() {
|
||||
final Thread.UncaughtExceptionHandler originalHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionLogger(originalHandler));
|
||||
Thread.setDefaultUncaughtExceptionHandler(new SignalUncaughtExceptionHandler(originalHandler));
|
||||
}
|
||||
|
||||
private void initializeApplicationMigrations() {
|
||||
@@ -220,7 +243,7 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
}
|
||||
|
||||
public void initializeMessageRetrieval() {
|
||||
this.incomingMessageObserver = new IncomingMessageObserver(this);
|
||||
ApplicationDependencies.getIncomingMessageObserver();
|
||||
}
|
||||
|
||||
private void initializeAppDependencies() {
|
||||
@@ -231,10 +254,7 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
if (TextSecurePreferences.getFirstInstallVersion(this) == -1) {
|
||||
if (!SQLCipherOpenHelper.databaseFileExists(this)) {
|
||||
Log.i(TAG, "First ever app launch!");
|
||||
|
||||
InsightsOptOut.userRequestedOptOut(this);
|
||||
TextSecurePreferences.setAppMigrationVersion(this, ApplicationMigrations.CURRENT_VERSION);
|
||||
TextSecurePreferences.setJobManagerVersion(this, JobManager.CURRENT_VERSION);
|
||||
AppInitialization.onFirstEverAppLaunch(this);
|
||||
}
|
||||
|
||||
Log.i(TAG, "Setting first install version to " + BuildConfig.CANONICAL_VERSION_CODE);
|
||||
@@ -295,6 +315,7 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
add("Moto G4");
|
||||
add("TA-1053");
|
||||
add("Mi A1");
|
||||
add("Mi A2");
|
||||
add("E5823"); // Sony z5 compact
|
||||
add("Redmi Note 5");
|
||||
add("FP2"); // Fairphone FP2
|
||||
@@ -314,9 +335,9 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
|
||||
}
|
||||
|
||||
CallConnectionFactory.initialize(this, new RingRtcLogger());
|
||||
CallManager.initialize(this, new RingRtcLogger());
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
Log.w(TAG, e);
|
||||
throw new AssertionError("Unable to load ringrtc library", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,22 +379,45 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
|
||||
}
|
||||
|
||||
private void initializeBlobProvider() {
|
||||
AsyncTask.THREAD_POOL_EXECUTOR.execute(() -> {
|
||||
SignalExecutors.BOUNDED.execute(() -> {
|
||||
BlobProvider.getInstance().onSessionStart(this);
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
private void initializeCameraX() {
|
||||
if (CameraXUtil.isSupported()) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
CameraX.init(this, Camera2AppConfig.create(this));
|
||||
} catch (Throwable t) {
|
||||
Log.w(TAG, "Failed to initialize CameraX.");
|
||||
}
|
||||
}, "signal-camerax-initialization").start();
|
||||
}
|
||||
private void initializeCleanup() {
|
||||
SignalExecutors.BOUNDED.execute(() -> {
|
||||
int deleted = DatabaseFactory.getAttachmentDatabase(this).deleteAbandonedPreuploadedAttachments();
|
||||
Log.i(TAG, "Deleted " + deleted + " abandoned attachments.");
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeGlideCodecs() {
|
||||
SignalGlideCodecs.setLogProvider(new org.signal.glide.Log.Provider() {
|
||||
@Override
|
||||
public void v(@NonNull String tag, @NonNull String message) {
|
||||
Log.v(tag, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void d(@NonNull String tag, @NonNull String message) {
|
||||
Log.d(tag, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void i(@NonNull String tag, @NonNull String message) {
|
||||
Log.i(tag, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void w(@NonNull String tag, @NonNull String message) {
|
||||
Log.w(tag, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(@NonNull String tag, @NonNull String message, @Nullable Throwable throwable) {
|
||||
Log.e(tag, message, throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Whisper Systems
|
||||
* Copyright (C) 2013-2017 Open Whisper Systems
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import org.thoughtcrime.securesms.help.HelpFragment;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.preferences.AdvancedPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.AppProtectionPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.AppearancePreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.BackupsPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.ChatsPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.CorrectedPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.NotificationsPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.SmsMmsPreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.StoragePreferenceFragment;
|
||||
import org.thoughtcrime.securesms.preferences.widgets.ProfilePreference;
|
||||
import org.thoughtcrime.securesms.preferences.widgets.UsernamePreference;
|
||||
import org.thoughtcrime.securesms.profiles.edit.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
import org.thoughtcrime.securesms.util.CommunicationActions;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||
|
||||
/**
|
||||
* The Activity for application preference display and management.
|
||||
*
|
||||
* @author Moxie Marlinspike
|
||||
*
|
||||
*/
|
||||
|
||||
public class ApplicationPreferencesActivity extends PassphraseRequiredActivity
|
||||
implements SharedPreferences.OnSharedPreferenceChangeListener
|
||||
{
|
||||
public static final String LAUNCH_TO_BACKUPS_FRAGMENT = "launch.to.backups.fragment";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = ApplicationPreferencesActivity.class.getSimpleName();
|
||||
|
||||
private static final String PREFERENCE_CATEGORY_PROFILE = "preference_category_profile";
|
||||
private static final String PREFERENCE_CATEGORY_USERNAME = "preference_category_username";
|
||||
private static final String PREFERENCE_CATEGORY_SMS_MMS = "preference_category_sms_mms";
|
||||
private static final String PREFERENCE_CATEGORY_NOTIFICATIONS = "preference_category_notifications";
|
||||
private static final String PREFERENCE_CATEGORY_APP_PROTECTION = "preference_category_app_protection";
|
||||
private static final String PREFERENCE_CATEGORY_APPEARANCE = "preference_category_appearance";
|
||||
private static final String PREFERENCE_CATEGORY_CHATS = "preference_category_chats";
|
||||
private static final String PREFERENCE_CATEGORY_STORAGE = "preference_category_storage";
|
||||
private static final String PREFERENCE_CATEGORY_DEVICES = "preference_category_devices";
|
||||
private static final String PREFERENCE_CATEGORY_HELP = "preference_category_help";
|
||||
private static final String PREFERENCE_CATEGORY_ADVANCED = "preference_category_advanced";
|
||||
private static final String PREFERENCE_CATEGORY_DONATE = "preference_category_donate";
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
|
||||
@Override
|
||||
protected void onPreCreate() {
|
||||
dynamicTheme.onCreate(this);
|
||||
dynamicLanguage.onCreate(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle icicle, boolean ready) {
|
||||
//noinspection ConstantConditions
|
||||
this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
if (getIntent() != null && getIntent().getCategories() != null && getIntent().getCategories().contains("android.intent.category.NOTIFICATION_PREFERENCES")) {
|
||||
initFragment(android.R.id.content, new NotificationsPreferenceFragment());
|
||||
} else if (getIntent() != null && getIntent().getBooleanExtra(LAUNCH_TO_BACKUPS_FRAGMENT, false)) {
|
||||
initFragment(android.R.id.content, new BackupsPreferenceFragment());
|
||||
} else if (icicle == null) {
|
||||
initFragment(android.R.id.content, new ApplicationPreferenceFragment());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
dynamicTheme.onResume(this);
|
||||
dynamicLanguage.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data)
|
||||
{
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentById(android.R.id.content);
|
||||
fragment.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
if (fragmentManager.getBackStackEntryCount() > 0) {
|
||||
fragmentManager.popBackStack();
|
||||
} else {
|
||||
// TODO [greyson] Navigation
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
if (key.equals(TextSecurePreferences.THEME_PREF)) {
|
||||
recreate();
|
||||
} else if (key.equals(TextSecurePreferences.LANGUAGE_PREF)) {
|
||||
recreate();
|
||||
|
||||
Intent intent = new Intent(this, KeyCachingService.class);
|
||||
intent.setAction(KeyCachingService.LOCALE_CHANGE_EVENT);
|
||||
startService(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public void pushFragment(@NonNull Fragment fragment) {
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.setCustomAnimations(R.anim.slide_from_end, R.anim.slide_to_start, R.anim.slide_from_start, R.anim.slide_to_end)
|
||||
.replace(android.R.id.content, fragment)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
}
|
||||
|
||||
public static class ApplicationPreferenceFragment extends CorrectedPreferenceFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
|
||||
this.findPreference(PREFERENCE_CATEGORY_PROFILE)
|
||||
.setOnPreferenceClickListener(new ProfileClickListener());
|
||||
this.findPreference(PREFERENCE_CATEGORY_USERNAME)
|
||||
.setOnPreferenceClickListener(new UsernameClickListener());
|
||||
this.findPreference(PREFERENCE_CATEGORY_SMS_MMS)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_SMS_MMS));
|
||||
this.findPreference(PREFERENCE_CATEGORY_NOTIFICATIONS)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_NOTIFICATIONS));
|
||||
this.findPreference(PREFERENCE_CATEGORY_APP_PROTECTION)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_APP_PROTECTION));
|
||||
this.findPreference(PREFERENCE_CATEGORY_APPEARANCE)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_APPEARANCE));
|
||||
this.findPreference(PREFERENCE_CATEGORY_CHATS)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_CHATS));
|
||||
this.findPreference(PREFERENCE_CATEGORY_STORAGE)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_STORAGE));
|
||||
this.findPreference(PREFERENCE_CATEGORY_DEVICES)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_DEVICES));
|
||||
this.findPreference(PREFERENCE_CATEGORY_HELP)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_HELP));
|
||||
this.findPreference(PREFERENCE_CATEGORY_ADVANCED)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_ADVANCED));
|
||||
this.findPreference(PREFERENCE_CATEGORY_DONATE)
|
||||
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_DONATE));
|
||||
|
||||
tintIcons();
|
||||
}
|
||||
|
||||
private void tintIcons() {
|
||||
if (Build.VERSION.SDK_INT >= 21) return;
|
||||
|
||||
Preference preference = this.findPreference(PREFERENCE_CATEGORY_SMS_MMS);
|
||||
preference.getIcon().setColorFilter(ThemeUtil.getThemedColor(requireContext(), R.attr.icon_tint), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
|
||||
if (FeatureFlags.usernames()) {
|
||||
UsernamePreference pref = (UsernamePreference) findPreference(PREFERENCE_CATEGORY_USERNAME);
|
||||
pref.setVisible(shouldDisplayUsernameReminder());
|
||||
pref.setOnLongClickListener(v -> {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
.setMessage(R.string.ApplicationPreferencesActivity_hide_reminder)
|
||||
.setPositiveButton(R.string.ApplicationPreferencesActivity_hide, (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
SignalStore.misc().hideUsernameReminder();
|
||||
findPreference(PREFERENCE_CATEGORY_USERNAME).setVisible(false);
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, ((dialog, which) -> dialog.dismiss()))
|
||||
.setCancelable(true)
|
||||
.show();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
//noinspection ConstantConditions
|
||||
((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.text_secure_normal__menu_settings);
|
||||
setCategorySummaries();
|
||||
setCategoryVisibility();
|
||||
}
|
||||
|
||||
private void setCategorySummaries() {
|
||||
((ProfilePreference)this.findPreference(PREFERENCE_CATEGORY_PROFILE)).refresh();
|
||||
|
||||
if (FeatureFlags.usernames()) {
|
||||
this.findPreference(PREFERENCE_CATEGORY_USERNAME)
|
||||
.setVisible(shouldDisplayUsernameReminder());
|
||||
}
|
||||
|
||||
this.findPreference(PREFERENCE_CATEGORY_SMS_MMS)
|
||||
.setSummary(SmsMmsPreferenceFragment.getSummary(getActivity()));
|
||||
this.findPreference(PREFERENCE_CATEGORY_NOTIFICATIONS)
|
||||
.setSummary(NotificationsPreferenceFragment.getSummary(getActivity()));
|
||||
this.findPreference(PREFERENCE_CATEGORY_APP_PROTECTION)
|
||||
.setSummary(AppProtectionPreferenceFragment.getSummary(getActivity()));
|
||||
this.findPreference(PREFERENCE_CATEGORY_APPEARANCE)
|
||||
.setSummary(AppearancePreferenceFragment.getSummary(getActivity()));
|
||||
this.findPreference(PREFERENCE_CATEGORY_CHATS)
|
||||
.setSummary(ChatsPreferenceFragment.getSummary(getActivity()));
|
||||
}
|
||||
|
||||
private void setCategoryVisibility() {
|
||||
Preference devicePreference = this.findPreference(PREFERENCE_CATEGORY_DEVICES);
|
||||
if (devicePreference != null && !TextSecurePreferences.isPushRegistered(getActivity())) {
|
||||
getPreferenceScreen().removePreference(devicePreference);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean shouldDisplayUsernameReminder() {
|
||||
return FeatureFlags.usernames() && !Recipient.self().getUsername().isPresent() && SignalStore.misc().shouldShowUsernameReminder();
|
||||
}
|
||||
|
||||
private class CategoryClickListener implements Preference.OnPreferenceClickListener {
|
||||
private String category;
|
||||
|
||||
CategoryClickListener(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
Fragment fragment = null;
|
||||
|
||||
switch (category) {
|
||||
case PREFERENCE_CATEGORY_SMS_MMS:
|
||||
fragment = new SmsMmsPreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_NOTIFICATIONS:
|
||||
fragment = new NotificationsPreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_APP_PROTECTION:
|
||||
fragment = new AppProtectionPreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_APPEARANCE:
|
||||
fragment = new AppearancePreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_CHATS:
|
||||
fragment = new ChatsPreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_STORAGE:
|
||||
fragment = new StoragePreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_DEVICES:
|
||||
Intent intent = new Intent(getActivity(), DeviceActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_ADVANCED:
|
||||
fragment = new AdvancedPreferenceFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_HELP:
|
||||
fragment = new HelpFragment();
|
||||
break;
|
||||
case PREFERENCE_CATEGORY_DONATE:
|
||||
CommunicationActions.openBrowserLink(requireContext(), getString(R.string.donate_url));
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
if (fragment != null) {
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
|
||||
((ApplicationPreferencesActivity) requireActivity()).pushFragment(fragment);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private class ProfileClickListener implements Preference.OnPreferenceClickListener {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
requireActivity().startActivity(EditProfileActivity.getIntentForUserProfileEdit(preference.getContext()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private class UsernameClickListener implements Preference.OnPreferenceClickListener {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
requireActivity().startActivity(EditProfileActivity.getIntentForUsernameEdit(preference.getContext()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.transition.TransitionInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
|
||||
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ProfileContactPhoto;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.FullscreenHelper;
|
||||
|
||||
/**
|
||||
* Activity for displaying avatars full screen.
|
||||
*/
|
||||
public final class AvatarPreviewActivity extends PassphraseRequiredActivity {
|
||||
|
||||
private static final String TAG = Log.tag(AvatarPreviewActivity.class);
|
||||
|
||||
private static final String RECIPIENT_ID_EXTRA = "recipient_id";
|
||||
|
||||
public static @NonNull Intent intentFromRecipientId(@NonNull Context context,
|
||||
@NonNull RecipientId recipientId)
|
||||
{
|
||||
Intent intent = new Intent(context, AvatarPreviewActivity.class);
|
||||
intent.putExtra(RECIPIENT_ID_EXTRA, recipientId.serialize());
|
||||
return intent;
|
||||
}
|
||||
|
||||
public static Bundle createTransitionBundle(@NonNull Activity activity, @NonNull View from) {
|
||||
return ActivityOptionsCompat.makeSceneTransitionAnimation(activity, from, "avatar").toBundle();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState, boolean ready) {
|
||||
super.onCreate(savedInstanceState, ready);
|
||||
|
||||
setTheme(R.style.TextSecure_MediaPreview);
|
||||
setContentView(R.layout.contact_photo_preview_activity);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
postponeEnterTransition();
|
||||
TransitionInflater inflater = TransitionInflater.from(this);
|
||||
getWindow().setSharedElementEnterTransition(inflater.inflateTransition(R.transition.full_screen_avatar_image_enter_transition_set));
|
||||
getWindow().setSharedElementReturnTransition(inflater.inflateTransition(R.transition.full_screen_avatar_image_return_transition_set));
|
||||
}
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
ImageView avatar = findViewById(R.id.avatar);
|
||||
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
requireSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
Context context = getApplicationContext();
|
||||
RecipientId recipientId = RecipientId.from(getIntent().getStringExtra(RECIPIENT_ID_EXTRA));
|
||||
|
||||
Recipient.live(recipientId).observe(this, recipient -> {
|
||||
ContactPhoto contactPhoto = recipient.isLocalNumber() ? new ProfileContactPhoto(recipient, recipient.getProfileAvatar())
|
||||
: recipient.getContactPhoto();
|
||||
FallbackContactPhoto fallbackPhoto = recipient.isLocalNumber() ? new ResourceContactPhoto(R.drawable.ic_profile_outline_40, R.drawable.ic_profile_outline_20, R.drawable.ic_person_large)
|
||||
: recipient.getFallbackContactPhoto();
|
||||
|
||||
Resources resources = this.getResources();
|
||||
|
||||
GlideApp.with(this)
|
||||
.asBitmap()
|
||||
.load(contactPhoto)
|
||||
.fallback(fallbackPhoto.asCallCard(this))
|
||||
.error(fallbackPhoto.asCallCard(this))
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.addListener(new RequestListener<Bitmap>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
|
||||
Log.w(TAG, "Unable to load avatar, or avatar removed, closing");
|
||||
finish();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
avatar.setImageDrawable(RoundedBitmapDrawableFactory.create(resources, resource));
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
startPostponedEnterTransition();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
}
|
||||
});
|
||||
|
||||
toolbar.setTitle(recipient.getDisplayName(context));
|
||||
});
|
||||
|
||||
FullscreenHelper fullscreenHelper = new FullscreenHelper(this);
|
||||
|
||||
findViewById(android.R.id.content).setOnClickListener(v -> fullscreenHelper.toggleUiVisibility());
|
||||
|
||||
fullscreenHelper.configureToolbarSpacer(findViewById(R.id.toolbar_cutout_spacer));
|
||||
|
||||
fullscreenHelper.showAndHideWithSystemUI(getWindow(), findViewById(R.id.toolbar_layout));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageActivityHelper;
|
||||
import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageContextWrapper;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Base class for all activities. The vast majority of activities shouldn't extend this directly.
|
||||
* Instead, they should extend {@link PassphraseRequiredActivity} so they're protected by
|
||||
* screen lock.
|
||||
*/
|
||||
public abstract class BaseActivity extends AppCompatActivity {
|
||||
private static final String TAG = Log.tag(BaseActivity.class);
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
logEvent("onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
initializeScreenshotSecurity();
|
||||
DynamicLanguageActivityHelper.recreateIfNotInCorrectLanguage(this, TextSecurePreferences.getLanguage(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
logEvent("onStart()");
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
logEvent("onStop()");
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
logEvent("onDestroy()");
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private void initializeScreenshotSecurity() {
|
||||
if (TextSecurePreferences.isScreenSecurityEnabled(this)) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
|
||||
protected void startActivitySceneTransition(Intent intent, View sharedView, String transitionName) {
|
||||
Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(this, sharedView, transitionName)
|
||||
.toBundle();
|
||||
ActivityCompat.startActivity(this, intent, bundle);
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
protected void setStatusBarColor(int color) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
getWindow().setStatusBarColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(DynamicLanguageContextWrapper.updateContext(newBase, TextSecurePreferences.getLanguage(newBase)));
|
||||
}
|
||||
|
||||
private void logEvent(@NonNull String event) {
|
||||
Log.d(TAG, "[" + Log.tag(getClass()) + "] " + event);
|
||||
}
|
||||
|
||||
public final @NonNull ActionBar requireSupportActionBar() {
|
||||
return Objects.requireNonNull(getSupportActionBar());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import org.thoughtcrime.securesms.components.voice.VoiceNotePlaybackState;
|
||||
import org.thoughtcrime.securesms.contactshare.Contact;
|
||||
import org.thoughtcrime.securesms.conversation.ConversationMessage;
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.stickers.StickerLocator;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public interface BindableConversationItem extends Unbindable {
|
||||
void bind(@NonNull LifecycleOwner lifecycleOwner,
|
||||
@NonNull ConversationMessage messageRecord,
|
||||
@NonNull Optional<MessageRecord> previousMessageRecord,
|
||||
@NonNull Optional<MessageRecord> nextMessageRecord,
|
||||
@NonNull GlideRequests glideRequests,
|
||||
@NonNull Locale locale,
|
||||
@NonNull Set<ConversationMessage> batchSelected,
|
||||
@NonNull Recipient recipients,
|
||||
@Nullable String searchQuery,
|
||||
boolean pulseMention);
|
||||
|
||||
ConversationMessage getConversationMessage();
|
||||
|
||||
void setEventListener(@Nullable EventListener listener);
|
||||
|
||||
interface EventListener {
|
||||
void onQuoteClicked(MmsMessageRecord messageRecord);
|
||||
void onLinkPreviewClicked(@NonNull LinkPreview linkPreview);
|
||||
void onMoreTextClicked(@NonNull RecipientId conversationRecipientId, long messageId, boolean isMms);
|
||||
void onStickerClicked(@NonNull StickerLocator stickerLocator);
|
||||
void onViewOnceMessageClicked(@NonNull MmsMessageRecord messageRecord);
|
||||
void onSharedContactDetailsClicked(@NonNull Contact contact, @NonNull View avatarTransitionView);
|
||||
void onAddToContactsClicked(@NonNull Contact contact);
|
||||
void onMessageSharedContactClicked(@NonNull List<Recipient> choices);
|
||||
void onInviteSharedContactClicked(@NonNull List<Recipient> choices);
|
||||
void onReactionClicked(@NonNull View reactionTarget, long messageId, boolean isMms);
|
||||
void onGroupMemberClicked(@NonNull RecipientId recipientId, @NonNull GroupId groupId);
|
||||
void onMessageWithErrorClicked(@NonNull MessageRecord messageRecord);
|
||||
void onRegisterVoiceNoteCallbacks(@NonNull Observer<VoiceNotePlaybackState> onPlaybackStartObserver);
|
||||
void onUnregisterVoiceNoteCallbacks(@NonNull Observer<VoiceNotePlaybackState> onPlaybackStartObserver);
|
||||
void onVoiceNotePause(@NonNull Uri uri);
|
||||
void onVoiceNotePlay(@NonNull Uri uri, long messageId, double position);
|
||||
void onVoiceNoteSeekTo(@NonNull Uri uri, double position);
|
||||
|
||||
/** @return true if handled, false if you want to let the normal url handling continue */
|
||||
boolean onUrlClicked(@NonNull String url);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.database.model.ThreadRecord;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public interface BindableConversationListItem extends Unbindable {
|
||||
|
||||
void bind(@NonNull ThreadRecord thread,
|
||||
@NonNull GlideRequests glideRequests, @NonNull Locale locale,
|
||||
@NonNull Set<Long> typingThreads,
|
||||
@NonNull Set<Long> selectedThreads, boolean batchMode);
|
||||
|
||||
void setBatchMode(boolean batchMode);
|
||||
void updateTypingIndicator(@NonNull Set<Long> typingThreads);
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.WorkerThread;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SimpleTask;
|
||||
|
||||
/**
|
||||
* This should be used whenever we want to prompt the user to block/unblock a recipient.
|
||||
*/
|
||||
public final class BlockUnblockDialog {
|
||||
|
||||
private BlockUnblockDialog() { }
|
||||
|
||||
public static void showBlockFor(@NonNull Context context,
|
||||
@NonNull Lifecycle lifecycle,
|
||||
@NonNull Recipient recipient,
|
||||
@NonNull Runnable onBlock)
|
||||
{
|
||||
SimpleTask.run(lifecycle,
|
||||
() -> buildBlockFor(context, recipient, onBlock, null),
|
||||
AlertDialog.Builder::show);
|
||||
}
|
||||
|
||||
public static void showBlockAndDeleteFor(@NonNull Context context,
|
||||
@NonNull Lifecycle lifecycle,
|
||||
@NonNull Recipient recipient,
|
||||
@NonNull Runnable onBlock,
|
||||
@NonNull Runnable onBlockAndDelete)
|
||||
{
|
||||
SimpleTask.run(lifecycle,
|
||||
() -> buildBlockFor(context, recipient, onBlock, onBlockAndDelete),
|
||||
AlertDialog.Builder::show);
|
||||
}
|
||||
|
||||
public static void showUnblockFor(@NonNull Context context,
|
||||
@NonNull Lifecycle lifecycle,
|
||||
@NonNull Recipient recipient,
|
||||
@NonNull Runnable onUnblock)
|
||||
{
|
||||
SimpleTask.run(lifecycle,
|
||||
() -> buildUnblockFor(context, recipient, onUnblock),
|
||||
AlertDialog.Builder::show);
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private static AlertDialog.Builder buildBlockFor(@NonNull Context context,
|
||||
@NonNull Recipient recipient,
|
||||
@NonNull Runnable onBlock,
|
||||
@Nullable Runnable onBlockAndDelete)
|
||||
{
|
||||
recipient = recipient.resolve();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
Resources resources = context.getResources();
|
||||
|
||||
if (recipient.isGroup()) {
|
||||
if (DatabaseFactory.getGroupDatabase(context).isActive(recipient.requireGroupId())) {
|
||||
builder.setTitle(resources.getString(R.string.BlockUnblockDialog_block_and_leave_s, recipient.getDisplayName(context)));
|
||||
builder.setMessage(R.string.BlockUnblockDialog_you_will_no_longer_receive_messages_or_updates);
|
||||
builder.setPositiveButton(R.string.BlockUnblockDialog_block_and_leave, ((dialog, which) -> onBlock.run()));
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
} else {
|
||||
builder.setTitle(resources.getString(R.string.BlockUnblockDialog_block_s, recipient.getDisplayName(context)));
|
||||
builder.setMessage(R.string.BlockUnblockDialog_group_members_wont_be_able_to_add_you);
|
||||
builder.setPositiveButton(R.string.RecipientPreferenceActivity_block, ((dialog, which) -> onBlock.run()));
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
}
|
||||
} else {
|
||||
builder.setTitle(resources.getString(R.string.BlockUnblockDialog_block_s, recipient.getDisplayName(context)));
|
||||
builder.setMessage(R.string.BlockUnblockDialog_blocked_people_wont_be_able_to_call_you_or_send_you_messages);
|
||||
|
||||
if (onBlockAndDelete != null) {
|
||||
builder.setNeutralButton(android.R.string.cancel, null);
|
||||
builder.setPositiveButton(R.string.BlockUnblockDialog_block_and_delete, (d, w) -> onBlockAndDelete.run());
|
||||
builder.setNegativeButton(R.string.BlockUnblockDialog_block, (d, w) -> onBlock.run());
|
||||
} else {
|
||||
builder.setPositiveButton(R.string.BlockUnblockDialog_block, ((dialog, which) -> onBlock.run()));
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
}
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private static AlertDialog.Builder buildUnblockFor(@NonNull Context context,
|
||||
@NonNull Recipient recipient,
|
||||
@NonNull Runnable onUnblock)
|
||||
{
|
||||
recipient = recipient.resolve();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
Resources resources = context.getResources();
|
||||
|
||||
if (recipient.isGroup()) {
|
||||
if (DatabaseFactory.getGroupDatabase(context).isActive(recipient.requireGroupId())) {
|
||||
builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));
|
||||
builder.setMessage(R.string.BlockUnblockDialog_group_members_will_be_able_to_add_you);
|
||||
builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
} else {
|
||||
builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));
|
||||
builder.setMessage(R.string.BlockUnblockDialog_group_members_will_be_able_to_add_you);
|
||||
builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
}
|
||||
} else {
|
||||
builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));
|
||||
builder.setMessage(R.string.BlockUnblockDialog_you_will_be_able_to_call_and_message_each_other);
|
||||
builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,21 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.ListFragment;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.Loader;
|
||||
import androidx.cursoradapter.widget.CursorAdapter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cursoradapter.widget.CursorAdapter;
|
||||
import androidx.fragment.app.ListFragment;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.Loader;
|
||||
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
||||
import org.thoughtcrime.securesms.database.loaders.BlockedContactsLoader;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
@@ -25,21 +24,18 @@ import org.thoughtcrime.securesms.preferences.BlockedContactListItem;
|
||||
import org.thoughtcrime.securesms.recipients.LiveRecipient;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
|
||||
public class BlockedContactsActivity extends PassphraseRequiredActionBarActivity {
|
||||
public class BlockedContactsActivity extends PassphraseRequiredActivity {
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
private final DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
|
||||
@Override
|
||||
public void onPreCreate() {
|
||||
dynamicTheme.onCreate(this);
|
||||
dynamicLanguage.onCreate(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle, boolean ready) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
@@ -51,16 +47,12 @@ public class BlockedContactsActivity extends PassphraseRequiredActionBarActivity
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
dynamicTheme.onResume(this);
|
||||
dynamicLanguage.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home: finish(); return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class BlockedContactsFragment
|
||||
@@ -76,14 +68,14 @@ public class BlockedContactsActivity extends PassphraseRequiredActionBarActivity
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setListAdapter(new BlockedContactAdapter(getActivity(), GlideApp.with(this), null));
|
||||
getLoaderManager().initLoader(0, null, this);
|
||||
setListAdapter(new BlockedContactAdapter(requireActivity(), GlideApp.with(this), null));
|
||||
LoaderManager.getInstance(this).initLoader(0, null, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
getLoaderManager().restartLoader(0, null, this);
|
||||
LoaderManager.getInstance(this).restartLoader(0, null, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,10 +106,10 @@ public class BlockedContactsActivity extends PassphraseRequiredActionBarActivity
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
Recipient recipient = ((BlockedContactListItem)view).getRecipient();
|
||||
Intent intent = new Intent(getActivity(), RecipientPreferenceActivity.class);
|
||||
intent.putExtra(RecipientPreferenceActivity.RECIPIENT_ID, recipient.getId());
|
||||
|
||||
startActivity(intent);
|
||||
BlockUnblockDialog.showUnblockFor(requireContext(), getLifecycle(), recipient, () -> {
|
||||
RecipientUtil.unblock(requireContext(), recipient);
|
||||
LoaderManager.getInstance(this).restartLoader(0, null, this);
|
||||
});
|
||||
}
|
||||
|
||||
private static class BlockedContactAdapter extends CursorAdapter {
|
||||
@@ -143,7 +135,5 @@ public class BlockedContactsActivity extends PassphraseRequiredActionBarActivity
|
||||
((BlockedContactListItem) view).set(glideRequests, recipient);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.ContextThemeWrapper;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||
|
||||
public class ClearProfileAvatarActivity extends Activity {
|
||||
|
||||
private static final String ARG_TITLE = "arg_title";
|
||||
|
||||
public static Intent createForUserProfilePhoto() {
|
||||
return new Intent("org.thoughtcrime.securesms.action.CLEAR_PROFILE_PHOTO");
|
||||
}
|
||||
|
||||
public static Intent createForGroupProfilePhoto() {
|
||||
Intent intent = new Intent("org.thoughtcrime.securesms.action.CLEAR_PROFILE_PHOTO");
|
||||
intent.putExtra(ARG_TITLE, R.string.ClearProfileActivity_remove_group_photo);
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
int titleId = getIntent().getIntExtra(ARG_TITLE, R.string.ClearProfileActivity_remove_profile_photo);
|
||||
|
||||
new AlertDialog.Builder(new ContextThemeWrapper(this, DynamicTheme.isDarkTheme(this) ? R.style.TextSecure_DarkTheme : R.style.TextSecure_LightTheme))
|
||||
.setMessage(titleId)
|
||||
.setNegativeButton(android.R.string.cancel, (dialog, which) -> finish())
|
||||
.setPositiveButton(R.string.ClearProfileActivity_remove, (dialog, which) -> {
|
||||
Intent result = new Intent();
|
||||
result.putExtra("delete", true);
|
||||
setResult(Activity.RESULT_OK, result);
|
||||
finish();
|
||||
})
|
||||
.setOnCancelListener(dialog -> finish())
|
||||
.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,30 +3,29 @@ package org.thoughtcrime.securesms;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.database.Cursor;
|
||||
import android.os.AsyncTask;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.storage.TextSecureIdentityKeyStore;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.MessageDatabase;
|
||||
import org.thoughtcrime.securesms.database.MmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.MmsSmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.PushDatabase;
|
||||
import org.thoughtcrime.securesms.database.SmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.documents.IdentityKeyMismatch;
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobs.PushDecryptJob;
|
||||
import org.thoughtcrime.securesms.jobs.PushDecryptMessageJob;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.sms.MessageSender;
|
||||
import org.thoughtcrime.securesms.util.Base64;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.VerifySpan;
|
||||
import org.whispersystems.libsignal.SignalProtocolAddress;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
@@ -51,7 +50,7 @@ public class ConfirmIdentityDialog extends AlertDialog {
|
||||
super(context);
|
||||
|
||||
Recipient recipient = Recipient.resolved(mismatch.getRecipientId(context));
|
||||
String name = recipient.toShortString(context);
|
||||
String name = recipient.getDisplayName(context);
|
||||
String introduction = context.getString(R.string.ConfirmIdentityDialog_your_safety_number_with_s_has_changed, name, name);
|
||||
SpannableString spannableString = new SpannableString(introduction + " " +
|
||||
context.getString(R.string.ConfirmIdentityDialog_you_may_wish_to_verify_your_safety_number_with_this_contact));
|
||||
@@ -105,7 +104,6 @@ public class ConfirmIdentityDialog extends AlertDialog {
|
||||
}
|
||||
|
||||
processMessageRecord(messageRecord);
|
||||
processPendingMessageRecords(messageRecord.getThreadId(), mismatch);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -115,29 +113,9 @@ public class ConfirmIdentityDialog extends AlertDialog {
|
||||
else processIncomingMessageRecord(messageRecord);
|
||||
}
|
||||
|
||||
private void processPendingMessageRecords(long threadId, IdentityKeyMismatch mismatch) {
|
||||
MmsSmsDatabase mmsSmsDatabase = DatabaseFactory.getMmsSmsDatabase(getContext());
|
||||
Cursor cursor = mmsSmsDatabase.getIdentityConflictMessagesForThread(threadId);
|
||||
MmsSmsDatabase.Reader reader = mmsSmsDatabase.readerFor(cursor);
|
||||
MessageRecord record;
|
||||
|
||||
try {
|
||||
while ((record = reader.getNext()) != null) {
|
||||
for (IdentityKeyMismatch recordMismatch : record.getIdentityKeyMismatches()) {
|
||||
if (mismatch.equals(recordMismatch)) {
|
||||
processMessageRecord(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (reader != null)
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void processOutgoingMessageRecord(MessageRecord messageRecord) {
|
||||
SmsDatabase smsDatabase = DatabaseFactory.getSmsDatabase(getContext());
|
||||
MmsDatabase mmsDatabase = DatabaseFactory.getMmsDatabase(getContext());
|
||||
MessageDatabase smsDatabase = DatabaseFactory.getSmsDatabase(getContext());
|
||||
MessageDatabase mmsDatabase = DatabaseFactory.getMmsDatabase(getContext());
|
||||
|
||||
if (messageRecord.isMms()) {
|
||||
mmsDatabase.removeMismatchedIdentity(messageRecord.getId(),
|
||||
@@ -160,8 +138,8 @@ public class ConfirmIdentityDialog extends AlertDialog {
|
||||
|
||||
private void processIncomingMessageRecord(MessageRecord messageRecord) {
|
||||
try {
|
||||
PushDatabase pushDatabase = DatabaseFactory.getPushDatabase(getContext());
|
||||
SmsDatabase smsDatabase = DatabaseFactory.getSmsDatabase(getContext());
|
||||
PushDatabase pushDatabase = DatabaseFactory.getPushDatabase(getContext());
|
||||
MessageDatabase smsDatabase = DatabaseFactory.getSmsDatabase(getContext());
|
||||
|
||||
smsDatabase.removeMismatchedIdentity(messageRecord.getId(),
|
||||
mismatch.getRecipientId(getContext()),
|
||||
@@ -175,11 +153,13 @@ public class ConfirmIdentityDialog extends AlertDialog {
|
||||
messageRecord.getDateSent(),
|
||||
legacy ? Base64.decode(messageRecord.getBody()) : null,
|
||||
!legacy ? Base64.decode(messageRecord.getBody()) : null,
|
||||
0, null);
|
||||
0,
|
||||
0,
|
||||
null);
|
||||
|
||||
long pushId = pushDatabase.insert(envelope);
|
||||
|
||||
ApplicationDependencies.getJobManager().add(new PushDecryptJob(getContext(), pushId, messageRecord.getId()));
|
||||
ApplicationDependencies.getJobManager().add(new PushDecryptMessageJob(getContext(), pushId, messageRecord.getId()));
|
||||
} catch (IOException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
@@ -19,20 +19,18 @@ package org.thoughtcrime.securesms;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.thoughtcrime.securesms.components.ContactFilterToolbar;
|
||||
import org.thoughtcrime.securesms.contacts.ContactsCursorLoader.DisplayMode;
|
||||
import org.thoughtcrime.securesms.contacts.sync.DirectoryHelper;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -44,14 +42,16 @@ import java.lang.ref.WeakReference;
|
||||
* @author Moxie Marlinspike
|
||||
*
|
||||
*/
|
||||
public abstract class ContactSelectionActivity extends PassphraseRequiredActionBarActivity
|
||||
public abstract class ContactSelectionActivity extends PassphraseRequiredActivity
|
||||
implements SwipeRefreshLayout.OnRefreshListener,
|
||||
ContactSelectionListFragment.OnContactSelectedListener
|
||||
ContactSelectionListFragment.OnContactSelectedListener,
|
||||
ContactSelectionListFragment.ScrollCallback
|
||||
{
|
||||
private static final String TAG = ContactSelectionActivity.class.getSimpleName();
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
public static final String EXTRA_LAYOUT_RES_ID = "layout_res_id";
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
||||
|
||||
protected ContactSelectionListFragment contactsFragment;
|
||||
|
||||
@@ -60,18 +60,17 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB
|
||||
@Override
|
||||
protected void onPreCreate() {
|
||||
dynamicTheme.onCreate(this);
|
||||
dynamicLanguage.onCreate(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle icicle, boolean ready) {
|
||||
if (!getIntent().hasExtra(ContactSelectionListFragment.DISPLAY_MODE)) {
|
||||
int displayMode = TextSecurePreferences.isSmsEnabled(this) ? DisplayMode.FLAG_ALL
|
||||
: DisplayMode.FLAG_PUSH | DisplayMode.FLAG_ACTIVE_GROUPS | DisplayMode.FLAG_INACTIVE_GROUPS;
|
||||
: DisplayMode.FLAG_PUSH | DisplayMode.FLAG_ACTIVE_GROUPS | DisplayMode.FLAG_INACTIVE_GROUPS | DisplayMode.FLAG_SELF;
|
||||
getIntent().putExtra(ContactSelectionListFragment.DISPLAY_MODE, displayMode);
|
||||
}
|
||||
|
||||
setContentView(R.layout.contact_selection_activity);
|
||||
setContentView(getIntent().getIntExtra(EXTRA_LAYOUT_RES_ID, R.layout.contact_selection_activity));
|
||||
|
||||
initializeToolbar();
|
||||
initializeResources();
|
||||
@@ -82,7 +81,6 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
dynamicTheme.onResume(this);
|
||||
dynamicLanguage.onResume(this);
|
||||
}
|
||||
|
||||
protected ContactFilterToolbar getToolbar() {
|
||||
@@ -90,10 +88,9 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB
|
||||
}
|
||||
|
||||
private void initializeToolbar() {
|
||||
this.toolbar = ViewUtil.findById(this, R.id.toolbar);
|
||||
this.toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
assert getSupportActionBar() != null;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
getSupportActionBar().setIcon(null);
|
||||
@@ -116,11 +113,24 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContactSelected(Optional<RecipientId> recipientId, String number) {}
|
||||
public boolean onBeforeContactSelected(Optional<RecipientId> recipientId, String number) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContactDeselected(Optional<RecipientId> recipientId, String number) {}
|
||||
|
||||
@Override
|
||||
public void onBeginScroll() {
|
||||
hideKeyboard();
|
||||
}
|
||||
|
||||
private void hideKeyboard() {
|
||||
ServiceUtil.getInputMethodManager(this)
|
||||
.hideSoftInputFromWindow(toolbar.getWindowToken(), 0);
|
||||
toolbar.clearFocus();
|
||||
}
|
||||
|
||||
private static class RefreshDirectoryTask extends AsyncTask<Context, Void, Void> {
|
||||
|
||||
private final WeakReference<ContactSelectionActivity> activity;
|
||||
@@ -0,0 +1,646 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Open Whisper Systems
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.animation.LayoutTransition;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.CycleInterpolator;
|
||||
import android.widget.Button;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.Loader;
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.transition.AutoTransition;
|
||||
import androidx.transition.TransitionManager;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.chip.ChipGroup;
|
||||
import com.pnikosis.materialishprogress.ProgressWheel;
|
||||
|
||||
import org.thoughtcrime.securesms.components.RecyclerViewFastScroller;
|
||||
import org.thoughtcrime.securesms.contacts.ContactChip;
|
||||
import org.thoughtcrime.securesms.contacts.ContactSelectionListAdapter;
|
||||
import org.thoughtcrime.securesms.contacts.ContactSelectionListItem;
|
||||
import org.thoughtcrime.securesms.contacts.ContactsCursorLoader;
|
||||
import org.thoughtcrime.securesms.contacts.ContactsCursorLoader.DisplayMode;
|
||||
import org.thoughtcrime.securesms.contacts.SelectedContact;
|
||||
import org.thoughtcrime.securesms.contacts.sync.DirectoryHelper;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.recipients.LiveRecipient;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.StickyHeaderDecoration;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.UsernameUtil;
|
||||
import org.thoughtcrime.securesms.util.adapter.FixedViewsAdapter;
|
||||
import org.thoughtcrime.securesms.util.adapter.RecyclerViewConcatenateAdapterStickyHeader;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SimpleTask;
|
||||
import org.thoughtcrime.securesms.util.views.SimpleProgressDialog;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Fragment for selecting a one or more contacts from a list.
|
||||
*
|
||||
* @author Moxie Marlinspike
|
||||
*
|
||||
*/
|
||||
public final class ContactSelectionListFragment extends LoggingFragment
|
||||
implements LoaderManager.LoaderCallbacks<Cursor>
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = Log.tag(ContactSelectionListFragment.class);
|
||||
|
||||
private static final int CHIP_GROUP_EMPTY_CHILD_COUNT = 1;
|
||||
private static final int CHIP_GROUP_REVEAL_DURATION_MS = 150;
|
||||
|
||||
public static final int NO_LIMIT = Integer.MAX_VALUE;
|
||||
|
||||
public static final String DISPLAY_MODE = "display_mode";
|
||||
public static final String MULTI_SELECT = "multi_select";
|
||||
public static final String REFRESHABLE = "refreshable";
|
||||
public static final String RECENTS = "recents";
|
||||
public static final String SELECTION_LIMIT = "selection_limit";
|
||||
public static final String CURRENT_SELECTION = "current_selection";
|
||||
|
||||
private ConstraintLayout constraintLayout;
|
||||
private TextView emptyText;
|
||||
private OnContactSelectedListener onContactSelectedListener;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
private View showContactsLayout;
|
||||
private Button showContactsButton;
|
||||
private TextView showContactsDescription;
|
||||
private ProgressWheel showContactsProgress;
|
||||
private String cursorFilter;
|
||||
private RecyclerView recyclerView;
|
||||
private RecyclerViewFastScroller fastScroller;
|
||||
private ContactSelectionListAdapter cursorRecyclerViewAdapter;
|
||||
private ChipGroup chipGroup;
|
||||
private HorizontalScrollView chipGroupScrollContainer;
|
||||
private TextView groupLimit;
|
||||
|
||||
@Nullable private FixedViewsAdapter headerAdapter;
|
||||
@Nullable private FixedViewsAdapter footerAdapter;
|
||||
@Nullable private ListCallback listCallback;
|
||||
@Nullable private ScrollCallback scrollCallback;
|
||||
private GlideRequests glideRequests;
|
||||
private int selectionLimit;
|
||||
private Set<RecipientId> currentSelection;
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
if (context instanceof ListCallback) {
|
||||
listCallback = (ListCallback) context;
|
||||
}
|
||||
|
||||
if (context instanceof ScrollCallback) {
|
||||
scrollCallback = (ScrollCallback) context;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle icicle) {
|
||||
super.onActivityCreated(icicle);
|
||||
|
||||
initializeCursor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS)
|
||||
.ifNecessary()
|
||||
.onAllGranted(() -> {
|
||||
if (!TextSecurePreferences.hasSuccessfullyRetrievedDirectory(getActivity())) {
|
||||
handleContactPermissionGranted();
|
||||
} else {
|
||||
LoaderManager.getInstance(this).initLoader(0, null, this);
|
||||
}
|
||||
})
|
||||
.onAnyDenied(() -> {
|
||||
FragmentActivity activity = requireActivity();
|
||||
|
||||
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||
|
||||
if (activity.getIntent().getBooleanExtra(RECENTS, false)) {
|
||||
LoaderManager.getInstance(this).initLoader(0, null, ContactSelectionListFragment.this);
|
||||
} else {
|
||||
initializeNoContactsPermission();
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.contact_selection_list_fragment, container, false);
|
||||
|
||||
emptyText = view.findViewById(android.R.id.empty);
|
||||
recyclerView = view.findViewById(R.id.recycler_view);
|
||||
swipeRefresh = view.findViewById(R.id.swipe_refresh);
|
||||
fastScroller = view.findViewById(R.id.fast_scroller);
|
||||
showContactsLayout = view.findViewById(R.id.show_contacts_container);
|
||||
showContactsButton = view.findViewById(R.id.show_contacts_button);
|
||||
showContactsDescription = view.findViewById(R.id.show_contacts_description);
|
||||
showContactsProgress = view.findViewById(R.id.progress);
|
||||
chipGroup = view.findViewById(R.id.chipGroup);
|
||||
chipGroupScrollContainer = view.findViewById(R.id.chipGroupScrollContainer);
|
||||
groupLimit = view.findViewById(R.id.group_limit);
|
||||
constraintLayout = view.findViewById(R.id.container);
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setItemAnimator(new DefaultItemAnimator() {
|
||||
@Override
|
||||
public boolean canReuseUpdatedViewHolder(@NonNull RecyclerView.ViewHolder viewHolder) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
swipeRefresh.setEnabled(requireActivity().getIntent().getBooleanExtra(REFRESHABLE, true));
|
||||
|
||||
selectionLimit = requireActivity().getIntent().getIntExtra(SELECTION_LIMIT, NO_LIMIT);
|
||||
currentSelection = getCurrentSelection();
|
||||
|
||||
updateGroupLimit(getChipCount());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private void updateGroupLimit(int chipCount) {
|
||||
if (selectionLimit != NO_LIMIT) {
|
||||
groupLimit.setText(String.format(Locale.getDefault(), "%d/%d", currentSelection.size() + chipCount, selectionLimit));
|
||||
groupLimit.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
groupLimit.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
public @NonNull List<SelectedContact> getSelectedContacts() {
|
||||
if (cursorRecyclerViewAdapter == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return cursorRecyclerViewAdapter.getSelectedContacts();
|
||||
}
|
||||
|
||||
public int getSelectedContactsCount() {
|
||||
if (cursorRecyclerViewAdapter == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cursorRecyclerViewAdapter.getSelectedContactsCount();
|
||||
}
|
||||
|
||||
private Set<RecipientId> getCurrentSelection() {
|
||||
List<RecipientId> currentSelection = requireActivity().getIntent().getParcelableArrayListExtra(CURRENT_SELECTION);
|
||||
|
||||
return currentSelection == null ? Collections.emptySet()
|
||||
: Collections.unmodifiableSet(Stream.of(currentSelection).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
public boolean isMulti() {
|
||||
return requireActivity().getIntent().getBooleanExtra(MULTI_SELECT, false);
|
||||
}
|
||||
|
||||
private void initializeCursor() {
|
||||
glideRequests = GlideApp.with(this);
|
||||
|
||||
cursorRecyclerViewAdapter = new ContactSelectionListAdapter(requireContext(),
|
||||
glideRequests,
|
||||
null,
|
||||
new ListClickListener(),
|
||||
isMulti(),
|
||||
currentSelection);
|
||||
|
||||
RecyclerViewConcatenateAdapterStickyHeader concatenateAdapter = new RecyclerViewConcatenateAdapterStickyHeader();
|
||||
|
||||
if (listCallback != null) {
|
||||
headerAdapter = new FixedViewsAdapter(createNewGroupItem(listCallback));
|
||||
headerAdapter.hide();
|
||||
concatenateAdapter.addAdapter(headerAdapter);
|
||||
}
|
||||
|
||||
concatenateAdapter.addAdapter(cursorRecyclerViewAdapter);
|
||||
|
||||
if (listCallback != null) {
|
||||
footerAdapter = new FixedViewsAdapter(createInviteActionView(listCallback));
|
||||
footerAdapter.hide();
|
||||
concatenateAdapter.addAdapter(footerAdapter);
|
||||
}
|
||||
|
||||
recyclerView.setAdapter(concatenateAdapter);
|
||||
recyclerView.addItemDecoration(new StickyHeaderDecoration(concatenateAdapter, true, true));
|
||||
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
|
||||
if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
|
||||
if (scrollCallback != null) {
|
||||
scrollCallback.onBeginScroll();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private View createInviteActionView(@NonNull ListCallback listCallback) {
|
||||
View view = LayoutInflater.from(requireContext())
|
||||
.inflate(R.layout.contact_selection_invite_action_item, (ViewGroup) requireView(), false);
|
||||
view.setOnClickListener(v -> listCallback.onInvite());
|
||||
return view;
|
||||
}
|
||||
|
||||
private View createNewGroupItem(@NonNull ListCallback listCallback) {
|
||||
View view = LayoutInflater.from(requireContext())
|
||||
.inflate(R.layout.contact_selection_new_group_item, (ViewGroup) requireView(), false);
|
||||
view.setOnClickListener(v -> listCallback.onNewGroup(false));
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initializeNoContactsPermission() {
|
||||
swipeRefresh.setVisibility(View.GONE);
|
||||
|
||||
showContactsLayout.setVisibility(View.VISIBLE);
|
||||
showContactsProgress.setVisibility(View.INVISIBLE);
|
||||
showContactsDescription.setText(R.string.contact_selection_list_fragment__signal_needs_access_to_your_contacts_in_order_to_display_them);
|
||||
showContactsButton.setVisibility(View.VISIBLE);
|
||||
|
||||
showContactsButton.setOnClickListener(v -> {
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS)
|
||||
.ifNecessary()
|
||||
.withPermanentDenialDialog(getString(R.string.ContactSelectionListFragment_signal_requires_the_contacts_permission_in_order_to_display_your_contacts))
|
||||
.onSomeGranted(permissions -> {
|
||||
if (permissions.contains(Manifest.permission.WRITE_CONTACTS)) {
|
||||
handleContactPermissionGranted();
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
});
|
||||
}
|
||||
|
||||
public void setQueryFilter(String filter) {
|
||||
this.cursorFilter = filter;
|
||||
LoaderManager.getInstance(this).restartLoader(0, null, this);
|
||||
}
|
||||
|
||||
public void resetQueryFilter() {
|
||||
setQueryFilter(null);
|
||||
swipeRefresh.setRefreshing(false);
|
||||
}
|
||||
|
||||
public boolean hasQueryFilter() {
|
||||
return !TextUtils.isEmpty(cursorFilter);
|
||||
}
|
||||
|
||||
public void setRefreshing(boolean refreshing) {
|
||||
swipeRefresh.setRefreshing(refreshing);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
cursorRecyclerViewAdapter.clearSelectedContacts();
|
||||
|
||||
if (!isDetached() && !isRemoving() && getActivity() != null && !getActivity().isFinishing()) {
|
||||
LoaderManager.getInstance(this).restartLoader(0, null, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
||||
FragmentActivity activity = requireActivity();
|
||||
return new ContactsCursorLoader(activity,
|
||||
activity.getIntent().getIntExtra(DISPLAY_MODE, DisplayMode.FLAG_ALL),
|
||||
cursorFilter, activity.getIntent().getBooleanExtra(RECENTS, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(@NonNull Loader<Cursor> loader, @Nullable Cursor data) {
|
||||
swipeRefresh.setVisibility(View.VISIBLE);
|
||||
showContactsLayout.setVisibility(View.GONE);
|
||||
|
||||
cursorRecyclerViewAdapter.changeCursor(data);
|
||||
|
||||
if (footerAdapter != null) {
|
||||
footerAdapter.show();
|
||||
}
|
||||
|
||||
if (headerAdapter != null) {
|
||||
if (TextUtils.isEmpty(cursorFilter)) {
|
||||
headerAdapter.show();
|
||||
} else {
|
||||
headerAdapter.hide();
|
||||
}
|
||||
}
|
||||
|
||||
emptyText.setText(R.string.contact_selection_group_activity__no_contacts);
|
||||
boolean useFastScroller = data != null && data.getCount() > 20;
|
||||
recyclerView.setVerticalScrollBarEnabled(!useFastScroller);
|
||||
if (useFastScroller) {
|
||||
fastScroller.setVisibility(View.VISIBLE);
|
||||
fastScroller.setRecyclerView(recyclerView);
|
||||
} else {
|
||||
fastScroller.setRecyclerView(null);
|
||||
fastScroller.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(@NonNull Loader<Cursor> loader) {
|
||||
cursorRecyclerViewAdapter.changeCursor(null);
|
||||
fastScroller.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private void handleContactPermissionGranted() {
|
||||
final Context context = requireContext();
|
||||
|
||||
new AsyncTask<Void, Void, Boolean>() {
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
swipeRefresh.setVisibility(View.GONE);
|
||||
showContactsLayout.setVisibility(View.VISIBLE);
|
||||
showContactsButton.setVisibility(View.INVISIBLE);
|
||||
showContactsDescription.setText(R.string.ConversationListFragment_loading);
|
||||
showContactsProgress.setVisibility(View.VISIBLE);
|
||||
showContactsProgress.spin();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... voids) {
|
||||
try {
|
||||
DirectoryHelper.refreshDirectory(context, false);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
if (result) {
|
||||
showContactsLayout.setVisibility(View.GONE);
|
||||
swipeRefresh.setVisibility(View.VISIBLE);
|
||||
reset();
|
||||
} else {
|
||||
Toast.makeText(getContext(), R.string.ContactSelectionListFragment_error_retrieving_contacts_check_your_network_connection, Toast.LENGTH_LONG).show();
|
||||
initializeNoContactsPermission();
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
private class ListClickListener implements ContactSelectionListAdapter.ItemClickListener {
|
||||
@Override
|
||||
public void onItemClick(ContactSelectionListItem contact) {
|
||||
SelectedContact selectedContact = contact.isUsernameType() ? SelectedContact.forUsername(contact.getRecipientId().orNull(), contact.getNumber())
|
||||
: SelectedContact.forPhone(contact.getRecipientId().orNull(), contact.getNumber());
|
||||
|
||||
if (isMulti() && Recipient.self().getId().equals(selectedContact.getOrCreateRecipientId(requireContext()))) {
|
||||
Toast.makeText(requireContext(), R.string.ContactSelectionListFragment_you_do_not_need_to_add_yourself_to_the_group, Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isMulti() || !cursorRecyclerViewAdapter.isSelectedContact(selectedContact)) {
|
||||
if (selectionLimitReached()) {
|
||||
Toast.makeText(requireContext(), R.string.ContactSelectionListFragment_the_group_is_full, Toast.LENGTH_SHORT).show();
|
||||
groupLimit.animate().scaleX(1.3f).scaleY(1.3f).setInterpolator(new CycleInterpolator(0.5f)).start();
|
||||
return;
|
||||
}
|
||||
|
||||
if (contact.isUsernameType()) {
|
||||
AlertDialog loadingDialog = SimpleProgressDialog.show(requireContext());
|
||||
|
||||
SimpleTask.run(getViewLifecycleOwner().getLifecycle(), () -> {
|
||||
return UsernameUtil.fetchUuidForUsername(requireContext(), contact.getNumber());
|
||||
}, uuid -> {
|
||||
loadingDialog.dismiss();
|
||||
if (uuid.isPresent()) {
|
||||
Recipient recipient = Recipient.externalUsername(requireContext(), uuid.get(), contact.getNumber());
|
||||
SelectedContact selected = SelectedContact.forUsername(recipient.getId(), contact.getNumber());
|
||||
|
||||
if (onContactSelectedListener != null) {
|
||||
if (onContactSelectedListener.onBeforeContactSelected(Optional.of(recipient.getId()), null)) {
|
||||
markContactSelected(selected);
|
||||
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
|
||||
}
|
||||
} else {
|
||||
markContactSelected(selected);
|
||||
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
|
||||
}
|
||||
} else {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
.setTitle(R.string.ContactSelectionListFragment_username_not_found)
|
||||
.setMessage(getString(R.string.ContactSelectionListFragment_s_is_not_a_signal_user, contact.getNumber()))
|
||||
.setPositiveButton(R.string.ContactSelectionListFragment_okay, (dialog, which) -> dialog.dismiss())
|
||||
.show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (onContactSelectedListener != null) {
|
||||
if (onContactSelectedListener.onBeforeContactSelected(contact.getRecipientId(), contact.getNumber())) {
|
||||
markContactSelected(selectedContact);
|
||||
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
|
||||
}
|
||||
} else {
|
||||
markContactSelected(selectedContact);
|
||||
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
markContactUnselected(selectedContact);
|
||||
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
|
||||
|
||||
if (onContactSelectedListener != null) {
|
||||
onContactSelectedListener.onContactDeselected(contact.getRecipientId(), contact.getNumber());
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
private boolean selectionLimitReached() {
|
||||
return getChipCount() + currentSelection.size() >= selectionLimit;
|
||||
}
|
||||
|
||||
private void markContactSelected(@NonNull SelectedContact selectedContact) {
|
||||
cursorRecyclerViewAdapter.addSelectedContact(selectedContact);
|
||||
if (isMulti()) {
|
||||
addChipForSelectedContact(selectedContact);
|
||||
}
|
||||
}
|
||||
|
||||
private void markContactUnselected(@NonNull SelectedContact selectedContact) {
|
||||
cursorRecyclerViewAdapter.removeFromSelectedContacts(selectedContact);
|
||||
cursorRecyclerViewAdapter.notifyItemRangeChanged(0, cursorRecyclerViewAdapter.getItemCount(), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
|
||||
removeChipForContact(selectedContact);
|
||||
}
|
||||
|
||||
private void removeChipForContact(@NonNull SelectedContact contact) {
|
||||
for (int i = chipGroup.getChildCount() - 1; i >= 0; i--) {
|
||||
View v = chipGroup.getChildAt(i);
|
||||
if (v instanceof ContactChip && contact.matches(((ContactChip) v).getContact())) {
|
||||
chipGroup.removeView(v);
|
||||
}
|
||||
}
|
||||
|
||||
updateGroupLimit(getChipCount());
|
||||
|
||||
if (getChipCount() == 0) {
|
||||
setChipGroupVisibility(ConstraintSet.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void addChipForSelectedContact(@NonNull SelectedContact selectedContact) {
|
||||
SimpleTask.run(getViewLifecycleOwner().getLifecycle(),
|
||||
() -> Recipient.resolved(selectedContact.getOrCreateRecipientId(requireContext())),
|
||||
resolved -> addChipForRecipient(resolved, selectedContact));
|
||||
}
|
||||
|
||||
private void addChipForRecipient(@NonNull Recipient recipient, @NonNull SelectedContact selectedContact) {
|
||||
final ContactChip chip = new ContactChip(requireContext());
|
||||
|
||||
if (getChipCount() == 0) {
|
||||
setChipGroupVisibility(ConstraintSet.VISIBLE);
|
||||
}
|
||||
|
||||
chip.setText(recipient.getShortDisplayName(requireContext()));
|
||||
chip.setContact(selectedContact);
|
||||
chip.setCloseIconVisible(true);
|
||||
chip.setOnCloseIconClickListener(view -> {
|
||||
markContactUnselected(selectedContact);
|
||||
|
||||
if (onContactSelectedListener != null) {
|
||||
onContactSelectedListener.onContactDeselected(Optional.of(recipient.getId()), recipient.getE164().orNull());
|
||||
}
|
||||
});
|
||||
|
||||
chipGroup.getLayoutTransition().addTransitionListener(new LayoutTransition.TransitionListener() {
|
||||
@Override
|
||||
public void startTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) {
|
||||
if (view == chip && transitionType == LayoutTransition.APPEARING) {
|
||||
chipGroup.getLayoutTransition().removeTransitionListener(this);
|
||||
registerChipRecipientObserver(chip, recipient.live());
|
||||
chipGroup.post(ContactSelectionListFragment.this::smoothScrollChipsToEnd);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
chip.setAvatar(glideRequests, recipient, () -> addChip(chip));
|
||||
}
|
||||
|
||||
private void addChip(@NonNull ContactChip chip) {
|
||||
chipGroup.addView(chip);
|
||||
updateGroupLimit(getChipCount());
|
||||
}
|
||||
|
||||
private int getChipCount() {
|
||||
int count = chipGroup.getChildCount() - CHIP_GROUP_EMPTY_CHILD_COUNT;
|
||||
if (count < 0) throw new AssertionError();
|
||||
return count;
|
||||
}
|
||||
|
||||
private void registerChipRecipientObserver(@NonNull ContactChip chip, @Nullable LiveRecipient recipient) {
|
||||
if (recipient != null) {
|
||||
recipient.observe(getViewLifecycleOwner(), resolved -> {
|
||||
if (chip.isAttachedToWindow()) {
|
||||
chip.setAvatar(glideRequests, resolved, null);
|
||||
chip.setText(resolved.getShortDisplayName(chip.getContext()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void setChipGroupVisibility(int visibility) {
|
||||
TransitionManager.beginDelayedTransition(constraintLayout, new AutoTransition().setDuration(CHIP_GROUP_REVEAL_DURATION_MS));
|
||||
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
constraintSet.clone(constraintLayout);
|
||||
constraintSet.setVisibility(R.id.chipGroupScrollContainer, visibility);
|
||||
constraintSet.applyTo(constraintLayout);
|
||||
}
|
||||
|
||||
public void setOnContactSelectedListener(OnContactSelectedListener onContactSelectedListener) {
|
||||
this.onContactSelectedListener = onContactSelectedListener;
|
||||
}
|
||||
|
||||
public void setOnRefreshListener(SwipeRefreshLayout.OnRefreshListener onRefreshListener) {
|
||||
this.swipeRefresh.setOnRefreshListener(onRefreshListener);
|
||||
}
|
||||
|
||||
private void smoothScrollChipsToEnd() {
|
||||
int x = chipGroupScrollContainer.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR ? chipGroup.getWidth() : 0;
|
||||
chipGroupScrollContainer.smoothScrollTo(x, 0);
|
||||
}
|
||||
|
||||
public interface OnContactSelectedListener {
|
||||
/** @return True if the contact is allowed to be selected, otherwise false. */
|
||||
boolean onBeforeContactSelected(Optional<RecipientId> recipientId, String number);
|
||||
void onContactDeselected(Optional<RecipientId> recipientId, String number);
|
||||
}
|
||||
|
||||
public interface ListCallback {
|
||||
void onInvite();
|
||||
void onNewGroup(boolean forceV1);
|
||||
}
|
||||
|
||||
public interface ScrollCallback {
|
||||
void onBeginScroll();
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import org.thoughtcrime.securesms.database.SmsMigrator.ProgressDescription;
|
||||
import org.thoughtcrime.securesms.service.ApplicationMigrationService;
|
||||
import org.thoughtcrime.securesms.service.ApplicationMigrationService.ImportState;
|
||||
|
||||
public class DatabaseMigrationActivity extends PassphraseRequiredActionBarActivity {
|
||||
public class DatabaseMigrationActivity extends PassphraseRequiredActivity {
|
||||
|
||||
private final ImportServiceConnection serviceConnection = new ImportServiceConnection();
|
||||
private final ImportStateHandler importStateHandler = new ImportStateHandler();
|
||||
@@ -23,7 +23,6 @@ import org.thoughtcrime.securesms.crypto.ProfileKeyUtil;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.push.AccountManagerFactory;
|
||||
import org.thoughtcrime.securesms.qr.ScanListener;
|
||||
import org.thoughtcrime.securesms.util.Base64;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
@@ -42,7 +41,7 @@ import org.whispersystems.signalservice.internal.push.DeviceLimitExceededExcepti
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class DeviceActivity extends PassphraseRequiredActionBarActivity
|
||||
public class DeviceActivity extends PassphraseRequiredActivity
|
||||
implements Button.OnClickListener, ScanListener, DeviceLinkFragment.LinkClickedListener
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewAnimationUtils;
|
||||
@@ -20,7 +20,7 @@ import org.thoughtcrime.securesms.qr.ScanListener;
|
||||
import org.thoughtcrime.securesms.qr.ScanningThread;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
public class DeviceAddFragment extends Fragment {
|
||||
public class DeviceAddFragment extends LoggingFragment {
|
||||
|
||||
private ViewGroup container;
|
||||
private LinearLayout overlay;
|
||||
@@ -53,7 +53,7 @@ public class DeviceListFragment extends ListFragment
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.locale = (Locale) getArguments().getSerializable(PassphraseRequiredActionBarActivity.LOCALE_EXTRA);
|
||||
this.locale = (Locale) getArguments().getSerializable(PassphraseRequiredActivity.LOCALE_EXTRA);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,25 +164,29 @@ public class DeviceListFragment extends ListFragment
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private void handleDisconnectDevice(final long deviceId) {
|
||||
new ProgressDialogAsyncTask<Void, Void, Void>(getActivity(),
|
||||
R.string.DeviceListActivity_unlinking_device_no_ellipsis,
|
||||
R.string.DeviceListActivity_unlinking_device)
|
||||
new ProgressDialogAsyncTask<Void, Void, Boolean>(getActivity(),
|
||||
R.string.DeviceListActivity_unlinking_device_no_ellipsis,
|
||||
R.string.DeviceListActivity_unlinking_device)
|
||||
{
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
protected Boolean doInBackground(Void... params) {
|
||||
try {
|
||||
accountManager.removeDevice(deviceId);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
Toast.makeText(getActivity(), R.string.DeviceListActivity_network_failed, Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
protected void onPostExecute(Boolean result) {
|
||||
super.onPostExecute(result);
|
||||
getLoaderManager().restartLoader(0, null, DeviceListFragment.this);
|
||||
if (result) {
|
||||
getLoaderManager().restartLoader(0, null, DeviceListFragment.this);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), R.string.DeviceListActivity_network_failed, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import android.os.Bundle;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import android.view.Window;
|
||||
|
||||
public class DeviceProvisioningActivity extends PassphraseRequiredActionBarActivity {
|
||||
public class DeviceProvisioningActivity extends PassphraseRequiredActivity {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = DeviceProvisioningActivity.class.getSimpleName();
|
||||
@@ -17,9 +17,6 @@ public class DeviceProvisioningActivity extends PassphraseRequiredActionBarActiv
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle bundle, boolean ready) {
|
||||
assert getSupportActionBar() != null;
|
||||
getSupportActionBar().hide();
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(getString(R.string.DeviceProvisioningActivity_link_a_signal_device))
|
||||
.setMessage(getString(R.string.DeviceProvisioningActivity_it_looks_like_youre_trying_to_link_a_signal_device_using_a_3rd_party_scanner))
|
||||
@@ -29,7 +26,7 @@ public class DeviceProvisioningActivity extends PassphraseRequiredActionBarActiv
|
||||
startActivity(intent);
|
||||
finish();
|
||||
})
|
||||
.setNegativeButton(R.string.DeviceProvisioningActivity_cancel, (dialog12, which) -> {
|
||||
.setNegativeButton(android.R.string.cancel, (dialog12, which) -> {
|
||||
dialog12.dismiss();
|
||||
finish();
|
||||
})
|
||||
@@ -1,14 +1,17 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import org.thoughtcrime.securesms.util.ExpirationUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import cn.carbswang.android.numberpickerview.library.NumberPickerView;
|
||||
|
||||
public class ExpirationDialog extends AlertDialog {
|
||||
@@ -36,7 +39,7 @@ public class ExpirationDialog extends AlertDialog {
|
||||
builder.setView(view);
|
||||
builder.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
int selected = ((NumberPickerView)view.findViewById(R.id.expiration_number_picker)).getValue();
|
||||
listener.onClick(context.getResources().getIntArray(R.array.expiration_times)[selected]);
|
||||
listener.onClick(getExpirationTimes(context, currentExpiration)[selected]);
|
||||
});
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.show();
|
||||
@@ -47,7 +50,7 @@ public class ExpirationDialog extends AlertDialog {
|
||||
final View view = inflater.inflate(R.layout.expiration_dialog, null);
|
||||
final NumberPickerView numberPickerView = view.findViewById(R.id.expiration_number_picker);
|
||||
final TextView textView = view.findViewById(R.id.expiration_details);
|
||||
final int[] expirationTimes = context.getResources().getIntArray(R.array.expiration_times);
|
||||
final int[] expirationTimes = getExpirationTimes(context, currentExpiration);
|
||||
final String[] expirationDisplayValues = new String[expirationTimes.length];
|
||||
|
||||
int selectedIndex = expirationTimes.length - 1;
|
||||
@@ -80,6 +83,19 @@ public class ExpirationDialog extends AlertDialog {
|
||||
return view;
|
||||
}
|
||||
|
||||
private static int[] getExpirationTimes(Context context, int currentExpiration) {
|
||||
int[] expirationTimes = context.getResources().getIntArray(R.array.expiration_times);
|
||||
int location = Arrays.binarySearch(expirationTimes, currentExpiration);
|
||||
if (location < 0) {
|
||||
int[] temp = Arrays.copyOf(expirationTimes, expirationTimes.length + 1);
|
||||
temp[temp.length - 1] = currentExpiration;
|
||||
Arrays.sort(temp);
|
||||
expirationTimes = temp;
|
||||
}
|
||||
|
||||
return expirationTimes;
|
||||
}
|
||||
|
||||
public interface OnClickListener {
|
||||
public void onClick(int expirationTime);
|
||||
}
|
||||