Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bde010b84b | ||
|
|
86eeff2843 | ||
|
|
d850108f6c | ||
|
|
f5b356cdf6 | ||
|
|
62534afba7 | ||
|
|
9667eb61a2 | ||
|
|
5582a51520 | ||
|
|
558fa2273a | ||
|
|
6e9702ab1f | ||
|
|
4a7071562b | ||
|
|
44625a08e4 | ||
|
|
5a8f0f64a0 | ||
|
|
63b057d7de | ||
|
|
aef131e98c | ||
|
|
3b403fc094 | ||
|
|
78833ef911 | ||
|
|
599566363e | ||
|
|
5dabec67bf | ||
|
|
f2f5e64eba | ||
|
|
bd3e065730 | ||
|
|
7e1424a88c | ||
|
|
a623fc5094 | ||
|
|
f8bc2a7a31 | ||
|
|
0cdcf970c6 | ||
|
|
41b365234a | ||
|
|
087ed97e1a | ||
|
|
b16d996c87 | ||
|
|
711508ec29 | ||
|
|
2b169ef74b | ||
|
|
6542334c4e | ||
|
|
b5f357819f | ||
|
|
ce14d3116c | ||
|
|
f8601fc9db | ||
|
|
eb727d4f12 | ||
|
|
6ecc023708 | ||
|
|
b784d84121 | ||
|
|
79da94ad62 | ||
|
|
19761b2474 | ||
|
|
090cfb5087 | ||
|
|
00c2702e77 | ||
|
|
9c439e8f87 | ||
|
|
1f97a53caa | ||
|
|
c28ee84781 | ||
|
|
3a1339ece4 | ||
|
|
a003c4b953 | ||
|
|
9dd7b5fef9 | ||
|
|
6681f447db | ||
|
|
8c9af3ca91 | ||
|
|
d572179d74 | ||
|
|
ef8789d2a7 | ||
|
|
8f49110b1a | ||
|
|
2340870c30 | ||
|
|
d8128d82c4 | ||
|
|
13523a0ed3 | ||
|
|
a2f16a6b94 | ||
|
|
a7130d2515 | ||
|
|
9a71255e68 | ||
|
|
5c56014f89 | ||
|
|
5676e0435b | ||
|
|
233b4a0e63 | ||
|
|
4af1a57723 | ||
|
|
f21f4eff22 | ||
|
|
1ea191fc59 | ||
|
|
f9d9a18b87 | ||
|
|
07cc2fc7e7 | ||
|
|
bc80cac6b8 | ||
|
|
c4c6b8d2c6 | ||
|
|
ae71d59b7f | ||
|
|
7ae10a4e66 | ||
|
|
a038c2c837 | ||
|
|
2e4a43eecd | ||
|
|
5b0a35204f | ||
|
|
b584ab79d2 | ||
|
|
bf86cf6a41 | ||
|
|
5b64410074 | ||
|
|
ff116e9527 | ||
|
|
f4dec19e28 | ||
|
|
023bd57f8a | ||
|
|
1f9c49bb70 | ||
|
|
38b0a91a00 | ||
|
|
c6de05dcb2 | ||
|
|
bf6e11f55c | ||
|
|
f4f53cf254 | ||
|
|
aac5514c03 | ||
|
|
6d92a87a50 | ||
|
|
414b31c507 | ||
|
|
54bf33423a | ||
|
|
ffe3ca5a55 | ||
|
|
838c266502 | ||
|
|
860e8e7ff4 | ||
|
|
904d89712f | ||
|
|
3dea959d5e | ||
|
|
7df8f8ba45 | ||
|
|
3e6d01965b | ||
|
|
c408370deb | ||
|
|
136c7d8aa3 | ||
|
|
fff0ca1be1 | ||
|
|
d266c209a6 | ||
|
|
246a0bd3b2 | ||
|
|
bf99c2d929 | ||
|
|
f2a1608883 | ||
|
|
cd0b0fb552 | ||
|
|
e496f6379b | ||
|
|
c37a933a19 | ||
|
|
4474f8a9bf | ||
|
|
67239482ec | ||
|
|
8bb292a3a9 | ||
|
|
220bcfdb0a | ||
|
|
d1053ac37f | ||
|
|
358f8bc6bc | ||
|
|
005beb1e81 | ||
|
|
74b2287e34 | ||
|
|
3ba52bec36 | ||
|
|
656653fffa | ||
|
|
5561ab8e92 | ||
|
|
5f7b25f8a1 | ||
|
|
b8d6cb0657 | ||
|
|
11007b50ab | ||
|
|
217afa5bb0 | ||
|
|
da862a2c59 | ||
|
|
e3b1487ce5 | ||
|
|
5afa099d3b | ||
|
|
f8561d883f | ||
|
|
b34c0d1c98 | ||
|
|
0fe1cb0e58 | ||
|
|
91e152c7fb | ||
|
|
ed5d969c6e | ||
|
|
0d78339bb5 | ||
|
|
7440ab8d2c | ||
|
|
6be9c49c8b | ||
|
|
91fa1397f5 | ||
|
|
8554770ad0 | ||
|
|
6a34cf4d2c | ||
|
|
cdf6757f11 | ||
|
|
1ce6a61e99 | ||
|
|
0fce9555fe | ||
|
|
c35b5723c4 | ||
|
|
f3a5860d59 | ||
|
|
1ecb52bcf2 | ||
|
|
005be93ccb | ||
|
|
01d05861d9 | ||
|
|
1a4384deba | ||
|
|
a3dc394c79 | ||
|
|
d00a496be4 | ||
|
|
f208e3d4e9 | ||
|
|
88abcc07d0 | ||
|
|
5a19c3f321 | ||
|
|
4fb4ff4280 | ||
|
|
213f2c597e | ||
|
|
03c33a9207 | ||
|
|
918895a70d | ||
|
|
7518450626 | ||
|
|
a7576c42cf | ||
|
|
cfddd6b856 | ||
|
|
4b4d76eb19 | ||
|
|
b4e9ecbf49 | ||
|
|
77947fb6bd | ||
|
|
94f9f65a7d | ||
|
|
941239c19a | ||
|
|
6ca671ad85 | ||
|
|
4c6d9738b0 | ||
|
|
95b788a772 | ||
|
|
120d8887d6 | ||
|
|
db96ceec25 | ||
|
|
1dcff6b609 | ||
|
|
a06d9ee94b | ||
|
|
51bec2f7b9 | ||
|
|
5b558b13fa | ||
|
|
8671252285 | ||
|
|
083b19a96e | ||
|
|
485ec04094 | ||
|
|
8f1955b38e | ||
|
|
dc91c94c07 | ||
|
|
55ddb391f0 | ||
|
|
24204d50d1 | ||
|
|
da1587ae7d | ||
|
|
0f2ffd5a9d | ||
|
|
e4e1fe76c5 | ||
|
|
4737ee286c | ||
|
|
d396bbf772 | ||
|
|
0b96ae76f4 | ||
|
|
8f3d37364f | ||
|
|
7c7447d989 | ||
|
|
9b8cd0bca4 | ||
|
|
44712da72f | ||
|
|
869c4a91e7 | ||
|
|
79caeb24e7 | ||
|
|
6624f2fb6e | ||
|
|
40bf0911c6 | ||
|
|
4b81e6a1b3 | ||
|
|
3bf5eaf35f | ||
|
|
9de8f71fa1 | ||
|
|
20790bc22e | ||
|
|
eaebc1235e | ||
|
|
5b6ad9add1 | ||
|
|
e1feb49fe1 | ||
|
|
411bbd02cf | ||
|
|
2860d4cbed | ||
|
|
750bfbc3c4 | ||
|
|
60fe6fd04a | ||
|
|
6a2193de8d | ||
|
|
8a36f720e5 | ||
|
|
1e63423397 | ||
|
|
7532bced49 | ||
|
|
cb090dd2f1 | ||
|
|
43323e1669 | ||
|
|
50c951cbe7 | ||
|
|
be71ee0ea1 | ||
|
|
072480b58d | ||
|
|
93f52c463d | ||
|
|
d9e3a83446 | ||
|
|
89e92e276c | ||
|
|
17cfcefae5 | ||
|
|
97ec3464fe | ||
|
|
3e79e4f026 | ||
|
|
a5af94d986 | ||
|
|
2394230a7b | ||
|
|
ac4bcc7a72 | ||
|
|
f92c6b9170 | ||
|
|
ca362c250d | ||
|
|
8475a041fb | ||
|
|
26e3c606b5 | ||
|
|
fe794f5a40 | ||
|
|
2a2380c4dd | ||
|
|
5584ae8bd7 | ||
|
|
fbdc024092 | ||
|
|
d0e9a86ca0 | ||
|
|
c5f0174016 | ||
|
|
a90f71e600 | ||
|
|
3527b2b7f7 | ||
|
|
ee1886cc96 | ||
|
|
b7089df901 | ||
|
|
db8940f6f7 | ||
|
|
cc4d340bd5 | ||
|
|
aae0eac155 | ||
|
|
c74130b89b | ||
|
|
df847a3f38 | ||
|
|
6e91162494 | ||
|
|
73411d5f09 | ||
|
|
5fb2f37170 | ||
|
|
d29e120f31 | ||
|
|
6188e7e05d | ||
|
|
29478a394b | ||
|
|
79fb99febc | ||
|
|
41e20972e2 | ||
|
|
023cd0a549 | ||
|
|
dc41a2f7f0 | ||
|
|
a127eac5e6 | ||
|
|
454fb0a547 | ||
|
|
492d70345e | ||
|
|
0a27760872 | ||
|
|
55ea5b43bf | ||
|
|
70c5da0b96 | ||
|
|
84392c8b04 | ||
|
|
6354538bd4 | ||
|
|
8966afd43a | ||
|
|
3022591419 | ||
|
|
2393e38542 | ||
|
|
53b4df7bf8 | ||
|
|
839a61e08f | ||
|
|
6149835cbb | ||
|
|
b5ab5402d6 | ||
|
|
9ea1393008 | ||
|
|
114bc67dec | ||
|
|
64113cf6a1 | ||
|
|
5ebfa13be5 | ||
|
|
5d641b4e32 | ||
|
|
7af48266bc | ||
|
|
e851ef5044 | ||
|
|
939877252d | ||
|
|
1c19cbb392 | ||
|
|
64a75d821b | ||
|
|
b67c086a71 | ||
|
|
6cd4f956f1 | ||
|
|
f6d09ff6c7 | ||
|
|
ad43cf6e31 | ||
|
|
d9882c916b | ||
|
|
bb272a71d0 | ||
|
|
82ee8b8627 | ||
|
|
a285f5d46c | ||
|
|
95628f4449 | ||
|
|
8dce69087f | ||
|
|
ffb61f3e72 | ||
|
|
6f9ac654c5 | ||
|
|
4b9985303b | ||
|
|
32385007b4 | ||
|
|
2ddff919e4 | ||
|
|
220a869e93 | ||
|
|
2fa0687493 | ||
|
|
c40d5e5605 | ||
|
|
ba81710bc3 | ||
|
|
e3b33c31e0 | ||
|
|
686fc49db8 | ||
|
|
3c2e49e2c9 | ||
|
|
810da6abd6 | ||
|
|
32e677a151 | ||
|
|
9582b3ea86 | ||
|
|
51d7ea8cd6 | ||
|
|
22641967d2 | ||
|
|
cea480a772 | ||
|
|
ef427144d6 | ||
|
|
ec383d2aed | ||
|
|
77ecec4531 | ||
|
|
d00cc5150f | ||
|
|
5fc395850a | ||
|
|
8971dc1442 | ||
|
|
38859e5bce | ||
|
|
6311d69c61 | ||
|
|
10b4cb8caf | ||
|
|
627106c18f | ||
|
|
b3bfa8641e | ||
|
|
cf6dccc835 | ||
|
|
d4e39c036e | ||
|
|
11595bc60b | ||
|
|
963753afb2 | ||
|
|
1aaaac6682 | ||
|
|
aaaeac533a | ||
|
|
57edd906c1 | ||
|
|
9689a19099 | ||
|
|
cb7134817e | ||
|
|
9927a649dc | ||
|
|
304d11e590 | ||
|
|
9f235b36cc | ||
|
|
c3b65814df | ||
|
|
103bf18a2f | ||
|
|
51bdf578eb | ||
|
|
a1ba4a1a23 | ||
|
|
6100cc7c60 | ||
|
|
d47c77ca5c | ||
|
|
24cff7db24 | ||
|
|
374f36c31a | ||
|
|
ab670780b0 | ||
|
|
da1d1e4b0b | ||
|
|
3129c0e68d | ||
|
|
0a7f5cf063 | ||
|
|
a641d528d2 | ||
|
|
a6c2c20ccf | ||
|
|
1ee794a5b7 | ||
|
|
216356c14a | ||
|
|
ec2c0c910f | ||
|
|
fd5b9694cd | ||
|
|
35c399618a | ||
|
|
440eb53d28 | ||
|
|
ef2c14e403 | ||
|
|
13a29ebc10 | ||
|
|
6f485566e3 | ||
|
|
3bd8286807 | ||
|
|
159aacdd15 | ||
|
|
3ca95252c4 | ||
|
|
2d02b53176 | ||
|
|
08b7031fa0 | ||
|
|
7004c02614 | ||
|
|
3d9283872f | ||
|
|
e610eb133a | ||
|
|
940a6b8cb6 | ||
|
|
3439981292 | ||
|
|
8ae93db343 | ||
|
|
6ff68d52e8 | ||
|
|
bc73c6e0ea | ||
|
|
68e263b16c | ||
|
|
665284e401 | ||
|
|
088f54337a | ||
|
|
dd9da32bc4 | ||
|
|
9f2e1e477c | ||
|
|
3e8836ab1a | ||
|
|
de712f8c82 | ||
|
|
ec99b36141 | ||
|
|
a1c9af68e8 | ||
|
|
d24a79247c | ||
|
|
51eba2df7a | ||
|
|
5b426a1ef5 | ||
|
|
5a99013f5e | ||
|
|
7702386ccc | ||
|
|
16fd088d91 | ||
|
|
bbeacbfc57 | ||
|
|
bea1560dd9 | ||
|
|
794705a8a4 | ||
|
|
bf76349998 | ||
|
|
80fdcf3801 | ||
|
|
f8d2e8339e | ||
|
|
08cf746db7 | ||
|
|
b49ba06649 | ||
|
|
8c44b94a27 | ||
|
|
95aca3ee9b | ||
|
|
a97f46b442 | ||
|
|
e08d39a6a7 | ||
|
|
08fc1cbfd2 | ||
|
|
c321009b53 | ||
|
|
19241cfa87 | ||
|
|
4061028cad | ||
|
|
cbb5f825d8 | ||
|
|
9b22ac7e20 | ||
|
|
ea87c1899e | ||
|
|
cd1ab30bf9 | ||
|
|
288ed6585b | ||
|
|
59bf0c7edd | ||
|
|
0342faad6f | ||
|
|
ccf3098391 | ||
|
|
cc7c474016 | ||
|
|
6f3595e780 | ||
|
|
2cf17a6fde | ||
|
|
2c41c92353 | ||
|
|
1cca8a07a0 | ||
|
|
b4f30ada4a | ||
|
|
fc507e0989 | ||
|
|
ab9c8bef46 | ||
|
|
1f1ee5b049 | ||
|
|
2429968cea | ||
|
|
3d6c57abbe | ||
|
|
e650039af2 | ||
|
|
c804b5c89e | ||
|
|
94621b15ab | ||
|
|
4fa0ca9ef0 | ||
|
|
b50079d3d7 | ||
|
|
df9fdc0406 | ||
|
|
70b43a2f24 | ||
|
|
4ca0f921a7 | ||
|
|
ba24f648a0 | ||
|
|
a201dae5e2 | ||
|
|
33690c51b9 | ||
|
|
a05f959f4d | ||
|
|
24c0092d74 | ||
|
|
2b33b43e33 | ||
|
|
de583ca3dc | ||
|
|
9d151e7144 | ||
|
|
ba378a6049 | ||
|
|
1fa9f39a0d | ||
|
|
dab1812c31 | ||
|
|
a39448ca3b | ||
|
|
1a7652d8b1 | ||
|
|
99e30ad670 | ||
|
|
6da1079ce5 | ||
|
|
ad2c41602b | ||
|
|
5caa4881b0 | ||
|
|
de99761ffb | ||
|
|
b85dc4412c | ||
|
|
9891e81c9e | ||
|
|
5f315ef682 | ||
|
|
d185e878ab | ||
|
|
53538eb44d | ||
|
|
5431eeab6c | ||
|
|
b425bba679 | ||
|
|
ae41f78ed4 | ||
|
|
b2c7b14eeb | ||
|
|
a6328f366c | ||
|
|
2a988f8b78 | ||
|
|
568c6efbf3 | ||
|
|
fb9521fb47 | ||
|
|
d283753081 | ||
|
|
8d121eecbc | ||
|
|
7c2fc79824 | ||
|
|
7bba2b192a | ||
|
|
1e5c4801b4 | ||
|
|
f882c28671 | ||
|
|
4fac5b07a0 | ||
|
|
eeddeefc5f | ||
|
|
142990052e | ||
|
|
bf8a54d0e2 | ||
|
|
d7a4f270dc | ||
|
|
f1978da46f | ||
|
|
1f5025a6e6 | ||
|
|
be80e38e2f | ||
|
|
9a6bee5407 | ||
|
|
fb047939ef | ||
|
|
1b359d3998 | ||
|
|
4306850628 | ||
|
|
5759e9b3ba | ||
|
|
ce86481516 | ||
|
|
acf2a1edfa | ||
|
|
7e585c273c | ||
|
|
c1a75ffc1d | ||
|
|
d93d5ef151 | ||
|
|
f50453bb27 | ||
|
|
37b8ae825c | ||
|
|
a89dcd94d8 | ||
|
|
4490a02efa | ||
|
|
732f65acb2 | ||
|
|
315769979b | ||
|
|
ce0d4ba3db | ||
|
|
abb58599f7 | ||
|
|
c5378a7d8d | ||
|
|
3634c432df | ||
|
|
64afaf2820 | ||
|
|
4176ac2917 | ||
|
|
557f8b53e9 | ||
|
|
677133ad4f | ||
|
|
7eba750e4a | ||
|
|
3e3a32e588 | ||
|
|
c0515a02f6 | ||
|
|
59c6169ccc | ||
|
|
bf134ceece | ||
|
|
6cf499828c | ||
|
|
824a91ad5d | ||
|
|
52f77239f7 | ||
|
|
803cfadb1f | ||
|
|
23b91eb2e8 | ||
|
|
2ab33bd1f4 | ||
|
|
83c5306c9b | ||
|
|
6daf772501 | ||
|
|
d45f047a38 | ||
|
|
2e9428ad69 | ||
|
|
3079073da6 | ||
|
|
4894157942 | ||
|
|
4d192025aa | ||
|
|
5838918a0a | ||
|
|
075bb74736 | ||
|
|
a37b34fc78 | ||
|
|
2d028495c7 | ||
|
|
8c679c20b7 | ||
|
|
034058ff1e | ||
|
|
7d02c0b045 | ||
|
|
88ce0bd256 | ||
|
|
c09fd78e90 | ||
|
|
41fbb08395 | ||
|
|
398503a4b3 | ||
|
|
ad60cc2415 | ||
|
|
0a2ed61fa9 | ||
|
|
4b7175a89c | ||
|
|
efadfa6759 | ||
|
|
045e3feb81 | ||
|
|
4e9f48341f | ||
|
|
f6b7f5ae80 | ||
|
|
d60465d3b0 | ||
|
|
63211df14a | ||
|
|
0eed3b00a9 | ||
|
|
8f63377171 | ||
|
|
7aa8496c68 | ||
|
|
cb1bff1ce0 | ||
|
|
396c8c4906 | ||
|
|
e8264e0231 | ||
|
|
5901f97c0d | ||
|
|
4d24261e84 | ||
|
|
b6efa6c8b6 | ||
|
|
d0ed64f977 | ||
|
|
e77216cfbe | ||
|
|
653c82351c | ||
|
|
a353e3ca6a | ||
|
|
19e9692541 | ||
|
|
3e0c4e70c5 | ||
|
|
9e115d91d0 | ||
|
|
77da74be3a | ||
|
|
cad6cd6a19 | ||
|
|
3c8475c8b0 | ||
|
|
594eba571f | ||
|
|
bf51735633 | ||
|
|
478fccf6a1 | ||
|
|
bbd1f96f76 | ||
|
|
59cf6b9ba4 | ||
|
|
3e7efd86ff | ||
|
|
e5597e14c9 | ||
|
|
e197b31c15 | ||
|
|
9c9079df54 | ||
|
|
f605fd597c | ||
|
|
bf034d2383 | ||
|
|
34c016ff27 | ||
|
|
f3844cfb73 | ||
|
|
135a36a10a | ||
|
|
0f34902fb4 | ||
|
|
43ce903559 | ||
|
|
9f9adfe9af | ||
|
|
41321b77c5 | ||
|
|
62afaefff6 | ||
|
|
0aceb0d001 | ||
|
|
30b5f87c1d | ||
|
|
84303837a6 | ||
|
|
70c364ebe8 | ||
|
|
9264eb8ecc | ||
|
|
0c07ef376b | ||
|
|
2285b4208e | ||
|
|
7be83616a1 | ||
|
|
51db0a6f57 | ||
|
|
8264ed040d | ||
|
|
f020e02dfb | ||
|
|
b997966e90 | ||
|
|
c1e014373f | ||
|
|
8cebbf8146 | ||
|
|
d3d78ab744 | ||
|
|
96af008653 | ||
|
|
1910e4cfa6 | ||
|
|
3fc27cc927 | ||
|
|
3fdc757ac1 | ||
|
|
b972c46686 | ||
|
|
09d1fe7654 | ||
|
|
e1514db205 | ||
|
|
3a2f68523d | ||
|
|
53cc99b032 | ||
|
|
6b038492b1 | ||
|
|
f4f9af41dc | ||
|
|
a7c95b46c5 | ||
|
|
2eb476639a | ||
|
|
cc5b9a10eb | ||
|
|
36df660d29 | ||
|
|
3bbc5adecd | ||
|
|
9bc802dddf | ||
|
|
6e6bbb7d8b | ||
|
|
8650de4d45 | ||
|
|
49bbf945fe | ||
|
|
b4fc0388c0 | ||
|
|
bd253f1584 | ||
|
|
1762ecbd26 | ||
|
|
6011fc42c5 | ||
|
|
76b8681061 | ||
|
|
4d485d00e7 | ||
|
|
3a7ef82632 | ||
|
|
0807696761 | ||
|
|
be320936d9 | ||
|
|
ce5acb05ab | ||
|
|
3c87e5a14f | ||
|
|
d5da8965d3 | ||
|
|
b785b0b18d | ||
|
|
7a0af443b2 | ||
|
|
90e74a6722 | ||
|
|
d177ed6755 | ||
|
|
ed103ad530 | ||
|
|
fb06caff1c | ||
|
|
e7a5cfd45a | ||
|
|
b34001d866 | ||
|
|
b5827c7ec1 | ||
|
|
f4d25af034 | ||
|
|
d6fcc4869f | ||
|
|
df5eddcd85 | ||
|
|
9d0457f16e | ||
|
|
5d40c37121 | ||
|
|
c72076ae21 | ||
|
|
828b0a7d75 | ||
|
|
b31d650b28 | ||
|
|
4ed02c40b7 | ||
|
|
64bfb52541 | ||
|
|
dbf8f9e68a | ||
|
|
8069f04766 | ||
|
|
23a1f2530e | ||
|
|
60d13157d5 | ||
|
|
8a19ee7d84 | ||
|
|
730f10e9d7 | ||
|
|
9a24eb221d | ||
|
|
3705e5a209 | ||
|
|
40268978e7 | ||
|
|
959cce44fb | ||
|
|
404bbe3f13 | ||
|
|
70978089b6 | ||
|
|
b35ddef4fb | ||
|
|
28112b6444 | ||
|
|
bc2f52840b | ||
|
|
2e6fb57cef | ||
|
|
c29fddfc7e | ||
|
|
9780b3ef08 | ||
|
|
b2301cb040 | ||
|
|
85170d2389 | ||
|
|
93bc0b4050 | ||
|
|
77211f2cf0 | ||
|
|
37d34de34f | ||
|
|
350f9e9ef4 | ||
|
|
8d676ea556 | ||
|
|
bef25b7bc0 | ||
|
|
a1167ea3d7 | ||
|
|
71784259f9 | ||
|
|
f6709fcf6d | ||
|
|
0d3211e974 | ||
|
|
d2e867d61b | ||
|
|
13b76b3fb9 | ||
|
|
1742509309 | ||
|
|
6850d73c40 | ||
|
|
0b1e102715 | ||
|
|
e46818f3fa | ||
|
|
9c5a390257 | ||
|
|
1f5bae0dbb | ||
|
|
8091470ae3 | ||
|
|
162ccfc15c | ||
|
|
0aae8653d8 | ||
|
|
3dab2b0a4c | ||
|
|
52c000a50f | ||
|
|
4f1d4f4250 | ||
|
|
69b86b5e6c | ||
|
|
c381bc9da8 | ||
|
|
8ba7257628 | ||
|
|
560ae2c311 | ||
|
|
c0c1e0085b | ||
|
|
c8a87a2e06 | ||
|
|
49d516969d | ||
|
|
b32e1705d9 | ||
|
|
bd58321cfa | ||
|
|
7ea630a88e | ||
|
|
e37e11cc3e | ||
|
|
facf8a2aae | ||
|
|
c5ff313d27 | ||
|
|
c9d77884c5 | ||
|
|
f20f74fec9 | ||
|
|
e250b61e01 | ||
|
|
6210a69297 | ||
|
|
f91a9725d7 | ||
|
|
0d5b557bf2 | ||
|
|
bcbbdfb9df | ||
|
|
dd95a6af0f | ||
|
|
d74c5da260 | ||
|
|
c4cfd0de25 | ||
|
|
0e23d84b72 | ||
|
|
7944422a2f | ||
|
|
8ac77c731e | ||
|
|
c15bc58a39 | ||
|
|
ab8bcbddc2 | ||
|
|
df5aa98cd0 | ||
|
|
90302c0de0 | ||
|
|
ad7771d8e4 | ||
|
|
ce72bef98c | ||
|
|
59a4e24ade | ||
|
|
630585b2e4 | ||
|
|
d375140e4a | ||
|
|
91590b2408 | ||
|
|
aa96a1ded7 | ||
|
|
ebce82e1e8 | ||
|
|
27ea5731bb | ||
|
|
5771aa3631 | ||
|
|
fbb350a64b | ||
|
|
7ad8a1a863 | ||
|
|
831f083153 | ||
|
|
4736124a9e | ||
|
|
3b9e6fa210 | ||
|
|
59745fb8ca | ||
|
|
52b61670a4 | ||
|
|
01eaebbe98 | ||
|
|
6d567fb68c | ||
|
|
27855ddb84 | ||
|
|
a90766c5b9 | ||
|
|
77a46d0e29 | ||
|
|
fac6bf5461 | ||
|
|
8dff447f68 | ||
|
|
8324d47d43 | ||
|
|
fce151948f | ||
|
|
a22a80374e | ||
|
|
e705342dc3 | ||
|
|
a81792e788 | ||
|
|
e1c27f65b5 | ||
|
|
b963818a98 | ||
|
|
b48fbb2e06 | ||
|
|
334ec4824c | ||
|
|
401f99762c | ||
|
|
44896ba832 | ||
|
|
cf983d621f | ||
|
|
e7ae1a5364 | ||
|
|
d0a3302212 | ||
|
|
7e2230970b | ||
|
|
dac6bac8df | ||
|
|
7fc2d9f902 | ||
|
|
5c0e4be5c9 | ||
|
|
87cda5a97f | ||
|
|
dab0ea373c | ||
|
|
078d19382c | ||
|
|
f74570f348 | ||
|
|
ea58ad6340 | ||
|
|
5e135e6ced | ||
|
|
82e713c167 | ||
|
|
c01061b9df | ||
|
|
148f9b119b | ||
|
|
46f916b1a2 | ||
|
|
b6c528763c | ||
|
|
bc2179965f | ||
|
|
2e2e509835 | ||
|
|
30fc18d772 | ||
|
|
7876f44e5b | ||
|
|
31ea2e7be4 | ||
|
|
08d36d68e3 | ||
|
|
e39c1658f1 | ||
|
|
5d1e3a2213 | ||
|
|
952fe722f6 | ||
|
|
c0fa9b9bf6 | ||
|
|
1d1e4f974b | ||
|
|
8e835271d5 | ||
|
|
6f8e5b53b3 | ||
|
|
a5d6731611 | ||
|
|
0c525db644 | ||
|
|
9bbf69a621 | ||
|
|
33af9119ce | ||
|
|
4eb62c7655 | ||
|
|
e9758fda6c | ||
|
|
7a17e13d55 | ||
|
|
f9bc65b6e1 | ||
|
|
febc475634 | ||
|
|
b9b6d9da78 | ||
|
|
3f4502e861 | ||
|
|
6d8c7af90c | ||
|
|
a4e3347abf | ||
|
|
a71f449adc | ||
|
|
96fe9e094c | ||
|
|
b105abc56f | ||
|
|
bb5790cd1a | ||
|
|
506dee2337 | ||
|
|
1cf1b0f1da | ||
|
|
15bc754ea7 | ||
|
|
01641a05f4 | ||
|
|
84a1cc37a5 | ||
|
|
a4088eb173 | ||
|
|
70f0d9c61b | ||
|
|
0c6b7fc4a1 | ||
|
|
bf9df6e0b2 | ||
|
|
f3fff52304 | ||
|
|
3cde7fc4ee | ||
|
|
9b19f3940b | ||
|
|
e5e776c288 | ||
|
|
f648fdc31c | ||
|
|
5ea50b1030 | ||
|
|
c3269e6639 | ||
|
|
bba96eef89 | ||
|
|
d9080650ac | ||
|
|
704a41b281 | ||
|
|
585f734e32 | ||
|
|
412d32e58d | ||
|
|
73ecd3505e | ||
|
|
f2759fc5dd | ||
|
|
5b07b66492 | ||
|
|
2b91e651d4 | ||
|
|
80582657f0 | ||
|
|
82de7f631a | ||
|
|
333b544001 | ||
|
|
6e98e25184 | ||
|
|
36bed52eae | ||
|
|
976abb854b | ||
|
|
d667354e09 | ||
|
|
6b468d5751 | ||
|
|
a61f6e8f93 | ||
|
|
86e564bb91 | ||
|
|
f5b9f28cc0 | ||
|
|
7dad67ad35 | ||
|
|
0eb93b4e8b | ||
|
|
f5ad4c9117 | ||
|
|
14e7cfcbef | ||
|
|
89e4cc7be0 | ||
|
|
00b2cfb785 | ||
|
|
8b8820ef91 | ||
|
|
d3ffbb6bd0 | ||
|
|
725ecb192c | ||
|
|
15fa3804af | ||
|
|
5d359ba7a0 | ||
|
|
df779d9f2a | ||
|
|
b9633f1c22 | ||
|
|
a6ec9e3049 | ||
|
|
bec84e799e | ||
|
|
4eb45af6d0 | ||
|
|
61579b1166 | ||
|
|
41aae0b753 | ||
|
|
23ff844e70 | ||
|
|
a3730c7c82 | ||
|
|
a587defb76 | ||
|
|
38407d55a9 | ||
|
|
63435257f0 | ||
|
|
17065f9193 | ||
|
|
6caecfce72 | ||
|
|
1dabdb5315 | ||
|
|
131a8fafcd | ||
|
|
b5f742f3ba | ||
|
|
726cb1a3eb | ||
|
|
59d0b99121 | ||
|
|
b061b1a557 | ||
|
|
3b1c6ae68f | ||
|
|
d5ed79ab66 | ||
|
|
df3bb79365 | ||
|
|
7308f3464b | ||
|
|
8a53f5ff56 | ||
|
|
3e5de81414 | ||
|
|
6b59ade7bd | ||
|
|
ebed24ab5d | ||
|
|
64c227afc9 | ||
|
|
bb6947d9d9 | ||
|
|
f35db9a594 | ||
|
|
fb446d433a | ||
|
|
1e443545c9 | ||
|
|
0ee0c655cf | ||
|
|
183f8f5398 | ||
|
|
91e300cb68 | ||
|
|
641895c0d5 | ||
|
|
e84522c2fa | ||
|
|
dc4077325b | ||
|
|
44c42e1c01 | ||
|
|
f2f86932f4 | ||
|
|
943d197253 | ||
|
|
3a015657cb | ||
|
|
974520a733 | ||
|
|
b1dedf3435 | ||
|
|
29347af729 | ||
|
|
9efd3ec7ad | ||
|
|
169b0e560b | ||
|
|
9c560eae63 | ||
|
|
3e2c4b1db0 | ||
|
|
cb47072fa7 | ||
|
|
8291a19487 | ||
|
|
c40a912815 | ||
|
|
0efdf2bbac |
No files matched your search
@@ -1,67 +1,68 @@
|
||||
pipeline:
|
||||
compile:
|
||||
image: nextcloudci/android:android-40
|
||||
commands:
|
||||
# build app and assemble APK
|
||||
- sh -c "if [ '${FLAVOR}' != 'Analysis' ]; then ./gradlew assemble${FLAVOR}; fi"
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: [Generic, Gplay]
|
||||
compile:
|
||||
image: nextcloudci/android:android-44
|
||||
commands:
|
||||
# build app and assemble APK
|
||||
- sh -c "if [ '${FLAVOR}' != 'Analysis' ]; then ./gradlew assemble${FLAVOR}; fi"
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: [Generic, Gplay]
|
||||
|
||||
test:
|
||||
image: nextcloudci/android:android-40
|
||||
privileged: true
|
||||
commands:
|
||||
- emulator -avd android-27 -no-window -no-audio &
|
||||
- ./wait_for_emulator.sh
|
||||
- ./gradlew assembleGplayDebug
|
||||
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "Unit"
|
||||
- ./gradlew installGplayDebugAndroidTest
|
||||
- ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "IT"
|
||||
- ./gradlew combinedTestReport
|
||||
- curl -o codecov.sh https://codecov.io/bash
|
||||
- bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
|
||||
secrets: [ LOG_USERNAME, LOG_PASSWORD ]
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: Gplay
|
||||
test:
|
||||
image: nextcloudci/android:android-44
|
||||
privileged: true
|
||||
commands:
|
||||
- emulator -avd android-27 -no-window -no-audio &
|
||||
- ./wait_for_emulator.sh
|
||||
- ./gradlew assembleGplayDebug
|
||||
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
- ./gradlew installGplayDebugAndroidTest
|
||||
- ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
- ./gradlew combinedTestReport
|
||||
- curl -o codecov.sh https://codecov.io/bash
|
||||
- bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
|
||||
secrets: [ LOG_USERNAME, LOG_PASSWORD, GIT_USERNAME, GIT_TOKEN ]
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: Gplay
|
||||
|
||||
analysis:
|
||||
image: nextcloudci/android:android-40
|
||||
commands:
|
||||
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
|
||||
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
|
||||
secrets: [ GIT_USERNAME, GIT_TOKEN, LOG_USERNAME, LOG_PASSWORD ]
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: Analysis
|
||||
|
||||
notify:
|
||||
image: drillster/drone-email
|
||||
host: $EMAIL_HOST
|
||||
port: 587
|
||||
username: $EMAIL_USERNAME
|
||||
password: $EMAIL_PASSWORD
|
||||
from: [email protected]
|
||||
recipients_only: true
|
||||
recipients: [ $EMAIL_RECIPIENTS ]
|
||||
secrets: [ EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_RECIPIENTS, EMAIL_HOST ]
|
||||
when:
|
||||
event: push
|
||||
status: failure
|
||||
branch: master
|
||||
analysis:
|
||||
image: nextcloudci/android:android-44
|
||||
commands:
|
||||
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
|
||||
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
|
||||
secrets: [ GIT_USERNAME, GIT_TOKEN, LOG_USERNAME, LOG_PASSWORD ]
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: Analysis
|
||||
|
||||
notify:
|
||||
image: drillster/drone-email
|
||||
host: $EMAIL_HOST
|
||||
port: 587
|
||||
username: $EMAIL_USERNAME
|
||||
password: $EMAIL_PASSWORD
|
||||
from: [email protected]
|
||||
skip_verify: true
|
||||
recipients_only: true
|
||||
recipients: [ $EMAIL_RECIPIENTS ]
|
||||
secrets: [ EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_RECIPIENTS, EMAIL_HOST ]
|
||||
when:
|
||||
event: push
|
||||
status: failure
|
||||
branch: master
|
||||
|
||||
matrix:
|
||||
FLAVOR:
|
||||
FLAVOR:
|
||||
- Generic
|
||||
- Gplay
|
||||
- Analysis
|
||||
|
||||
services:
|
||||
server:
|
||||
image: nextcloudci/server:server-1
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: Gplay
|
||||
server:
|
||||
image: nextcloudci/server:server-3
|
||||
when:
|
||||
matrix:
|
||||
FLAVOR: Gplay
|
||||
|
||||
branches: master
|
||||
@@ -0,0 +1,33 @@
|
||||
# .editorconfig
|
||||
|
||||
# see http://EditorConfig.org
|
||||
|
||||
# This is the file in the root of the project.
|
||||
# For sub folders you can have other files that override only some settings.
|
||||
# For these, this settings should be false.
|
||||
root=true
|
||||
|
||||
[*]
|
||||
max_line_length=120
|
||||
# use spaces, not tabs.
|
||||
indent_style=space
|
||||
indent_size=4
|
||||
|
||||
charset=utf-8
|
||||
|
||||
# Trimming is good for consistency
|
||||
trim_trailing_whitespace=true
|
||||
# I've seen cases where a missing new_line was ignored on *nix systems.
|
||||
# Never again with this setting!
|
||||
insert_final_newline=true
|
||||
|
||||
[*.properties]
|
||||
# Exception for Java properties files should be encoded latin1 (aka iso8859-1)
|
||||
charset=latin1
|
||||
|
||||
[*.{cmd,bat}]
|
||||
# batch files on Windows should stay with CRLF
|
||||
end_of_line=crlf
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace=false
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
labels: bug
|
||||
|
||||
---
|
||||
|
||||
### Actual behaviour
|
||||
- Tell us what happens
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
labels: enhancement
|
||||
|
||||
---
|
||||
|
||||
### Is your feature request related to a problem? Please describe.
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
### Describe the solution you'd like
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
### Describe alternatives you've considered
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
### Additional context
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
**NOTE:** Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate
|
||||
@@ -27,14 +27,14 @@ group_defaults:
|
||||
|
||||
groups:
|
||||
code-review:
|
||||
required: 2
|
||||
required: 1
|
||||
reject_value: -99
|
||||
users:
|
||||
- AndyScherzinger
|
||||
- tobiasKaminsky
|
||||
- mario
|
||||
- przybylski
|
||||
- ardevd
|
||||
- ardevd
|
||||
|
||||
design-review:
|
||||
conditions:
|
||||
@@ -45,5 +45,5 @@ groups:
|
||||
required: 1
|
||||
reject_value: -99
|
||||
users:
|
||||
- jancborchardt
|
||||
- jancborchardt
|
||||
- eppfel
|
||||
@@ -1,3 +1,58 @@
|
||||
## 3.5.0 (February, 13, 2019)
|
||||
|
||||
- Chunked upload: 1MB on mobile data, 10MB on Wi-Fi
|
||||
- Switch to Material Design
|
||||
- Option to not show notifications for new media folders
|
||||
- Add support for QR codes & deep links
|
||||
- Direct camera upload
|
||||
- Fully working Document provider
|
||||
- Detail view: Show complete date upon click
|
||||
- Show correct share error message
|
||||
- Use default/device font
|
||||
- Sync all downloaded
|
||||
- Add battery optimization warning
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/28
|
||||
|
||||
## 3.4.2 (January, 21, 2019)
|
||||
- fix sharing to group
|
||||
- show correct share error messages
|
||||
- fix bug when searching for user/group if Talk is disabled
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/29
|
||||
|
||||
## 3.4.1 (December, 23, 2018)
|
||||
- fix wrong detection of direct editing capability for RichDocuments
|
||||
|
||||
## 3.4.0 (December, 17, 2018)
|
||||
- hide download when creating share links
|
||||
- direct editing files with Collabora (Collabora Server >=4.0)
|
||||
- sort deleted files by deletion date by default
|
||||
- set/edit notes on shares
|
||||
- search inside of text files
|
||||
- actions on notifications
|
||||
- remember last path on upload
|
||||
- share file to Talk room
|
||||
- show local size in "on device" view
|
||||
- SSO: add request header for deck app
|
||||
- bug fixes
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/25
|
||||
|
||||
## 3.3.2 (November, 02, 2018)
|
||||
- fix fingerprint not working on certain devices
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/27
|
||||
|
||||
## 3.3.1 (October, 29, 2018)
|
||||
Bugfix release
|
||||
- fix crash on shared folder/file via Talk
|
||||
- fix crash on Notification activity
|
||||
- fixed setup DAVdroid via settings
|
||||
- hide edit option on shares, if not allowed
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/26
|
||||
|
||||
## 3.3.0 (September, 19, 2018)
|
||||
- Support for Trashbin (Nc14+)
|
||||
- Media streaming (Nc14+)
|
||||
@@ -17,7 +72,7 @@
|
||||
- Fix push notification on gplay release
|
||||
|
||||
## 3.2.3 (August, 21, 2018)
|
||||
- Fix crash on Android Android 4.x
|
||||
- Fix crash on Android 4.x
|
||||
|
||||
## 3.2.2 (August, 20, 2018)
|
||||
- New simple signup screen
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
# Guidelines
|
||||
|
||||
## Issue reporting
|
||||
* [Report the issue](https://github.com/nextcloud/android/issues/new) using our [template](https://github.com/nextcloud/android/blob/master/issue_template.md), it includes all the information we need to track down the issue.
|
||||
* [Report the issue](https://github.com/nextcloud/android/issues/new/choose) and choose bug report or feature request. The template includes all the information we need to track down the issue.
|
||||
* This repository is *only* for issues within the Nextcloud Android app code. Issues in other components should be reported in their own repositories, e.g. [Nextcloud core](https://github.com/nextcloud/core/issues)
|
||||
* Search the [existing issues](https://github.com/nextcloud/android/issues) first, it's likely that your issue was already reported.
|
||||
If your issue appears to be a bug, and hasn't been reported, open a new issue.
|
||||
|
||||
@@ -45,7 +45,7 @@ Easy starting points are also reviewing [pull requests](https://github.com/nextc
|
||||
#### With a computer:
|
||||
- connect the device via USB
|
||||
- open command prompt/terminal
|
||||
- enter `adb logcat | grep "$(adb shell ps | grep com.nextcloud.client | awk '{print $2}')" > logcatOutput.txt` to save the output to this file
|
||||
- enter `adb logcat | grep "$(adb shell ps | awk '/com.nextcloud.client/{print $2}')" > logcatOutput.txt` to save the output to this file
|
||||
|
||||
**Note:** You must have [adb](https://developer.android.com/studio/releases/platform-tools.html) installed first!
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ To set up the project in Android Studio follow the next steps:
|
||||
* Make sure you have called ```git submodule update``` whenever you switched branches
|
||||
* Open Android Studio and select 'Import Project (Eclipse ADT, Gradle, etc)'. Browse through your file system to the folder 'android' where the project is located. Android Studio will then create the '.iml' files it needs. If you ever close the project but the files are still there, you just select 'Open Project…'. The file chooser will show an Android face as the folder icon, which you can select to reopen the project.
|
||||
* Android Studio will try to build the project directly after importing it. To build it manually, follow the menu path 'Build'/'Make Project', or just click the 'Play' button in the toolbar to build and run it in a mobile device or an emulator. The resulting APK file will be saved in the 'build/outputs/apk/' subdirectory in the project folder.
|
||||
* Setup Android Studio editor configurtation for the project: ```Settings``` → ```Editor``` → ```Code Style``` → ```Scheme: Project``` and ```Enable EditorConfig support```
|
||||
|
||||
|
||||
### 3. Working in a terminal with Gradle:
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<version>4.3.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.android</groupId>
|
||||
@@ -75,4 +75,4 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
@@ -7,18 +7,17 @@
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath 'org.codehaus.groovy:groovy-all:2.4.12'
|
||||
classpath('com.dicedmelon.gradle:jacoco-android:0.1.3') {
|
||||
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||
classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
|
||||
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,12 +30,14 @@ apply plugin: 'jacoco-android'
|
||||
|
||||
configurations.all {
|
||||
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'
|
||||
|
||||
// check for updates every build
|
||||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
||||
}
|
||||
|
||||
ext {
|
||||
supportLibraryVersion = '27.1.1'
|
||||
jacocoVersion = "0.8.2"
|
||||
|
||||
travisBuild = System.getenv("TRAVIS") == "true"
|
||||
@@ -46,10 +47,10 @@ ext {
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
||||
google()
|
||||
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
@@ -58,9 +59,9 @@ repositories {
|
||||
|
||||
// semantic versioning for version code
|
||||
def versionMajor = 3
|
||||
def versionMinor = 4
|
||||
def versionMinor = 5
|
||||
def versionPatch = 0
|
||||
def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 99=stable
|
||||
def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
|
||||
|
||||
def taskRequest = getGradle().getStartParameter().getTaskRequests().toString()
|
||||
if (taskRequest.contains("Gplay") || taskRequest.contains("findbugs") || taskRequest.contains("lint")) {
|
||||
@@ -72,36 +73,35 @@ android {
|
||||
abortOnError false
|
||||
htmlReport true
|
||||
htmlOutput file("$project.buildDir/reports/lint/lint.html")
|
||||
disable 'MissingTranslation'
|
||||
disable 'MissingTranslation', 'GradleDependency'
|
||||
}
|
||||
|
||||
dexOptions {
|
||||
javaMaxHeapSize "4g"
|
||||
}
|
||||
|
||||
compileSdkVersion 27
|
||||
compileSdkVersion 28
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 27
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
targetSdkVersion 28
|
||||
|
||||
// arguments to be passed to functional tests
|
||||
testInstrumentationRunnerArgument "TEST_USER", "\"$System.env.OCTEST_APP_USERNAME\""
|
||||
testInstrumentationRunnerArgument "TEST_PASSWORD", "\"$System.env.OCTEST_APP_PASSWORD\""
|
||||
testInstrumentationRunnerArgument "TEST_SERVER_URL", "\"$System.env.OCTEST_SERVER_BASE_URL\""
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
|
||||
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
|
||||
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
|
||||
|
||||
multiDexEnabled true
|
||||
|
||||
versionCode versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
|
||||
|
||||
if (versionBuild > 98) {
|
||||
if (versionBuild > 89) {
|
||||
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
|
||||
} else if (versionBuild > 50) {
|
||||
versionName "${versionMajor}.${versionMinor}.${versionPatch} RC"+(versionBuild-50)
|
||||
versionName "${versionMajor}.${versionMinor}.${versionPatch} RC" + (versionBuild - 50)
|
||||
} else {
|
||||
versionName "${versionMajor}.${versionMinor}.${versionPatch} Alpha"+(versionBuild+1)
|
||||
versionName "${versionMajor}.${versionMinor}.${versionPatch} Alpha" + (versionBuild + 1)
|
||||
}
|
||||
|
||||
// adapt structure from Eclipse to Gradle/Android Studio expectations;
|
||||
@@ -130,8 +130,8 @@ android {
|
||||
versionDev {
|
||||
applicationId "com.nextcloud.android.beta"
|
||||
dimension "default"
|
||||
versionCode 20180924
|
||||
versionName "20180924"
|
||||
versionCode 20190309
|
||||
versionName "20190309"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ android {
|
||||
exclude 'META-INF/LICENSE'
|
||||
}
|
||||
|
||||
task checkstyle(type: Checkstyle) {
|
||||
tasks.register("checkstyle", Checkstyle) {
|
||||
configFile = file("${rootProject.projectDir}/checkstyle.xml")
|
||||
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
|
||||
source 'src'
|
||||
@@ -158,7 +158,7 @@ android {
|
||||
classpath = files()
|
||||
}
|
||||
|
||||
task pmd(type: Pmd) {
|
||||
tasks.register("pmd", Pmd) {
|
||||
ruleSetFiles = files("${project.rootDir}/pmd-ruleset.xml")
|
||||
ignoreFailures = false
|
||||
ruleSets = []
|
||||
@@ -179,11 +179,11 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
task findbugs(type: FindBugs) {
|
||||
tasks.register("findbugs", FindBugs) {
|
||||
ignoreFailures = false
|
||||
effort = "max"
|
||||
reportLevel = "medium"
|
||||
classes = fileTree("$project.buildDir/intermediates/classes/gplay/debug/com/owncloud")
|
||||
classes = fileTree("$project.buildDir/intermediates/javac/gplayDebug/compileGplayDebugJavaWithJavac/classes/")
|
||||
excludeFilter = file("${project.rootDir}/findbugs-filter.xml")
|
||||
source = fileTree('src/main/java')
|
||||
pluginClasspath = project.configurations.findbugsPlugins
|
||||
@@ -210,65 +210,71 @@ android {
|
||||
|
||||
dependencies {
|
||||
// dependencies for app building
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
// implementation project('nextcloud-android-library')
|
||||
genericImplementation "com.github.nextcloud:android-library:master-SNAPSHOT"
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
gplayImplementation "com.github.nextcloud:android-library:master-SNAPSHOT"
|
||||
versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT' // use always latest master
|
||||
implementation "com.android.support:support-v4:${supportLibraryVersion}"
|
||||
implementation "com.android.support:design:${supportLibraryVersion}"
|
||||
genericImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'
|
||||
gplayImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'
|
||||
versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
implementation 'com.jakewharton:disklrucache:2.0.2'
|
||||
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
|
||||
implementation "com.android.support:cardview-v7:${supportLibraryVersion}"
|
||||
implementation "com.android.support:exifinterface:${supportLibraryVersion}"
|
||||
implementation 'com.github.albfernandez:juniversalchardet:2.2.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.0.0'
|
||||
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
|
||||
implementation 'com.google.code.findbugs:annotations:2.0.1'
|
||||
implementation 'commons-io:commons-io:2.6'
|
||||
implementation 'com.github.evernote:android-job:v1.2.5'
|
||||
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||
implementation 'com.github.tobiaskaminsky:android-job:v1.2.6.1' // 'com.github.evernote:android-job:v1.2.5'
|
||||
implementation 'com.jakewharton:butterknife:10.1.0'
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
|
||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.4'
|
||||
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5'
|
||||
implementation 'org.lukhnos:nnio:0.2'
|
||||
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
|
||||
implementation 'com.google.code.gson:gson:2.8.5'
|
||||
implementation 'com.afollestad:sectioned-recyclerview:0.5.0'
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
|
||||
implementation 'com.github.tobiaskaminsky:qrcodescanner:0.1.2.2' // 'com.github.blikoon:QRCodeScanner:0.1.2'
|
||||
implementation 'com.google.android:flexbox:1.1.0'
|
||||
|
||||
implementation 'org.parceler:parceler-api:1.1.11'
|
||||
annotationProcessor 'org.parceler:parceler:1.1.11'
|
||||
implementation ('com.github.bumptech.glide:glide:3.7.0') {
|
||||
implementation 'org.parceler:parceler-api:1.1.12'
|
||||
annotationProcessor 'org.parceler:parceler:1.1.12'
|
||||
implementation('com.github.bumptech.glide:glide:3.7.0') {
|
||||
exclude group: "com.android.support"
|
||||
}
|
||||
implementation 'com.caverock:androidsvg:1.3'
|
||||
implementation "com.android.support:support-annotations:${supportLibraryVersion}"
|
||||
implementation 'androidx.annotation:annotation:1.0.2'
|
||||
implementation 'com.google.code.gson:gson:2.8.5'
|
||||
|
||||
// dependencies for local unit tests
|
||||
testImplementation 'junit:junit:4.12'
|
||||
testImplementation 'org.mockito:mockito-core:2.22.0'
|
||||
testImplementation 'org.mockito:mockito-core:2.25.0'
|
||||
// dependencies for instrumented tests
|
||||
// JUnit4 Rules
|
||||
androidTestImplementation 'com.android.support.test:rules:1.0.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
||||
androidTestImplementation 'androidx.test:rules:1.1.1'
|
||||
// Android JUnit Runner
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||
|
||||
// Espresso core
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.1'
|
||||
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
|
||||
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
|
||||
// androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
|
||||
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
|
||||
implementation 'org.jetbrains:annotations:16.0.3'
|
||||
implementation 'org.jetbrains:annotations:17.0.0'
|
||||
|
||||
compileOnly "org.projectlombok:lombok:1.18.6"
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.6"
|
||||
|
||||
androidTestImplementation 'tools.fastlane:screengrab:1.2.0'
|
||||
|
||||
findbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.8.0'
|
||||
findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.3'
|
||||
|
||||
|
||||
// jacocoAnt "org.jacoco:org.jacoco.ant:${jacocoVersion}"
|
||||
// jacocoAgent "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
||||
// androidJacocoAgent "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
||||
@@ -295,7 +301,7 @@ android.applicationVariants.all { variant ->
|
||||
}
|
||||
}
|
||||
|
||||
task combinedTestReport(type: JacocoReport) {
|
||||
tasks.register("combinedTestReport", JacocoReport) {
|
||||
|
||||
reports {
|
||||
xml.enabled = true
|
||||
@@ -309,6 +315,6 @@ task combinedTestReport(type: JacocoReport) {
|
||||
sourceDirectories = files([mainSrc])
|
||||
classDirectories = files([debugTree])
|
||||
executionData = fileTree(dir: project.buildDir, includes: [
|
||||
'jacoco/testGplayDebugUnitTest.exec', 'outputs/code-coverage/connected/flavors/GPLAY/*coverage.ec'
|
||||
'jacoco/testGplayDebugUnitTest.exec', 'outputs/code-coverage/connected/flavors/GPLAY/*coverage.ec'
|
||||
])
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path d="M0 0h24v24H0z" fill="none" />
|
||||
<path
|
||||
d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4zM13 18h-2v-2h2v2zm0-4h-2V9h2v5z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 318 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 216 B |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path d="M0 0h24v24H0z" fill="none" />
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 277 B |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path fill="none" d="M0 0h24v24H0V0zm0 0h24v24H0V0z" />
|
||||
<path
|
||||
d="M16.59 7.58L10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 346 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewbox="0 0 16 16">
|
||||
<path
|
||||
d="M8 1.5C3.582 1.5 0 3.962 0 7s3.582 5.5 8 5.5c.25 0 .49-.016.734-.03L13 16v-4.703c1.83-1.008 3-2.56 3-4.297 0-3.038-3.582-5.5-8-5.5z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 262 B |
@@ -13,7 +13,7 @@
|
||||
viewBox="0 0 128 128"
|
||||
version="1.1"
|
||||
id="svg829"
|
||||
inkscape:version="0.92.2 2405546, 2018-03-11"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
sodipodi:docname="first_run_talk.svg">
|
||||
<defs
|
||||
id="defs823"/>
|
||||
@@ -25,8 +25,8 @@
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="297.07973"
|
||||
inkscape:cy="366.5173"
|
||||
inkscape:cx="197.26742"
|
||||
inkscape:cy="78.319822"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
@@ -35,10 +35,10 @@
|
||||
fit-margin-left="2"
|
||||
fit-margin-right="2"
|
||||
fit-margin-bottom="2"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="835"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1046"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-y="34"
|
||||
inkscape:window-maximized="1"/>
|
||||
<metadata
|
||||
id="metadata826">
|
||||
@@ -58,9 +58,11 @@
|
||||
id="layer1"
|
||||
transform="translate(-15.580506,-52.12649)">
|
||||
<path
|
||||
style="fill:#ffffff;stroke-width:4.78543139"
|
||||
d="M 241.85938,2.6035156 C 109.72511,2.6053865 2.6113188,109.72517 2.6152344,241.86133 c 8.69e-5,132.13334 107.1127156,239.24815 239.2441456,239.25 26.38805,-0.0535 52.46249,-4.4707 77.19954,-12.96295 16.31567,-5.60118 32.04955,-12.97512 46.90788,-22.039 12.78608,5.081 32.46588,14.50729 51.91537,22.30803 25.27886,10.13878 50.16864,17.53156 59.02799,9.06892 8.75623,-8.36216 2.65569,-33.29226 -6.22433,-58.86696 -7.73207,-22.26856 -17.57143,-45.02584 -21.54521,-57.75999 9.61628,-16.68601 17.14139,-34.39874 22.46771,-52.73831 6.22776,-21.44334 9.44951,-43.74365 9.49323,-66.26169 C 481.09967,109.72865 373.99016,2.6150774 241.86133,2.6113281 Z m 0.0273,90.9609374 h 0.002 c 81.9303,3.48e-4 148.34762,66.419397 148.34766,148.351567 -0.004,81.92844 -66.42304,148.34179 -148.34961,148.34179 -81.92656,0 -148.342022,-66.41335 -148.347658,-148.34179 2.7e-5,-81.93241 66.417128,-148.351563 148.347658,-148.351567 z"
|
||||
transform="matrix(0.26458333,0,0,0.26458333,15.580506,52.12649)"
|
||||
id="path4753"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;stroke-width:1.26614535"
|
||||
d="m 79.572589,52.815123 a 63.300934,63.301842 0 0 0 -63.300038,63.303717 63.300934,63.301842 0 0 0 63.300038,63.3018 63.300934,63.301842 0 0 0 32.836581,-9.26097 c 7.77991,3.09162 25.20623,12.26357 29.35376,8.30176 4.33401,-4.13896 -5.08818,-23.61904 -7.34707,-30.85775 A 63.300934,63.301842 0 0 0 142.8719,116.11826 63.300934,63.301842 0 0 0 79.572762,52.817324 Z m 0.0074,24.06677 A 39.250508,39.251409 0 0 1 118.83033,116.13329 39.250508,39.251409 0 0 1 79.579825,155.382 39.250508,39.251409 0 0 1 40.329319,116.13329 39.250508,39.251409 0 0 1 79.579825,76.881893 Z"
|
||||
id="path2"/>
|
||||
sodipodi:nodetypes="cccscscscscccsccscs"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z" /></svg>
|
||||
|
After Width: | Height: | Size: 518 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>
|
||||
|
After Width: | Height: | Size: 404 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z" /></svg>
|
||||
|
After Width: | Height: | Size: 422 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" /></svg>
|
||||
|
After Width: | Height: | Size: 336 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z" /></svg>
|
||||
|
After Width: | Height: | Size: 411 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" /></svg>
|
||||
|
After Width: | Height: | Size: 410 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M18,4L20,8H17L15,4H13L15,8H12L10,4H8L10,8H7L5,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V4H18Z" /></svg>
|
||||
|
After Width: | Height: | Size: 401 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z" /></svg>
|
||||
|
After Width: | Height: | Size: 515 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M18,8H16V4H18M15,8H13V4H15M12,8H10V4H12M18,2H10L4,8V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V4A2,2 0 0,0 18,2Z" /></svg>
|
||||
|
After Width: | Height: | Size: 401 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z" /></svg>
|
||||
|
After Width: | Height: | Size: 521 B |
@@ -0,0 +1,247 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" baseProfile="full" width="232" height="232" viewBox="0 0 232 232" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<desc></desc>
|
||||
<rect width="232" height="232" fill="#ffffff" cx="0" cy="0" />
|
||||
<defs>
|
||||
<rect id="p" width="8" height="8" />
|
||||
</defs>
|
||||
<g fill="#000000">
|
||||
<use x="32" y="32" xlink:href="#p" />
|
||||
<use x="32" y="40" xlink:href="#p" />
|
||||
<use x="32" y="48" xlink:href="#p" />
|
||||
<use x="32" y="56" xlink:href="#p" />
|
||||
<use x="32" y="64" xlink:href="#p" />
|
||||
<use x="32" y="72" xlink:href="#p" />
|
||||
<use x="32" y="80" xlink:href="#p" />
|
||||
<use x="32" y="96" xlink:href="#p" />
|
||||
<use x="32" y="104" xlink:href="#p" />
|
||||
<use x="32" y="112" xlink:href="#p" />
|
||||
<use x="32" y="120" xlink:href="#p" />
|
||||
<use x="32" y="128" xlink:href="#p" />
|
||||
<use x="32" y="144" xlink:href="#p" />
|
||||
<use x="32" y="152" xlink:href="#p" />
|
||||
<use x="32" y="160" xlink:href="#p" />
|
||||
<use x="32" y="168" xlink:href="#p" />
|
||||
<use x="32" y="176" xlink:href="#p" />
|
||||
<use x="32" y="184" xlink:href="#p" />
|
||||
<use x="32" y="192" xlink:href="#p" />
|
||||
<use x="40" y="32" xlink:href="#p" />
|
||||
<use x="40" y="80" xlink:href="#p" />
|
||||
<use x="40" y="96" xlink:href="#p" />
|
||||
<use x="40" y="104" xlink:href="#p" />
|
||||
<use x="40" y="144" xlink:href="#p" />
|
||||
<use x="40" y="192" xlink:href="#p" />
|
||||
<use x="48" y="32" xlink:href="#p" />
|
||||
<use x="48" y="48" xlink:href="#p" />
|
||||
<use x="48" y="56" xlink:href="#p" />
|
||||
<use x="48" y="64" xlink:href="#p" />
|
||||
<use x="48" y="80" xlink:href="#p" />
|
||||
<use x="48" y="96" xlink:href="#p" />
|
||||
<use x="48" y="104" xlink:href="#p" />
|
||||
<use x="48" y="120" xlink:href="#p" />
|
||||
<use x="48" y="128" xlink:href="#p" />
|
||||
<use x="48" y="144" xlink:href="#p" />
|
||||
<use x="48" y="160" xlink:href="#p" />
|
||||
<use x="48" y="168" xlink:href="#p" />
|
||||
<use x="48" y="176" xlink:href="#p" />
|
||||
<use x="48" y="192" xlink:href="#p" />
|
||||
<use x="56" y="32" xlink:href="#p" />
|
||||
<use x="56" y="48" xlink:href="#p" />
|
||||
<use x="56" y="56" xlink:href="#p" />
|
||||
<use x="56" y="64" xlink:href="#p" />
|
||||
<use x="56" y="80" xlink:href="#p" />
|
||||
<use x="56" y="96" xlink:href="#p" />
|
||||
<use x="56" y="104" xlink:href="#p" />
|
||||
<use x="56" y="112" xlink:href="#p" />
|
||||
<use x="56" y="128" xlink:href="#p" />
|
||||
<use x="56" y="144" xlink:href="#p" />
|
||||
<use x="56" y="160" xlink:href="#p" />
|
||||
<use x="56" y="168" xlink:href="#p" />
|
||||
<use x="56" y="176" xlink:href="#p" />
|
||||
<use x="56" y="192" xlink:href="#p" />
|
||||
<use x="64" y="32" xlink:href="#p" />
|
||||
<use x="64" y="48" xlink:href="#p" />
|
||||
<use x="64" y="56" xlink:href="#p" />
|
||||
<use x="64" y="64" xlink:href="#p" />
|
||||
<use x="64" y="80" xlink:href="#p" />
|
||||
<use x="64" y="96" xlink:href="#p" />
|
||||
<use x="64" y="104" xlink:href="#p" />
|
||||
<use x="64" y="112" xlink:href="#p" />
|
||||
<use x="64" y="120" xlink:href="#p" />
|
||||
<use x="64" y="144" xlink:href="#p" />
|
||||
<use x="64" y="160" xlink:href="#p" />
|
||||
<use x="64" y="168" xlink:href="#p" />
|
||||
<use x="64" y="176" xlink:href="#p" />
|
||||
<use x="64" y="192" xlink:href="#p" />
|
||||
<use x="72" y="32" xlink:href="#p" />
|
||||
<use x="72" y="80" xlink:href="#p" />
|
||||
<use x="72" y="104" xlink:href="#p" />
|
||||
<use x="72" y="120" xlink:href="#p" />
|
||||
<use x="72" y="144" xlink:href="#p" />
|
||||
<use x="72" y="192" xlink:href="#p" />
|
||||
<use x="80" y="32" xlink:href="#p" />
|
||||
<use x="80" y="40" xlink:href="#p" />
|
||||
<use x="80" y="48" xlink:href="#p" />
|
||||
<use x="80" y="56" xlink:href="#p" />
|
||||
<use x="80" y="64" xlink:href="#p" />
|
||||
<use x="80" y="72" xlink:href="#p" />
|
||||
<use x="80" y="80" xlink:href="#p" />
|
||||
<use x="80" y="96" xlink:href="#p" />
|
||||
<use x="80" y="112" xlink:href="#p" />
|
||||
<use x="80" y="128" xlink:href="#p" />
|
||||
<use x="80" y="144" xlink:href="#p" />
|
||||
<use x="80" y="152" xlink:href="#p" />
|
||||
<use x="80" y="160" xlink:href="#p" />
|
||||
<use x="80" y="168" xlink:href="#p" />
|
||||
<use x="80" y="176" xlink:href="#p" />
|
||||
<use x="80" y="184" xlink:href="#p" />
|
||||
<use x="80" y="192" xlink:href="#p" />
|
||||
<use x="88" y="96" xlink:href="#p" />
|
||||
<use x="88" y="104" xlink:href="#p" />
|
||||
<use x="88" y="112" xlink:href="#p" />
|
||||
<use x="88" y="128" xlink:href="#p" />
|
||||
<use x="96" y="40" xlink:href="#p" />
|
||||
<use x="96" y="56" xlink:href="#p" />
|
||||
<use x="96" y="72" xlink:href="#p" />
|
||||
<use x="96" y="80" xlink:href="#p" />
|
||||
<use x="96" y="96" xlink:href="#p" />
|
||||
<use x="96" y="136" xlink:href="#p" />
|
||||
<use x="96" y="144" xlink:href="#p" />
|
||||
<use x="96" y="160" xlink:href="#p" />
|
||||
<use x="96" y="168" xlink:href="#p" />
|
||||
<use x="96" y="176" xlink:href="#p" />
|
||||
<use x="96" y="184" xlink:href="#p" />
|
||||
<use x="96" y="192" xlink:href="#p" />
|
||||
<use x="104" y="40" xlink:href="#p" />
|
||||
<use x="104" y="56" xlink:href="#p" />
|
||||
<use x="104" y="64" xlink:href="#p" />
|
||||
<use x="104" y="88" xlink:href="#p" />
|
||||
<use x="104" y="120" xlink:href="#p" />
|
||||
<use x="104" y="128" xlink:href="#p" />
|
||||
<use x="104" y="136" xlink:href="#p" />
|
||||
<use x="104" y="144" xlink:href="#p" />
|
||||
<use x="104" y="152" xlink:href="#p" />
|
||||
<use x="104" y="160" xlink:href="#p" />
|
||||
<use x="104" y="168" xlink:href="#p" />
|
||||
<use x="104" y="176" xlink:href="#p" />
|
||||
<use x="112" y="32" xlink:href="#p" />
|
||||
<use x="112" y="40" xlink:href="#p" />
|
||||
<use x="112" y="48" xlink:href="#p" />
|
||||
<use x="112" y="80" xlink:href="#p" />
|
||||
<use x="112" y="104" xlink:href="#p" />
|
||||
<use x="112" y="112" xlink:href="#p" />
|
||||
<use x="112" y="128" xlink:href="#p" />
|
||||
<use x="112" y="144" xlink:href="#p" />
|
||||
<use x="112" y="184" xlink:href="#p" />
|
||||
<use x="112" y="192" xlink:href="#p" />
|
||||
<use x="120" y="32" xlink:href="#p" />
|
||||
<use x="120" y="48" xlink:href="#p" />
|
||||
<use x="120" y="72" xlink:href="#p" />
|
||||
<use x="120" y="96" xlink:href="#p" />
|
||||
<use x="120" y="104" xlink:href="#p" />
|
||||
<use x="120" y="120" xlink:href="#p" />
|
||||
<use x="120" y="144" xlink:href="#p" />
|
||||
<use x="120" y="160" xlink:href="#p" />
|
||||
<use x="120" y="168" xlink:href="#p" />
|
||||
<use x="120" y="184" xlink:href="#p" />
|
||||
<use x="128" y="32" xlink:href="#p" />
|
||||
<use x="128" y="40" xlink:href="#p" />
|
||||
<use x="128" y="48" xlink:href="#p" />
|
||||
<use x="128" y="56" xlink:href="#p" />
|
||||
<use x="128" y="64" xlink:href="#p" />
|
||||
<use x="128" y="80" xlink:href="#p" />
|
||||
<use x="128" y="104" xlink:href="#p" />
|
||||
<use x="128" y="112" xlink:href="#p" />
|
||||
<use x="128" y="120" xlink:href="#p" />
|
||||
<use x="128" y="128" xlink:href="#p" />
|
||||
<use x="128" y="136" xlink:href="#p" />
|
||||
<use x="128" y="168" xlink:href="#p" />
|
||||
<use x="128" y="176" xlink:href="#p" />
|
||||
<use x="128" y="184" xlink:href="#p" />
|
||||
<use x="128" y="192" xlink:href="#p" />
|
||||
<use x="136" y="96" xlink:href="#p" />
|
||||
<use x="136" y="104" xlink:href="#p" />
|
||||
<use x="136" y="112" xlink:href="#p" />
|
||||
<use x="136" y="120" xlink:href="#p" />
|
||||
<use x="136" y="136" xlink:href="#p" />
|
||||
<use x="136" y="168" xlink:href="#p" />
|
||||
<use x="136" y="184" xlink:href="#p" />
|
||||
<use x="144" y="32" xlink:href="#p" />
|
||||
<use x="144" y="40" xlink:href="#p" />
|
||||
<use x="144" y="48" xlink:href="#p" />
|
||||
<use x="144" y="56" xlink:href="#p" />
|
||||
<use x="144" y="64" xlink:href="#p" />
|
||||
<use x="144" y="72" xlink:href="#p" />
|
||||
<use x="144" y="80" xlink:href="#p" />
|
||||
<use x="144" y="128" xlink:href="#p" />
|
||||
<use x="144" y="168" xlink:href="#p" />
|
||||
<use x="144" y="176" xlink:href="#p" />
|
||||
<use x="144" y="184" xlink:href="#p" />
|
||||
<use x="152" y="32" xlink:href="#p" />
|
||||
<use x="152" y="80" xlink:href="#p" />
|
||||
<use x="152" y="96" xlink:href="#p" />
|
||||
<use x="152" y="136" xlink:href="#p" />
|
||||
<use x="152" y="152" xlink:href="#p" />
|
||||
<use x="152" y="168" xlink:href="#p" />
|
||||
<use x="152" y="192" xlink:href="#p" />
|
||||
<use x="160" y="32" xlink:href="#p" />
|
||||
<use x="160" y="48" xlink:href="#p" />
|
||||
<use x="160" y="56" xlink:href="#p" />
|
||||
<use x="160" y="64" xlink:href="#p" />
|
||||
<use x="160" y="80" xlink:href="#p" />
|
||||
<use x="160" y="104" xlink:href="#p" />
|
||||
<use x="160" y="120" xlink:href="#p" />
|
||||
<use x="160" y="128" xlink:href="#p" />
|
||||
<use x="160" y="136" xlink:href="#p" />
|
||||
<use x="160" y="160" xlink:href="#p" />
|
||||
<use x="160" y="168" xlink:href="#p" />
|
||||
<use x="160" y="184" xlink:href="#p" />
|
||||
<use x="168" y="32" xlink:href="#p" />
|
||||
<use x="168" y="48" xlink:href="#p" />
|
||||
<use x="168" y="56" xlink:href="#p" />
|
||||
<use x="168" y="64" xlink:href="#p" />
|
||||
<use x="168" y="80" xlink:href="#p" />
|
||||
<use x="168" y="96" xlink:href="#p" />
|
||||
<use x="168" y="104" xlink:href="#p" />
|
||||
<use x="168" y="112" xlink:href="#p" />
|
||||
<use x="168" y="120" xlink:href="#p" />
|
||||
<use x="168" y="128" xlink:href="#p" />
|
||||
<use x="168" y="152" xlink:href="#p" />
|
||||
<use x="168" y="160" xlink:href="#p" />
|
||||
<use x="168" y="168" xlink:href="#p" />
|
||||
<use x="168" y="184" xlink:href="#p" />
|
||||
<use x="176" y="32" xlink:href="#p" />
|
||||
<use x="176" y="48" xlink:href="#p" />
|
||||
<use x="176" y="56" xlink:href="#p" />
|
||||
<use x="176" y="64" xlink:href="#p" />
|
||||
<use x="176" y="80" xlink:href="#p" />
|
||||
<use x="176" y="104" xlink:href="#p" />
|
||||
<use x="176" y="112" xlink:href="#p" />
|
||||
<use x="176" y="120" xlink:href="#p" />
|
||||
<use x="176" y="144" xlink:href="#p" />
|
||||
<use x="176" y="152" xlink:href="#p" />
|
||||
<use x="176" y="168" xlink:href="#p" />
|
||||
<use x="176" y="176" xlink:href="#p" />
|
||||
<use x="176" y="184" xlink:href="#p" />
|
||||
<use x="184" y="32" xlink:href="#p" />
|
||||
<use x="184" y="80" xlink:href="#p" />
|
||||
<use x="184" y="96" xlink:href="#p" />
|
||||
<use x="184" y="112" xlink:href="#p" />
|
||||
<use x="184" y="128" xlink:href="#p" />
|
||||
<use x="184" y="144" xlink:href="#p" />
|
||||
<use x="184" y="152" xlink:href="#p" />
|
||||
<use x="184" y="192" xlink:href="#p" />
|
||||
<use x="192" y="32" xlink:href="#p" />
|
||||
<use x="192" y="40" xlink:href="#p" />
|
||||
<use x="192" y="48" xlink:href="#p" />
|
||||
<use x="192" y="56" xlink:href="#p" />
|
||||
<use x="192" y="64" xlink:href="#p" />
|
||||
<use x="192" y="72" xlink:href="#p" />
|
||||
<use x="192" y="80" xlink:href="#p" />
|
||||
<use x="192" y="104" xlink:href="#p" />
|
||||
<use x="192" y="120" xlink:href="#p" />
|
||||
<use x="192" y="128" xlink:href="#p" />
|
||||
<use x="192" y="160" xlink:href="#p" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -8,4 +8,6 @@
|
||||
<Match>
|
||||
<Class name="~.*\.R\$.*"/>
|
||||
</Match>
|
||||
<Bug pattern="PATH_TRAVERSAL_IN" />
|
||||
<Bug pattern="ANDROID_EXTERNAL_FILE_ACCESS" />
|
||||
</FindBugsFilter>
|
||||
@@ -0,0 +1,7 @@
|
||||
# can be overriden by ~/.gradle/gradle.properties
|
||||
NC_TEST_SERVER_BASEURL=http://server
|
||||
NC_TEST_SERVER_USERNAME=test
|
||||
NC_TEST_SERVER_PASSWORD=test
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
android.debug.obsoleteApi=true
|
||||
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
distributionSha256Sum=7a2c66d1a78f811d5f37d14630ad21cec5e77a2a4dc61e787e2257a6341016ce
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
||||
distributionSha256Sum=36bf7ff499223d5139f005822130ccca784c91591b514677fd376eed966c907e
|
||||
@@ -1,17 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
<issue id="UnusedAttribute">
|
||||
<ignore regexp="importantForAutofill"/>
|
||||
<ignore regexp="autofillHints"/>
|
||||
</issue>
|
||||
<issue id="InvalidPackage">
|
||||
<ignore path="**/freemarker-2.3.23.jar"/>
|
||||
<ignore path="**/freemarker-2.3.28.jar" />
|
||||
<ignore path="**/nnio-0.2.jar"/>
|
||||
<ignore path="**/pkix-1.54.0.0.jar"/>
|
||||
</issue>
|
||||
|
||||
|
||||
<issue id="UnusedResources">
|
||||
<ignore regexp="store_short_desc|store_full_desc|store_short_dev_desc|store_full_dev_desc" />
|
||||
<ignore
|
||||
regexp="screenshot_01_gridView|screenshot_02_listView|screenshot_03_drawer|screenshot_04_accounts|screenshot_05_autoUpload|screenshot_06_davdroid"/>
|
||||
<ignore path="**/raw/encryption_key_words.txt" />
|
||||
</issue>
|
||||
|
||||
|
||||
<issue id="MissingQuantity">
|
||||
<ignore path="**/values-ka-rGE/strings.xml"/>
|
||||
</issue>
|
||||
@@ -28,178 +33,15 @@
|
||||
</issue>
|
||||
|
||||
<issue id="UnusedResources">
|
||||
<ignore path="**/values-b+en+001/strings.xml"/>
|
||||
<ignore path="**/values-b+es+419/strings.xml" />
|
||||
<ignore path="**/values-pt-rPT/strings.xml"/>
|
||||
<ignore path="**/values-ro/strings.xml"/>
|
||||
<ignore path="**/values-zh-rCN/strings.xml"/>
|
||||
<ignore path="**/values-bg-rBG/strings.xml"/>
|
||||
<ignore path="**/values-nb-rNO/strings.xml"/>
|
||||
<ignore path="**/values-es/strings.xml"/>
|
||||
<ignore path="**/values-fa/strings.xml"/>
|
||||
<ignore path="**/values-ko/strings.xml"/>
|
||||
<ignore path="**/values-ru/strings.xml"/>
|
||||
<ignore path="**/values-ast/strings.xml"/>
|
||||
<ignore path="**/values-es-rCO/strings.xml"/>
|
||||
<ignore path="**/values-es-rCL/strings.xml"/>
|
||||
<ignore path="**/values-es-rSV/strings.xml"/>
|
||||
<ignore path="**/values-sv/strings.xml"/>
|
||||
<ignore path="**/values-tr/strings.xml"/>
|
||||
<ignore path="**/values-es-rUY/strings.xml"/>
|
||||
<ignore path="**/values-es-rGT/strings.xml"/>
|
||||
<ignore path="**/values-fr/strings.xml"/>
|
||||
<ignore path="**/values-es-rMX/strings.xml"/>
|
||||
<ignore path="**/values-fi-rFI/strings.xml"/>
|
||||
<ignore path="**/values-ar/strings.xml"/>
|
||||
<ignore path="**/values-es-rAR/strings.xml"/>
|
||||
<ignore path="**/values-de-rDE/strings.xml"/>
|
||||
<ignore path="**/values-ca/strings.xml"/>
|
||||
<ignore path="**/values-is/strings.xml"/>
|
||||
<ignore path="**/values-es-rNI/strings.xml"/>
|
||||
<ignore path="**/values-es-rPR/strings.xml"/>
|
||||
<ignore path="**/values-es-rDO/strings.xml"/>
|
||||
<ignore path="**/values-sq/strings.xml"/>
|
||||
<ignore path="**/values-pt-rBR/strings.xml"/>
|
||||
<ignore path="**/values-ja-rJP/strings.xml"/>
|
||||
<ignore path="**/values-sr/strings.xml"/>
|
||||
<ignore path="**/values-it/strings.xml"/>
|
||||
<ignore path="**/values-hu-rHU/strings.xml"/>
|
||||
<ignore path="**/values-pl/strings.xml"/>
|
||||
<ignore path="**/values-es-rHN/strings.xml"/>
|
||||
<ignore path="**/values-lt-rLT/strings.xml"/>
|
||||
<ignore path="**/values-es-rPA/strings.xml"/>
|
||||
<ignore path="**/values-nl/strings.xml"/>
|
||||
<ignore path="**/values-sk-rSK/strings.xml"/>
|
||||
<ignore path="**/values-ka-rGE/strings.xml"/>
|
||||
<ignore path="**/values-eu/strings.xml"/>
|
||||
<ignore path="**/values-es-rCR/strings.xml"/>
|
||||
<ignore path="**/values-da/strings.xml"/>
|
||||
<ignore path="**/values-es-rEC/strings.xml"/>
|
||||
<ignore path="**/values-de/strings.xml"/>
|
||||
<ignore path="**/values-sl/strings.xml"/>
|
||||
<ignore path="**/values-es-rPY/strings.xml"/>
|
||||
<ignore path="**/values-es-rPE/strings.xml"/>
|
||||
<ignore path="**/values-zh-rTW/strings.xml"/>
|
||||
<ignore path="**/values-el/strings.xml"/>
|
||||
<ignore path="**/values-id/strings.xml"/>
|
||||
<ignore path="**/values-cs-rCZ/strings.xml"/>
|
||||
<ignore path="**/values-en-rGB/strings.xml"/>
|
||||
<ignore path="**/values-**/strings.xml" />
|
||||
</issue>
|
||||
|
||||
|
||||
<issue id="TypographyEllipsis">
|
||||
<ignore path="**/values-b+en+001/strings.xml"/>
|
||||
<ignore path="**/values-pt-rPT/strings.xml"/>
|
||||
<ignore path="**/values-ro/strings.xml"/>
|
||||
<ignore path="**/values-zh-rCN/strings.xml"/>
|
||||
<ignore path="**/values-bg-rBG/strings.xml"/>
|
||||
<ignore path="**/values-nb-rNO/strings.xml"/>
|
||||
<ignore path="**/values-es/strings.xml"/>
|
||||
<ignore path="**/values-fa/strings.xml"/>
|
||||
<ignore path="**/values-ko/strings.xml"/>
|
||||
<ignore path="**/values-ru/strings.xml"/>
|
||||
<ignore path="**/values-ast/strings.xml"/>
|
||||
<ignore path="**/values-es-rCO/strings.xml"/>
|
||||
<ignore path="**/values-es-rCL/strings.xml"/>
|
||||
<ignore path="**/values-es-rSV/strings.xml"/>
|
||||
<ignore path="**/values-sv/strings.xml"/>
|
||||
<ignore path="**/values-tr/strings.xml"/>
|
||||
<ignore path="**/values-es-rUY/strings.xml"/>
|
||||
<ignore path="**/values-es-rGT/strings.xml"/>
|
||||
<ignore path="**/values-fr/strings.xml"/>
|
||||
<ignore path="**/values-es-rMX/strings.xml"/>
|
||||
<ignore path="**/values-fi-rFI/strings.xml"/>
|
||||
<ignore path="**/values-ar/strings.xml"/>
|
||||
<ignore path="**/values-es-rAR/strings.xml"/>
|
||||
<ignore path="**/values-de-rDE/strings.xml"/>
|
||||
<ignore path="**/values-ca/strings.xml"/>
|
||||
<ignore path="**/values-is/strings.xml"/>
|
||||
<ignore path="**/values-es-rNI/strings.xml"/>
|
||||
<ignore path="**/values-es-rPR/strings.xml"/>
|
||||
<ignore path="**/values-es-rDO/strings.xml"/>
|
||||
<ignore path="**/values-sq/strings.xml"/>
|
||||
<ignore path="**/values-pt-rBR/strings.xml"/>
|
||||
<ignore path="**/values-ja-rJP/strings.xml"/>
|
||||
<ignore path="**/values-sr/strings.xml"/>
|
||||
<ignore path="**/values-it/strings.xml"/>
|
||||
<ignore path="**/values-hu-rHU/strings.xml"/>
|
||||
<ignore path="**/values-pl/strings.xml"/>
|
||||
<ignore path="**/values-es-rHN/strings.xml"/>
|
||||
<ignore path="**/values-lt-rLT/strings.xml"/>
|
||||
<ignore path="**/values-es-rPA/strings.xml"/>
|
||||
<ignore path="**/values-nl/strings.xml"/>
|
||||
<ignore path="**/values-sk-rSK/strings.xml"/>
|
||||
<ignore path="**/values-ka-rGE/strings.xml"/>
|
||||
<ignore path="**/values-eu/strings.xml"/>
|
||||
<ignore path="**/values-es-rCR/strings.xml"/>
|
||||
<ignore path="**/values-da/strings.xml"/>
|
||||
<ignore path="**/values-es-rEC/strings.xml"/>
|
||||
<ignore path="**/values-de/strings.xml"/>
|
||||
<ignore path="**/values-sl/strings.xml"/>
|
||||
<ignore path="**/values-es-rPY/strings.xml"/>
|
||||
<ignore path="**/values-es-rPE/strings.xml"/>
|
||||
<ignore path="**/values-zh-rTW/strings.xml"/>
|
||||
<ignore path="**/values-el/strings.xml"/>
|
||||
<ignore path="**/values-id/strings.xml"/>
|
||||
<ignore path="**/values-cs-rCZ/strings.xml"/>
|
||||
<ignore path="**/values-en-rGB/strings.xml"/>
|
||||
<ignore path="**/values-**/strings.xml" />
|
||||
</issue>
|
||||
|
||||
<issue id="Typos">
|
||||
<ignore path="**/values-b+en+001/strings.xml"/>
|
||||
<ignore path="**/values-pt-rPT/strings.xml"/>
|
||||
<ignore path="**/values-ro/strings.xml"/>
|
||||
<ignore path="**/values-zh-rCN/strings.xml"/>
|
||||
<ignore path="**/values-bg-rBG/strings.xml"/>
|
||||
<ignore path="**/values-nb-rNO/strings.xml"/>
|
||||
<ignore path="**/values-es/strings.xml"/>
|
||||
<ignore path="**/values-fa/strings.xml"/>
|
||||
<ignore path="**/values-ko/strings.xml"/>
|
||||
<ignore path="**/values-ru/strings.xml"/>
|
||||
<ignore path="**/values-ast/strings.xml"/>
|
||||
<ignore path="**/values-es-rCO/strings.xml"/>
|
||||
<ignore path="**/values-es-rCL/strings.xml"/>
|
||||
<ignore path="**/values-es-rSV/strings.xml"/>
|
||||
<ignore path="**/values-sv/strings.xml"/>
|
||||
<ignore path="**/values-tr/strings.xml"/>
|
||||
<ignore path="**/values-es-rUY/strings.xml"/>
|
||||
<ignore path="**/values-es-rGT/strings.xml"/>
|
||||
<ignore path="**/values-fr/strings.xml"/>
|
||||
<ignore path="**/values-es-rMX/strings.xml"/>
|
||||
<ignore path="**/values-fi-rFI/strings.xml"/>
|
||||
<ignore path="**/values-ar/strings.xml"/>
|
||||
<ignore path="**/values-es-rAR/strings.xml"/>
|
||||
<ignore path="**/values-de-rDE/strings.xml"/>
|
||||
<ignore path="**/values-ca/strings.xml"/>
|
||||
<ignore path="**/values-is/strings.xml"/>
|
||||
<ignore path="**/values-es-rNI/strings.xml"/>
|
||||
<ignore path="**/values-es-rPR/strings.xml"/>
|
||||
<ignore path="**/values-es-rDO/strings.xml"/>
|
||||
<ignore path="**/values-sq/strings.xml"/>
|
||||
<ignore path="**/values-pt-rBR/strings.xml"/>
|
||||
<ignore path="**/values-ja-rJP/strings.xml"/>
|
||||
<ignore path="**/values-sr/strings.xml"/>
|
||||
<ignore path="**/values-it/strings.xml"/>
|
||||
<ignore path="**/values-hu-rHU/strings.xml"/>
|
||||
<ignore path="**/values-pl/strings.xml"/>
|
||||
<ignore path="**/values-es-rHN/strings.xml"/>
|
||||
<ignore path="**/values-lt-rLT/strings.xml"/>
|
||||
<ignore path="**/values-es-rPA/strings.xml"/>
|
||||
<ignore path="**/values-nl/strings.xml"/>
|
||||
<ignore path="**/values-sk-rSK/strings.xml"/>
|
||||
<ignore path="**/values-ka-rGE/strings.xml"/>
|
||||
<ignore path="**/values-eu/strings.xml"/>
|
||||
<ignore path="**/values-es-rCR/strings.xml"/>
|
||||
<ignore path="**/values-da/strings.xml"/>
|
||||
<ignore path="**/values-es-rEC/strings.xml"/>
|
||||
<ignore path="**/values-de/strings.xml"/>
|
||||
<ignore path="**/values-sl/strings.xml"/>
|
||||
<ignore path="**/values-es-rPY/strings.xml"/>
|
||||
<ignore path="**/values-es-rPE/strings.xml"/>
|
||||
<ignore path="**/values-zh-rTW/strings.xml"/>
|
||||
<ignore path="**/values-el/strings.xml"/>
|
||||
<ignore path="**/values-id/strings.xml"/>
|
||||
<ignore path="**/values-cs-rCZ/strings.xml"/>
|
||||
<ignore path="**/values-en-rGB/strings.xml"/>
|
||||
|
||||
<issue id="Typos">
|
||||
<ignore path="**/values-**/strings.xml" />
|
||||
</issue>
|
||||
|
||||
</lint>
|
||||
@@ -8,10 +8,14 @@
|
||||
#6: DRONE_BUILD_NUMBER
|
||||
#7: PULL_REQUEST_NUMBER
|
||||
|
||||
stableBranch="master"
|
||||
repository="android"
|
||||
|
||||
ruby scripts/analysis/lint-up.rb $1 $2 $3
|
||||
lintValue=$?
|
||||
|
||||
./gradlew findbugs
|
||||
ruby scripts/analysis/findbugs-up.rb $1 $2 $3
|
||||
findbugsValue=$?
|
||||
|
||||
# exit codes:
|
||||
# 0: count was reduced
|
||||
@@ -20,62 +24,105 @@ lintValue=$?
|
||||
|
||||
echo "Branch: $3"
|
||||
|
||||
if [ $3 = "master" ]; then
|
||||
echo "New findbugs result for master at: https://www.kaminsky.me/nc-dev/client-findbugs/master.html"
|
||||
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/findbugs/master.html --upload-file build/reports/findbugs/findbugs.html
|
||||
|
||||
summary=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" build/reports/findbugs/findbugs.html | head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s'/Summary/FindBugs (master)/' | tr "\"" "\'" | tr -d "\r\n")
|
||||
curl -u $4:$5 -X PUT -d "$summary" https://nextcloud.kaminsky.me/remote.php/webdav/findbugs/findbugs.html
|
||||
|
||||
if [ $3 = $stableBranch ]; then
|
||||
echo "New findbugs result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html"
|
||||
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$stableBranch.html --upload-file build/reports/findbugs/findbugs.html
|
||||
|
||||
summary=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" build/reports/findbugs/findbugs.html | head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"/Summary/FindBugs ($stableBranch)/" | tr "\"" "\'" | tr -d "\r\n")
|
||||
curl -u $4:$5 -X PUT -d "$summary" https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/findbugs-summary-$stableBranch.html
|
||||
|
||||
if [ $lintValue -ne 1 ]; then
|
||||
echo "New lint result for master at: https://www.kaminsky.me/nc-dev/client-lint/master.html"
|
||||
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/droneLogs/master.html --upload-file build/reports/lint/lint.html
|
||||
echo "New lint result for $stableBranch at: https://www.kaminsky.me/nc-dev/$repository-lint/$stableBranch.html"
|
||||
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/$stableBranch.html --upload-file build/reports/lint/lint.html
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
if [ -e $6 ]; then
|
||||
6="master-"$(date +%F)
|
||||
6=$stableBranch"-"$(date +%F)
|
||||
fi
|
||||
echo "New lint results at https://www.kaminsky.me/nc-dev/client-lint/$6.html"
|
||||
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/droneLogs/$6.html --upload-file build/reports/lint/lint.html
|
||||
|
||||
echo "New findbugs results at https://www.kaminsky.me/nc-dev/client-findbugs/$6.html"
|
||||
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/findbugs/$6.html --upload-file build/reports/findbugs/findbugs.html
|
||||
|
||||
echo "New lint results at https://www.kaminsky.me/nc-dev/$repository-lint/$6.html"
|
||||
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-lint/$6.html --upload-file build/reports/lint/lint.html
|
||||
|
||||
echo "New findbugs results at https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html"
|
||||
curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/$repository-findbugs/$6.html --upload-file build/reports/findbugs/findbugs.html
|
||||
|
||||
# delete all old comments
|
||||
oldComments=$(curl 2>/dev/null -u $1:$2 -X GET https://api.github.com/repos/nextcloud/android/issues/$7/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) ' | grep true | tr -d "\"" | cut -f1 -d"|")
|
||||
|
||||
echo $oldComments | while read comment ; do
|
||||
oldComments=$(curl 2>/dev/null -u $1:$2 -X GET https://api.github.com/repos/nextcloud/android/issues/$7/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) ' | grep true | tr -d "\"" | cut -f1 -d"|")
|
||||
|
||||
echo $oldComments | while read comment ; do
|
||||
curl 2>/dev/null -u $1:$2 -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
|
||||
done
|
||||
|
||||
|
||||
# check library, only if base branch is master
|
||||
baseBranch=$(scripts/analysis/getBranchBase.sh $1 $2 $7 | tr -d "\"")
|
||||
if [ $baseBranch = "master" -a $(grep "android-library:master" build.gradle -c) -ne 3 ]; then
|
||||
checkLibraryMessage="<h1>Android-library is not set to master branch in build.gradle</h1>"
|
||||
checkLibrary=1
|
||||
else
|
||||
else
|
||||
checkLibrary=0
|
||||
fi
|
||||
|
||||
|
||||
# lint and findbugs file must exist
|
||||
if [ ! -s build/reports/lint/lint.html ] ; then
|
||||
echo "lint.html file is missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -s build/reports/findbugs/findbugs.html ] ; then
|
||||
echo "findbugs.html file is missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# add comment with results
|
||||
lintResultNew=$(grep "Lint Report.* [0-9]* warnings" build/reports/lint/lint.html | cut -f2 -d':' |cut -f1 -d'<')
|
||||
lintErrorNew=$(echo $lintResultNew | grep "[0-9]* error" -o | cut -f1 -d" ")
|
||||
lintWarningNew=$(echo $lintResultNew | grep "[0-9]* warning" -o | cut -f1 -d" ")
|
||||
lintErrorOld=$(grep "[0-9]* error" scripts/analysis/lint-results.txt -o | cut -f1 -d" ")
|
||||
lintWarningOld=$(grep "[0-9]* warning" scripts/analysis/lint-results.txt -o | cut -f1 -d" ")
|
||||
lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>Type</td><td><a href='https://www.kaminsky.me/nc-dev/client-lint/master.html'>Master</a></td><td><a href='https://www.kaminsky.me/nc-dev/client-lint/"$6".html'>PR</a></td></tr><tr class='tablerow1'><td>Warnings</td><td>"$lintWarningOld"</td><td>"$lintWarningNew"</td></tr><tr class='tablerow0'><td>Errors</td><td>"$lintErrorOld"</td><td>"$lintErrorNew"</td></tr></table>"
|
||||
findbugsResultNew=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" build/reports/findbugs/findbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"#Summary#<a href=\"https://www.kaminsky.me/nc-dev/client-findbugs/$6.html\">FindBugs</a> (new)#" | tr "\"" "\'" | tr -d "\n")
|
||||
findbugsResultOld=$(curl 2>/dev/null https://nextcloud.kaminsky.me/index.php/s/YaHngKMM6ERmBeg/download | tr "\"" "\'" | tr -d "\r\n" | sed s'#FindBugs#<a href=\"https://www.kaminsky.me/nc-dev/client-findbugs/master.html">FindBugs</a>#'| tr "\"" "\'" | tr -d "\n")
|
||||
curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld $checkLibraryMessage \" }"
|
||||
|
||||
lintResultNew=$(grep "Lint Report.* [0-9]* warning" build/reports/lint/lint.html | cut -f2 -d':' |cut -f1 -d'<')
|
||||
|
||||
lintErrorNew=$(echo $lintResultNew | grep "[0-9]* error" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintErrorNew ] ); then
|
||||
lintErrorNew=0
|
||||
fi
|
||||
|
||||
lintWarningNew=$(echo $lintResultNew | grep "[0-9]* warning" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintWarningNew ] ); then
|
||||
lintWarningNew=0
|
||||
fi
|
||||
|
||||
lintResultOld=$(curl 2>/dev/null https://raw.githubusercontent.com/nextcloud/android/$stableBranch/scripts/analysis/lint-results.txt)
|
||||
lintErrorOld=$(echo $lintResultOld | grep "[0-9]* error" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintErrorOld ] ); then
|
||||
lintErrorOld=0
|
||||
fi
|
||||
|
||||
lintWarningOld=$(echo $lintResultOld | grep "[0-9]* warning" -o | cut -f1 -d" ")
|
||||
if ( [ -z $lintWarningOld ] ); then
|
||||
lintWarningOld=0
|
||||
fi
|
||||
|
||||
lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>Type</td><td><a href='https://www.kaminsky.me/nc-dev/"$repository"-lint/"$stableBranch".html'>$stableBranch</a></td><td><a href='https://www.kaminsky.me/nc-dev/"$repository"-lint/"$6".html'>PR</a></td></tr><tr class='tablerow1'><td>Warnings</td><td>"$lintWarningOld"</td><td>"$lintWarningNew"</td></tr><tr class='tablerow0'><td>Errors</td><td>"$lintErrorOld"</td><td>"$lintErrorNew"</td></tr></table>"
|
||||
findbugsResultNew=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" build/reports/findbugs/findbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s"#Summary#<a href=\"https://www.kaminsky.me/nc-dev/$repository-findbugs/$6.html\">FindBugs</a> (new)#" | tr "\"" "\'" | tr -d "\n")
|
||||
findbugsResultOld=$(curl 2>/dev/null https://www.kaminsky.me/nc-dev/$repository-findbugs/findbugs-summary-$stableBranch.html | tr "\"" "\'" | tr -d "\r\n" | sed s"#FindBugs#<a href=\"https://www.kaminsky.me/nc-dev/$repository-findbugs/$stableBranch.html\">FindBugs</a>#" | tr "\"" "\'" | tr -d "\n")
|
||||
|
||||
|
||||
if ( [ $lintValue -eq 1 ] ) ; then
|
||||
lintMessage="<h1>Lint increased!</h1>"
|
||||
fi
|
||||
|
||||
if ( [ $findbugsValue -eq 1 ] ) ; then
|
||||
findbugsMessage="<h1>Findbugs increased!</h1>"
|
||||
fi
|
||||
|
||||
curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld $checkLibraryMessage $lintMessage $findbugsMessage \" }"
|
||||
|
||||
if [ $checkLibrary -eq 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $lintValue -eq 2 ]; then
|
||||
|
||||
if [ ! $lintValue -eq 2 ]; then
|
||||
exit $lintValue
|
||||
fi
|
||||
|
||||
if [ $findbugsValue -eq 2 ]; then
|
||||
exit 0
|
||||
else
|
||||
exit $lintValue
|
||||
fi
|
||||
exit $findbugsValue
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1 @@
|
||||
475
|
||||
@@ -0,0 +1,130 @@
|
||||
## Script from https://github.com/tir38/android-lint-entropy-reducer at 07.05.2017
|
||||
# adapts to drone, use git username / token as parameter
|
||||
|
||||
Encoding.default_external = Encoding::UTF_8
|
||||
Encoding.default_internal = Encoding::UTF_8
|
||||
|
||||
puts "=================== starting Android FindBugs Entropy Reducer ===================="
|
||||
|
||||
# get args
|
||||
git_user, git_token, git_branch = ARGV
|
||||
|
||||
# ======================== SETUP ============================
|
||||
|
||||
# User name for git commits made by this script.
|
||||
TRAVIS_GIT_USERNAME = String.new("Drone CI server")
|
||||
|
||||
# File name and relative path of generated FindBugs report. Must match build.gradle file:
|
||||
# lintOptions {
|
||||
# htmlOutput file("[FILE_NAME].html")
|
||||
# }
|
||||
FINDBUGS_REPORT_FILE = String.new("build/reports/findbugs/findbugs.html")
|
||||
|
||||
# File name and relative path of previous results of this script.
|
||||
PREVIOUS_FINDBUGS_RESULTS_FILE=String.new("scripts/analysis/findbugs-results.txt")
|
||||
|
||||
# Flag to evaluate warnings. true = check warnings; false = ignore warnings
|
||||
CHECK_WARNINGS = true
|
||||
|
||||
# File name and relative path to custom FindBugs rules; Can be null or "".
|
||||
CUSTOM_FINDBUGS_FILE = String.new("")
|
||||
|
||||
# ================ SETUP DONE; DON'T TOUCH ANYTHING BELOW ================
|
||||
|
||||
require 'fileutils'
|
||||
require 'pathname'
|
||||
require 'open3'
|
||||
|
||||
# since we need the xml-simple gem, and we want this script self-contained, let's grab it just when we need it
|
||||
begin
|
||||
gem "xml-simple"
|
||||
rescue LoadError
|
||||
system("gem install xml-simple")
|
||||
Gem.clear_paths
|
||||
end
|
||||
|
||||
require 'xmlsimple'
|
||||
|
||||
# run FindBugs
|
||||
puts "running FindBugs..."
|
||||
system './gradlew findbugs'
|
||||
|
||||
# find FindBugs report file
|
||||
findbugs_reports = Dir.glob(FINDBUGS_REPORT_FILE)
|
||||
if findbugs_reports.length == 0
|
||||
puts "Findbugs HTML report not found."
|
||||
exit 1
|
||||
end
|
||||
findbugs_report = String.new(findbugs_reports[0])
|
||||
|
||||
# find number of warnings
|
||||
current_warning_count = `grep -A 3 "<b>Total</b>" build/reports/findbugs/findbugs.html | tail -n1 | cut -f2 -d">" | cut -f1 -d"<"`.to_i
|
||||
puts "found warnings: " + current_warning_count.to_s
|
||||
|
||||
# get warning counts from last successful build
|
||||
|
||||
previous_results = false
|
||||
|
||||
previous_findbugs_reports = Dir.glob(PREVIOUS_FINDBUGS_RESULTS_FILE)
|
||||
if previous_findbugs_reports.nil? || previous_findbugs_reports.length == 0
|
||||
previous_findbugs_report = File.new(PREVIOUS_FINDBUGS_RESULTS_FILE, "w") # create for writing to later
|
||||
else
|
||||
previous_findbugs_report = String.new(previous_findbugs_reports[0])
|
||||
|
||||
previous_warning_count = File.open(previous_findbugs_report, &:readline).match(/[0-9]*/)[0].to_i
|
||||
|
||||
if previous_warning_count.nil?
|
||||
previous_results = false
|
||||
else
|
||||
previous_results = true
|
||||
|
||||
puts "previous warnings: " + previous_warning_count.to_s
|
||||
end
|
||||
end
|
||||
|
||||
# compare previous warning count with current warning count
|
||||
if previous_results == true && current_warning_count > previous_warning_count
|
||||
puts "FAIL: warning count increased"
|
||||
exit 1
|
||||
end
|
||||
|
||||
# check if warning and error count stayed the same
|
||||
if previous_results == true && current_warning_count == previous_warning_count
|
||||
puts "SUCCESS: count stayed the same"
|
||||
exit 2
|
||||
end
|
||||
|
||||
# warning count DECREASED
|
||||
puts "SUCCESS: count decreased from " + previous_warning_count.to_s + " to " + current_warning_count.to_s
|
||||
|
||||
# write new results to file (will overwrite existing, or create new)
|
||||
File.write(previous_findbugs_report, current_warning_count)
|
||||
|
||||
# push changes to github (if this script is run locally, we don't want to overwrite git username and email, so save temporarily)
|
||||
previous_git_username, _ = Open3.capture2('git config user.name')
|
||||
previous_git_username = previous_git_username.strip
|
||||
|
||||
previous_git_email, _ = Open3.capture3('git config user.email')
|
||||
previous_git_email = previous_git_email.strip
|
||||
|
||||
# update git user name and email for this script
|
||||
system ("git config --local user.name '" + git_user + "'")
|
||||
system ("git config --local user.email '[email protected]'")
|
||||
system ("git remote rm origin")
|
||||
system ("git remote add origin https://" + git_user + ":" + git_token + "@github.com/nextcloud/android")
|
||||
|
||||
# add previous FindBugs result file to git
|
||||
system ('git add ' + PREVIOUS_FINDBUGS_RESULTS_FILE)
|
||||
|
||||
# commit changes; Add "skip ci" so that we don't accidentally trigger another Drone build
|
||||
system ('git commit -sm "Drone: update FindBugs results to reflect reduced error/warning count [skip ci]" ')
|
||||
|
||||
# push to origin
|
||||
system ('git push origin HEAD:' + git_branch)
|
||||
|
||||
# restore previous git user name and email
|
||||
system("git config --local user.name '#{previous_git_username}'")
|
||||
system("git config --local user.email '#{previous_git_email}'")
|
||||
|
||||
puts "SUCCESS: count was reduced"
|
||||
exit 0 # success
|
||||
@@ -5,5 +5,5 @@
|
||||
if [ -z $3 ] ; then
|
||||
echo "master";
|
||||
else
|
||||
curl 2>/dev/null -u $1:$2 https://api.github.com/repos/nextcloud/android/pulls/$3 | grep \"ref\": | grep -v master | cut -d"\"" -f4
|
||||
curl 2>/dev/null -u $1:$2 https://api.github.com/repos/nextcloud/android/pulls/$3 | grep \"ref\": | grep -v '"master"' | cut -d"\"" -f4
|
||||
fi
|
||||
@@ -1,2 +1,2 @@
|
||||
DO NOT TOUCH; GENERATED BY DRONE
|
||||
<span class="mdl-layout-title">Lint Report: 94 warnings</span>
|
||||
<span class="mdl-layout-title">Lint Report: 68 warnings</span>
|
||||
@@ -178,7 +178,7 @@ previous_git_email = previous_git_email.strip
|
||||
|
||||
# update git user name and email for this script
|
||||
system ("git config --local user.name '" + git_user + "'")
|
||||
system ("git config --local user.email '.'") # set email blank
|
||||
system ("git config --local user.email '[email protected]'")
|
||||
system ("git remote rm origin")
|
||||
system ("git remote add origin https://" + git_user + ":" + git_token + "@github.com/nextcloud/android")
|
||||
|
||||
@@ -186,7 +186,7 @@ system ("git remote add origin https://" + git_user + ":" + git_token + "@github
|
||||
system ('git add ' + PREVIOUS_LINT_RESULTS_FILE)
|
||||
|
||||
# commit changes; Add "skip ci" so that we don't accidentally trigger another Drone build
|
||||
system ('git commit -m "Drone: update Lint results to reflect reduced error/warning count [skip ci]" ')
|
||||
system ('git commit -sm "Drone: update Lint results to reflect reduced error/warning count [skip ci]" ')
|
||||
|
||||
# push to origin
|
||||
system ('git push origin HEAD:' + git_branch)
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
URL=https://nextcloud.kaminsky.me/remote.php/webdav/integrationTests
|
||||
#1: LOG_USERNAME
|
||||
#2: LOG_PASSWORD
|
||||
#3: DRONE_BUILD_NUMBER
|
||||
#4: TYPE (IT or Unit)
|
||||
#5: DRONE_PULL_REQUEST
|
||||
#6: GIT_USERNAME
|
||||
#7: GIT_TOKEN
|
||||
|
||||
URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-integrationTests
|
||||
ID=$3
|
||||
USER=$1
|
||||
PASS=$2
|
||||
@@ -8,12 +16,15 @@ TYPE=$4
|
||||
|
||||
if [ $TYPE = "IT" ]; then
|
||||
cd build/reports/androidTests/connected/flavors/GPLAY
|
||||
else
|
||||
else
|
||||
cd build/reports/tests/testGplayDebugUnitTest
|
||||
fi
|
||||
|
||||
find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$ID/$(echo {} | sed s#\./##) \;
|
||||
find . -type f -exec curl -u $USER:$PASS -X PUT $URL/$ID/$(echo {} | sed s#\./##) --upload-file {} \;
|
||||
|
||||
echo "Uploaded failing tests to https://nextcloud.kaminsky.me/index.php/s/XqY52jBr9ZYfDiz -> $ID"
|
||||
echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$ID"
|
||||
|
||||
curl -u $6:$7 -X POST https://api.github.com/repos/nextcloud/android/issues/$5/comments -d "{ \"body\" : \"$TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$ID \" }"
|
||||
|
||||
exit 1
|
||||
@@ -25,8 +25,8 @@
|
||||
the normal release/debug builds.
|
||||
-->
|
||||
|
||||
<manifest
|
||||
package="${applicationId}.test"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-sdk tools:overrideLibrary="android.support.test.uiautomator.v18"/>
|
||||
</manifest>
|
||||
<manifest xmlns:tools="http://schemas.android.com/tools"
|
||||
package="${applicationId}.test">
|
||||
|
||||
<uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator" />
|
||||
</manifest>
|
||||
@@ -1,11 +1,6 @@
|
||||
package com.owncloud.android.screenshots;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.espresso.action.ViewActions;
|
||||
import android.support.test.espresso.contrib.DrawerActions;
|
||||
import android.support.test.espresso.matcher.PreferenceMatchers;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||
@@ -20,15 +15,20 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
import androidx.test.espresso.Espresso;
|
||||
import androidx.test.espresso.action.ViewActions;
|
||||
import androidx.test.espresso.contrib.DrawerActions;
|
||||
import androidx.test.espresso.matcher.PreferenceMatchers;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import tools.fastlane.screengrab.Screengrab;
|
||||
import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy;
|
||||
import tools.fastlane.screengrab.locale.LocaleTestRule;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onData;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static androidx.test.espresso.Espresso.onData;
|
||||
import static androidx.test.espresso.Espresso.onView;
|
||||
import static androidx.test.espresso.action.ViewActions.click;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.hamcrest.Matchers.anything;
|
||||
import static org.hamcrest.core.AnyOf.anyOf;
|
||||
|
||||
|
||||
@@ -21,18 +21,19 @@ package com.owncloud.android.uiautomator;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.filters.SdkSuppress;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.support.test.uiautomator.UiDevice;
|
||||
import android.support.test.uiautomator.UiObject;
|
||||
import android.support.test.uiautomator.UiObjectNotFoundException;
|
||||
import android.support.test.uiautomator.UiSelector;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import androidx.test.filters.SdkSuppress;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
import androidx.test.uiautomator.UiDevice;
|
||||
import androidx.test.uiautomator.UiObject;
|
||||
import androidx.test.uiautomator.UiObjectNotFoundException;
|
||||
import androidx.test.uiautomator.UiSelector;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import android.accounts.AuthenticatorException;
|
||||
import android.accounts.OperationCanceledException;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.test.ApplicationTestCase;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
@@ -15,35 +15,40 @@ import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
|
||||
import com.owncloud.android.utils.FileStorageUtils;
|
||||
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* Common base for all integration tests
|
||||
*/
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public abstract class AbstractIT extends ApplicationTestCase<MainApp> {
|
||||
public abstract class AbstractIT {
|
||||
|
||||
protected static OwnCloudClient client;
|
||||
protected static Account account;
|
||||
static Account account;
|
||||
protected static Context context;
|
||||
|
||||
private static final String username = "test";
|
||||
private static final String password = "test";
|
||||
private static final String baseUrl = "server";
|
||||
|
||||
public AbstractIT() {
|
||||
super(MainApp.class);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeAll() {
|
||||
try {
|
||||
context = MainApp.getAppContext();
|
||||
context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
Bundle arguments = androidx.test.platform.app.InstrumentationRegistry.getArguments();
|
||||
|
||||
Uri baseUrl = Uri.parse(arguments.getString("TEST_SERVER_URL"));
|
||||
String username = arguments.getString("TEST_SERVER_USERNAME");
|
||||
String password = arguments.getString("TEST_SERVER_PASSWORD");
|
||||
|
||||
Account temp = new Account(username + "@" + baseUrl, MainApp.getAccountType(context));
|
||||
|
||||
@@ -53,7 +58,8 @@ public abstract class AbstractIT extends ApplicationTestCase<MainApp> {
|
||||
accountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_ACCOUNT_VERSION,
|
||||
Integer.toString(com.owncloud.android.authentication.AccountUtils.ACCOUNT_VERSION));
|
||||
accountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_VERSION, "14.0.0.0");
|
||||
accountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "http://" + baseUrl);
|
||||
accountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, baseUrl.toString());
|
||||
accountManager.setUserData(temp, AccountUtils.Constants.KEY_USER_ID, username);
|
||||
}
|
||||
|
||||
account = com.owncloud.android.authentication.AccountUtils.getOwnCloudAccountByName(context,
|
||||
@@ -62,10 +68,12 @@ public abstract class AbstractIT extends ApplicationTestCase<MainApp> {
|
||||
if (account == null) {
|
||||
throw new ActivityNotFoundException();
|
||||
}
|
||||
|
||||
|
||||
client = OwnCloudClientFactory.createOwnCloudClient(account, context);
|
||||
|
||||
createDummyFiles();
|
||||
|
||||
waitForServer(client, baseUrl);
|
||||
} catch (OperationCanceledException e) {
|
||||
e.printStackTrace();
|
||||
} catch (AuthenticatorException e) {
|
||||
@@ -77,14 +85,50 @@ public abstract class AbstractIT extends ApplicationTestCase<MainApp> {
|
||||
}
|
||||
}
|
||||
|
||||
protected FileDataStorageManager getStorageManager() {
|
||||
FileDataStorageManager getStorageManager() {
|
||||
return new FileDataStorageManager(account, context.getContentResolver());
|
||||
}
|
||||
|
||||
private static void createDummyFiles() throws IOException {
|
||||
new File(FileStorageUtils.getSavePath(account.name)).mkdirs();
|
||||
|
||||
File file = new File(FileStorageUtils.getSavePath(account.name) + "/123.txt");
|
||||
createFile("empty.txt", 0);
|
||||
createFile("nonEmpty.txt", 100);
|
||||
createFile("chunkedFile.txt", 500000);
|
||||
}
|
||||
|
||||
private static void createFile(String name, int iteration) throws IOException {
|
||||
File file = new File(FileStorageUtils.getSavePath(account.name) + File.separator + name);
|
||||
file.createNewFile();
|
||||
|
||||
FileWriter writer = new FileWriter(file);
|
||||
|
||||
for (int i = 0; i < iteration; i++) {
|
||||
writer.write("123123123123123123123123123\n");
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
|
||||
private static void waitForServer(OwnCloudClient client, Uri baseUrl) {
|
||||
GetMethod get = new GetMethod(baseUrl + "/status.php");
|
||||
|
||||
try {
|
||||
int i = 0;
|
||||
while (client.executeMethod(get) != HttpStatus.SC_OK && i < 3) {
|
||||
System.out.println("wait…");
|
||||
Thread.sleep(60 * 1000);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i == 3) {
|
||||
Assert.fail("Server not ready!");
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,41 @@
|
||||
package com.owncloud.android;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.operations.CreateFolderOperation;
|
||||
import com.owncloud.android.operations.RemoveFileOperation;
|
||||
import com.owncloud.android.operations.common.SyncOperation;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import static junit.framework.TestCase.assertTrue;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
/**
|
||||
* Tests related to file operations
|
||||
*/
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FileIT extends AbstractIT {
|
||||
|
||||
@Test
|
||||
public void testCreateFolder() {
|
||||
String path = "/testFolder/";
|
||||
|
||||
|
||||
// folder does not exist yet
|
||||
assertNull(getStorageManager().getFileByPath(path));
|
||||
|
||||
SyncOperation syncOp = new CreateFolderOperation(path, true);
|
||||
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
|
||||
|
||||
assertTrue(result.isSuccess());
|
||||
assertTrue(result.toString(), result.isSuccess());
|
||||
|
||||
// folder exists
|
||||
assertTrue(getStorageManager().getFileByPath(path).isFolder());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation(path, false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -40,9 +46,12 @@ public class FileIT extends AbstractIT {
|
||||
|
||||
SyncOperation syncOp = new CreateFolderOperation(path, true);
|
||||
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
|
||||
assertTrue(result.isSuccess());
|
||||
assertTrue(result.toString(), result.isSuccess());
|
||||
|
||||
// folder exists
|
||||
assertTrue(getStorageManager().getFileByPath(path).isFolder());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation("/testFolder/", false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
package com.owncloud.android;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.owncloud.android.db.OCUpload;
|
||||
import com.owncloud.android.files.services.FileUploader;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.operations.RemoveFileOperation;
|
||||
import com.owncloud.android.operations.UploadFileOperation;
|
||||
import com.owncloud.android.utils.FileStorageUtils;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import static junit.framework.TestCase.assertTrue;
|
||||
|
||||
/**
|
||||
* Tests related to file uploads
|
||||
*/
|
||||
@@ -19,18 +22,54 @@ import org.junit.runner.RunWith;
|
||||
public class UploadIT extends AbstractIT {
|
||||
|
||||
@Test
|
||||
public void testSimpleUpload() {
|
||||
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + "/123.txt",
|
||||
"/testUpload/1.txt", account.name);
|
||||
public void testEmptyUpload() {
|
||||
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + "/empty.txt",
|
||||
"/testUpload/empty.txt", account.name);
|
||||
|
||||
RemoteOperationResult result = testUpload(ocUpload);
|
||||
|
||||
assertTrue(result.toString(), result.isSuccess());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonEmptyUpload() {
|
||||
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + "/nonEmpty.txt",
|
||||
"/testUpload/nonEmpty.txt", account.name);
|
||||
|
||||
RemoteOperationResult result = testUpload(ocUpload);
|
||||
|
||||
assertTrue(result.toString(), result.isSuccess());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChunkedUpload() {
|
||||
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + "/chunkedFile.txt",
|
||||
"/testUpload/chunkedFile.txt", account.name);
|
||||
|
||||
RemoteOperationResult result = testUpload(ocUpload);
|
||||
|
||||
assertTrue(result.toString(), result.isSuccess());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
|
||||
public RemoteOperationResult testUpload(OCUpload ocUpload) {
|
||||
UploadFileOperation newUpload = new UploadFileOperation(
|
||||
account,
|
||||
null,
|
||||
ocUpload,
|
||||
false,
|
||||
FileUploader.LOCAL_BEHAVIOUR_COPY,
|
||||
context,
|
||||
false,
|
||||
false
|
||||
account,
|
||||
null,
|
||||
ocUpload,
|
||||
false,
|
||||
FileUploader.LOCAL_BEHAVIOUR_COPY,
|
||||
context,
|
||||
false,
|
||||
false
|
||||
);
|
||||
newUpload.addRenameUploadListener(() -> {
|
||||
// dummy
|
||||
@@ -38,13 +77,12 @@ public class UploadIT extends AbstractIT {
|
||||
|
||||
newUpload.setRemoteFolderToBeCreated();
|
||||
|
||||
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
|
||||
assertTrue(result.isSuccess());
|
||||
return newUpload.execute(client, getStorageManager());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUploadInNonExistingFolder() {
|
||||
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + "/123.txt",
|
||||
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + "/empty.txt",
|
||||
"/testUpload/2/3/4/1.txt", account.name);
|
||||
UploadFileOperation newUpload = new UploadFileOperation(
|
||||
account,
|
||||
@@ -63,6 +101,9 @@ public class UploadIT extends AbstractIT {
|
||||
newUpload.setRemoteFolderToBeCreated();
|
||||
|
||||
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
|
||||
assertTrue(result.isSuccess());
|
||||
assertTrue(result.toString(), result.isSuccess());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author David A. Velasco
|
||||
@@ -21,13 +21,14 @@
|
||||
package com.owncloud.android.datamodel;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.support.test.filters.SmallTest;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import androidx.test.filters.SmallTest;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
@@ -77,21 +78,20 @@ public class OCFileUnitTest {
|
||||
mFile.setFileId(ID);
|
||||
mFile.setParentId(PARENT_ID);
|
||||
mFile.setStoragePath(STORAGE_PATH);
|
||||
mFile.setMimetype(MIME_TYPE);
|
||||
mFile.setMimeType(MIME_TYPE);
|
||||
mFile.setFileLength(FILE_LENGTH);
|
||||
mFile.setCreationTimestamp(CREATION_TIMESTAMP);
|
||||
mFile.setModificationTimestamp(MODIFICATION_TIMESTAMP);
|
||||
mFile.setModificationTimestampAtLastSyncForData(MODIFICATION_TIMESTAMP_AT_LAST_SYNC_FOR_DATA);
|
||||
mFile.setLastSyncDateForProperties(LAST_SYNC_DATE_FOR_PROPERTIES);
|
||||
mFile.setLastSyncDateForData(LAST_SYNC_DATE_FOR_DATA);
|
||||
mFile.setAvailableOffline(true);
|
||||
mFile.setEtag(ETAG);
|
||||
mFile.setShareViaLink(true);
|
||||
mFile.setShareWithSharee(true);
|
||||
mFile.setSharedViaLink(true);
|
||||
mFile.setSharedWithSharee(true);
|
||||
mFile.setPublicLink(PUBLIC_LINK);
|
||||
mFile.setPermissions(PERMISSIONS);
|
||||
mFile.setRemoteId(REMOTE_ID);
|
||||
mFile.setNeedsUpdateThumbnail(true);
|
||||
mFile.setUpdateThumbnailNeeded(true);
|
||||
mFile.setDownloading(true);
|
||||
mFile.setEtagInConflict(ETAG_IN_CONFLICT);
|
||||
|
||||
@@ -119,16 +119,14 @@ public class OCFileUnitTest {
|
||||
);
|
||||
assertThat(fileReadFromParcel.getLastSyncDateForProperties(), is(LAST_SYNC_DATE_FOR_PROPERTIES));
|
||||
assertThat(fileReadFromParcel.getLastSyncDateForData(), is(LAST_SYNC_DATE_FOR_DATA));
|
||||
assertThat(fileReadFromParcel.isAvailableOffline(), is(true));
|
||||
assertThat(fileReadFromParcel.getEtag(), is(ETAG));
|
||||
assertThat(fileReadFromParcel.isSharedViaLink(), is(true));
|
||||
assertThat(fileReadFromParcel.isSharedWithSharee(), is(true));
|
||||
assertThat(fileReadFromParcel.getPublicLink(), is(PUBLIC_LINK));
|
||||
assertThat(fileReadFromParcel.getPermissions(), is(PERMISSIONS));
|
||||
assertThat(fileReadFromParcel.getRemoteId(), is(REMOTE_ID));
|
||||
assertThat(fileReadFromParcel.needsUpdateThumbnail(), is(true));
|
||||
assertThat(fileReadFromParcel.isUpdateThumbnailNeeded(), is(true));
|
||||
assertThat(fileReadFromParcel.isDownloading(), is(true));
|
||||
assertThat(fileReadFromParcel.getEtagInConflict(), is(ETAG_IN_CONFLICT));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,6 @@ package com.owncloud.android.datamodel;
|
||||
import android.accounts.Account;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.filters.SmallTest;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.owncloud.android.db.OCUpload;
|
||||
|
||||
@@ -17,6 +14,10 @@ import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import androidx.test.filters.SmallTest;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
/**
|
||||
* Created by JARP on 6/7/17.
|
||||
*/
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
package com.owncloud.android.util;
|
||||
|
||||
import android.os.Build;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
@@ -50,7 +48,10 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
import static junit.framework.Assert.assertFalse;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -14,6 +14,5 @@
|
||||
|
||||
<application
|
||||
android:testOnly="false"
|
||||
android:allowBackup="false"
|
||||
tools:ignore="GoogleAppIndexingWarning"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,18 @@
|
||||
La versió lliure i llicenciada com a \"copyleft\" de l'app de Nextcloud per a Android us dona llibertat de moviment.
|
||||
|
||||
Característiques:\* Fàcil, interfície moderna, associada a l'aspecte del vostre servidor
|
||||
* Pugeu fitxers al vostre servidor Nextcloud
|
||||
* Compartiu-los amb d'altres
|
||||
* Mantingueu els vostres fitxers i carpetes preferits sincronitzats
|
||||
* Cerqueu a través de totes les carpetes del vostre servidor
|
||||
* Pujada automàtica de les fotos i vídeos fets des del vostre dispositiu
|
||||
* Mantingueu les notificacions actualitzades
|
||||
* Suport per a multi-usuari
|
||||
* Accés segur a les vostres dades a través d'empremta digital o PIN
|
||||
* Integració amb DAVdroid per una configuració senzilla del calendari & i sincronització de contactes
|
||||
|
||||
Si us plau informeu de totes les incidències a https://github.com/nextcloud/android/issues i debateu sobre aquesta app a https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Nou a Nextcloud? Nextcloud és un servidor de comunicacions per a mantenir fitxers privats sincronitzats i compartir &. És programari lliure i podeu allotjar-los vos mateix o pagar a una empresa perquè ho faci per a vos. D'aquesta manera, teniu el control de les vostres fotos, calendaris i dades dels contactes, els vostres documents i tota la resta.
|
||||
|
||||
Proveu Nextcloud a https://nextcloud.com
|
||||
@@ -0,0 +1 @@
|
||||
L'app de Nextcloud per a Android demana dona accés mòbil per a tots els fitxers
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud
|
||||
@@ -1,19 +1,19 @@
|
||||
Svobodná (copyleft) aplikace Nextcloud pro Android, poskytující mobilní svobodu.
|
||||
Svobodně licencovaná Nexcloud Android aplikace, dávající vám mobilní svobodu.
|
||||
|
||||
Funkce:
|
||||
* Snadno použitelné moderní rozhraní, hodící se k vzhledu vašeho serveru
|
||||
* Nahrávání souborů na Nextcloud server
|
||||
* Jejich sdílení s ostatními
|
||||
* Synchronizace vašich oblíbených souborů a složek
|
||||
* Hledání napříč všemi složkami na serveru
|
||||
* Automatické nahrávání fotek a videí pořízených vaším zařízením
|
||||
* Doručování oznámení
|
||||
* Podpora vícero účtů
|
||||
* Snadno použitelné moderní rozhraní, přizpůsobené vzhledu, používaném na vašem serveru
|
||||
* Nahrávejte soubory na svůj Nextcloud server
|
||||
* Sdílejte je s ostatními
|
||||
* Udržujte své oblíbené soubory a složky synchronizované
|
||||
* Hledejte napříč všemi složkami na svém serveru
|
||||
* Automaticky nahrávejte své fotky a videa, pořízená zařízením
|
||||
* Udržujte si přehled pomocí oznámení
|
||||
* Podporuje vícero účtů
|
||||
* Zabezpečený přístup k vašim datům pomocí otisku prstu nebo PIN kódu
|
||||
* Začlenění DAVdroid pro snadný přístup ke kalendáři & Synchronizace kontaktů
|
||||
* Napojení na DAVx5 (dříve známé pod názvem DAVdroid) pro snadné nastavení synchronizace kalendáře a kontaktů
|
||||
|
||||
Jakékoli problémy prosím hlaste na https://github.com/nextcloud/android/issues a o aplikaci diskutujte na https://help.nextcloud.com/c/clients/android
|
||||
Veškeré nalezené problémy hlaste na https://github.com/nextcloud/android/issues a diskutujte o aplikaci na https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Noví v Nextcloud? Nextcloud je server pro soukromou synchronizaci souborů &, sdílení a komunikaci. Je to svobodný software a můžete ho buď provozovat sami nebo pronajímat od společnosti. Tím vy vládnete svým fotkám, údajům v kalendáři a kontaktech, dokumentům a všemu ostatnímu.
|
||||
Noví v Nextcloud? Nextcloud je soukromý server pro synchronizaci souborů a jejich sdílení, dále pro komunikaci. Jedná se o svobodný software a můžete ho hostovat svými silami nebo za to zaplatit nějaké společnosti. Tím máte pod kontrolou své fotky, kalendář a kontakty, dokumenty a vše ostatní.
|
||||
|
||||
Podívejte se na Nextcloud na https://nextcloud.com
|
||||
@@ -1 +1 @@
|
||||
Aplikace Nextcloud pro Android ti nabízí přístup ke všem souborům ve tvém Nextcl
|
||||
Aplikace Nextcloud pro Android poskytuje přístup ke všem souborům na vašem Nextc
|
||||
@@ -0,0 +1,19 @@
|
||||
Nextcloud Android app copylefted libre, giver mobil frihed.
|
||||
|
||||
Fremviser:
|
||||
* Nem, moderne brugerflade, tilpasset til din servers tema
|
||||
* Send filer til din Nextcloud server
|
||||
* Del dem med andre
|
||||
* Hold dine favorit filer og mapper i sync
|
||||
* Søg henover alle foldere på din server
|
||||
* Auto Upload photos og videoer taget med din device
|
||||
* Hold dig opdateret med notifikationer
|
||||
* Understøttelse af multiple konti
|
||||
* Sikret tilgang til dine data med fingeraftryk eller PIN
|
||||
* Integration med DAVx5 (tidligere kendt som DAVdroid) for let adgang til kalender & kontakt synkronisering
|
||||
|
||||
Venligst rapporter alle problemer på https://github.com/nextcloud/android/issues og diskuter denne app på https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Ny på Nextcloud? Nextcloud er en privat fil synkronisering & dele og kommunikationsserver. Det er fri software, og du kan være din egen vært eller betale et firma for at være vært for dig. På den måde har du kontrol over dine photos, din kalender og kontakt data, dine dokumenter og alt det andet.
|
||||
|
||||
Tjek Nextcloud på https://nextcloud.com
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud Android appen giver mobil adgang til alle filer på din Nextcloud.
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud
|
||||
@@ -1,19 +1,19 @@
|
||||
Die Open Source Nextcloud Android App erlaubt Ihnen Zugriff auf alle Dateien in Ihrer Nextcloud.
|
||||
|
||||
Eigenschaften:
|
||||
* Einfache, moderne Oberfläche
|
||||
* Einfache, moderne an Ihr Theme angepasste Oberfläche
|
||||
* Laden Sie Ihre Dateien auf Ihren Nextcloud Server
|
||||
* Teilen Sie Ihre Dateien mit anderen
|
||||
* Wichtige Dateien und Verzeichnisse können aktuell gehalten werden
|
||||
* Halten Sie Ihre favorisierten Dateien und Verzeichnisse synchron
|
||||
* Suche über alle Ordner auf Ihrem Server
|
||||
* Automatisches Hochladen von Photos und Videos von Ihrem Gerät
|
||||
* Automatisches Hochladen von Fotos und Videos von Ihrem Gerät
|
||||
* Bleiben Sie auf dem Laufenden durch Benachrichtigungen
|
||||
* Mehrere Konten gleichzeitig
|
||||
* Geschützter Zugriff durch Fingerabdruck oder PIN
|
||||
* Integration mit DAVdroid für einfaches Konfigurieren von Kalender & Kontakte Synchronisierung
|
||||
* Integration mit DAVx5 (zuvor DAVdroid) für einfaches Konfigurieren der Kalender- & Kontakte-Synchronisation
|
||||
|
||||
Bitte melden Sie alle Probleme unter https://github.com/nextcloud/android/issues oder diskutieren Sie über die App auf https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Was ist die Nextcloud? Die Nextcloud ist ein privater Dateiaustausch & -synchronisierungs Server. Nextcloud ist Open Source und kann auf einem eigenen Server installiert werden. So behalten Sie die Kontrolle über Ihre Fotos, Ihre Kalender und Kontakte, Ihre Dokumente und alle anderen Daten.
|
||||
|
||||
Schauen Sie sich Nextcloud unter https://nextcloud.com an.
|
||||
Schauen Sie sich Nextcloud an unter https://nextcloud.com.
|
||||
@@ -10,7 +10,7 @@ Features:
|
||||
* Keep up to date with notifications
|
||||
* Multi-account support
|
||||
* Secure access to your data with fingerprint or PIN
|
||||
* Integration with DAVdroid for easy setup of calendar & Contacts synchronization
|
||||
* Integration with DAVx5 (formerly known as DAVdroid) for easy setup of calendar & Contacts synchronization
|
||||
|
||||
Please report all issues at https://github.com/nextcloud/android/issues and discuss this app at https://help.nextcloud.com/c/clients/android
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
La app copyleft de software libre Nextcloud para Android te da libertad móvil.
|
||||
La app (copyleft y software libre) Nextcloud para Android te da libertad móvil.
|
||||
|
||||
Características
|
||||
* Interfaz sencilla y moderna, adaptada al tema de tu servidor
|
||||
@@ -10,7 +10,7 @@ Características
|
||||
* Mantente al tanto de todo mediante las notificaciones
|
||||
* Soporte de múltiples cuentas
|
||||
* Acceso seguro a tus datos con huella dactilar o PIN
|
||||
* Integración con DAVdroid para configurar fácilmente la sincronización de calendarios y contactos
|
||||
* Integración con DAVx5 (antes conocido como DAVdroid) para configurar fácilmente la sincronización de calendarios y contactos
|
||||
|
||||
Por favor, informa de todos los problemas en https://github.com/nextcloud/android/issues y discute la app en https://help.nextcloud.com/c/clients/android
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Fonctionnalitées :
|
||||
* Rester à jour avec vos notifications
|
||||
* Utilisation de plusieurs comptes
|
||||
* Accès sécurisé à vos données avec votre empreinte digitale ou code PIN
|
||||
* Intégration avec DAVdroid pour une synchronisation facile des contacts & agenda
|
||||
* Intégration avec DAVx5 (autrefois connu comme DAVdroid) pour une synchronisation facile des contacts & agenda
|
||||
|
||||
S'il vous plait, rapporter les bogues à l'adresse suivante : https://github.com/nextcloud/android/issues et parler de cette application à l'adresse suivante : https://help.nextcloud.com/c/clients/android
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ L'applicazione libera e priva di copyright per Android di Nextcloud ti offre lib
|
||||
* Tieniti aggiornato con le notifiche
|
||||
* Supporto di più account
|
||||
* Proteggi l'accesso ai tuoi dati con impronta digitale o PIN
|
||||
* Integrazione con DAVdroid per una facile configurazione della sincronizzazione di calendari e contatti
|
||||
* Integrazione con DAVx5 (conosciuto originariamente come DAVdroid) per una facile configurazione della sincronizzazione di calendari e contatti
|
||||
|
||||
Segnala tutti i problemi su https://github.com/nextcloud/android/issues e discuti questa applicazione su https://help.nextcloud.com/c/clients/android
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud Android programėlė suteikia jums mobiliąją prieigą prie jūsų visų Next
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud
|
||||
@@ -10,10 +10,10 @@ Functies:
|
||||
* Blijf op de hoogte met notificaties
|
||||
* Ondersteuning voor meerdere accounts en servers
|
||||
* Beveilig toegang tot je gegevens met vingerafdruk of pincode
|
||||
* Integratie met DAVdroid voor makkelijk synchroniseren van je kalender & contacten
|
||||
* Integratie met DAVx5 (vroeger bekend als DAVdroid) voor makkelijk synchroniseren van je kalender & contacten
|
||||
|
||||
Meld alsjeblieft alle bugs en problemen op https://github.com/nextcloud/android/issues en doe je zegje over deze app in ons forum https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Nieuw bij Nextcloud? Nextcloud is je persoonlijke bestanden- en communicatieserver. Het is volledig open source en je kunt het zelf hosten of een bedrijf betalen om dat voor je te doen. Zo heb je volledige controle over je foto's, kalender, adresboek, document en al het andere.
|
||||
Nieuw bij Nextcloud? Nextcloud is een privé bestanden- en communicatieserver. Het is volledig open source en je kunt het zelf hosten of een bedrijf betalen om dat voor je te doen. Zo heb je volledige controle over je foto's, kalender, adresboek, document en al het andere.
|
||||
|
||||
Check Nextcloud op https://nextcloud.com
|
||||
@@ -1,14 +1,19 @@
|
||||
Oparta na Open Source aplikacja Nexcloud Android umożliwia dostęp do wszystkich twoich plików w Nextcloud.
|
||||
Rozpowszechniana bez ograniczeń aplikacja NextCloud (Android), zapewniająca mobilną swobodę.
|
||||
|
||||
Funkcje:
|
||||
* Prosty i nowoczesny wygląd
|
||||
* Wysyłaj swoje pliki na swój serwer Nextcloud* Dawaj innym dostęp do twoich plików
|
||||
* Synchronizuj wybrane pliki i katalogi z serwerem
|
||||
* Automatycznie wysyłaj zdjęcia i filmy robione urządzeniem
|
||||
* Wsparcie dla wielu kont
|
||||
* Łatwy, nowoczesny interfejs, dostosowany do motywu serwera
|
||||
* Wysyłanie plików na serwer NextCloud
|
||||
* Udostępnianie ich innym użytkownikom
|
||||
* Synchronizacja Twoich ulubionych plików i katalogów
|
||||
* Przeszukiwanie wszystkich katalogów na serwerze
|
||||
* Automatyczne wysyłanie na serwer zdjęć i filmów
|
||||
* Otrzymywanie powiadomień na bierząco
|
||||
* Obsługa wielu kont
|
||||
* Bezpieczny dostęp do danych za pomocą odcisku palca lub PIN
|
||||
* Integracja z DAVx5 (dawniej DAVdroid), aby łatwiej skonfigurować kalendarz& synchronizację kontaktów
|
||||
|
||||
Zgłaszaj błędy na https://github.com/nextcloud/android/issues i dyskutuj na temat tej aplikacji na https://help.nextcloud.com/c/clients/android
|
||||
Wszelkie problemy z aplikacją proszę zgłaszać do Nextcloud https://github.com/nextcloud/android/issues, forum dyskusyjne dla aplikacji znajduje się na https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Nie znasz jeszcze Nextcloud? Nextcloud jest prywatnym serwerem synchronizacji & współdzielenia plików oraz komunikacji. Jego źródła są całkowicie otwarte, więc możesz korzystać z niego na własnym serwerze albo możesz zapłacić za to firmie trzeciej. W ten sposób kontrolujesz swoje zdjęcia, kalendarz, dane kontaktowe, twoje dokumenty i inne dane.
|
||||
Nowy Nextcloud zapewnia poufną synchronizację danych& udostępnianie plików oraz komunikację. Jest darmowym oprogramowaniem, które możesz wykorzystać samodzielnie lub zlecić odpłatnie instalację firmie, która zrobi to za Ciebie. Dzięki temu posiadasz pełną kontrolę nad swoimi zdjęciami, kalendarzem, kontaktami, dokumentami i pozostałymi poufnymi danymi.
|
||||
|
||||
Zobacz Nextcloud na https://nextcloud.com
|
||||
Wypróbuj Nextcloud https://nextcloud.com
|
||||
@@ -1 +1 @@
|
||||
Przy użyciu aplikacji mobilnej Nextcloud na Android'a uzyskasz dostęp do wszystk
|
||||
Aplikacja Nextcloud dla Androida zapewnia mobilny dostęp do plików na serwerze.
|
||||
@@ -1,19 +1,19 @@
|
||||
O aplicativo de código aberto Nextcloud, lhe dá liberdade móvel.
|
||||
O aplicativo de código aberto Nextcloud para Android oferece liberdade móvel.
|
||||
|
||||
Recursos:
|
||||
Características:
|
||||
* Interface fácil e moderna, adequada ao tema do seu servidor
|
||||
* Envio de arquivos para seu servidor Nextcloud
|
||||
* Compartilhá-los com outros
|
||||
* Manter seus arquivos e pastas favoritos sincronizados
|
||||
* Pesquisa em todas as pastas no seu servidor
|
||||
* Envio automático de fotos e vídeos tirados pelo seu dispositivo
|
||||
* Manter-se atualizado com notificações
|
||||
* Suporte a múltiplas contas
|
||||
* Acesso seguro aos seus dados com impressão digital ou PIN
|
||||
* Integração com o DAVdroid para fácil configuração da sincronização do Calendário & Contatos
|
||||
* Envia arquivos para o servidor Nextcloud
|
||||
* Compartilha com outras pessoas
|
||||
* Mantém seus arquivos e pastas favoritas sincronizados
|
||||
* Pesquisa em todas as pastas do servidor
|
||||
* Envio automático de fotos e vídeos feitos pelo seu dispositivo
|
||||
* Atualiza-se com as notificações
|
||||
* Suporte a várias contas
|
||||
* Acesso seguro aos seus dados com impressão digital ou PIN
|
||||
* Integração com o DAVx5 (conhecido como DAVdroid) para facilitar a sincronização do calendário & contatos
|
||||
|
||||
Informe todos os problemas em https://github.com/nextcloud/android/issues e discuta este aplicativo em https://help.nextcloud.com/c/clients/android
|
||||
Reporte qualquer problema em https://github.com/nextcloud/android/issues e fale sobre este aplicativo em https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Novo para Nextcloud? Nextcloud é um servidor privado de comunicação, sincronismo & compartilhamento. É um software livre e você mesmo pode hospedá-lo ou pagar uma empresa para fazê-lo. Dessa forma, você controla suas fotos, calendários e dados de contato, seus documentos e tudo mais.
|
||||
É novo para o Nextcloud? Nextcloud é um servidor privado de comunicação & compartilhamento. É software livre e você pode auto-hospedá-lo ou pagar uma empresa para fazer isso. Dessa forma, você está no controle de suas fotos, calendário, dados de contato, documentos e tudo mais.
|
||||
|
||||
Saiba mais sobre o Nextcloud em https://nextcloud.com
|
||||
Saiba mais em https://nextcloud.com
|
||||
@@ -0,0 +1,19 @@
|
||||
A aplicação Open Source Nextcloud para Android, dá-lhe liberdade móvel.
|
||||
|
||||
Funcionalidades:
|
||||
* Fácil, interface moderna, adaptado ao tema do seu servidor
|
||||
* Envie ficheiros para o seu servidor Nextcloud
|
||||
* Partilhe-os com outras pessoas
|
||||
* Mantenha os seus ficheiros e pastas favoritos sincronizados
|
||||
* Pesquise através de todas as pastas no seu servidor
|
||||
* Envio automático de fotos e vídeos capturados pelo seu dispositivo
|
||||
* Mantenha-se actualizado com notificações
|
||||
* Suporte para várias contas
|
||||
* Aceda aos seus dados de forma segura usando a impressão digital ou PIN
|
||||
* Integração com DAVx5 (anteriormente conhecido como DAVdroid) para configuração fácil do Calendário & sincronização de Contactos
|
||||
|
||||
Por favor, reporte todos os problemas em https://github.com/nextcloud/android/issues e discuta sobre esta aplicação em https://help.nextcloud.com/c/clients/android
|
||||
|
||||
A Nextcloud é um servidor privado de comunicação, sincronização & partilha de ficheiros. É Open Source, e pode ser hospedado por si ou pagar a uma empresa para o fazer. Assim, está sob o controlo das suas fotos, calendário e dados de contacto, dos seus documentos e de tudo o resto.
|
||||
|
||||
Dê uma vista de olhos no Nextcloud em: https://nextcloud.com
|
||||
@@ -0,0 +1 @@
|
||||
A aplicação Nextcloud para Android permite acesso móvel a todos os ficheiros no
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud
|
||||
@@ -1,4 +1,4 @@
|
||||
Некстклауд андроид апликација отвореног кода омогућава приступ свим фајловима на Вашем Некстклауд серверу, дајући Вам мобилну слободу.
|
||||
Некстклауд андроид апликација отвореног кода Вам даје мобилну слободу.
|
||||
Особине:
|
||||
* Лако и модерно сучеље, потпуно усклађено са темом са сервера
|
||||
* Отпремање фајлова на Некстклауд сервер
|
||||
@@ -9,10 +9,10 @@
|
||||
* Обавештења са сервера
|
||||
* Подршка за више налога
|
||||
* Безбедан приступ свим подацима преко отиска прста или пина
|
||||
* Интеграција са ДАВдроидом за брзо подешавање синхронизације календара & контаката
|
||||
* Интеграција са DAVx5-ом (раније знаном и као ДАВдроид) за брзо подешавање синхронизације календара & контаката
|
||||
|
||||
Све проблеме можете да пријавите на https://github.com/nextcloud/android/issues а о апликацији дискутујте на https://help.nextcloud.com/c/clients/android
|
||||
|
||||
Нови сте на Некстклауду? Некстклауд је лични сервер за синхронизацију, дељење фајлова & комуникацију. Потпуно је отвореног кода и можете да га сами хостовати или платити компанији да која то већ ради. На овај начин, сами контролишете своје слике, календаре, контакате, документа и све остало.
|
||||
Нови сте на Некстклауду? Некстклауд је лични сервер за синхронизацију, дељење фајлова & комуникацију. Потпуно је отвореног кода и можете да га сами хостовати или платити компанији да то ради за Вас. На овај начин, сами контролишете своје слике, календаре, контакте, документа и све остало.
|
||||
|
||||
Погледајте Некстклауд на https://nextcloud.com
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud Android-appen ger mobilåtkomst till alla filer på ditt Nextcloud.
|
||||
@@ -0,0 +1 @@
|
||||
Nextcloud
|
||||
@@ -9,7 +9,7 @@ Copyleft Nextcloud Android uygulaması, Nextcloud üzerindeki tüm dosyalarını
|
||||
* Bildirimler ile güncel kalma
|
||||
* Birden çok hesap desteği
|
||||
*Parmak izi ya da PIN kodu ile verilerinize güvenli erişme
|
||||
* Davdroid bütünleştirmesi ile takvim ve kişileri eşitleme
|
||||
* DAVx5 (eski adı DAVdroid) bütünleştirmesi ile takvim ve kişileri eşitleme
|
||||
|
||||
Kullanımda karşılaşabileceğiniz hataları https://github.com/nextcloud/android/issues adresinden bildirebilir, uygulama hakkındaki konuları https://help.nextcloud.com/c/clients/android adresinde tartışabilirsiniz
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.content.Context;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.datamodel.SignatureVerification;
|
||||
import com.owncloud.android.db.PreferenceManager;
|
||||
import com.nextcloud.client.preferences.PreferenceManager;
|
||||
|
||||
import java.security.Key;
|
||||
|
||||
|
||||
@@ -84,12 +84,7 @@
|
||||
<service
|
||||
android:name="com.evernote.android.job.gcm.PlatformGcmService"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
|
||||
tools:replace="android:enabled">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.gcm.ACTION_TASK_READY"/>
|
||||
</intent-filter>
|
||||
tools:node="remove">
|
||||
</service>
|
||||
|
||||
</application>
|
||||
|
||||
@@ -23,9 +23,9 @@ import android.text.TextUtils;
|
||||
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
import com.google.firebase.iid.FirebaseInstanceIdService;
|
||||
import com.nextcloud.client.preferences.PreferenceManager;
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.db.PreferenceManager;
|
||||
import com.owncloud.android.utils.PushUtils;
|
||||
|
||||
public class NCFirebaseInstanceIDService extends FirebaseInstanceIdService {
|
||||
|
||||
@@ -29,13 +29,13 @@ import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.nextcloud.client.preferences.PreferenceManager;
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.PushConfigurationState;
|
||||
import com.owncloud.android.datamodel.SignatureVerification;
|
||||
import com.owncloud.android.db.PreferenceManager;
|
||||
import com.owncloud.android.lib.common.OwnCloudAccount;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
||||
@@ -395,19 +395,11 @@ public final class PushUtils {
|
||||
PreferenceManager.setKeysMigration(context, true);
|
||||
} else {
|
||||
if (oldPrivateKeyFile.exists()) {
|
||||
try {
|
||||
FileStorageUtils.moveFile(oldPrivateKeyFile, privateKeyFile);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Failed to move old private key to new location");
|
||||
}
|
||||
FileStorageUtils.moveFile(oldPrivateKeyFile, privateKeyFile);
|
||||
}
|
||||
|
||||
if (oldPublicKeyFile.exists()) {
|
||||
try {
|
||||
FileStorageUtils.moveFile(oldPublicKeyFile, publicKeyFile);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Failed to move old public key to new location");
|
||||
}
|
||||
FileStorageUtils.moveFile(oldPublicKeyFile, publicKeyFile);
|
||||
}
|
||||
|
||||
if (privateKeyFile.exists() && publicKeyFile.exists()) {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<string name="google_app_id" translatable="false">1:829118773643:android:512449826e931d0e</string>
|
||||
<string name="google_crash_reporting_api_key" translatable="false">AIzaSyAWIyOcLafaFp8PFL61h64cy1NNZW2cU_s</string>
|
||||
<string name="google_storage_bucket" translatable="false">nextcloud-a7dea.appspot.com</string>
|
||||
<string name="project_id" translatable="false">nextcloud-a7dea</string>
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
<!-- WRITE_EXTERNAL_STORAGE may be enabled or disabled by the user after installation in
|
||||
API >= 23; the app needs to handle this -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<!-- Next permissions are always approved in installation time, the apps needs to do nothing special in runtime -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
@@ -64,8 +66,13 @@
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
|
||||
<!-- Apps that target Android 9 (API level 28) or higher and use foreground services
|
||||
must request the FOREGROUND_SERVICE permission -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||
|
||||
<uses-sdk tools:overrideLibrary="com.blikoon.qrcodescanner" />
|
||||
|
||||
<application
|
||||
android:name=".MainApp"
|
||||
@@ -79,6 +86,11 @@
|
||||
android:installLocation="internalOnly"
|
||||
android:manageSpaceActivity="com.owncloud.android.ui.activity.ManageSpaceActivity"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<uses-library
|
||||
android:name="org.apache.http.legacy"
|
||||
android:required="false" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.activity.FileDisplayActivity"
|
||||
android:launchMode="singleTop"
|
||||
@@ -103,13 +115,18 @@
|
||||
<activity android:name=".ui.activities.ActivitiesActivity"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity android:name=".ui.activity.SyncedFoldersActivity"/>
|
||||
<receiver android:name="com.owncloud.android.jobs.MediaFoldersDetectionJob$NotificationReceiver" />
|
||||
<receiver android:name="com.owncloud.android.jobs.NotificationJob$NotificationReceiver" />
|
||||
<activity android:name=".ui.activity.UploadFilesActivity" />
|
||||
<activity android:name=".ui.activity.ExternalSiteWebView"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".ui.activity.RichDocumentsWebView"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
||||
<activity android:name=".ui.activity.ContactsPreferenceActivity"
|
||||
android:launchMode="singleInstance"/>
|
||||
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
|
||||
|
||||
|
||||
android:taskAffinity=""
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/Theme.ownCloud.NoActionBar">
|
||||
@@ -125,7 +142,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.activity.Preferences"
|
||||
android:name=".ui.activity.SettingsActivity"
|
||||
android:theme="@style/Theme.ownCloud" >
|
||||
</activity>
|
||||
<activity
|
||||
@@ -171,7 +188,40 @@
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:label="@string/sync_string_files"
|
||||
android:syncable="true" />
|
||||
android:syncable="true">
|
||||
<path-permission
|
||||
android:pathPrefix="/shares"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/capabilities"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/uploads"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/synced_folders"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/external_links"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/arbitrary_data"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/virtual"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
<path-permission
|
||||
android:pathPrefix="/filesystem"
|
||||
android:readPermission="false"
|
||||
android:writePermission="false" />
|
||||
</provider>
|
||||
|
||||
<provider
|
||||
android:name=".providers.UsersAndGroupsSearchProvider"
|
||||
@@ -194,7 +244,7 @@
|
||||
|
||||
<!-- new provider used to generate URIs without file:// scheme (forbidden from Android 7) -->
|
||||
<provider
|
||||
android:name="android.support.v4.content.FileProvider"
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="@string/file_provider_authority"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false">
|
||||
@@ -228,11 +278,24 @@
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".authentication.DeepLinkLoginActivity"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:theme="@style/Theme.ownCloud.noActionBar.Login">
|
||||
<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="@string/login_data_own_scheme" android:host="login"/>
|
||||
|
||||
<data
|
||||
android:host="login"
|
||||
android:scheme="@string/login_data_own_scheme" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -242,10 +305,12 @@
|
||||
<service android:name=".media.MediaService" />
|
||||
|
||||
<activity android:name=".ui.activity.PassCodeActivity" />
|
||||
<activity android:name=".ui.activity.RequestCredentialsActivity" />
|
||||
<activity
|
||||
android:name=".ui.activity.RequestCredentialsActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity android:name=".ui.activity.ConflictsResolveActivity"/>
|
||||
<activity android:name=".ui.activity.ErrorsWhileCopyingHandlerActivity"/>
|
||||
|
||||
|
||||
<activity android:name=".ui.activity.LogHistoryActivity"/>
|
||||
|
||||
<activity android:name=".ui.errorhandling.ErrorShowActivity" />
|
||||
@@ -277,6 +342,12 @@
|
||||
<activity
|
||||
android:name=".ui.activity.FolderPickerActivity"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name=".ui.activity.FilePickerActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.ownCloud.Dialog.NoTitle"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity
|
||||
android:name=".ui.activity.UploadPathActivity"
|
||||
android:label="@string/app_name" />
|
||||
|
||||
@@ -20,6 +20,8 @@ package com.nextcloud.android.sso.aidl;
|
||||
// Declare the interface.
|
||||
interface IInputStreamService {
|
||||
|
||||
ParcelFileDescriptor performNextcloudRequest(in ParcelFileDescriptor input);
|
||||
ParcelFileDescriptor performNextcloudRequestAndBodyStream(in ParcelFileDescriptor input,
|
||||
in ParcelFileDescriptor requestBodyParcelFileDescriptor);
|
||||
|
||||
}
|
||||
ParcelFileDescriptor performNextcloudRequest(in ParcelFileDescriptor input);
|
||||
}
|
||||
@@ -26,8 +26,10 @@ import android.accounts.AuthenticatorException;
|
||||
import android.accounts.OperationCanceledException;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.nextcloud.android.sso.aidl.IInputStreamService;
|
||||
@@ -41,21 +43,32 @@ import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.utils.EncryptionUtils;
|
||||
|
||||
import org.apache.commons.httpclient.HttpConnection;
|
||||
import org.apache.commons.httpclient.HttpMethodBase;
|
||||
import org.apache.commons.httpclient.HttpState;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.methods.DeleteMethod;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.apache.jackrabbit.webdav.DavConstants;
|
||||
import org.apache.jackrabbit.webdav.client.methods.MkColMethod;
|
||||
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
|
||||
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.nextcloud.android.sso.Constants.EXCEPTION_ACCOUNT_NOT_FOUND;
|
||||
@@ -96,9 +109,16 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
}
|
||||
|
||||
public ParcelFileDescriptor performNextcloudRequest(ParcelFileDescriptor input) {
|
||||
return performNextcloudRequestAndBodyStream(input, null);
|
||||
}
|
||||
|
||||
public ParcelFileDescriptor performNextcloudRequestAndBodyStream(ParcelFileDescriptor input,
|
||||
ParcelFileDescriptor requestBodyParcelFileDescriptor) {
|
||||
// read the input
|
||||
final InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(input);
|
||||
|
||||
final InputStream requestBodyInputStream = requestBodyParcelFileDescriptor != null ?
|
||||
new ParcelFileDescriptor.AutoCloseInputStream(requestBodyParcelFileDescriptor) : null;
|
||||
Exception exception = null;
|
||||
InputStream httpStream = new InputStream() {
|
||||
@Override
|
||||
@@ -106,22 +126,28 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
// Start request and catch exceptions
|
||||
NextcloudRequest request = deserializeObjectAndCloseStream(is);
|
||||
httpStream = processRequest(request);
|
||||
httpStream = processRequest(request, requestBodyInputStream);
|
||||
} catch (Exception e) {
|
||||
Log_OC.e(TAG, e.getMessage());
|
||||
Log_OC.e(TAG, "Error during Nextcloud request", e);
|
||||
exception = e;
|
||||
}
|
||||
|
||||
try {
|
||||
// Write exception to the stream followed by the actual network stream
|
||||
InputStream exceptionStream = serializeObjectToInputStream(exception);
|
||||
InputStream resultStream = new java.io.SequenceInputStream(exceptionStream, httpStream);
|
||||
InputStream resultStream;
|
||||
if (httpStream != null) {
|
||||
resultStream = new java.io.SequenceInputStream(exceptionStream, httpStream);
|
||||
} else {
|
||||
resultStream = exceptionStream;
|
||||
}
|
||||
return ParcelFileDescriptorUtil.pipeFrom(resultStream, thread -> Log.d(TAG, "Done sending result"));
|
||||
} catch (IOException e) {
|
||||
Log_OC.e(TAG, e.getMessage());
|
||||
Log_OC.e(TAG, "Error while sending response back to client app", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -135,7 +161,8 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
return new ByteArrayInputStream(baos.toByteArray());
|
||||
}
|
||||
|
||||
private <T extends Serializable> T deserializeObjectAndCloseStream(InputStream is) throws IOException, ClassNotFoundException {
|
||||
private <T extends Serializable> T deserializeObjectAndCloseStream(InputStream is) throws IOException,
|
||||
ClassNotFoundException {
|
||||
ObjectInputStream ois = new ObjectInputStream(is);
|
||||
T result = (T) ois.readObject();
|
||||
is.close();
|
||||
@@ -143,9 +170,88 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
return result;
|
||||
}
|
||||
|
||||
public class NCPropFindMethod extends PropFindMethod {
|
||||
NCPropFindMethod(String uri, int propfindType, int depth) throws IOException {
|
||||
super(uri, propfindType, new DavPropertyNameSet(), depth);
|
||||
}
|
||||
|
||||
private InputStream processRequest(final NextcloudRequest request) throws UnsupportedOperationException, com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException, OperationCanceledException, AuthenticatorException, IOException {
|
||||
Account account = AccountUtils.getOwnCloudAccountByName(context, request.getAccountName()); // TODO handle case that account is not found!
|
||||
@Override
|
||||
protected void processResponseBody(HttpState httpState, HttpConnection httpConnection) {
|
||||
// Do not process the response body here. Instead pass it on to client app.
|
||||
}
|
||||
}
|
||||
|
||||
private HttpMethodBase buildMethod(NextcloudRequest request, Uri baseUri, InputStream requestBodyInputStream)
|
||||
throws IOException {
|
||||
String requestUrl = baseUri + request.getUrl();
|
||||
HttpMethodBase method;
|
||||
switch (request.getMethod()) {
|
||||
case "GET":
|
||||
method = new GetMethod(requestUrl);
|
||||
break;
|
||||
|
||||
case "POST":
|
||||
method = new PostMethod(requestUrl);
|
||||
if(requestBodyInputStream != null){
|
||||
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream);
|
||||
((PostMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
else if (request.getRequestBody() != null) {
|
||||
StringRequestEntity requestEntity = new StringRequestEntity(
|
||||
request.getRequestBody(),
|
||||
CONTENT_TYPE_APPLICATION_JSON,
|
||||
CHARSET_UTF8);
|
||||
((PostMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PUT":
|
||||
method = new PutMethod(requestUrl);
|
||||
if(requestBodyInputStream != null){
|
||||
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream);
|
||||
((PutMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
else if (request.getRequestBody() != null) {
|
||||
StringRequestEntity requestEntity = new StringRequestEntity(
|
||||
request.getRequestBody(),
|
||||
CONTENT_TYPE_APPLICATION_JSON,
|
||||
CHARSET_UTF8);
|
||||
((PutMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
break;
|
||||
|
||||
case "DELETE":
|
||||
method = new DeleteMethod(requestUrl);
|
||||
break;
|
||||
|
||||
case "PROPFIND":
|
||||
method = new NCPropFindMethod(requestUrl, DavConstants.PROPFIND_ALL_PROP, DavConstants.DEPTH_1);
|
||||
if (request.getRequestBody() != null) {
|
||||
//text/xml; charset=UTF-8 is taken from XmlRequestEntity... Should be application/xml
|
||||
StringRequestEntity requestEntity = new StringRequestEntity(
|
||||
request.getRequestBody(),
|
||||
"text/xml; charset=UTF-8",
|
||||
CHARSET_UTF8);
|
||||
((PropFindMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
break;
|
||||
|
||||
case "MKCOL":
|
||||
method = new MkColMethod(requestUrl);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new UnsupportedOperationException(EXCEPTION_UNSUPPORTED_METHOD);
|
||||
|
||||
}
|
||||
return method;
|
||||
}
|
||||
|
||||
private InputStream processRequest(final NextcloudRequest request, final InputStream requestBodyInputStream)
|
||||
throws UnsupportedOperationException,
|
||||
com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException,
|
||||
OperationCanceledException, AuthenticatorException, IOException {
|
||||
Account account = AccountUtils.getOwnCloudAccountByName(context, request.getAccountName());
|
||||
if(account == null) {
|
||||
throw new IllegalStateException(EXCEPTION_ACCOUNT_NOT_FOUND);
|
||||
}
|
||||
@@ -156,56 +262,25 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
}
|
||||
|
||||
// Validate URL
|
||||
if(request.getUrl().length() == 0 || request.getUrl().charAt(0) != PATH_SEPARATOR) {
|
||||
throw new IllegalStateException(EXCEPTION_INVALID_REQUEST_URL, new IllegalStateException("URL need to start with a /"));
|
||||
if (request.getUrl().length() == 0 || request.getUrl().charAt(0) != PATH_SEPARATOR) {
|
||||
throw new IllegalStateException(EXCEPTION_INVALID_REQUEST_URL,
|
||||
new IllegalStateException("URL need to start with a /"));
|
||||
}
|
||||
|
||||
OwnCloudClientManager ownCloudClientManager = OwnCloudClientManagerFactory.getDefaultSingleton();
|
||||
OwnCloudAccount ocAccount = new OwnCloudAccount(account, context);
|
||||
OwnCloudClient client = ownCloudClientManager.getClientFor(ocAccount, context);
|
||||
|
||||
String requestUrl = client.getBaseUri() + request.getUrl();
|
||||
HttpMethodBase method;
|
||||
|
||||
switch (request.getMethod()) {
|
||||
case "GET":
|
||||
method = new GetMethod(requestUrl);
|
||||
break;
|
||||
|
||||
case "POST":
|
||||
method = new PostMethod(requestUrl);
|
||||
if (request.getRequestBody() != null) {
|
||||
StringRequestEntity requestEntity = new StringRequestEntity(
|
||||
request.getRequestBody(),
|
||||
CONTENT_TYPE_APPLICATION_JSON,
|
||||
CHARSET_UTF8);
|
||||
((PostMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PUT":
|
||||
method = new PutMethod(requestUrl);
|
||||
if (request.getRequestBody() != null) {
|
||||
StringRequestEntity requestEntity = new StringRequestEntity(
|
||||
request.getRequestBody(),
|
||||
CONTENT_TYPE_APPLICATION_JSON,
|
||||
CHARSET_UTF8);
|
||||
((PutMethod) method).setRequestEntity(requestEntity);
|
||||
}
|
||||
break;
|
||||
|
||||
case "DELETE":
|
||||
method = new DeleteMethod(requestUrl);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new UnsupportedOperationException(EXCEPTION_UNSUPPORTED_METHOD);
|
||||
|
||||
}
|
||||
HttpMethodBase method = buildMethod(request, client.getBaseUri(), requestBodyInputStream);
|
||||
|
||||
method.setQueryString(convertMapToNVP(request.getParameter()));
|
||||
method.addRequestHeader("OCS-APIREQUEST", "true");
|
||||
|
||||
for(Map.Entry<String, List<String>> header : request.getHeader().entrySet()) {
|
||||
// https://stackoverflow.com/a/3097052
|
||||
method.addRequestHeader(header.getKey(), TextUtils.join(",", header.getValue()));
|
||||
}
|
||||
|
||||
client.setFollowRedirects(request.isFollowRedirects());
|
||||
int status = client.executeMethod(method);
|
||||
|
||||
@@ -213,7 +288,20 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
if (status >= HTTP_STATUS_CODE_OK && status < HTTP_STATUS_CODE_MULTIPLE_CHOICES) {
|
||||
return method.getResponseBodyAsStream();
|
||||
} else {
|
||||
throw new IllegalStateException(EXCEPTION_HTTP_REQUEST_FAILED, new IllegalStateException(String.valueOf(status)));
|
||||
StringBuilder total = new StringBuilder();
|
||||
InputStream inputStream = method.getResponseBodyAsStream();
|
||||
// If response body is available
|
||||
if (inputStream != null) {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
||||
String line = reader.readLine();
|
||||
while (line != null) {
|
||||
total.append(line).append('\n');
|
||||
line = reader.readLine();
|
||||
}
|
||||
Log_OC.e(TAG, total.toString());
|
||||
}
|
||||
throw new IllegalStateException(EXCEPTION_HTTP_REQUEST_FAILED,
|
||||
new IllegalStateException(String.valueOf(status), new Throwable(total.toString())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +315,10 @@ public class InputStreamBinder extends IInputStreamService.Stub {
|
||||
}
|
||||
|
||||
private boolean validateToken(String hash, String token) {
|
||||
if (hash.isEmpty() || !hash.contains("$")) {
|
||||
throw new IllegalStateException(EXCEPTION_INVALID_TOKEN);
|
||||
}
|
||||
|
||||
String salt = hash.split("\\$")[1]; // TODO extract "$"
|
||||
|
||||
String newHash = EncryptionUtils.generateSHA512(token, salt);
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Nextcloud Android client application
|
||||
*
|
||||
* @author Chris Narkiewicz
|
||||
* Copyright (C) 2019 Chris Narkiewicz, EZ Aquarii
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.client.preferences;
|
||||
|
||||
public interface AppPreferences {
|
||||
boolean instantPictureUploadEnabled();
|
||||
boolean instantVideoUploadEnabled();
|
||||
|
||||
/**
|
||||
* Gets the selected file extension position the user selected to do the
|
||||
* last upload of a url file shared from other app.
|
||||
*
|
||||
* @return selectedPos the selected file extension position.
|
||||
*/
|
||||
int getUploadUrlFileExtensionUrlSelectedPos();
|
||||
|
||||
/**
|
||||
* Saves the selected file extension position the user selected to do the
|
||||
* last upload of a url file shared from other app.
|
||||
*
|
||||
* @param selectedPos the selected file extension position.
|
||||
*/
|
||||
void setUploadUrlFileExtensionUrlSelectedPos(int selectedPos);
|
||||
|
||||
/**
|
||||
* Gets the selected map file extension position the user selected to
|
||||
* do the last upload of a url file shared from other app.
|
||||
*
|
||||
* @return selectedPos the selected file extension position.
|
||||
*/
|
||||
int getUploadMapFileExtensionUrlSelectedPos();
|
||||
|
||||
/**
|
||||
* Saves the selected map file extension position the user selected to
|
||||
* do the last upload of a url file shared from other app.
|
||||
*
|
||||
* @param selectedPos the selected file extension position.
|
||||
*/
|
||||
void setUploadMapFileExtensionUrlSelectedPos(int selectedPos);
|
||||
|
||||
/**
|
||||
* Gets the last local path where the user selected to do an upload from.
|
||||
*
|
||||
* @return path Absolute path to a folder, as previously stored by
|
||||
* {@link #setUploadFromLocalLastPath(String)}, or empty String if never saved before.
|
||||
*/
|
||||
String getUploadFromLocalLastPath();
|
||||
|
||||
/**
|
||||
* Saves the path where the user selected to do the last local upload of a file from.
|
||||
*
|
||||
* @param path Absolute path to a folder.
|
||||
*/
|
||||
void setUploadFromLocalLastPath(String path);
|
||||
|
||||
/**
|
||||
* Gets the path where the user selected to do the last upload of a file shared from other app.
|
||||
*
|
||||
* @return path Absolute path to a folder, as previously stored by {@link #setLastUploadPath(String)},
|
||||
* or empty String if never saved before.
|
||||
*/
|
||||
String getLastUploadPath();
|
||||
|
||||
/**
|
||||
* Saves the path where the user selected to do the last upload of a file shared from other app.
|
||||
*
|
||||
* @param path Absolute path to a folder.
|
||||
*/
|
||||
void setLastUploadPath(String path);
|
||||
|
||||
/**
|
||||
* Gets the auto upload paths flag last set.
|
||||
*
|
||||
* @return ascending order the legacy cleaning flag, default is false
|
||||
*/
|
||||
boolean isAutoUploadPathsUpdateEnabled();
|
||||
|
||||
/**
|
||||
* Saves the legacy cleaning flag which the user has set last.
|
||||
*
|
||||
* @param pathUpdate flag if it is a auto upload path update
|
||||
*/
|
||||
void setAutoUploadPathsUpdateEnabled(boolean pathUpdate);
|
||||
|
||||
/**
|
||||
* Gets the auto upload split out flag last set.
|
||||
*
|
||||
* @return ascending order the legacy cleaning flag, default is false
|
||||
*/
|
||||
boolean isAutoUploadSplitEntriesEnabled();
|
||||
|
||||
/**
|
||||
* Saves the flag for split entries magic
|
||||
*
|
||||
* @param splitOut flag if it is a auto upload path update
|
||||
*/
|
||||
void setAutoUploadSplitEntriesEnabled(boolean splitOut);
|
||||
|
||||
boolean isAutoUploadInitialized();
|
||||
void setAutoUploadInit(boolean autoUploadInit);
|
||||
|
||||
boolean isShowDetailedTimestampEnabled();
|
||||
void setShowDetailedTimestampEnabled(boolean showDetailedTimestamp);
|
||||
|
||||
boolean isShowMediaScanNotifications();
|
||||
void setShowMediaScanNotifications(boolean showMediaScanNotification);
|
||||
|
||||
/**
|
||||
* Gets the uploader behavior which the user has set last.
|
||||
*
|
||||
* @return uploader behavior the uploader behavior
|
||||
*/
|
||||
int getUploaderBehaviour();
|
||||
|
||||
/**
|
||||
* Saves the uploader behavior which the user has set last.
|
||||
*
|
||||
* @param uploaderBehaviour the uploader behavior
|
||||
*/
|
||||
void setUploaderBehaviour(int uploaderBehaviour);
|
||||
|
||||
float getGridColumns();
|
||||
void setGridColumns(float gridColumns);
|
||||
|
||||
long getLockTimestamp();
|
||||
void setLockTimestamp(long timestamp);
|
||||
|
||||
/**
|
||||
* Gets the last seen version code right before updating.
|
||||
*
|
||||
* @return grid columns grid columns
|
||||
*/
|
||||
int getLastSeenVersionCode();
|
||||
|
||||
/**
|
||||
* Saves the version code as the last seen version code.
|
||||
*
|
||||
* @param versionCode the app's version code
|
||||
*/
|
||||
void setLastSeenVersionCode(int versionCode);
|
||||
|
||||
void removeLegacyPreferences();
|
||||
}
|
||||
@@ -3,21 +3,21 @@
|
||||
*
|
||||
* @author David A. Velasco
|
||||
* Copyright (C) 2016 ownCloud Inc.
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
*
|
||||
* 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 com.owncloud.android.db;
|
||||
package com.nextcloud.client.preferences;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
@@ -28,7 +28,7 @@ import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.ui.activity.ComponentsGetter;
|
||||
import com.owncloud.android.ui.activity.Preferences;
|
||||
import com.owncloud.android.ui.activity.SettingsActivity;
|
||||
import com.owncloud.android.utils.FileSortOrder;
|
||||
|
||||
import static com.owncloud.android.ui.fragment.OCFileListFragment.FOLDER_LAYOUT_LIST;
|
||||
@@ -36,16 +36,18 @@ import static com.owncloud.android.ui.fragment.OCFileListFragment.FOLDER_LAYOUT_
|
||||
/**
|
||||
* Helper to simplify reading of Preferences all around the app
|
||||
*/
|
||||
public final class PreferenceManager {
|
||||
public final class PreferenceManager implements AppPreferences {
|
||||
/**
|
||||
* Constant to access value of last path selected by the user to upload a file shared from other app.
|
||||
* Value handled by the app without direct access in the UI.
|
||||
*/
|
||||
private static final String AUTO_PREF__LAST_UPLOAD_PATH = "last_upload_path";
|
||||
private static final String AUTO_PREF__UPLOAD_FROM_LOCAL_LAST_PATH = "upload_from_local_last_path";
|
||||
private static final String AUTO_PREF__UPLOAD_FILE_EXTENSION_MAP_URL = "prefs_upload_file_extension_map_url";
|
||||
private static final String AUTO_PREF__UPLOAD_FILE_EXTENSION_URL = "prefs_upload_file_extension_url";
|
||||
private static final String AUTO_PREF__UPLOADER_BEHAVIOR = "prefs_uploader_behaviour";
|
||||
private static final String AUTO_PREF__GRID_COLUMNS = "grid_columns";
|
||||
private static final String AUTO_PREF__SHOW_DETAILED_TIMESTAMP = "detailed_timestamp";
|
||||
public static final String AUTO_PREF__LAST_SEEN_VERSION_CODE = "lastSeenVersionCode";
|
||||
private static final String PREF__INSTANT_UPLOADING = "instant_uploading";
|
||||
private static final String PREF__INSTANT_VIDEO_UPLOADING = "instant_video_uploading";
|
||||
@@ -64,8 +66,18 @@ public final class PreferenceManager {
|
||||
private static final String PREF__AUTO_UPLOAD_INIT = "autoUploadInit";
|
||||
private static final String PREF__FOLDER_SORT_ORDER = "folder_sort_order";
|
||||
private static final String PREF__FOLDER_LAYOUT = "folder_layout";
|
||||
public static final String PREF__LOCK_TIMESTAMP = "lock_timestamp";
|
||||
private static final String PREF__SHOW_MEDIA_SCAN_NOTIFICATIONS = "show_media_scan_notifications";
|
||||
|
||||
private PreferenceManager() {
|
||||
private final SharedPreferences preferences;
|
||||
|
||||
public static AppPreferences fromContext(Context context) {
|
||||
SharedPreferences prefs = getDefaultSharedPreferences(context.getApplicationContext());
|
||||
return new PreferenceManager(prefs);
|
||||
}
|
||||
|
||||
PreferenceManager(SharedPreferences preferences) {
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
public static void setKeysReInit(Context context) {
|
||||
@@ -84,12 +96,14 @@ public final class PreferenceManager {
|
||||
return getDefaultSharedPreferences(context).getString(PREF__PUSH_TOKEN, "");
|
||||
}
|
||||
|
||||
public static boolean instantPictureUploadEnabled(Context context) {
|
||||
return getDefaultSharedPreferences(context).getBoolean(PREF__INSTANT_UPLOADING, false);
|
||||
@Override
|
||||
public boolean instantPictureUploadEnabled() {
|
||||
return preferences.getBoolean(PREF__INSTANT_UPLOADING, false);
|
||||
}
|
||||
|
||||
public static boolean instantVideoUploadEnabled(Context context) {
|
||||
return getDefaultSharedPreferences(context).getBoolean(PREF__INSTANT_VIDEO_UPLOADING, false);
|
||||
@Override
|
||||
public boolean instantVideoUploadEnabled() {
|
||||
return preferences.getBoolean(PREF__INSTANT_VIDEO_UPLOADING, false);
|
||||
}
|
||||
|
||||
public static boolean instantPictureUploadPathUseSubfolders(Context context) {
|
||||
@@ -121,69 +135,44 @@ public final class PreferenceManager {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("show_hidden_files_pref", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the selected file extension position the user selected to do the last upload of a url file shared from other
|
||||
* app.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return selectedPos the selected file extension position.
|
||||
*/
|
||||
public static int getUploadUrlFileExtensionUrlSelectedPos(Context context) {
|
||||
return getDefaultSharedPreferences(context).getInt(AUTO_PREF__UPLOAD_FILE_EXTENSION_URL, 0);
|
||||
@Override
|
||||
public int getUploadUrlFileExtensionUrlSelectedPos() {
|
||||
return preferences.getInt(AUTO_PREF__UPLOAD_FILE_EXTENSION_URL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the selected file extension position the user selected to do the last upload of a url file shared from
|
||||
* other app.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param selectedPos the selected file extension position.
|
||||
*/
|
||||
public static void setUploadUrlFileExtensionUrlSelectedPos(Context context, int selectedPos) {
|
||||
saveIntPreference(context, AUTO_PREF__UPLOAD_FILE_EXTENSION_URL, selectedPos);
|
||||
@Override
|
||||
public void setUploadUrlFileExtensionUrlSelectedPos(int selectedPos) {
|
||||
preferences.edit().putInt(AUTO_PREF__UPLOAD_FILE_EXTENSION_URL, selectedPos).apply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the selected map file extension position the user selected to do the last upload of a url file shared
|
||||
* from other app.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return selectedPos the selected file extension position.
|
||||
*/
|
||||
public static int getUploadMapFileExtensionUrlSelectedPos(Context context) {
|
||||
return getDefaultSharedPreferences(context).getInt(AUTO_PREF__UPLOAD_FILE_EXTENSION_MAP_URL, 0);
|
||||
@Override
|
||||
public int getUploadMapFileExtensionUrlSelectedPos() {
|
||||
return preferences.getInt(AUTO_PREF__UPLOAD_FILE_EXTENSION_MAP_URL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the selected map file extension position the user selected to do the last upload of a url file shared from
|
||||
* other app.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param selectedPos the selected file extension position.
|
||||
*/
|
||||
public static void setUploadMapFileExtensionUrlSelectedPos(Context context, int selectedPos) {
|
||||
saveIntPreference(context, AUTO_PREF__UPLOAD_FILE_EXTENSION_MAP_URL, selectedPos);
|
||||
@Override
|
||||
public void setUploadMapFileExtensionUrlSelectedPos(int selectedPos) {
|
||||
preferences.edit().putInt(AUTO_PREF__UPLOAD_FILE_EXTENSION_MAP_URL, selectedPos).apply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path where the user selected to do the last upload of a file shared from other app.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return path Absolute path to a folder, as previously stored by {@link #setLastUploadPath(Context, String)},
|
||||
* or empty String if never saved before.
|
||||
*/
|
||||
public static String getLastUploadPath(Context context) {
|
||||
return getDefaultSharedPreferences(context).getString(AUTO_PREF__LAST_UPLOAD_PATH, "");
|
||||
@Override
|
||||
public String getUploadFromLocalLastPath() {
|
||||
return preferences.getString(AUTO_PREF__UPLOAD_FROM_LOCAL_LAST_PATH, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the path where the user selected to do the last upload of a file shared from other app.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param path Absolute path to a folder.
|
||||
*/
|
||||
public static void setLastUploadPath(Context context, String path) {
|
||||
saveStringPreference(context, AUTO_PREF__LAST_UPLOAD_PATH, path);
|
||||
@Override
|
||||
public void setUploadFromLocalLastPath(String path) {
|
||||
preferences.edit().putString(AUTO_PREF__UPLOAD_FROM_LOCAL_LAST_PATH, path).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastUploadPath() {
|
||||
return preferences.getString(AUTO_PREF__LAST_UPLOAD_PATH, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLastUploadPath(String path) {
|
||||
preferences.edit().putString(AUTO_PREF__LAST_UPLOAD_PATH, path).apply();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,7 +182,7 @@ public final class PreferenceManager {
|
||||
* @return lock lock preference value.
|
||||
*/
|
||||
public static String getLockPreference(Context context) {
|
||||
return getDefaultSharedPreferences(context).getString(Preferences.PREFERENCE_LOCK, "");
|
||||
return getDefaultSharedPreferences(context).getString(SettingsActivity.PREFERENCE_LOCK, "");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +192,7 @@ public final class PreferenceManager {
|
||||
* @return useFingerprint is lock via fingerprint preference.
|
||||
*/
|
||||
public static boolean isUseFingerprint(Context context) {
|
||||
return getDefaultSharedPreferences(context).getBoolean(Preferences.PREFERENCE_USE_FINGERPRINT, false);
|
||||
return getDefaultSharedPreferences(context).getBoolean(SettingsActivity.PREFERENCE_USE_FINGERPRINT, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,7 +200,7 @@ public final class PreferenceManager {
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to preferences manager.
|
||||
* @param folder Folder
|
||||
* @return preference value, default is
|
||||
* @return preference value, default is
|
||||
* {@link com.owncloud.android.ui.fragment.OCFileListFragment#FOLDER_LAYOUT_LIST}
|
||||
*/
|
||||
public static String getFolderLayout(Context context, OCFile folder) {
|
||||
@@ -235,19 +224,57 @@ public final class PreferenceManager {
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return sort order the sort order, default is {@link FileSortOrder#sort_a_to_z} (sort by name)
|
||||
*/
|
||||
public static FileSortOrder getSortOrder(Context context, OCFile folder) {
|
||||
public static FileSortOrder getSortOrderByFolder(Context context, OCFile folder) {
|
||||
return FileSortOrder.sortOrders.get(getFolderPreference(context, PREF__FOLDER_SORT_ORDER, folder,
|
||||
FileSortOrder.sort_a_to_z.mName));
|
||||
FileSortOrder.sort_a_to_z.name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set preferred folder sort order.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param sortOrder the sort order
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param sortOrder the sort order
|
||||
*/
|
||||
public static void setSortOrder(Context context, OCFile folder, FileSortOrder sortOrder) {
|
||||
setFolderPreference(context, PREF__FOLDER_SORT_ORDER, folder, sortOrder.mName);
|
||||
setFolderPreference(context, PREF__FOLDER_SORT_ORDER, folder, sortOrder.name);
|
||||
}
|
||||
|
||||
public static FileSortOrder getSortOrderByType(Context context, FileSortOrder.Type type) {
|
||||
return getSortOrderByType(context, type, FileSortOrder.sort_a_to_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get preferred folder sort order.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return sort order the sort order, default is {@link FileSortOrder#sort_a_to_z} (sort by name)
|
||||
*/
|
||||
public static FileSortOrder getSortOrderByType(Context context, FileSortOrder.Type type,
|
||||
FileSortOrder defaultOrder) {
|
||||
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
||||
|
||||
if (account == null) {
|
||||
return defaultOrder;
|
||||
}
|
||||
|
||||
ArbitraryDataProvider dataProvider = new ArbitraryDataProvider(context.getContentResolver());
|
||||
|
||||
String value = dataProvider.getValue(account.name, PREF__FOLDER_SORT_ORDER + "_" + type);
|
||||
|
||||
return value.isEmpty() ? defaultOrder : FileSortOrder.sortOrders.get(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set preferred folder sort order.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param sortOrder the sort order
|
||||
*/
|
||||
public static void setSortOrder(Context context, FileSortOrder.Type type, FileSortOrder sortOrder) {
|
||||
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
||||
ArbitraryDataProvider dataProvider = new ArbitraryDataProvider(context.getContentResolver());
|
||||
|
||||
dataProvider.storeOrUpdateKeyValue(account.name, PREF__FOLDER_SORT_ORDER + "_" + type, sortOrder.name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,14 +294,14 @@ public final class PreferenceManager {
|
||||
if (account == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
ArbitraryDataProvider dataProvider = new ArbitraryDataProvider(context.getContentResolver());
|
||||
FileDataStorageManager storageManager = ((ComponentsGetter)context).getStorageManager();
|
||||
|
||||
if (storageManager == null) {
|
||||
storageManager = new FileDataStorageManager(account, context.getContentResolver());
|
||||
}
|
||||
|
||||
|
||||
String value = dataProvider.getValue(account.name, getKeyFromFolder(preferenceName, folder));
|
||||
while (folder != null && value.isEmpty()) {
|
||||
folder = storageManager.getFileById(folder.getParentId());
|
||||
@@ -283,6 +310,29 @@ public final class PreferenceManager {
|
||||
return value.isEmpty() ? defaultValue : value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get preference value for a view.
|
||||
*
|
||||
* @param context Context object.
|
||||
* @param preferenceName Name of the preference to lookup.
|
||||
* @param type view which view
|
||||
* @param defaultValue Fallback value in case nothing is set.
|
||||
* @return Preference value
|
||||
*/
|
||||
public static String getTypePreference(Context context, String preferenceName, String type, String defaultValue) {
|
||||
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
||||
|
||||
if (account == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
ArbitraryDataProvider dataProvider = new ArbitraryDataProvider(context.getContentResolver());
|
||||
|
||||
String value = dataProvider.getValue(account.name, preferenceName + "_" + type);
|
||||
|
||||
return value.isEmpty() ? defaultValue : value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set preference value for a folder.
|
||||
*
|
||||
@@ -300,12 +350,8 @@ public final class PreferenceManager {
|
||||
private static String getKeyFromFolder(String preferenceName, OCFile folder) {
|
||||
final String folderIdString = String.valueOf(folder != null ? folder.getFileId() :
|
||||
FileDataStorageManager.ROOT_PARENT_ID);
|
||||
|
||||
return preferenceName + "_" + folderIdString;
|
||||
}
|
||||
|
||||
public static boolean getAutoUploadInit(Context context) {
|
||||
return getDefaultSharedPreferences(context).getBoolean(PREF__AUTO_UPLOAD_INIT, false);
|
||||
return preferenceName + "_" + folderIdString;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,25 +372,34 @@ public final class PreferenceManager {
|
||||
return getDefaultSharedPreferences(context).getBoolean(PREF__FIX_STORAGE_PATH, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the auto upload paths flag last set.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return ascending order the legacy cleaning flag, default is false
|
||||
*/
|
||||
public static boolean getAutoUploadPathsUpdate(Context context) {
|
||||
return getDefaultSharedPreferences(context).getBoolean(PREF__AUTO_UPLOAD_UPDATE_PATH, false);
|
||||
@Override
|
||||
public boolean isAutoUploadPathsUpdateEnabled() {
|
||||
return preferences.getBoolean(PREF__AUTO_UPLOAD_UPDATE_PATH, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the auto upload split out flag last set.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return ascending order the legacy cleaning flag, default is false
|
||||
*/
|
||||
public static boolean getAutoUploadSplitEntries(Context context) {
|
||||
return getDefaultSharedPreferences(context).getBoolean(PREF__AUTO_UPLOAD_SPLIT_OUT, false);
|
||||
@Override
|
||||
public void setAutoUploadPathsUpdateEnabled(boolean pathUpdate) {
|
||||
preferences.edit().putBoolean(PREF__AUTO_UPLOAD_UPDATE_PATH, pathUpdate).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoUploadSplitEntriesEnabled() {
|
||||
return preferences.getBoolean(PREF__AUTO_UPLOAD_SPLIT_OUT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAutoUploadSplitEntriesEnabled(boolean splitOut) {
|
||||
preferences.edit().putBoolean(PREF__AUTO_UPLOAD_SPLIT_OUT, splitOut).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoUploadInitialized() {
|
||||
return preferences.getBoolean(PREF__AUTO_UPLOAD_INIT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAutoUploadInit(boolean autoUploadInit) {
|
||||
preferences.edit().putBoolean(PREF__AUTO_UPLOAD_INIT, autoUploadInit).apply();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,88 +420,72 @@ public final class PreferenceManager {
|
||||
saveBooleanPreference(context, PREF__FIX_STORAGE_PATH, storagePathFix);
|
||||
}
|
||||
|
||||
public static void setAutoUploadInit(Context context, boolean autoUploadInit) {
|
||||
saveBooleanPreference(context, PREF__AUTO_UPLOAD_INIT, autoUploadInit);
|
||||
@Override
|
||||
public int getUploaderBehaviour() {
|
||||
return preferences.getInt(AUTO_PREF__UPLOADER_BEHAVIOR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the legacy cleaning flag which the user has set last.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param pathUpdate flag if it is a auto upload path update
|
||||
*/
|
||||
public static void setAutoUploadPathsUpdate(Context context, boolean pathUpdate) {
|
||||
saveBooleanPreference(context, PREF__AUTO_UPLOAD_UPDATE_PATH, pathUpdate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the flag for split entries magic
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param splitOut flag if it is a auto upload path update
|
||||
*/
|
||||
public static void setAutoUploadSplitEntries(Context context, boolean splitOut) {
|
||||
saveBooleanPreference(context, PREF__AUTO_UPLOAD_SPLIT_OUT, splitOut);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the uploader behavior which the user has set last.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return uploader behavior the uploader behavior
|
||||
*/
|
||||
public static int getUploaderBehaviour(Context context) {
|
||||
return getDefaultSharedPreferences(context).getInt(AUTO_PREF__UPLOADER_BEHAVIOR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the uploader behavior which the user has set last.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param uploaderBehaviour the uploader behavior
|
||||
*/
|
||||
public static void setUploaderBehaviour(Context context, int uploaderBehaviour) {
|
||||
saveIntPreference(context, AUTO_PREF__UPLOADER_BEHAVIOR, uploaderBehaviour);
|
||||
@Override
|
||||
public void setUploaderBehaviour(int uploaderBehaviour) {
|
||||
preferences.edit().putInt(AUTO_PREF__UPLOADER_BEHAVIOR, uploaderBehaviour).apply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the grid columns which the user has set last.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return grid columns grid columns
|
||||
*/
|
||||
public static float getGridColumns(Context context) {
|
||||
return getDefaultSharedPreferences(context).getFloat(AUTO_PREF__GRID_COLUMNS, 4.0f);
|
||||
@Override
|
||||
public float getGridColumns() {
|
||||
return preferences.getFloat(AUTO_PREF__GRID_COLUMNS, 4.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the grid columns which the user has set last.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param gridColumns the uploader behavior
|
||||
*/
|
||||
public static void setGridColumns(Context context, float gridColumns) {
|
||||
saveFloatPreference(context, AUTO_PREF__GRID_COLUMNS, gridColumns);
|
||||
@Override
|
||||
public void setGridColumns(float gridColumns) {
|
||||
preferences.edit().putFloat(AUTO_PREF__GRID_COLUMNS, gridColumns).apply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last seen version code right before updating.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @return grid columns grid columns
|
||||
*/
|
||||
public static int getLastSeenVersionCode(Context context) {
|
||||
return getDefaultSharedPreferences(context).getInt(AUTO_PREF__LAST_SEEN_VERSION_CODE, 0);
|
||||
@Override
|
||||
public int getLastSeenVersionCode() {
|
||||
return preferences.getInt(AUTO_PREF__LAST_SEEN_VERSION_CODE, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the version code as the last seen version code.
|
||||
*
|
||||
* @param context Caller {@link Context}, used to access to shared preferences manager.
|
||||
* @param versionCode the app's version code
|
||||
*/
|
||||
public static void setLastSeenVersionCode(Context context, int versionCode) {
|
||||
saveIntPreference(context, AUTO_PREF__LAST_SEEN_VERSION_CODE, versionCode);
|
||||
@Override
|
||||
public void setLastSeenVersionCode(int versionCode) {
|
||||
preferences.edit().putInt(AUTO_PREF__LAST_SEEN_VERSION_CODE, versionCode).apply();
|
||||
}
|
||||
|
||||
public long getLockTimestamp() {
|
||||
return preferences.getLong(PREF__LOCK_TIMESTAMP, 0);
|
||||
}
|
||||
|
||||
public void setLockTimestamp(long timestamp) {
|
||||
preferences.edit().putLong(PREF__LOCK_TIMESTAMP, timestamp).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowDetailedTimestampEnabled() {
|
||||
return preferences.getBoolean(AUTO_PREF__SHOW_DETAILED_TIMESTAMP, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShowDetailedTimestampEnabled(boolean showDetailedTimestamp) {
|
||||
preferences.edit().putBoolean(AUTO_PREF__SHOW_DETAILED_TIMESTAMP, showDetailedTimestamp).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowMediaScanNotifications() {
|
||||
return preferences.getBoolean(PREF__SHOW_MEDIA_SCAN_NOTIFICATIONS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShowMediaScanNotifications(boolean value) {
|
||||
preferences.edit().putBoolean(PREF__SHOW_MEDIA_SCAN_NOTIFICATIONS, value).apply();
|
||||
}
|
||||
|
||||
private static void saveBooleanPreference(Context context, String key, boolean value) {
|
||||
@@ -475,7 +514,30 @@ public final class PreferenceManager {
|
||||
appPreferences.putFloat(key, value).apply();
|
||||
}
|
||||
|
||||
private static void saveLongPreference(Context context, String key, long value) {
|
||||
SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit();
|
||||
appPreferences.putLong(key, value).apply();
|
||||
}
|
||||
|
||||
public static SharedPreferences getDefaultSharedPreferences(Context context) {
|
||||
return android.preference.PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLegacyPreferences() {
|
||||
preferences.edit()
|
||||
.remove("instant_uploading")
|
||||
.remove("instant_video_uploading")
|
||||
.remove("instant_upload_path")
|
||||
.remove("instant_upload_path_use_subfolders")
|
||||
.remove("instant_upload_on_wifi")
|
||||
.remove("instant_upload_on_charging")
|
||||
.remove("instant_video_upload_path")
|
||||
.remove("instant_video_upload_path_use_subfolders")
|
||||
.remove("instant_video_upload_on_wifi")
|
||||
.remove("instant_video_uploading")
|
||||
.remove("instant_video_upload_on_charging")
|
||||
.remove("prefs_instant_behaviour")
|
||||
.apply();
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,16 @@
|
||||
* @author masensio
|
||||
* @author David A. Velasco
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
@@ -35,16 +35,13 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.StrictMode;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
import android.support.v4.util.Pair;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.TextUtils;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.evernote.android.job.JobManager;
|
||||
import com.evernote.android.job.JobRequest;
|
||||
import com.nextcloud.client.preferences.AppPreferences;
|
||||
import com.nextcloud.client.preferences.PreferenceManager;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.authentication.PassCodeManager;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
@@ -56,7 +53,6 @@ import com.owncloud.android.datamodel.SyncedFolderProvider;
|
||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
|
||||
import com.owncloud.android.datastorage.DataStorageProvider;
|
||||
import com.owncloud.android.datastorage.StoragePoint;
|
||||
import com.owncloud.android.db.PreferenceManager;
|
||||
import com.owncloud.android.jobs.MediaFoldersDetectionJob;
|
||||
import com.owncloud.android.jobs.NCJobCreator;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
||||
@@ -64,7 +60,7 @@ import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
||||
import com.owncloud.android.ui.activity.ContactsPreferenceActivity;
|
||||
import com.owncloud.android.ui.activity.Preferences;
|
||||
import com.owncloud.android.ui.activity.SettingsActivity;
|
||||
import com.owncloud.android.ui.activity.SyncedFoldersActivity;
|
||||
import com.owncloud.android.ui.activity.WhatsNewActivity;
|
||||
import com.owncloud.android.ui.notifications.NotificationUtils;
|
||||
@@ -81,6 +77,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.util.Pair;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
|
||||
import static com.owncloud.android.ui.activity.ContactsPreferenceActivity.PREFERENCE_CONTACTS_AUTOMATIC_BACKUP;
|
||||
@@ -95,6 +96,7 @@ import static com.owncloud.android.ui.activity.ContactsPreferenceActivity.PREFER
|
||||
public class MainApp extends MultiDexApplication {
|
||||
|
||||
public static final OwnCloudVersion OUTDATED_SERVER_VERSION = OwnCloudVersion.nextcloud_12;
|
||||
public static final OwnCloudVersion MINIMUM_SUPPORTED_SERVER_VERSION = OwnCloudVersion.nextcloud_10;
|
||||
|
||||
private static final String TAG = MainApp.class.getSimpleName();
|
||||
|
||||
@@ -111,7 +113,9 @@ public class MainApp extends MultiDexApplication {
|
||||
|
||||
private static boolean mOnlyOnDevice;
|
||||
|
||||
private SharedPreferences appPrefs;
|
||||
private SharedPreferences sharedPreferences;
|
||||
private AppPreferences preferences;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean mBound;
|
||||
|
||||
@@ -125,12 +129,12 @@ public class MainApp extends MultiDexApplication {
|
||||
new SecurityUtils();
|
||||
DisplayUtils.useCompatVectorIfNeeded();
|
||||
|
||||
appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
|
||||
fixStoragePath();
|
||||
|
||||
MainApp.storagePath = appPrefs.getString(Preferences.PreferenceKeys.STORAGE_PATH,
|
||||
getApplicationContext().getFilesDir().getAbsolutePath());
|
||||
MainApp.storagePath = sharedPreferences.getString(SettingsActivity.PreferenceKeys.STORAGE_PATH,
|
||||
getApplicationContext().getFilesDir().getAbsolutePath());
|
||||
|
||||
boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
|
||||
|
||||
@@ -147,8 +151,7 @@ public class MainApp extends MultiDexApplication {
|
||||
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
|
||||
|
||||
|
||||
if (BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled) ||
|
||||
appPrefs.getBoolean(Preferences.PREFERENCE_EXPERT_MODE, false)) {
|
||||
if (BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled)) {
|
||||
// use app writable dir, no permissions needed
|
||||
Log_OC.startLogging(getAppContext());
|
||||
Log_OC.d("Debug", "start logging");
|
||||
@@ -180,7 +183,6 @@ public class MainApp extends MultiDexApplication {
|
||||
.build()
|
||||
.schedule();
|
||||
|
||||
|
||||
// register global protection with pass code
|
||||
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
||||
|
||||
@@ -242,22 +244,22 @@ public class MainApp extends MultiDexApplication {
|
||||
if (!PreferenceManager.getStoragePathFix(this)) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
StoragePoint[] storagePoints = DataStorageProvider.getInstance().getAvailableStoragePoints();
|
||||
String storagePath = appPrefs.getString(Preferences.PreferenceKeys.STORAGE_PATH, "");
|
||||
String storagePath = sharedPreferences.getString(SettingsActivity.PreferenceKeys.STORAGE_PATH, "");
|
||||
if (TextUtils.isEmpty(storagePath)) {
|
||||
if (PreferenceManager.getLastSeenVersionCode(this) != 0) {
|
||||
if (preferences.getLastSeenVersionCode() != 0) {
|
||||
// We already used the app, but no storage is set - fix that!
|
||||
appPrefs.edit().putString(Preferences.PreferenceKeys.STORAGE_PATH,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath()).commit();
|
||||
appPrefs.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
sharedPreferences.edit().putString(SettingsActivity.PreferenceKeys.STORAGE_PATH,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath()).commit();
|
||||
sharedPreferences.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
} else {
|
||||
// find internal storage path that's indexable
|
||||
boolean set = false;
|
||||
for (StoragePoint storagePoint : storagePoints) {
|
||||
if (storagePoint.getStorageType().equals(StoragePoint.StorageType.INTERNAL) &&
|
||||
storagePoint.getPrivacyType().equals(StoragePoint.PrivacyType.PUBLIC)) {
|
||||
appPrefs.edit().putString(Preferences.PreferenceKeys.STORAGE_PATH,
|
||||
storagePoint.getPath()).commit();
|
||||
appPrefs.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
sharedPreferences.edit().putString(SettingsActivity.PreferenceKeys.STORAGE_PATH,
|
||||
storagePoint.getPath()).commit();
|
||||
sharedPreferences.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
set = true;
|
||||
break;
|
||||
}
|
||||
@@ -266,9 +268,9 @@ public class MainApp extends MultiDexApplication {
|
||||
if (!set) {
|
||||
for (StoragePoint storagePoint : storagePoints) {
|
||||
if (storagePoint.getPrivacyType().equals(StoragePoint.PrivacyType.PUBLIC)) {
|
||||
appPrefs.edit().putString(Preferences.PreferenceKeys.STORAGE_PATH,
|
||||
storagePoint.getPath()).commit();
|
||||
appPrefs.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
sharedPreferences.edit().putString(SettingsActivity.PreferenceKeys.STORAGE_PATH,
|
||||
storagePoint.getPath()).commit();
|
||||
sharedPreferences.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
set = true;
|
||||
break;
|
||||
}
|
||||
@@ -278,15 +280,15 @@ public class MainApp extends MultiDexApplication {
|
||||
}
|
||||
PreferenceManager.setStoragePathFix(this, true);
|
||||
} else {
|
||||
appPrefs.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
sharedPreferences.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
PreferenceManager.setStoragePathFix(this, true);
|
||||
}
|
||||
} else {
|
||||
if (TextUtils.isEmpty(storagePath)) {
|
||||
appPrefs.edit().putString(Preferences.PreferenceKeys.STORAGE_PATH,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath()).commit();
|
||||
sharedPreferences.edit().putString(SettingsActivity.PreferenceKeys.STORAGE_PATH,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath()).commit();
|
||||
}
|
||||
appPrefs.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
sharedPreferences.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
|
||||
PreferenceManager.setStoragePathFix(this, true);
|
||||
}
|
||||
}
|
||||
@@ -302,7 +304,8 @@ public class MainApp extends MultiDexApplication {
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
splitOutAutoUploadEntries();
|
||||
} else {
|
||||
PreferenceManager.setAutoUploadSplitEntries(getAppContext(), true);
|
||||
AppPreferences preferences = PreferenceManager.fromContext(getAppContext());
|
||||
preferences.setAutoUploadSplitEntriesEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +390,7 @@ public class MainApp extends MultiDexApplication {
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Context getAppContext() {
|
||||
return MainApp.mContext;
|
||||
@@ -405,9 +408,9 @@ public class MainApp extends MultiDexApplication {
|
||||
MainApp.storagePath = path;
|
||||
}
|
||||
|
||||
// Methods to obtain Strings referring app_name
|
||||
// From AccountAuthenticator
|
||||
// public static final String ACCOUNT_TYPE = "owncloud";
|
||||
// Methods to obtain Strings referring app_name
|
||||
// From AccountAuthenticator
|
||||
// public static final String ACCOUNT_TYPE = "owncloud";
|
||||
public static String getAccountType(Context context) {
|
||||
return context.getResources().getString(R.string.account_type);
|
||||
}
|
||||
@@ -446,7 +449,7 @@ public class MainApp extends MultiDexApplication {
|
||||
return getAppContext().getResources().getString(R.string.authority);
|
||||
}
|
||||
|
||||
// From ProviderMeta
|
||||
// From ProviderMeta
|
||||
// public static final String DB_FILE = "owncloud.db";
|
||||
public static String getDBFile() {
|
||||
return getAppContext().getResources().getString(R.string.db_file);
|
||||
@@ -508,23 +511,9 @@ public class MainApp extends MultiDexApplication {
|
||||
|
||||
private static void updateToAutoUpload() {
|
||||
Context context = getAppContext();
|
||||
if (PreferenceManager.instantPictureUploadEnabled(context) ||
|
||||
PreferenceManager.instantVideoUploadEnabled(context)){
|
||||
|
||||
// remove legacy shared preferences
|
||||
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
|
||||
editor.remove("instant_uploading")
|
||||
.remove("instant_video_uploading")
|
||||
.remove("instant_upload_path")
|
||||
.remove("instant_upload_path_use_subfolders")
|
||||
.remove("instant_upload_on_wifi")
|
||||
.remove("instant_upload_on_charging")
|
||||
.remove("instant_video_upload_path")
|
||||
.remove("instant_video_upload_path_use_subfolders")
|
||||
.remove("instant_video_upload_on_wifi")
|
||||
.remove("instant_video_uploading")
|
||||
.remove("instant_video_upload_on_charging")
|
||||
.remove("prefs_instant_behaviour").apply();
|
||||
AppPreferences preferences = PreferenceManager.fromContext(context);
|
||||
if (preferences.instantPictureUploadEnabled() || preferences.instantVideoUploadEnabled()){
|
||||
preferences.removeLegacyPreferences();
|
||||
|
||||
// show info pop-up
|
||||
try {
|
||||
@@ -549,7 +538,8 @@ public class MainApp extends MultiDexApplication {
|
||||
private static void updateAutoUploadEntries() {
|
||||
// updates entries to reflect their true paths
|
||||
Context context = getAppContext();
|
||||
if (!PreferenceManager.getAutoUploadPathsUpdate(context)) {
|
||||
AppPreferences preferences = PreferenceManager.fromContext(context);
|
||||
if (!preferences.isAutoUploadPathsUpdateEnabled()) {
|
||||
SyncedFolderProvider syncedFolderProvider =
|
||||
new SyncedFolderProvider(MainApp.getAppContext().getContentResolver());
|
||||
syncedFolderProvider.updateAutoUploadPaths(mContext);
|
||||
@@ -558,7 +548,8 @@ public class MainApp extends MultiDexApplication {
|
||||
|
||||
private static void splitOutAutoUploadEntries() {
|
||||
Context context = getAppContext();
|
||||
if (!PreferenceManager.getAutoUploadSplitEntries(context)) {
|
||||
AppPreferences preferences = PreferenceManager.fromContext(context);
|
||||
if (!preferences.isAutoUploadSplitEntriesEnabled()) {
|
||||
// magic to split out existing synced folders in two when needed
|
||||
// otherwise, we migrate them to their proper type (image or video)
|
||||
Log_OC.i(TAG, "Migrate synced_folders records for image/video split");
|
||||
@@ -606,13 +597,14 @@ public class MainApp extends MultiDexApplication {
|
||||
syncedFolderProvider.deleteSyncedFolder(id);
|
||||
}
|
||||
|
||||
PreferenceManager.setAutoUploadSplitEntries(context, true);
|
||||
preferences.setAutoUploadSplitEntriesEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private static void initiateExistingAutoUploadEntries() {
|
||||
new Thread(() -> {
|
||||
if (!PreferenceManager.getAutoUploadInit(getAppContext())) {
|
||||
AppPreferences preferences = PreferenceManager.fromContext(getAppContext());
|
||||
if (!preferences.isAutoUploadInitialized()) {
|
||||
SyncedFolderProvider syncedFolderProvider =
|
||||
new SyncedFolderProvider(MainApp.getAppContext().getContentResolver());
|
||||
|
||||
@@ -622,7 +614,7 @@ public class MainApp extends MultiDexApplication {
|
||||
}
|
||||
}
|
||||
|
||||
PreferenceManager.setAutoUploadInit(getAppContext(), true);
|
||||
preferences.setAutoUploadInit(true);
|
||||
}
|
||||
|
||||
}).start();
|
||||
|
||||
@@ -19,16 +19,17 @@ package com.owncloud.android.authentication;
|
||||
import android.accounts.AccountAuthenticatorResponse;
|
||||
import android.accounts.AccountManager;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/*
|
||||
* Base class for implementing an Activity that is used to help implement an AbstractAccountAuthenticator.
|
||||
* If the AbstractAccountAuthenticator needs to use an activity to handle the request then it can have the activity extend
|
||||
* Base class for implementing an Activity that is used to help implement an AbstractAccountAuthenticator.
|
||||
* If the AbstractAccountAuthenticator needs to use an activity to handle the request then it can have the activity extend
|
||||
* AccountAuthenticatorActivity. The AbstractAccountAuthenticator passes in the response to the intent using the following:
|
||||
* intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
|
||||
*
|
||||
* The activity then sets the result that is to be handed to the response via setAccountAuthenticatorResult(android.os.Bundle).
|
||||
* This result will be sent as the result of the request when the activity finishes. If this is never set or if it is set to null
|
||||
*
|
||||
* The activity then sets the result that is to be handed to the response via setAccountAuthenticatorResult(android.os.Bundle).
|
||||
* This result will be sent as the result of the request when the activity finishes. If this is never set or if it is set to null
|
||||
* then error AccountManager.ERROR_CODE_CANCELED will be called on the response.
|
||||
*/
|
||||
|
||||
@@ -41,7 +42,7 @@ public class AccountAuthenticatorActivity extends AppCompatActivity {
|
||||
/**
|
||||
* Set the result that is to be sent as the result of the request that caused this Activity to be launched.
|
||||
* If result is null or this method is never called then the request will be canceled.
|
||||
*
|
||||
*
|
||||
* @param result this is returned as the result of the AbstractAccountAuthenticator request
|
||||
*/
|
||||
public final void setAccountAuthenticatorResult(Bundle result) {
|
||||
@@ -64,7 +65,7 @@ public class AccountAuthenticatorActivity extends AppCompatActivity {
|
||||
mAccountAuthenticatorResponse.onRequestContinued();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present.
|
||||
*/
|
||||
|
||||
@@ -23,24 +23,36 @@ import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.lib.common.OwnCloudAccount;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
||||
import com.owncloud.android.lib.common.UserInfo;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
||||
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
|
||||
import com.owncloud.android.ui.activity.ManageAccountsActivity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Helper class for dealing with accounts.
|
||||
*/
|
||||
public final class AccountUtils {
|
||||
private static final String TAG = AccountUtils.class.getSimpleName();
|
||||
private static final String PREF_SELECT_OC_ACCOUNT = "select_oc_account";
|
||||
|
||||
public static final int ACCOUNT_VERSION = 1;
|
||||
//public static final int ACCOUNT_VERSION_WITH_PROPER_ID = 2;
|
||||
public static final int ACCOUNT_VERSION_WITH_PROPER_ID = 2;
|
||||
public static final String ACCOUNT_USES_STANDARD_PASSWORD = "ACCOUNT_USES_STANDARD_PASSWORD";
|
||||
|
||||
private AccountUtils() {
|
||||
@@ -50,10 +62,10 @@ public final class AccountUtils {
|
||||
/**
|
||||
* Can be used to get the currently selected ownCloud {@link Account} in the
|
||||
* application preferences.
|
||||
*
|
||||
*
|
||||
* @param context The current application {@link Context}
|
||||
* @return The ownCloud {@link Account} currently saved in preferences, or the first
|
||||
* {@link Account} available, if valid (still registered in the system as ownCloud
|
||||
* @return The ownCloud {@link Account} currently saved in preferences, or the first
|
||||
* {@link Account} available, if valid (still registered in the system as ownCloud
|
||||
* account). If none is available and valid, returns null.
|
||||
*/
|
||||
public static @Nullable Account getCurrentOwnCloudAccount(Context context) {
|
||||
@@ -96,7 +108,7 @@ public final class AccountUtils {
|
||||
return accountManager.getAccountsByType(MainApp.getAccountType(context));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static boolean exists(Account account, Context context) {
|
||||
Account[] ocAccounts = getAccounts(context);
|
||||
|
||||
@@ -132,7 +144,7 @@ public final class AccountUtils {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns owncloud account identified by accountName or null if it does not exist.
|
||||
* @param context the context
|
||||
@@ -176,24 +188,172 @@ public final class AccountUtils {
|
||||
/**
|
||||
* Access the version of the OC server corresponding to an account SAVED IN THE ACCOUNTMANAGER
|
||||
*
|
||||
* @param account ownCloud account
|
||||
* @return Version of the OC server corresponding to account, according to the data saved
|
||||
* in the system AccountManager
|
||||
* @param account ownCloud account
|
||||
* @return Version of the OC server corresponding to account, according to the data saved
|
||||
* in the system AccountManager
|
||||
*/
|
||||
public static @NonNull
|
||||
OwnCloudVersion getServerVersion(Account account) {
|
||||
OwnCloudVersion serverVersion = OwnCloudVersion.nextcloud_10;
|
||||
OwnCloudVersion serverVersion = MainApp.MINIMUM_SUPPORTED_SERVER_VERSION;
|
||||
|
||||
if (account != null) {
|
||||
AccountManager accountMgr = AccountManager.get(MainApp.getAppContext());
|
||||
String serverVersionStr = accountMgr.getUserData(account, Constants.KEY_OC_VERSION);
|
||||
|
||||
if (serverVersionStr != null) {
|
||||
serverVersion = new OwnCloudVersion(serverVersionStr);
|
||||
}
|
||||
}
|
||||
|
||||
return serverVersion;
|
||||
}
|
||||
|
||||
public static boolean hasSearchSupport(Account account) {
|
||||
return getServerVersion(account).isSearchSupported();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the accounts in AccountManager to meet the current version of accounts expected by the app, if needed.
|
||||
* <p>
|
||||
* Introduced to handle a change in the structure of stored account names needed to allow different OC servers in
|
||||
* the same domain, but not in the same path.
|
||||
*
|
||||
* @param context Used to access the AccountManager.
|
||||
*/
|
||||
public static void updateAccountVersion(Context context) {
|
||||
Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(context);
|
||||
AccountManager accountMgr = AccountManager.get(context);
|
||||
|
||||
if (currentAccount != null) {
|
||||
String currentAccountVersion = accountMgr.getUserData(currentAccount, Constants.KEY_OC_ACCOUNT_VERSION);
|
||||
|
||||
if (!String.valueOf(ACCOUNT_VERSION_WITH_PROPER_ID).equalsIgnoreCase(currentAccountVersion)) {
|
||||
Log_OC.i(TAG, "Upgrading accounts to account version #" + ACCOUNT_VERSION_WITH_PROPER_ID);
|
||||
|
||||
Account[] ocAccounts = accountMgr.getAccountsByType(MainApp.getAccountType(context));
|
||||
String serverUrl;
|
||||
String username;
|
||||
String displayName;
|
||||
String newAccountName;
|
||||
Account newAccount;
|
||||
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation();
|
||||
|
||||
for (Account account : ocAccounts) {
|
||||
// build new account name
|
||||
serverUrl = accountMgr.getUserData(account, Constants.KEY_OC_BASE_URL);
|
||||
|
||||
// update user name
|
||||
try {
|
||||
OwnCloudAccount ocAccount = new OwnCloudAccount(account, context);
|
||||
OwnCloudClient client = OwnCloudClientManagerFactory.getDefaultSingleton()
|
||||
.getClientFor(ocAccount, context);
|
||||
|
||||
RemoteOperationResult result = remoteUserNameOperation.execute(client);
|
||||
|
||||
if (result.isSuccess()) {
|
||||
UserInfo userInfo = (UserInfo) result.getData().get(0);
|
||||
username = userInfo.id;
|
||||
displayName = userInfo.displayName;
|
||||
} else {
|
||||
// skip account, try it next time
|
||||
Log_OC.e(TAG, "Error while getting username for account: " + account.name);
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log_OC.e(TAG, "Error while getting username: " + e.getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
newAccountName = com.owncloud.android.lib.common.accounts.AccountUtils.
|
||||
buildAccountName(Uri.parse(serverUrl), username);
|
||||
|
||||
// migrate to a new account, if needed
|
||||
if (!newAccountName.equals(account.name)) {
|
||||
newAccount = migrateAccount(context, currentAccount, accountMgr, serverUrl, newAccountName,
|
||||
account);
|
||||
|
||||
} else {
|
||||
// servers which base URL is in the root of their domain need no change
|
||||
Log_OC.d(TAG, account.name + " needs no upgrade ");
|
||||
newAccount = account;
|
||||
}
|
||||
|
||||
accountMgr.setUserData(newAccount, Constants.KEY_DISPLAY_NAME, displayName);
|
||||
accountMgr.setUserData(newAccount, Constants.KEY_USER_ID, username);
|
||||
|
||||
// at least, upgrade account version
|
||||
Log_OC.d(TAG, "Setting version " + ACCOUNT_VERSION_WITH_PROPER_ID + " to " + newAccountName);
|
||||
accountMgr.setUserData(newAccount, Constants.KEY_OC_ACCOUNT_VERSION,
|
||||
Integer.toString(ACCOUNT_VERSION_WITH_PROPER_ID));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static Account migrateAccount(Context context, Account currentAccount, AccountManager accountMgr,
|
||||
String serverUrl, String newAccountName, Account account) {
|
||||
|
||||
Log_OC.d(TAG, "Upgrading " + account.name + " to " + newAccountName);
|
||||
|
||||
// create the new account
|
||||
Account newAccount = new Account(newAccountName, MainApp.getAccountType(context));
|
||||
String password = accountMgr.getPassword(account);
|
||||
accountMgr.addAccountExplicitly(newAccount, (password != null) ? password : "", null);
|
||||
|
||||
// copy base URL
|
||||
accountMgr.setUserData(newAccount, Constants.KEY_OC_BASE_URL, serverUrl);
|
||||
|
||||
// copy server version
|
||||
accountMgr.setUserData(
|
||||
newAccount,
|
||||
Constants.KEY_OC_VERSION,
|
||||
accountMgr.getUserData(account, Constants.KEY_OC_VERSION)
|
||||
);
|
||||
|
||||
// copy cookies
|
||||
accountMgr.setUserData(
|
||||
newAccount,
|
||||
Constants.KEY_COOKIES,
|
||||
accountMgr.getUserData(account, Constants.KEY_COOKIES)
|
||||
);
|
||||
|
||||
// copy type of authentication
|
||||
final String isSamlStr = accountMgr.getUserData(account, Constants.KEY_SUPPORTS_SAML_WEB_SSO);
|
||||
if (Boolean.parseBoolean(isSamlStr)) {
|
||||
accountMgr.setUserData(newAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO, "TRUE");
|
||||
}
|
||||
|
||||
final String isOauthStr = accountMgr.getUserData(account, Constants.KEY_SUPPORTS_OAUTH2);
|
||||
if (Boolean.parseBoolean(isOauthStr)) {
|
||||
accountMgr.setUserData(newAccount, Constants.KEY_SUPPORTS_OAUTH2, "TRUE");
|
||||
}
|
||||
|
||||
/* TODO - study if it's possible to run this method in a background thread to copy the authToken
|
||||
if (isOAuth || isSaml) {
|
||||
accountMgr.setAuthToken(newAccount, mAuthTokenType, mAuthToken);
|
||||
}
|
||||
*/
|
||||
|
||||
// don't forget the account saved in preferences as the current one
|
||||
if (currentAccount.name.equals(account.name)) {
|
||||
AccountUtils.setCurrentOwnCloudAccount(context, newAccountName);
|
||||
}
|
||||
|
||||
// remove the old account
|
||||
accountMgr.removeAccount(account, null, null);
|
||||
|
||||
// will assume it succeeds, not a big deal otherwise
|
||||
return newAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an account owns the file (file's ownerId is the same as account name)
|
||||
* @param file File to check
|
||||
* @param account account to compare
|
||||
* @return false if ownerId is not set or owner is a different account
|
||||
*/
|
||||
public static boolean accountOwnsFile(OCFile file, Account account) {
|
||||
return !TextUtils.isEmpty(file.getOwnerId()) && account.name.split("@")[0].equals(file.getOwnerId());
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
package com.owncloud.android.authentication;
|
||||
|
||||
import android.Manifest;
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.annotation.SuppressLint;
|
||||
@@ -50,6 +51,7 @@ import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
@@ -59,13 +61,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
@@ -90,6 +85,9 @@ import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.OnEditorActionListener;
|
||||
|
||||
import com.blikoon.qrcodescanner.QrCodeActivity;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;
|
||||
@@ -115,6 +113,7 @@ import com.owncloud.android.operations.GetServerInfoOperation;
|
||||
import com.owncloud.android.operations.OAuth2GetAccessToken;
|
||||
import com.owncloud.android.services.OperationsService;
|
||||
import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
|
||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||
import com.owncloud.android.ui.activity.FirstRunActivity;
|
||||
import com.owncloud.android.ui.components.CustomEditText;
|
||||
import com.owncloud.android.ui.dialog.CredentialsDialogFragment;
|
||||
@@ -124,14 +123,22 @@ import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
|
||||
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;
|
||||
import com.owncloud.android.utils.DisplayUtils;
|
||||
import com.owncloud.android.utils.ErrorMessageAdapter;
|
||||
import com.owncloud.android.utils.PermissionUtil;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
|
||||
/**
|
||||
@@ -191,6 +198,10 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
public static final int NO_ICON = 0;
|
||||
public static final String EMPTY_STRING = "";
|
||||
|
||||
private static final int REQUEST_CODE_QR_SCAN = 101;
|
||||
public static final int REQUEST_CODE_FIRST_RUN = 102;
|
||||
|
||||
|
||||
/// parameters from EXTRAs in starter Intent
|
||||
private byte mAction;
|
||||
private Account mAccount;
|
||||
@@ -203,7 +214,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
private AccountManager mAccountMgr;
|
||||
private Uri mNewCapturedUriFromOAuth2Redirection;
|
||||
|
||||
/// Server PRE-Fragment elements
|
||||
/// Server PRE-Fragment elements
|
||||
private CustomEditText mHostUrlInput;
|
||||
private View mRefreshButton;
|
||||
private TextView mServerStatusView;
|
||||
@@ -217,7 +228,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
private GetServerInfoOperation.ServerInfo mServerInfo = new GetServerInfoOperation.ServerInfo();
|
||||
|
||||
/// Authentication PRE-Fragment elements
|
||||
/// Authentication PRE-Fragment elements
|
||||
private CheckBox mOAuth2Check;
|
||||
private TextView mOAuthAuthEndpointText;
|
||||
private TextView mOAuthTokenEndpointText;
|
||||
@@ -237,7 +248,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
private boolean mIsFirstAuthAttempt;
|
||||
|
||||
/// Identifier of operation in progress which result shouldn't be lost
|
||||
/// Identifier of operation in progress which result shouldn't be lost
|
||||
private long mWaitingForOpId = Long.MAX_VALUE;
|
||||
|
||||
private String basicTokenType;
|
||||
@@ -261,10 +272,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
//Log_OC.e(TAG, "onCreate init");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
Uri data = getIntent().getData();
|
||||
boolean directLogin = data != null && data.toString().startsWith(getString(R.string.login_data_own_scheme));
|
||||
if (savedInstanceState == null && !directLogin) {
|
||||
FirstRunActivity.runIfNeeded(this);
|
||||
}
|
||||
|
||||
|
||||
basicTokenType = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType(this));
|
||||
oauthTokenType = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType(this));
|
||||
samlTokenType = AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType(this));
|
||||
@@ -320,21 +333,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
/// initialize general UI elements
|
||||
initOverallUi();
|
||||
|
||||
findViewById(R.id.centeredRefreshButton).setOnClickListener(new View.OnClickListener() {
|
||||
findViewById(R.id.centeredRefreshButton).setOnClickListener(v -> checkOcServer());
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
checkOcServer();
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.embeddedRefreshButton).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
checkOcServer();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.embeddedRefreshButton).setOnClickListener(v -> checkOcServer());
|
||||
|
||||
/// initialize block to be moved to single Fragment to check server and get info about it
|
||||
|
||||
@@ -379,7 +380,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
mLoginWebView.getSettings().setAllowFileAccess(false);
|
||||
mLoginWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mLoginWebView.getSettings().setDomStorageEnabled(true);
|
||||
|
||||
|
||||
if (useGenericUserAgent) {
|
||||
mLoginWebView.getSettings().setUserAgentString(MainApp.getNextcloudUserAgent());
|
||||
} else {
|
||||
@@ -404,41 +405,35 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
// show snackbar after 60s to switch back to old login method
|
||||
if (showLegacyLogin) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DisplayUtils.createSnackbar(mLoginWebView, R.string.fallback_weblogin_text, Snackbar.LENGTH_INDEFINITE)
|
||||
.setActionTextColor(getResources().getColor(R.color.primary_dark))
|
||||
.setAction(R.string.fallback_weblogin_back, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mLoginWebView.setVisibility(View.INVISIBLE);
|
||||
webViewLoginMethod = false;
|
||||
new Handler().postDelayed(() -> DisplayUtils.createSnackbar(mLoginWebView,
|
||||
R.string.fallback_weblogin_text,
|
||||
Snackbar.LENGTH_INDEFINITE)
|
||||
.setActionTextColor(getResources().getColor(R.color.white))
|
||||
.setAction(R.string.fallback_weblogin_back, v -> {
|
||||
mLoginWebView.setVisibility(View.INVISIBLE);
|
||||
webViewLoginMethod = false;
|
||||
|
||||
setContentView(R.layout.account_setup);
|
||||
setContentView(R.layout.account_setup);
|
||||
|
||||
// initialize general UI elements
|
||||
initOverallUi();
|
||||
// initialize general UI elements
|
||||
initOverallUi();
|
||||
|
||||
mPasswordInputLayout.setVisibility(View.VISIBLE);
|
||||
mUsernameInputLayout.setVisibility(View.VISIBLE);
|
||||
mUsernameInput.requestFocus();
|
||||
mOAuth2Check.setVisibility(View.INVISIBLE);
|
||||
mAuthStatusView.setVisibility(View.INVISIBLE);
|
||||
mServerStatusView.setVisibility(View.INVISIBLE);
|
||||
mTestServerButton.setVisibility(View.INVISIBLE);
|
||||
forceOldLoginMethod = true;
|
||||
mOkButton.setVisibility(View.VISIBLE);
|
||||
mPasswordInputLayout.setVisibility(View.VISIBLE);
|
||||
mUsernameInputLayout.setVisibility(View.VISIBLE);
|
||||
mUsernameInput.requestFocus();
|
||||
mOAuth2Check.setVisibility(View.INVISIBLE);
|
||||
mAuthStatusView.setVisibility(View.INVISIBLE);
|
||||
mServerStatusView.setVisibility(View.INVISIBLE);
|
||||
mTestServerButton.setVisibility(View.INVISIBLE);
|
||||
forceOldLoginMethod = true;
|
||||
mOkButton.setVisibility(View.VISIBLE);
|
||||
|
||||
initServerPreFragment(null);
|
||||
initServerPreFragment(null);
|
||||
|
||||
mHostUrlInput.setText(baseURL);
|
||||
mHostUrlInput.setText(baseURL);
|
||||
|
||||
checkOcServer();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
}, 60 * 1000);
|
||||
checkOcServer();
|
||||
}).show(), 60 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,9 +507,15 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, dataString);
|
||||
|
||||
if (loginUrlInfo != null) {
|
||||
mServerInfo.mBaseUrl = AuthenticatorUrlUtils.normalizeUrlSuffix(loginUrlInfo.serverAddress);
|
||||
webViewUser = loginUrlInfo.username;
|
||||
webViewPassword = loginUrlInfo.password;
|
||||
try {
|
||||
mServerInfo.mBaseUrl = AuthenticatorUrlUtils.normalizeUrlSuffix(loginUrlInfo.serverAddress);
|
||||
webViewUser = loginUrlInfo.username;
|
||||
webViewPassword = loginUrlInfo.password;
|
||||
} catch (Exception e) {
|
||||
mServerStatusIcon = R.drawable.ic_alert;
|
||||
mServerStatusText = "QR Code could not be read!";
|
||||
showServerStatus();
|
||||
}
|
||||
checkOcServer();
|
||||
}
|
||||
}
|
||||
@@ -573,9 +574,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
} else if (value.startsWith("server" + LOGIN_URL_DATA_KEY_VALUE_SEPARATOR)) {
|
||||
loginUrlInfo.serverAddress = URLDecoder.decode(
|
||||
value.substring(("server" + LOGIN_URL_DATA_KEY_VALUE_SEPARATOR).length()));
|
||||
} else {
|
||||
// error illegal URL element detected
|
||||
throw new IllegalArgumentException("Illegal magic login URL element detected: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,14 +581,19 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
}
|
||||
|
||||
private void initAuthTokenType() {
|
||||
mAuthTokenType = getIntent().getExtras().getString(AccountAuthenticator.KEY_AUTH_TOKEN_TYPE);
|
||||
Bundle extras = getIntent().getExtras();
|
||||
mAuthTokenType = null;
|
||||
|
||||
if (extras != null) {
|
||||
extras.getString(AccountAuthenticator.KEY_AUTH_TOKEN_TYPE);
|
||||
}
|
||||
|
||||
if (mAuthTokenType == null) {
|
||||
if (mAccount != null) {
|
||||
boolean oAuthRequired = mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_OAUTH2) != null;
|
||||
boolean samlWebSsoRequired = mAccountMgr.getUserData
|
||||
(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
|
||||
mAuthTokenType = chooseAuthTokenType(oAuthRequired, samlWebSsoRequired);
|
||||
|
||||
} else {
|
||||
boolean oAuthSupported = AUTH_ON.equals(getString(R.string.auth_method_oauth2));
|
||||
boolean samlWebSsoSupported = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
|
||||
@@ -627,6 +630,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
mOkButton = findViewById(R.id.buttonOK);
|
||||
mOkButton.setOnClickListener(v -> onOkClick());
|
||||
|
||||
findViewById(R.id.scanQR).setOnClickListener(v -> onScan());
|
||||
|
||||
setupInstructionMessage();
|
||||
|
||||
mTestServerButton.setVisibility(mAction == ACTION_CREATE ? View.VISIBLE : View.GONE);
|
||||
@@ -763,17 +768,14 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
|
||||
// TODO find out if this is really necessary, or if it can done in a different way
|
||||
findViewById(R.id.scroll).setOnTouchListener(new OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN &&
|
||||
AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(
|
||||
MainApp.getAccountType(getBaseContext())).equals(mAuthTokenType) &&
|
||||
mHostUrlInput.hasFocus()) {
|
||||
checkOcServer();
|
||||
}
|
||||
return false;
|
||||
findViewById(R.id.scroll).setOnTouchListener((view, event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN &&
|
||||
AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(
|
||||
MainApp.getAccountType(getBaseContext())).equals(mAuthTokenType) &&
|
||||
mHostUrlInput.hasFocus()) {
|
||||
checkOcServer();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -975,11 +977,20 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
Log_OC.d(TAG, "onNewIntent()");
|
||||
|
||||
if (intent.getBooleanExtra(FirstRunActivity.EXTRA_EXIT, false)) {
|
||||
super.finish();
|
||||
}
|
||||
|
||||
Uri data = intent.getData();
|
||||
if (data != null && data.toString().startsWith(getString(R.string.oauth2_redirect_uri))) {
|
||||
mNewCapturedUriFromOAuth2Redirection = data;
|
||||
}
|
||||
|
||||
if (data != null && data.toString().startsWith(getString(R.string.login_data_own_scheme))) {
|
||||
parseAndLoginFromWebView(data.toString());
|
||||
}
|
||||
|
||||
if (intent.getBooleanExtra(EXTRA_USE_PROVIDER_AS_WEBLOGIN, false)) {
|
||||
webViewLoginMethod = true;
|
||||
setContentView(R.layout.account_setup_webview);
|
||||
@@ -1295,9 +1306,11 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
}
|
||||
|
||||
/// be gentle with the user
|
||||
IndeterminateProgressDialog dialog =
|
||||
IndeterminateProgressDialog.newInstance(R.string.auth_trying_to_login, true);
|
||||
dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);
|
||||
IndeterminateProgressDialog dialog = IndeterminateProgressDialog.newInstance(R.string.auth_trying_to_login,
|
||||
true);
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
ft.add(dialog, WAIT_DIALOG_TAG);
|
||||
ft.commitAllowingStateLoss();
|
||||
|
||||
/// validate credentials accessing the root folder
|
||||
OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBasicCredentials(username, password);
|
||||
@@ -1339,7 +1352,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
uri = uriBuilder.build();
|
||||
Log_OC.d(TAG, "Starting browser to view " + uri.toString());
|
||||
Intent i = new Intent(Intent.ACTION_VIEW, uri);
|
||||
startActivity(i);
|
||||
|
||||
DisplayUtils.startIntentIfAppAvailable(i, this, R.string.no_browser_available);
|
||||
}
|
||||
|
||||
|
||||
@@ -1371,7 +1385,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
if (operation instanceof GetServerInfoOperation) {
|
||||
if (operation.hashCode() == mWaitingForOpId) {
|
||||
onGetServerInfoFinish(result);
|
||||
} // else nothing ; only the last check operation is considered;
|
||||
} // else nothing ; only the last check operation is considered;
|
||||
// multiple can be started if the user amends a URL quickly
|
||||
|
||||
} else if (operation instanceof OAuth2GetAccessToken) {
|
||||
@@ -1456,7 +1470,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
// 1. connection succeeded, and we know if it's SSL or not
|
||||
// 2. server is installed
|
||||
// 3. we got the server version
|
||||
// 4. we got the authentication method required by the server
|
||||
// 4. we got the authentication method required by the server
|
||||
mServerInfo = (GetServerInfoOperation.ServerInfo) (result.getData().get(0));
|
||||
|
||||
// show outdated warning
|
||||
@@ -1756,6 +1770,14 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
if (success) {
|
||||
finish();
|
||||
|
||||
AccountUtils.setCurrentOwnCloudAccount(this, mAccount.name);
|
||||
|
||||
Intent i = new Intent(this, FileDisplayActivity.class);
|
||||
i.setAction(FileDisplayActivity.RESTART);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(i);
|
||||
|
||||
} else {
|
||||
// init webView again
|
||||
if (mLoginWebView != null) {
|
||||
@@ -1776,7 +1798,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
}
|
||||
|
||||
} else if (result.isServerFail() || result.isException()) {
|
||||
/// server errors or exceptions in authorization take to requiring a new check of
|
||||
/// server errors or exceptions in authorization take to requiring a new check of
|
||||
/// the server
|
||||
mServerIsChecked = true;
|
||||
mServerIsValid = false;
|
||||
@@ -1803,9 +1825,31 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
} else { // authorization fail due to client side - probably wrong credentials
|
||||
if (webViewLoginMethod) {
|
||||
mLoginWebView = findViewById(R.id.login_webview);
|
||||
initWebViewLogin(mServerInfo.mBaseUrl + WEB_LOGIN, true, false);
|
||||
|
||||
DisplayUtils.showSnackMessage(this, mLoginWebView, R.string.auth_access_failed, result.getLogMessage());
|
||||
if (mLoginWebView != null) {
|
||||
initWebViewLogin(mServerInfo.mBaseUrl + WEB_LOGIN, true, false);
|
||||
DisplayUtils.showSnackMessage(this, mLoginWebView, R.string.auth_access_failed,
|
||||
result.getLogMessage());
|
||||
} else {
|
||||
DisplayUtils.showSnackMessage(this, R.string.auth_access_failed, result.getLogMessage());
|
||||
|
||||
// init webView again
|
||||
if (mLoginWebView != null) {
|
||||
mLoginWebView.setVisibility(View.GONE);
|
||||
}
|
||||
setContentView(R.layout.account_setup);
|
||||
|
||||
initOverallUi();
|
||||
|
||||
CustomEditText serverAddressField = findViewById(R.id.hostUrlInput);
|
||||
serverAddressField.setText(mServerInfo.mBaseUrl);
|
||||
|
||||
findViewById(R.id.oauth_onOff_check).setVisibility(View.GONE);
|
||||
findViewById(R.id.server_status_text).setVisibility(View.GONE);
|
||||
mAuthStatusView = findViewById(R.id.auth_status_text);
|
||||
|
||||
showAuthStatus();
|
||||
}
|
||||
} else {
|
||||
updateAuthStatusIconAndText(result);
|
||||
showAuthStatus();
|
||||
@@ -1837,13 +1881,13 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
if (AccountTypeUtils.getAuthTokenTypeAccessToken(accountType).equals(mAuthTokenType)) {
|
||||
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);
|
||||
// the next line is necessary, notifications are calling directly to the
|
||||
// the next line is necessary, notifications are calling directly to the
|
||||
// AuthenticatorActivity to update, without AccountManager intervention
|
||||
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);
|
||||
|
||||
} else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(accountType).equals(mAuthTokenType)) {
|
||||
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);
|
||||
// the next line is necessary; by now, notifications are calling directly to the
|
||||
// the next line is necessary; by now, notifications are calling directly to the
|
||||
// AuthenticatorActivity to update, without AccountManager intervention
|
||||
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);
|
||||
|
||||
@@ -1876,6 +1920,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
* TODO Decide how to name the OAuth accounts
|
||||
*/
|
||||
@SuppressFBWarnings("DMI")
|
||||
@SuppressLint("TrulyRandom")
|
||||
private boolean createAccount(RemoteOperationResult authResult) {
|
||||
String accountType = MainApp.getAccountType(this);
|
||||
|
||||
@@ -1896,7 +1941,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
username = webViewUser;
|
||||
}
|
||||
if (isOAuth) {
|
||||
username = "OAuth_user" + (new java.util.Random(System.currentTimeMillis())).nextLong();
|
||||
username = "OAuth_user" + new SecureRandom().nextLong();
|
||||
}
|
||||
|
||||
String accountName = com.owncloud.android.lib.common.accounts.AccountUtils.buildAccountName(uri, username);
|
||||
@@ -1925,10 +1970,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
}
|
||||
}
|
||||
|
||||
// include account version with the new account
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_ACCOUNT_VERSION,
|
||||
Integer.toString(AccountUtils.ACCOUNT_VERSION));
|
||||
|
||||
/// add the new account as default in preferences, if there is none already
|
||||
Account defaultAccount = AccountUtils.getCurrentOwnCloudAccount(this);
|
||||
if (defaultAccount == null) {
|
||||
@@ -1938,7 +1979,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
}
|
||||
|
||||
/// prepare result to return to the Authenticator
|
||||
// TODO check again what the Authenticator makes with it; probably has the same
|
||||
// TODO check again what the Authenticator makes with it; probably has the same
|
||||
// effect as addAccountExplicitly, but it's not well done
|
||||
final Intent intent = new Intent();
|
||||
intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, accountType);
|
||||
@@ -1947,7 +1988,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
if (isOAuth || isSaml) {
|
||||
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);
|
||||
}
|
||||
/// add user data to the new account; TODO probably can be done in the last parameter
|
||||
/// add user data to the new account; TODO probably can be done in the last parameter
|
||||
// addAccountExplicitly, or in KEY_USERDATA
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION, mServerInfo.mVersion.getVersion());
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL, mServerInfo.mBaseUrl);
|
||||
@@ -1957,11 +1998,18 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
UserInfo userInfo = (UserInfo) authResult.getData().get(0);
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_DISPLAY_NAME, userInfo.getDisplayName());
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_USER_ID, userInfo.getId());
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_ACCOUNT_VERSION,
|
||||
Integer.toString(AccountUtils.ACCOUNT_VERSION_WITH_PROPER_ID));
|
||||
|
||||
} catch (ClassCastException c) {
|
||||
Log_OC.w(TAG, "Couldn't get display name for " + username);
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_ACCOUNT_VERSION,
|
||||
Integer.toString(AccountUtils.ACCOUNT_VERSION));
|
||||
Log_OC.w(TAG, "Couldn't get display name and user id for " + username);
|
||||
}
|
||||
} else {
|
||||
Log_OC.w(TAG, "Couldn't get display name for " + username);
|
||||
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_ACCOUNT_VERSION,
|
||||
Integer.toString(AccountUtils.ACCOUNT_VERSION));
|
||||
Log_OC.w(TAG, "Couldn't get display name and user id for " + username);
|
||||
}
|
||||
|
||||
if (isSaml) {
|
||||
@@ -1977,6 +2025,40 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
}
|
||||
}
|
||||
|
||||
public void onScan() {
|
||||
if (PermissionUtil.checkSelfPermission(this, Manifest.permission.CAMERA)) {
|
||||
startQRScanner();
|
||||
} else {
|
||||
PermissionUtil.requestCameraPermission(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void startQRScanner() {
|
||||
Intent i = new Intent(this, QrCodeActivity.class);
|
||||
startActivityForResult(i, REQUEST_CODE_QR_SCAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[],
|
||||
@NonNull int[] grantResults) {
|
||||
switch (requestCode) {
|
||||
case PermissionUtil.PERMISSIONS_CAMERA: {
|
||||
// If request is cancelled, result arrays are empty.
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
// permission was granted
|
||||
startQRScanner();
|
||||
} else {
|
||||
// permission denied
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Updates the content and visibility state of the icon and text associated
|
||||
@@ -2053,7 +2135,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
|
||||
/**
|
||||
* Called when the 'action' button in an IME is pressed ('enter' in software keyboard).
|
||||
*
|
||||
*
|
||||
* Used to trigger the authentication check when the user presses 'enter' after writing the
|
||||
* password, or to throw the server test when the only field on screen is the URL input field.
|
||||
*/
|
||||
@@ -2192,7 +2274,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
public void onSavedCertificate() {
|
||||
Fragment fd = getSupportFragmentManager().findFragmentByTag(SAML_DIALOG_TAG);
|
||||
if (fd == null) {
|
||||
// if SAML dialog is not shown,
|
||||
// if SAML dialog is not shown,
|
||||
// the SslDialog was shown due to an SSL error in the server check
|
||||
checkOcServer();
|
||||
}
|
||||
@@ -2255,10 +2337,27 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
)) {
|
||||
mOperationsServiceBinder = (OperationsServiceBinder) service;
|
||||
|
||||
doOnResumeAndBound();
|
||||
Uri data = getIntent().getData();
|
||||
if (data != null && data.toString().startsWith(getString(R.string.login_data_own_scheme))) {
|
||||
String prefix = getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/";
|
||||
LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, data.toString());
|
||||
|
||||
if (loginUrlInfo != null) {
|
||||
try {
|
||||
mServerInfo.mBaseUrl = AuthenticatorUrlUtils.normalizeUrlSuffix(loginUrlInfo.serverAddress);
|
||||
webViewUser = loginUrlInfo.username;
|
||||
webViewPassword = loginUrlInfo.password;
|
||||
doOnResumeAndBound();
|
||||
} catch (Exception e) {
|
||||
mServerStatusIcon = R.drawable.ic_alert;
|
||||
mServerStatusText = "QR Code could not be read!";
|
||||
showServerStatus();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
doOnResumeAndBound();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2301,4 +2400,24 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
||||
public void doNegativeAuthenticationDialogClick() {
|
||||
mIsFirstAuthAttempt = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
if (requestCode == REQUEST_CODE_QR_SCAN) {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String result = data.getStringExtra("com.blikoon.qrcodescanner.got_qr_scan_relult");
|
||||
|
||||
if (!result.startsWith(getString(R.string.login_data_own_scheme))) {
|
||||
mServerStatusIcon = R.drawable.ic_alert;
|
||||
mServerStatusText = "QR Code could not be read!";
|
||||
showServerStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
parseAndLoginFromWebView(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* ownCloud Android client application
|
||||
*
|
||||
* @author masensio on 09/02/2015.
|
||||
@@ -43,11 +43,11 @@ public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOpera
|
||||
private static final String REMOTE_PATH = "/";
|
||||
private static final boolean SUCCESS_IF_ABSENT = false;
|
||||
|
||||
private Context mContext;
|
||||
private WeakReference<Context> mWeakContext;
|
||||
private final WeakReference<OnAuthenticatorTaskListener> mListener;
|
||||
|
||||
public AuthenticatorAsyncTask(Activity activity) {
|
||||
mContext = activity.getApplicationContext();
|
||||
mWeakContext = new WeakReference<>(activity.getApplicationContext());
|
||||
mListener = new WeakReference<>((OnAuthenticatorTaskListener)activity);
|
||||
}
|
||||
|
||||
@@ -55,21 +55,18 @@ public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOpera
|
||||
protected RemoteOperationResult doInBackground(Object... params) {
|
||||
|
||||
RemoteOperationResult result;
|
||||
if (params!= null && params.length==2) {
|
||||
if (params != null && params.length == 2 && mWeakContext.get() != null) {
|
||||
String url = (String)params[0];
|
||||
Context context = mWeakContext.get();
|
||||
OwnCloudCredentials credentials = (OwnCloudCredentials)params[1];
|
||||
|
||||
// Client
|
||||
Uri uri = Uri.parse(url);
|
||||
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true);
|
||||
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, context, true);
|
||||
client.setCredentials(credentials);
|
||||
|
||||
// Operation - try credentials
|
||||
ExistenceCheckRemoteOperation operation = new ExistenceCheckRemoteOperation(
|
||||
REMOTE_PATH,
|
||||
mContext,
|
||||
SUCCESS_IF_ABSENT
|
||||
);
|
||||
ExistenceCheckRemoteOperation operation = new ExistenceCheckRemoteOperation(REMOTE_PATH, SUCCESS_IF_ABSENT);
|
||||
result = operation.execute(client);
|
||||
|
||||
if (operation.wasRedirected()) {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.owncloud.android.authentication;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.utils.ThemeUtils;
|
||||
|
||||
public class DeepLinkLoginActivity extends AuthenticatorActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.deep_link_login);
|
||||
|
||||
Uri data = getIntent().getData();
|
||||
|
||||
if (data != null) {
|
||||
String prefix = getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/";
|
||||
LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, data.toString());
|
||||
|
||||
TextView loginText = findViewById(R.id.loginInfo);
|
||||
loginText.setTextColor(ThemeUtils.fontColor(this));
|
||||
loginText.setText(String.format("Login with %1$s to %2$s", loginUrlInfo.username,
|
||||
loginUrlInfo.serverAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,11 @@ import android.os.PowerManager;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.nextcloud.client.preferences.PreferenceManager;
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.db.PreferenceManager;
|
||||
import com.owncloud.android.ui.activity.PassCodeActivity;
|
||||
import com.owncloud.android.ui.activity.Preferences;
|
||||
import com.owncloud.android.ui.activity.RequestCredentialsActivity;
|
||||
import com.owncloud.android.ui.activity.SettingsActivity;
|
||||
import com.owncloud.android.utils.DeviceCredentialUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -50,12 +50,11 @@ public final class PassCodeManager {
|
||||
// other activities may be exempted, if needed
|
||||
}
|
||||
|
||||
private static final int PASS_CODE_TIMEOUT = 1000;
|
||||
private static final int PASS_CODE_TIMEOUT = 5000;
|
||||
// keeping a "low" positive value is the easiest way to prevent the pass code is requested on rotations
|
||||
|
||||
private static PassCodeManager passCodeManagerInstance;
|
||||
|
||||
private Long timestamp = 0L;
|
||||
private int visibleActivitiesCounter;
|
||||
|
||||
public static PassCodeManager getPassCodeManager() {
|
||||
@@ -79,7 +78,8 @@ public final class PassCodeManager {
|
||||
}
|
||||
|
||||
public void onActivityStarted(Activity activity) {
|
||||
if (!exemptOfPasscodeActivities.contains(activity.getClass()) && passCodeShouldBeRequested()) {
|
||||
Long timestamp = PreferenceManager.fromContext(activity).getLockTimestamp();
|
||||
if (!exemptOfPasscodeActivities.contains(activity.getClass()) && passCodeShouldBeRequested(timestamp)) {
|
||||
|
||||
Intent i = new Intent(MainApp.getAppContext(), PassCodeActivity.class);
|
||||
i.setAction(PassCodeActivity.ACTION_CHECK);
|
||||
@@ -88,8 +88,7 @@ public final class PassCodeManager {
|
||||
}
|
||||
|
||||
if (!exemptOfPasscodeActivities.contains(activity.getClass()) &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && deviceCredentialsShouldBeRequested(activity) &&
|
||||
!DeviceCredentialUtils.tryEncrypt(activity)) {
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && deviceCredentialsShouldBeRequested(timestamp, activity)) {
|
||||
Intent i = new Intent(MainApp.getAppContext(), RequestCredentialsActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
activity.startActivityForResult(i, PASSCODE_ACTIVITY);
|
||||
@@ -102,7 +101,7 @@ public final class PassCodeManager {
|
||||
if (visibleActivitiesCounter > 0) {
|
||||
visibleActivitiesCounter--;
|
||||
}
|
||||
setUnlockTimestamp();
|
||||
setUnlockTimestamp(activity);
|
||||
PowerManager powerMgr = (PowerManager) activity.getSystemService(Context.POWER_SERVICE);
|
||||
if ((passCodeIsEnabled() || deviceCredentialsAreEnabled(activity)) && powerMgr != null
|
||||
&& !powerMgr.isScreenOn()) {
|
||||
@@ -110,26 +109,26 @@ public final class PassCodeManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void setUnlockTimestamp() {
|
||||
timestamp = System.currentTimeMillis();
|
||||
private void setUnlockTimestamp(Activity activity) {
|
||||
PreferenceManager.fromContext(activity).setLockTimestamp(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
private boolean passCodeShouldBeRequested() {
|
||||
private boolean passCodeShouldBeRequested(Long timestamp) {
|
||||
return (System.currentTimeMillis() - timestamp) > PASS_CODE_TIMEOUT &&
|
||||
visibleActivitiesCounter <= 0 && passCodeIsEnabled();
|
||||
visibleActivitiesCounter <= 0 && passCodeIsEnabled();
|
||||
}
|
||||
|
||||
private boolean passCodeIsEnabled() {
|
||||
return PreferenceManager.getLockPreference(MainApp.getAppContext()).equals(Preferences.LOCK_PASSCODE);
|
||||
return SettingsActivity.LOCK_PASSCODE.equals(PreferenceManager.getLockPreference(MainApp.getAppContext()));
|
||||
}
|
||||
|
||||
private boolean deviceCredentialsShouldBeRequested(Activity activity) {
|
||||
private boolean deviceCredentialsShouldBeRequested(Long timestamp, Activity activity) {
|
||||
return (System.currentTimeMillis() - timestamp) > PASS_CODE_TIMEOUT && visibleActivitiesCounter <= 0 &&
|
||||
deviceCredentialsAreEnabled(activity);
|
||||
deviceCredentialsAreEnabled(activity);
|
||||
}
|
||||
|
||||
private boolean deviceCredentialsAreEnabled(Activity activity) {
|
||||
return PreferenceManager.getLockPreference(MainApp.getAppContext()).equals(Preferences.LOCK_DEVICE_CREDENTIALS)
|
||||
return SettingsActivity.LOCK_DEVICE_CREDENTIALS.equals(PreferenceManager.getLockPreference(MainApp.getAppContext()))
|
||||
|| Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||
(PreferenceManager.isUseFingerprint(MainApp.getAppContext())
|
||||
&& DeviceCredentialUtils.areCredentialsAvailable(activity));
|
||||
|
||||
@@ -24,9 +24,16 @@ package com.owncloud.android.datamodel;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Decrypted class representation of metadata json of folder metadata.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class DecryptedFolderMetadata {
|
||||
private Metadata metadata;
|
||||
private Map<String, DecryptedFile> files;
|
||||
@@ -36,170 +43,47 @@ public class DecryptedFolderMetadata {
|
||||
this.files = new HashMap<>();
|
||||
}
|
||||
|
||||
public DecryptedFolderMetadata(Metadata metadata, Map<String, DecryptedFile> files) {
|
||||
this.metadata = metadata;
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public Metadata getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public void setMetadata(Metadata metadata) {
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public Map<String, DecryptedFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(Map<String, DecryptedFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Metadata {
|
||||
private Map<Integer, String> metadataKeys; // each keys is encrypted on its own, decrypt on use
|
||||
private Sharing sharing;
|
||||
private int version;
|
||||
|
||||
public Map<Integer, String> getMetadataKeys() {
|
||||
return metadataKeys;
|
||||
}
|
||||
|
||||
public void setMetadataKeys(Map<Integer, String> metadataKeys) {
|
||||
this.metadataKeys = metadataKeys;
|
||||
}
|
||||
|
||||
public Sharing getSharing() {
|
||||
return sharing;
|
||||
}
|
||||
|
||||
public void setSharing(Sharing sharing) {
|
||||
this.sharing = sharing;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(version);
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Encrypted {
|
||||
private Map<Integer, String> metadataKeys;
|
||||
|
||||
public Map<Integer, String> getMetadataKeys() {
|
||||
return metadataKeys;
|
||||
}
|
||||
|
||||
public void setMetadataKeys(Map<Integer, String> metadataKeys) {
|
||||
this.metadataKeys = metadataKeys;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Sharing {
|
||||
private Map<String, String> recipient;
|
||||
private String signature;
|
||||
|
||||
public Map<String, String> getRecipient() {
|
||||
return recipient;
|
||||
}
|
||||
|
||||
public void setRecipient(Map<String, String> recipient) {
|
||||
this.recipient = recipient;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public void setSignature(String signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class DecryptedFile {
|
||||
private Data encrypted;
|
||||
private String initializationVector;
|
||||
private String authenticationTag;
|
||||
private int metadataKey;
|
||||
|
||||
public Data getEncrypted() {
|
||||
return encrypted;
|
||||
}
|
||||
|
||||
public void setEncrypted(Data encrypted) {
|
||||
this.encrypted = encrypted;
|
||||
}
|
||||
|
||||
public String getInitializationVector() {
|
||||
return initializationVector;
|
||||
}
|
||||
|
||||
public void setInitializationVector(String initializationVector) {
|
||||
this.initializationVector = initializationVector;
|
||||
}
|
||||
|
||||
public String getAuthenticationTag() {
|
||||
return authenticationTag;
|
||||
}
|
||||
|
||||
public void setAuthenticationTag(String authenticationTag) {
|
||||
this.authenticationTag = authenticationTag;
|
||||
}
|
||||
|
||||
public int getMetadataKey() {
|
||||
return metadataKey;
|
||||
}
|
||||
|
||||
public void setMetadataKey(int metadataKey) {
|
||||
this.metadataKey = metadataKey;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Data {
|
||||
private String key;
|
||||
private String filename;
|
||||
private String mimetype;
|
||||
private int version;
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getMimetype() {
|
||||
return mimetype;
|
||||
}
|
||||
|
||||
public void setMimetype(String mimetype) {
|
||||
this.mimetype = mimetype;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,54 +22,23 @@ package com.owncloud.android.datamodel;
|
||||
|
||||
import org.parceler.Parcel;
|
||||
|
||||
@Parcel public class DecryptedPushMessage {
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Parcel
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/*
|
||||
* Push data from server, https://github.com/nextcloud/notifications/blob/master/docs/push-v2.md#encrypted-subject-data
|
||||
*/
|
||||
public class DecryptedPushMessage {
|
||||
public String app;
|
||||
|
||||
public String type;
|
||||
|
||||
public String subject;
|
||||
|
||||
public String id;
|
||||
|
||||
public DecryptedPushMessage(String app, String type, String subject, String id) {
|
||||
this.app = app;
|
||||
this.type = type;
|
||||
this.subject = subject;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public DecryptedPushMessage() {
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public void setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public int nid;
|
||||
}
|
||||
@@ -23,71 +23,26 @@ package com.owncloud.android.datamodel;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Encrypted class representation of metadata json of folder metadata
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class EncryptedFolderMetadata {
|
||||
private DecryptedFolderMetadata.Metadata metadata;
|
||||
private Map<String, EncryptedFile> files;
|
||||
|
||||
public EncryptedFolderMetadata(DecryptedFolderMetadata.Metadata metadata, Map<String, EncryptedFile> files) {
|
||||
this.metadata = metadata;
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public DecryptedFolderMetadata.Metadata getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public void setMetadata(DecryptedFolderMetadata.Metadata metadata) {
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public Map<String, EncryptedFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(Map<String, EncryptedFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class EncryptedFile {
|
||||
private String encrypted;
|
||||
private String initializationVector;
|
||||
private String authenticationTag;
|
||||
private int metadataKey;
|
||||
|
||||
public String getEncrypted() {
|
||||
return encrypted;
|
||||
}
|
||||
|
||||
public void setEncrypted(String encrypted) {
|
||||
this.encrypted = encrypted;
|
||||
}
|
||||
|
||||
public String getInitializationVector() {
|
||||
return initializationVector;
|
||||
}
|
||||
|
||||
public void setInitializationVector(String initializationVector) {
|
||||
this.initializationVector = initializationVector;
|
||||
}
|
||||
|
||||
public String getAuthenticationTag() {
|
||||
return authenticationTag;
|
||||
}
|
||||
|
||||
public void setAuthenticationTag(String authenticationTag) {
|
||||
this.authenticationTag = authenticationTag;
|
||||
}
|
||||
|
||||
public int getMetadataKey() {
|
||||
return metadataKey;
|
||||
}
|
||||
|
||||
public void setMetadataKey(int metadataKey) {
|
||||
this.metadataKey = metadataKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
* Nextcloud Android client application
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2017 Tobias Kaminsky
|
||||
* Copyright (C) 2017 Nextcloud.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or 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 AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -23,7 +23,6 @@ import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.owncloud.android.db.ProviderMeta;
|
||||
import com.owncloud.android.lib.common.ExternalLink;
|
||||
@@ -33,6 +32,8 @@ import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Database provider for handling the persistence aspects of {@link com.owncloud.android.lib.common.ExternalLink}s.
|
||||
*/
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* ownCloud Android client application
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2015 ownCloud Inc.
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
@@ -33,15 +33,15 @@ import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
|
||||
import com.owncloud.android.lib.common.network.WebdavEntry;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.RemoteFile;
|
||||
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation;
|
||||
import com.owncloud.android.lib.resources.files.model.RemoteFile;
|
||||
import com.owncloud.android.lib.resources.shares.OCShare;
|
||||
import com.owncloud.android.lib.resources.shares.ShareType;
|
||||
import com.owncloud.android.lib.resources.status.CapabilityBooleanType;
|
||||
@@ -53,6 +53,7 @@ import com.owncloud.android.utils.MimeTypeUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -61,51 +62,37 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public class FileDataStorageManager {
|
||||
private static final String TAG = FileDataStorageManager.class.getSimpleName();
|
||||
|
||||
public static final int ROOT_PARENT_ID = 0;
|
||||
|
||||
private ContentResolver mContentResolver;
|
||||
private ContentProviderClient mContentProviderClient;
|
||||
private Account mAccount;
|
||||
private static final String AND = "=? AND ";
|
||||
private static final String FAILED_TO_INSERT_MSG = "Fail to insert insert file to database ";
|
||||
private static final String SENDING_TO_FILECONTENTPROVIDER_MSG = "Sending %d operations to FileContentProvider";
|
||||
private static final String EXCEPTION_MSG = "Exception in batch of operations ";
|
||||
|
||||
private static final String TAG = FileDataStorageManager.class.getSimpleName();
|
||||
public static final int ROOT_PARENT_ID = 0;
|
||||
|
||||
private ContentResolver contentResolver;
|
||||
private ContentProviderClient contentProviderClient;
|
||||
@Setter private Account account;
|
||||
|
||||
public FileDataStorageManager(Account account, ContentResolver cr) {
|
||||
mContentProviderClient = null;
|
||||
mContentResolver = cr;
|
||||
mAccount = account;
|
||||
contentProviderClient = null;
|
||||
contentResolver = cr;
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public FileDataStorageManager(Account account, ContentProviderClient cp) {
|
||||
mContentProviderClient = cp;
|
||||
mContentResolver = null;
|
||||
mAccount = account;
|
||||
contentProviderClient = cp;
|
||||
contentResolver = null;
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
|
||||
public void setAccount(Account account) {
|
||||
mAccount = account;
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
return mAccount;
|
||||
}
|
||||
|
||||
public ContentResolver getContentResolver() {
|
||||
return mContentResolver;
|
||||
}
|
||||
|
||||
public ContentProviderClient getContentProviderClient() {
|
||||
return mContentProviderClient;
|
||||
}
|
||||
|
||||
|
||||
public OCFile getFileByPath(String path) {
|
||||
Cursor c = getFileCursorForValue(ProviderTableMeta.FILE_PATH, path);
|
||||
OCFile file = null;
|
||||
@@ -119,7 +106,6 @@ public class FileDataStorageManager {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
public @Nullable
|
||||
OCFile getFileById(long id) {
|
||||
Cursor c = getFileCursorForValue(ProviderTableMeta._ID, String.valueOf(id));
|
||||
@@ -130,7 +116,7 @@ public class FileDataStorageManager {
|
||||
c.close();
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
public OCFile getFileByLocalPath(String path) {
|
||||
Cursor c = getFileCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
|
||||
OCFile file = null;
|
||||
@@ -172,7 +158,7 @@ public class FileDataStorageManager {
|
||||
|
||||
public List<OCFile> getFolderImages(OCFile folder, boolean onlyOnDevice) {
|
||||
List<OCFile> ret = new ArrayList<>();
|
||||
|
||||
|
||||
if (folder != null) {
|
||||
// TODO better implementation, filtering in the access to database instead of here
|
||||
List<OCFile> tmp = getFolderContent(folder, onlyOnDevice);
|
||||
@@ -205,30 +191,31 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.FILE_IS_ENCRYPTED, file.isEncrypted());
|
||||
cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
|
||||
}
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
|
||||
cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.isAvailableOffline() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_ON_SERVER, file.getEtagOnServer());
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, file.isSharedViaLink() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, file.isSharedWithSharee() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
|
||||
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
|
||||
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
|
||||
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
|
||||
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.isUpdateThumbnailNeeded());
|
||||
cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
|
||||
cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, file.getUnreadCommentsCount());
|
||||
cv.put(ProviderTableMeta.FILE_OWNER_ID, file.getOwnerId());
|
||||
cv.put(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME, file.getOwnerDisplayName());
|
||||
|
||||
boolean sameRemotePath = fileExists(file.getRemotePath());
|
||||
if (sameRemotePath ||
|
||||
fileExists(file.getFileId())) { // for renamed files; no more delete and create
|
||||
|
||||
OCFile oldFile;
|
||||
|
||||
if (sameRemotePath) {
|
||||
oldFile = getFileByPath(file.getRemotePath());
|
||||
OCFile oldFile = getFileByPath(file.getRemotePath());
|
||||
file.setFileId(oldFile.getFileId());
|
||||
} else {
|
||||
oldFile = getFileById(file.getFileId());
|
||||
}
|
||||
|
||||
overridden = true;
|
||||
@@ -274,7 +261,7 @@ public class FileDataStorageManager {
|
||||
* @return the parent file
|
||||
*/
|
||||
public OCFile saveFileWithParent(OCFile file, Context context) {
|
||||
if (file.getParentId() == 0 && !file.getRemotePath().equals("/")) {
|
||||
if (file.getParentId() == 0 && !"/".equals(file.getRemotePath())) {
|
||||
String remotePath = file.getRemotePath();
|
||||
String parentPath = remotePath.substring(0, remotePath.lastIndexOf(file.getFileName()));
|
||||
|
||||
@@ -283,7 +270,7 @@ public class FileDataStorageManager {
|
||||
OCFile returnFile;
|
||||
if (parentFile == null) {
|
||||
// remote request
|
||||
ReadRemoteFileOperation operation = new ReadRemoteFileOperation(parentPath);
|
||||
ReadFileRemoteOperation operation = new ReadFileRemoteOperation(parentPath);
|
||||
RemoteOperationResult result = operation.execute(getAccount(), context);
|
||||
if (result.isSuccess()) {
|
||||
OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
|
||||
@@ -359,16 +346,17 @@ public class FileDataStorageManager {
|
||||
|
||||
// prepare operations to remove files in the given folder
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PATH + "=?";
|
||||
String[] whereArgs;
|
||||
String[] whereArgs = new String[2];
|
||||
for (OCFile file : filesToRemove) {
|
||||
if (file.getParentId() == folder.getFileId()) {
|
||||
whereArgs = new String[]{mAccount.name, file.getRemotePath()};
|
||||
whereArgs[0] = account.name;
|
||||
whereArgs[1] = file.getRemotePath();
|
||||
if (file.isFolder()) {
|
||||
operations.add(ContentProviderOperation.newDelete(
|
||||
ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, file.getFileId()))
|
||||
.withSelection(where, whereArgs).build());
|
||||
|
||||
File localFolder = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
|
||||
File localFolder = new File(FileStorageUtils.getDefaultSavePathFor(account.name, file));
|
||||
if (localFolder.exists()) {
|
||||
removeLocalFolder(localFolder);
|
||||
}
|
||||
@@ -414,7 +402,7 @@ public class FileDataStorageManager {
|
||||
if (results != null) {
|
||||
long newId;
|
||||
Iterator<OCFile> filesIt = updatedFiles.iterator();
|
||||
OCFile file = null;
|
||||
OCFile file;
|
||||
for (ContentProviderResult result : results) {
|
||||
if (filesIt.hasNext()) {
|
||||
file = filesIt.next();
|
||||
@@ -445,18 +433,22 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.FILE_NAME, folder.getFileName());
|
||||
cv.put(ProviderTableMeta.FILE_PARENT, folder.getParentId());
|
||||
cv.put(ProviderTableMeta.FILE_PATH, folder.getRemotePath());
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, folder.getLastSyncDateForProperties());
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, folder.getLastSyncDateForData());
|
||||
cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, folder.isAvailableOffline() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_ETAG, folder.getEtag());
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_ON_SERVER, folder.getEtagOnServer());
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, folder.isSharedViaLink() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, folder.isSharedWithSharee() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, folder.getPublicLink());
|
||||
cv.put(ProviderTableMeta.FILE_PERMISSIONS, folder.getPermissions());
|
||||
cv.put(ProviderTableMeta.FILE_REMOTE_ID, folder.getRemoteId());
|
||||
cv.put(ProviderTableMeta.FILE_FAVORITE, folder.getIsFavorite());
|
||||
cv.put(ProviderTableMeta.FILE_FAVORITE, folder.isFavorite());
|
||||
cv.put(ProviderTableMeta.FILE_IS_ENCRYPTED, folder.isEncrypted());
|
||||
cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, folder.getUnreadCommentsCount());
|
||||
cv.put(ProviderTableMeta.FILE_OWNER_ID, folder.getOwnerId());
|
||||
cv.put(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME, folder.getOwnerDisplayName());
|
||||
|
||||
return cv;
|
||||
}
|
||||
|
||||
@@ -474,22 +466,27 @@ public class FileDataStorageManager {
|
||||
if (!file.isFolder()) {
|
||||
cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
|
||||
}
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
|
||||
cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.isAvailableOffline() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_ON_SERVER, file.getEtagOnServer());
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, file.isSharedViaLink() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, file.isSharedWithSharee() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
|
||||
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
|
||||
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
|
||||
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
|
||||
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.isUpdateThumbnailNeeded());
|
||||
cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
|
||||
cv.put(ProviderTableMeta.FILE_FAVORITE, file.getIsFavorite());
|
||||
cv.put(ProviderTableMeta.FILE_FAVORITE, file.isFavorite());
|
||||
cv.put(ProviderTableMeta.FILE_IS_ENCRYPTED, file.isEncrypted());
|
||||
cv.put(ProviderTableMeta.FILE_MOUNT_TYPE, file.getMountType().ordinal());
|
||||
cv.put(ProviderTableMeta.FILE_HAS_PREVIEW, file.isPreviewAvailable() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, file.getUnreadCommentsCount());
|
||||
cv.put(ProviderTableMeta.FILE_OWNER_ID, file.getOwnerId());
|
||||
cv.put(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME, file.getOwnerDisplayName());
|
||||
|
||||
return cv;
|
||||
}
|
||||
|
||||
@@ -505,7 +502,7 @@ public class FileDataStorageManager {
|
||||
// ""+file.getFileId());
|
||||
Uri file_uri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId());
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PATH + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name, file.getRemotePath()};
|
||||
String[] whereArgs = new String[]{account.name, file.getRemotePath()};
|
||||
int deleted = 0;
|
||||
if (getContentProviderClient() != null) {
|
||||
try {
|
||||
@@ -557,10 +554,10 @@ public class FileDataStorageManager {
|
||||
}
|
||||
|
||||
private boolean removeFolderInDb(OCFile folder) {
|
||||
Uri folder_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, "" + folder.getFileId()); // URI
|
||||
Uri folder_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, String.valueOf(folder.getFileId())); // URI
|
||||
// for recursive deletion
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PATH + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name, folder.getRemotePath()};
|
||||
String[] whereArgs = new String[]{account.name, folder.getRemotePath()};
|
||||
int deleted = 0;
|
||||
if (getContentProviderClient() != null) {
|
||||
try {
|
||||
@@ -576,7 +573,7 @@ public class FileDataStorageManager {
|
||||
|
||||
private boolean removeLocalFolder(OCFile folder) {
|
||||
boolean success = true;
|
||||
String localFolderPath = FileStorageUtils.getDefaultSavePathFor(mAccount.name, folder);
|
||||
String localFolderPath = FileStorageUtils.getDefaultSavePathFor(account.name, folder);
|
||||
File localFolder = new File(localFolderPath);
|
||||
if (localFolder.exists()) {
|
||||
// stage 1: remove the local files already registered in the files database
|
||||
@@ -600,7 +597,7 @@ public class FileDataStorageManager {
|
||||
}
|
||||
}
|
||||
|
||||
// stage 2: remove the folder itself and any local file inside out of sync;
|
||||
// stage 2: remove the folder itself and any local file inside out of sync;
|
||||
// for instance, after clearing the app cache or reinstalling
|
||||
success &= removeLocalFolder(localFolder);
|
||||
}
|
||||
@@ -646,7 +643,7 @@ public class FileDataStorageManager {
|
||||
ProviderTableMeta.CONTENT_URI,
|
||||
null,
|
||||
ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PATH + " LIKE ? ",
|
||||
new String[]{mAccount.name, file.getRemotePath() + "%"},
|
||||
new String[]{account.name, file.getRemotePath() + "%"},
|
||||
ProviderTableMeta.FILE_PATH + " ASC "
|
||||
);
|
||||
} catch (RemoteException e) {
|
||||
@@ -658,16 +655,16 @@ public class FileDataStorageManager {
|
||||
ProviderTableMeta.CONTENT_URI,
|
||||
null,
|
||||
ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PATH + " LIKE ? ",
|
||||
new String[]{mAccount.name, file.getRemotePath() + "%"},
|
||||
new String[]{account.name, file.getRemotePath() + "%"},
|
||||
ProviderTableMeta.FILE_PATH + " ASC "
|
||||
);
|
||||
}
|
||||
|
||||
/// 2. prepare a batch of update operations to change all the descendants
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<>(c.getCount());
|
||||
String defaultSavePath = FileStorageUtils.getSavePath(mAccount.name);
|
||||
List<String> originalPathsToTriggerMediaScan = new ArrayList<String>();
|
||||
List<String> newPathsToTriggerMediaScan = new ArrayList<String>();
|
||||
String defaultSavePath = FileStorageUtils.getSavePath(account.name);
|
||||
List<String> originalPathsToTriggerMediaScan = new ArrayList<>();
|
||||
List<String> newPathsToTriggerMediaScan = new ArrayList<>();
|
||||
if (c.moveToFirst()) {
|
||||
int lengthOfOldPath = file.getRemotePath().length();
|
||||
int lengthOfOldStoragePath = defaultSavePath.length() + lengthOfOldPath;
|
||||
@@ -717,8 +714,8 @@ public class FileDataStorageManager {
|
||||
Log_OC.e(TAG, "Fail to update " + file.getFileId() + " and descendants in database", e);
|
||||
}
|
||||
|
||||
/// 4. move in local file system
|
||||
String originalLocalPath = FileStorageUtils.getDefaultSavePathFor(mAccount.name, file);
|
||||
/// 4. move in local file system
|
||||
String originalLocalPath = FileStorageUtils.getDefaultSavePathFor(account.name, file);
|
||||
String targetLocalPath = defaultSavePath + targetPath;
|
||||
File localFile = new File(originalLocalPath);
|
||||
boolean renamed = false;
|
||||
@@ -750,10 +747,10 @@ public class FileDataStorageManager {
|
||||
public void copyLocalFile(OCFile file, String targetPath) {
|
||||
|
||||
if (file != null && file.fileExists() && !OCFile.ROOT_PATH.equals(file.getFileName())) {
|
||||
String localPath = FileStorageUtils.getDefaultSavePathFor(mAccount.name, file);
|
||||
String localPath = FileStorageUtils.getDefaultSavePathFor(account.name, file);
|
||||
File localFile = new File(localPath);
|
||||
boolean copied = false;
|
||||
String defaultSavePath = FileStorageUtils.getSavePath(mAccount.name);
|
||||
String defaultSavePath = FileStorageUtils.getSavePath(account.name);
|
||||
if (localFile.exists()) {
|
||||
File targetFile = new File(defaultSavePath + targetPath);
|
||||
File targetFolder = targetFile.getParentFile();
|
||||
@@ -859,7 +856,7 @@ public class FileDataStorageManager {
|
||||
}
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
|
||||
|
||||
c.close();
|
||||
}
|
||||
|
||||
@@ -869,7 +866,7 @@ public class FileDataStorageManager {
|
||||
|
||||
private OCFile createRootDir() {
|
||||
OCFile file = new OCFile(OCFile.ROOT_PATH);
|
||||
file.setMimetype(MimeType.DIRECTORY);
|
||||
file.setMimeType(MimeType.DIRECTORY);
|
||||
file.setParentId(FileDataStorageManager.ROOT_PARENT_ID);
|
||||
saveFile(file);
|
||||
return file;
|
||||
@@ -884,7 +881,7 @@ public class FileDataStorageManager {
|
||||
cmp_key + AND
|
||||
+ ProviderTableMeta.FILE_ACCOUNT_OWNER
|
||||
+ "=?",
|
||||
new String[]{value, mAccount.name}, null);
|
||||
new String[]{value, account.name}, null);
|
||||
} else {
|
||||
try {
|
||||
c = getContentProviderClient().query(
|
||||
@@ -892,7 +889,7 @@ public class FileDataStorageManager {
|
||||
null,
|
||||
cmp_key + AND
|
||||
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?",
|
||||
new String[]{value, mAccount.name}, null);
|
||||
new String[]{value, account.name}, null);
|
||||
} catch (RemoteException e) {
|
||||
Log_OC.e(TAG, "Couldn't determine file existance, assuming non existance: " + e.getMessage(), e);
|
||||
return false;
|
||||
@@ -904,7 +901,7 @@ public class FileDataStorageManager {
|
||||
}
|
||||
|
||||
private Cursor getFileCursorForValue(String key, String value) {
|
||||
Cursor c = null;
|
||||
Cursor c;
|
||||
if (getContentResolver() != null) {
|
||||
c = getContentResolver()
|
||||
.query(ProviderTableMeta.CONTENT_URI,
|
||||
@@ -912,14 +909,14 @@ public class FileDataStorageManager {
|
||||
key + AND
|
||||
+ ProviderTableMeta.FILE_ACCOUNT_OWNER
|
||||
+ "=?",
|
||||
new String[]{value, mAccount.name}, null);
|
||||
new String[]{value, account.name}, null);
|
||||
} else {
|
||||
try {
|
||||
c = getContentProviderClient().query(
|
||||
ProviderTableMeta.CONTENT_URI,
|
||||
null,
|
||||
key + AND + ProviderTableMeta.FILE_ACCOUNT_OWNER
|
||||
+ "=?", new String[]{value, mAccount.name},
|
||||
+ "=?", new String[]{value, account.name},
|
||||
null);
|
||||
} catch (RemoteException e) {
|
||||
Log_OC.e(TAG, "Could not get file details: " + e.getMessage(), e);
|
||||
@@ -947,13 +944,13 @@ public class FileDataStorageManager {
|
||||
file.setFileId(c.getLong(c.getColumnIndex(ProviderTableMeta._ID)));
|
||||
file.setParentId(c.getLong(c.getColumnIndex(ProviderTableMeta.FILE_PARENT)));
|
||||
file.setEncryptedFileName(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ENCRYPTED_NAME)));
|
||||
file.setMimetype(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)));
|
||||
file.setMimeType(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)));
|
||||
file.setStoragePath(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_STORAGE_PATH)));
|
||||
if (file.getStoragePath() == null) {
|
||||
// try to find existing file and bind it with current account;
|
||||
// with the current update of SynchronizeFolderOperation, this won't be
|
||||
// necessary anymore after a full synchronization of the account
|
||||
File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
|
||||
File f = new File(FileStorageUtils.getDefaultSavePathFor(account.name, file));
|
||||
if (f.exists()) {
|
||||
file.setStoragePath(f.getAbsolutePath());
|
||||
file.setLastSyncDateForData(f.lastModified());
|
||||
@@ -966,14 +963,14 @@ public class FileDataStorageManager {
|
||||
c.getColumnIndex(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA)));
|
||||
file.setLastSyncDateForProperties(c.getLong(c.getColumnIndex(ProviderTableMeta.FILE_LAST_SYNC_DATE)));
|
||||
file.setLastSyncDateForData(c.getLong(c.getColumnIndex(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA)));
|
||||
file.setAvailableOffline(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_KEEP_IN_SYNC)) == 1);
|
||||
file.setEtag(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG)));
|
||||
file.setShareViaLink(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_VIA_LINK)) == 1);
|
||||
file.setShareWithSharee(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1);
|
||||
file.setEtagOnServer(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG_ON_SERVER)));
|
||||
file.setSharedViaLink(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_VIA_LINK)) == 1);
|
||||
file.setSharedWithSharee(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1);
|
||||
file.setPublicLink(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PUBLIC_LINK)));
|
||||
file.setPermissions(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PERMISSIONS)));
|
||||
file.setRemoteId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID)));
|
||||
file.setNeedsUpdateThumbnail(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1);
|
||||
file.setUpdateThumbnailNeeded(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1);
|
||||
file.setDownloading(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1);
|
||||
file.setEtagInConflict(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG_IN_CONFLICT)));
|
||||
file.setFavorite(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_FAVORITE)) == 1);
|
||||
@@ -983,7 +980,12 @@ public class FileDataStorageManager {
|
||||
}
|
||||
file.setMountType(WebdavEntry.MountType.values()[c.getInt(
|
||||
c.getColumnIndex(ProviderTableMeta.FILE_MOUNT_TYPE))]);
|
||||
file.setPreviewAvailable(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_HAS_PREVIEW)) == 1);
|
||||
file.setUnreadCommentsCount(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT)));
|
||||
file.setOwnerId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_OWNER_ID)));
|
||||
file.setOwnerDisplayName(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME)));
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
@@ -1000,16 +1002,14 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
|
||||
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
|
||||
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
|
||||
cv.put(
|
||||
ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
|
||||
share.getSharedWithDisplayName()
|
||||
);
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
|
||||
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getRemoteId());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
|
||||
|
||||
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED, share.isPasswordProtected() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.OCSHARES_NOTE, share.getNote());
|
||||
cv.put(ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD, share.isHideFileDownload());
|
||||
|
||||
if (shareExistsForRemoteId(share.getRemoteId())) {// for renamed files; no more delete and create
|
||||
overriden = true;
|
||||
@@ -1109,7 +1109,7 @@ public class FileDataStorageManager {
|
||||
null,
|
||||
key + AND
|
||||
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
|
||||
new String[]{value, mAccount.name},
|
||||
new String[]{value, account.name},
|
||||
null
|
||||
);
|
||||
} else {
|
||||
@@ -1118,7 +1118,7 @@ public class FileDataStorageManager {
|
||||
ProviderTableMeta.CONTENT_URI_SHARE,
|
||||
null,
|
||||
key + AND + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
|
||||
new String[]{value, mAccount.name},
|
||||
new String[]{value, account.name},
|
||||
null
|
||||
);
|
||||
} catch (RemoteException e) {
|
||||
@@ -1139,7 +1139,7 @@ public class FileDataStorageManager {
|
||||
* @return First {@link OCShare} instance found in DB bound to the file in 'path'
|
||||
*/
|
||||
public OCShare getFirstShareByPathAndType(String path, ShareType type, String shareWith) {
|
||||
Cursor cursor = null;
|
||||
Cursor cursor;
|
||||
if (shareWith == null) {
|
||||
shareWith = "";
|
||||
}
|
||||
@@ -1156,13 +1156,13 @@ public class FileDataStorageManager {
|
||||
selectionArgs = new String[]{
|
||||
path,
|
||||
Integer.toString(type.getValue()),
|
||||
mAccount.name
|
||||
account.name
|
||||
};
|
||||
} else {
|
||||
selectionArgs = new String[]{
|
||||
path,
|
||||
Integer.toString(type.getValue()),
|
||||
mAccount.name,
|
||||
account.name,
|
||||
shareWith
|
||||
};
|
||||
}
|
||||
@@ -1211,10 +1211,12 @@ public class FileDataStorageManager {
|
||||
share.setToken(c.getString(c.getColumnIndex(ProviderTableMeta.OCSHARES_TOKEN)));
|
||||
share.setSharedWithDisplayName(
|
||||
c.getString(c.getColumnIndex(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME)));
|
||||
share.setIsFolder(c.getInt(c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1);
|
||||
share.setFolder(c.getInt(c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1);
|
||||
share.setUserId(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_USER_ID)));
|
||||
share.setIdRemoteShared(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED)));
|
||||
share.setIsPasswordProtected(c.getInt(c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED)) == 1);
|
||||
share.setRemoteId(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED)));
|
||||
share.setPasswordProtected(c.getInt(c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED)) == 1);
|
||||
share.setNote(c.getString(c.getColumnIndex(ProviderTableMeta.OCSHARES_NOTE)));
|
||||
share.setHideFileDownload(c.getInt(c.getColumnIndex(ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD)) == 1);
|
||||
}
|
||||
return share;
|
||||
}
|
||||
@@ -1225,7 +1227,7 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, false);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name};
|
||||
String[] whereArgs = new String[]{account.name};
|
||||
|
||||
if (getContentResolver() != null) {
|
||||
getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
|
||||
@@ -1245,7 +1247,7 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, false);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PARENT + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name, String.valueOf(folder.getFileId())};
|
||||
String[] whereArgs = new String[]{account.name, String.valueOf(folder.getFileId())};
|
||||
|
||||
if (getContentResolver() != null) {
|
||||
getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
|
||||
@@ -1265,7 +1267,7 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, false);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + AND + ProviderTableMeta.FILE_PATH + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name, filePath};
|
||||
String[] whereArgs = new String[]{account.name, filePath};
|
||||
|
||||
if (getContentResolver() != null) {
|
||||
getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
|
||||
@@ -1281,7 +1283,7 @@ public class FileDataStorageManager {
|
||||
|
||||
private void cleanShares() {
|
||||
String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name};
|
||||
String[] whereArgs = new String[]{account.name};
|
||||
|
||||
if (getContentResolver() != null) {
|
||||
getContentResolver().delete(ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs);
|
||||
@@ -1313,16 +1315,14 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
|
||||
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
|
||||
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
|
||||
cv.put(
|
||||
ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
|
||||
share.getSharedWithDisplayName()
|
||||
);
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
|
||||
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getRemoteId());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
|
||||
|
||||
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED, share.isPasswordProtected() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.OCSHARES_NOTE, share.getNote());
|
||||
cv.put(ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD, share.isHideFileDownload());
|
||||
|
||||
if (shareExistsForRemoteId(share.getRemoteId())) {
|
||||
// updating an existing file
|
||||
@@ -1386,28 +1386,22 @@ public class FileDataStorageManager {
|
||||
if (!file.isFolder()) {
|
||||
cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
|
||||
}
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
|
||||
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
|
||||
cv.put(
|
||||
ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA,
|
||||
file.getLastSyncDateForData()
|
||||
);
|
||||
cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.isAvailableOffline() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_ON_SERVER, file.getEtagOnServer());
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, file.isSharedViaLink() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, file.isSharedWithSharee() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
|
||||
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
|
||||
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
|
||||
cv.put(ProviderTableMeta.FILE_FAVORITE, file.getIsFavorite());
|
||||
cv.put(
|
||||
ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
|
||||
file.needsUpdateThumbnail() ? 1 : 0
|
||||
);
|
||||
cv.put(
|
||||
ProviderTableMeta.FILE_IS_DOWNLOADING,
|
||||
file.isDownloading() ? 1 : 0
|
||||
);
|
||||
cv.put(ProviderTableMeta.FILE_FAVORITE, file.isFavorite());
|
||||
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.isUpdateThumbnailNeeded() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
|
||||
|
||||
boolean existsByPath = fileExists(file.getRemotePath());
|
||||
@@ -1454,7 +1448,7 @@ public class FileDataStorageManager {
|
||||
Uri share_uri = ProviderTableMeta.CONTENT_URI_SHARE;
|
||||
String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + AND +
|
||||
ProviderTableMeta._ID + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name, Long.toString(share.getId())};
|
||||
String[] whereArgs = new String[]{account.name, Long.toString(share.getId())};
|
||||
if (getContentProviderClient() != null) {
|
||||
try {
|
||||
getContentProviderClient().delete(share_uri, where, whereArgs);
|
||||
@@ -1525,7 +1519,7 @@ public class FileDataStorageManager {
|
||||
|
||||
public void removeSharesForFile(String remotePath) {
|
||||
resetShareFlagInAFile(remotePath);
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>();
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<>();
|
||||
operations = prepareRemoveSharesInFile(remotePath, operations);
|
||||
// apply operations in batch
|
||||
if (operations.size() > 0) {
|
||||
@@ -1547,7 +1541,7 @@ public class FileDataStorageManager {
|
||||
|
||||
public void saveSharesInFolder(ArrayList<OCShare> shares, OCFile folder) {
|
||||
resetShareFlagsInFolder(folder);
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>();
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<>();
|
||||
operations = prepareRemoveSharesInFolder(folder, operations);
|
||||
|
||||
if (shares != null) {
|
||||
@@ -1584,9 +1578,10 @@ public class FileDataStorageManager {
|
||||
List<OCShare> shares, ArrayList<ContentProviderOperation> operations) {
|
||||
|
||||
if (shares != null) {
|
||||
ContentValues cv;
|
||||
// prepare operations to insert or update files to save in the given folder
|
||||
for (OCShare share : shares) {
|
||||
ContentValues cv = new ContentValues();
|
||||
cv = new ContentValues();
|
||||
cv.put(ProviderTableMeta.OCSHARES_FILE_SOURCE, share.getFileSource());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ITEM_SOURCE, share.getItemSource());
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARE_TYPE, share.getShareType().getValue());
|
||||
@@ -1596,23 +1591,18 @@ public class FileDataStorageManager {
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
|
||||
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
|
||||
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
|
||||
cv.put(
|
||||
ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
|
||||
share.getSharedWithDisplayName()
|
||||
);
|
||||
cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
|
||||
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getRemoteId());
|
||||
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
|
||||
|
||||
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, account.name);
|
||||
cv.put(ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED, share.isPasswordProtected() ? 1 : 0);
|
||||
cv.put(ProviderTableMeta.OCSHARES_NOTE, share.getNote());
|
||||
cv.put(ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD, share.isHideFileDownload());
|
||||
|
||||
// adding a new share resource
|
||||
operations.add(
|
||||
ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).
|
||||
withValues(cv).
|
||||
build()
|
||||
);
|
||||
operations.add(ContentProviderOperation.newInsert(
|
||||
ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
|
||||
}
|
||||
}
|
||||
return operations;
|
||||
@@ -1623,7 +1613,7 @@ public class FileDataStorageManager {
|
||||
if (folder != null) {
|
||||
String where = ProviderTableMeta.OCSHARES_PATH + AND
|
||||
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
|
||||
String[] whereArgs = new String[]{"", mAccount.name};
|
||||
String[] whereArgs = new String[]{"", account.name};
|
||||
|
||||
List<OCFile> files = getFolderContent(folder, false);
|
||||
|
||||
@@ -1645,7 +1635,7 @@ public class FileDataStorageManager {
|
||||
|
||||
String where = ProviderTableMeta.OCSHARES_PATH + AND
|
||||
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
|
||||
String[] whereArgs = new String[]{filePath, mAccount.name};
|
||||
String[] whereArgs = new String[]{filePath, account.name};
|
||||
|
||||
preparedOperations.add(
|
||||
ContentProviderOperation.newDelete(ProviderTableMeta.CONTENT_URI_SHARE).
|
||||
@@ -1664,31 +1654,30 @@ public class FileDataStorageManager {
|
||||
+ " (" + ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
|
||||
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
|
||||
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
|
||||
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? OR "
|
||||
+ ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? ) ";
|
||||
String[] whereArgs = new String[]{filePath, accountName,
|
||||
Integer.toString(ShareType.USER.getValue()),
|
||||
Integer.toString(ShareType.GROUP.getValue()),
|
||||
Integer.toString(ShareType.EMAIL.getValue()),
|
||||
Integer.toString(ShareType.FEDERATED.getValue())};
|
||||
Integer.toString(ShareType.FEDERATED.getValue()),
|
||||
Integer.toString(ShareType.ROOM.getValue())};
|
||||
|
||||
Cursor cursor = null;
|
||||
if (getContentResolver() != null) {
|
||||
cursor = getContentResolver().query(
|
||||
ProviderTableMeta.CONTENT_URI_SHARE,
|
||||
null, where, whereArgs, null);
|
||||
cursor = getContentResolver().query(ProviderTableMeta.CONTENT_URI_SHARE, null, where, whereArgs, null);
|
||||
} else {
|
||||
try {
|
||||
cursor = getContentProviderClient().query(
|
||||
ProviderTableMeta.CONTENT_URI_SHARE,
|
||||
null, where, whereArgs, null);
|
||||
cursor = getContentProviderClient().query(ProviderTableMeta.CONTENT_URI_SHARE, null, where,
|
||||
whereArgs, null);
|
||||
|
||||
} catch (RemoteException e) {
|
||||
Log_OC.e(TAG, "Could not get list of shares with: " + e.getMessage(), e);
|
||||
cursor = null;
|
||||
}
|
||||
}
|
||||
ArrayList<OCShare> shares = new ArrayList<OCShare>();
|
||||
OCShare share = null;
|
||||
ArrayList<OCShare> shares = new ArrayList<>();
|
||||
OCShare share;
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToFirst()) {
|
||||
do {
|
||||
@@ -1844,7 +1833,7 @@ public class FileDataStorageManager {
|
||||
ProviderTableMeta.CONTENT_URI_FILE,
|
||||
new String[]{ProviderTableMeta._ID},
|
||||
whereForDescencentsInConflict,
|
||||
new String[]{mAccount.name, parentPath + "%"},
|
||||
new String[]{account.name, parentPath + "%"},
|
||||
null
|
||||
);
|
||||
} else {
|
||||
@@ -1853,7 +1842,7 @@ public class FileDataStorageManager {
|
||||
ProviderTableMeta.CONTENT_URI_FILE,
|
||||
new String[]{ProviderTableMeta._ID},
|
||||
whereForDescencentsInConflict,
|
||||
new String[]{mAccount.name, parentPath + "%"},
|
||||
new String[]{account.name, parentPath + "%"},
|
||||
null
|
||||
);
|
||||
} catch (RemoteException e) {
|
||||
@@ -1868,7 +1857,7 @@ public class FileDataStorageManager {
|
||||
cv,
|
||||
ProviderTableMeta.FILE_ACCOUNT_OWNER + AND +
|
||||
ProviderTableMeta.FILE_PATH + "=?",
|
||||
new String[]{mAccount.name, parentPath}
|
||||
new String[]{account.name, parentPath}
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
@@ -1877,7 +1866,7 @@ public class FileDataStorageManager {
|
||||
cv,
|
||||
ProviderTableMeta.FILE_ACCOUNT_OWNER + AND +
|
||||
ProviderTableMeta.FILE_PATH + "=?"
|
||||
, new String[]{mAccount.name, parentPath}
|
||||
, new String[]{account.name, parentPath}
|
||||
);
|
||||
} catch (RemoteException e) {
|
||||
Log_OC.e(TAG, "Failed saving conflict in database " + e.getMessage(), e);
|
||||
@@ -1905,13 +1894,13 @@ public class FileDataStorageManager {
|
||||
|
||||
// Prepare capabilities data
|
||||
ContentValues cv = new ContentValues();
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_ACCOUNT_NAME, mAccount.name);
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_ACCOUNT_NAME, account.name);
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_VERSION_MAYOR, capability.getVersionMayor());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_VERSION_MINOR, capability.getVersionMinor());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_VERSION_MICRO, capability.getVersionMicro());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_VERSION_STRING, capability.getVersionString());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_VERSION_EDITION, capability.getVersionEdition());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_CORE_POLLINTERVAL, capability.getCorePollinterval());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_CORE_POLLINTERVAL, capability.getCorePollInterval());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_SHARING_API_ENABLED, capability.getFilesSharingApiEnabled().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_SHARING_PUBLIC_ENABLED,
|
||||
capability.getFilesSharingPublicEnabled().getValue());
|
||||
@@ -1934,7 +1923,7 @@ public class FileDataStorageManager {
|
||||
capability.getFilesSharingFederationOutgoing().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_SHARING_FEDERATION_INCOMING,
|
||||
capability.getFilesSharingFederationIncoming().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_FILES_BIGFILECHUNKING, capability.getFilesBigFileChuncking().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_FILES_BIGFILECHUNKING, capability.getFilesBigFileChunking().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_FILES_UNDELETE, capability.getFilesUndelete().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_FILES_VERSIONING, capability.getFilesVersioning().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_FILES_DROP, capability.getFilesFileDrop().getValue());
|
||||
@@ -1950,18 +1939,25 @@ public class FileDataStorageManager {
|
||||
.getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_SERVER_BACKGROUND_PLAIN, capability.getServerBackgroundPlain()
|
||||
.getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_ACTIVITY, capability.isActivityEnabled().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_ACTIVITY, capability.getActivity().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT, capability.getRichDocuments().getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT_MIMETYPE_LIST,
|
||||
TextUtils.join(",", capability.getRichDocumentsMimeTypeList()));
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT_DIRECT_EDITING, capability.getRichDocumentsDirectEditing()
|
||||
.getValue());
|
||||
cv.put(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT_TEMPLATES, capability.getRichDocumentsTemplatesAvailable()
|
||||
.getValue());
|
||||
|
||||
if (capabilityExists(mAccount.name)) {
|
||||
if (capabilityExists(account.name)) {
|
||||
if (getContentResolver() != null) {
|
||||
getContentResolver().update(ProviderTableMeta.CONTENT_URI_CAPABILITIES, cv,
|
||||
ProviderTableMeta.CAPABILITIES_ACCOUNT_NAME + "=?",
|
||||
new String[]{mAccount.name});
|
||||
new String[]{account.name});
|
||||
} else {
|
||||
try {
|
||||
getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_CAPABILITIES,
|
||||
cv, ProviderTableMeta.CAPABILITIES_ACCOUNT_NAME + "=?",
|
||||
new String[]{mAccount.name});
|
||||
new String[]{account.name});
|
||||
} catch (RemoteException e) {
|
||||
Log_OC.e(TAG, FAILED_TO_INSERT_MSG + e.getMessage(), e);
|
||||
}
|
||||
@@ -1983,7 +1979,7 @@ public class FileDataStorageManager {
|
||||
long new_id = Long.parseLong(result_uri.getPathSegments()
|
||||
.get(1));
|
||||
capability.setId(new_id);
|
||||
capability.setAccountName(mAccount.name);
|
||||
capability.setAccountName(account.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2024,7 +2020,7 @@ public class FileDataStorageManager {
|
||||
}
|
||||
|
||||
public OCCapability getCapability(String accountName) {
|
||||
OCCapability capability = null;
|
||||
OCCapability capability;
|
||||
Cursor c = getCapabilityCursorForAccount(accountName);
|
||||
|
||||
if (c.moveToFirst()) {
|
||||
@@ -2053,7 +2049,7 @@ public class FileDataStorageManager {
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_VERSION_STRING)));
|
||||
capability.setVersionEdition(c.getString(c
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_VERSION_EDITION)));
|
||||
capability.setCorePollinterval(c.getInt(c
|
||||
capability.setCorePollInterval(c.getInt(c
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_CORE_POLLINTERVAL)));
|
||||
capability.setFilesSharingApiEnabled(CapabilityBooleanType.fromValue(c.getInt(c
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_SHARING_API_ENABLED))));
|
||||
@@ -2079,7 +2075,7 @@ public class FileDataStorageManager {
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_SHARING_FEDERATION_OUTGOING))));
|
||||
capability.setFilesSharingFederationIncoming(CapabilityBooleanType.fromValue(c.getInt(c
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_SHARING_FEDERATION_INCOMING))));
|
||||
capability.setFilesBigFileChuncking(CapabilityBooleanType.fromValue(c.getInt(c
|
||||
capability.setFilesBigFileChunking(CapabilityBooleanType.fromValue(c.getInt(c
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_FILES_BIGFILECHUNKING))));
|
||||
capability.setFilesUndelete(CapabilityBooleanType.fromValue(c.getInt(c
|
||||
.getColumnIndex(ProviderTableMeta.CAPABILITIES_FILES_UNDELETE))));
|
||||
@@ -2106,6 +2102,17 @@ public class FileDataStorageManager {
|
||||
c.getInt(c.getColumnIndex(ProviderTableMeta.CAPABILITIES_SERVER_BACKGROUND_PLAIN))));
|
||||
capability.setActivity(CapabilityBooleanType.fromValue(
|
||||
c.getInt(c.getColumnIndex(ProviderTableMeta.CAPABILITIES_ACTIVITY))));
|
||||
capability.setRichDocuments(CapabilityBooleanType.fromValue(c.getInt(
|
||||
c.getColumnIndex(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT))));
|
||||
capability.setRichDocumentsDirectEditing(CapabilityBooleanType.fromValue(c.getInt(
|
||||
c.getColumnIndex(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT_DIRECT_EDITING))));
|
||||
capability.setRichDocumentsTemplatesAvailable(CapabilityBooleanType.fromValue(c.getInt(
|
||||
c.getColumnIndex(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT_TEMPLATES))));
|
||||
String mimetypes = c.getString(c.getColumnIndex(ProviderTableMeta.CAPABILITIES_RICHDOCUMENT_MIMETYPE_LIST));
|
||||
if (mimetypes == null) {
|
||||
mimetypes = "";
|
||||
}
|
||||
capability.setRichDocumentsMimeTypeList(Arrays.asList(mimetypes.split(",")));
|
||||
}
|
||||
return capability;
|
||||
}
|
||||
@@ -2214,7 +2221,7 @@ public class FileDataStorageManager {
|
||||
|
||||
public void deleteAllFiles() {
|
||||
String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
|
||||
String[] whereArgs = new String[]{mAccount.name};
|
||||
String[] whereArgs = new String[]{account.name};
|
||||
|
||||
if (getContentResolver() != null) {
|
||||
getContentResolver().delete(ProviderTableMeta.CONTENT_URI_FILE, where, whereArgs);
|
||||
@@ -2223,7 +2230,7 @@ public class FileDataStorageManager {
|
||||
try {
|
||||
getContentProviderClient().delete(ProviderTableMeta.CONTENT_URI_FILE, where, whereArgs);
|
||||
} catch (RemoteException e) {
|
||||
Log_OC.e(TAG, "Exception in deleteAllFiles for account " + mAccount.name + ": " + e.getMessage(), e);
|
||||
Log_OC.e(TAG, "Exception in deleteAllFiles for account " + account.name + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
* Nextcloud Android client application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* @author Andy Scherzinger
|
||||
* Copyright (C) 2017 Mario Danic
|
||||
* Copyright (C) 2017 Nextcloud
|
||||
* Copyright (C) 2018 Andy Scherzinger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
@@ -20,13 +22,20 @@
|
||||
*/
|
||||
package com.owncloud.android.datamodel;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import androidx.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Model for filesystem data from the database.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FileSystemDataSet {
|
||||
|
||||
private int id;
|
||||
private String localPath;
|
||||
private long modifiedAt;
|
||||
@@ -35,83 +44,4 @@ public class FileSystemDataSet {
|
||||
private long foundAt;
|
||||
private long syncedFolderId;
|
||||
@Nullable private String crc32;
|
||||
|
||||
public FileSystemDataSet() {
|
||||
}
|
||||
|
||||
public FileSystemDataSet(int id, String localPath, long modifiedAt, boolean folder,
|
||||
boolean sentForUpload, long foundAt, long syncedFolderId, @Nullable String crc32) {
|
||||
this.id = id;
|
||||
this.localPath = localPath;
|
||||
this.modifiedAt = modifiedAt;
|
||||
this.folder = folder;
|
||||
this.sentForUpload = sentForUpload;
|
||||
this.foundAt = foundAt;
|
||||
this.syncedFolderId = syncedFolderId;
|
||||
this.crc32 = crc32;
|
||||
}
|
||||
|
||||
public String getCrc32() {
|
||||
return crc32;
|
||||
}
|
||||
|
||||
public void setCrc32(String crc32) {
|
||||
this.crc32 = crc32;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLocalPath() {
|
||||
return localPath;
|
||||
}
|
||||
|
||||
public void setLocalPath(String localPath) {
|
||||
this.localPath = localPath;
|
||||
}
|
||||
|
||||
public long getModifiedAt() {
|
||||
return modifiedAt;
|
||||
}
|
||||
|
||||
public void setModifiedAt(long modifiedAt) {
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
|
||||
public boolean isFolder() {
|
||||
return folder;
|
||||
}
|
||||
|
||||
public void setFolder(boolean folder) {
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public long getFoundAt() {
|
||||
return foundAt;
|
||||
}
|
||||
|
||||
public void setFoundAt(long foundAt) {
|
||||
this.foundAt = foundAt;
|
||||
}
|
||||
|
||||
public boolean isSentForUpload() {
|
||||
return sentForUpload;
|
||||
}
|
||||
|
||||
public void setSentForUpload(boolean sentForUpload) {
|
||||
this.sentForUpload = sentForUpload;
|
||||
}
|
||||
|
||||
public long getSyncedFolderId() {
|
||||
return syncedFolderId;
|
||||
}
|
||||
|
||||
public void setSyncedFolderId(long syncedFolderId) {
|
||||
this.syncedFolderId = syncedFolderId;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,8 @@ package com.owncloud.android.datamodel;
|
||||
|
||||
import android.util.SparseArray;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Types of media folder.
|
||||
*/
|
||||
@@ -29,7 +31,7 @@ public enum MediaFolderType {
|
||||
IMAGE(1),
|
||||
VIDEO(2);
|
||||
|
||||
private Integer id;
|
||||
@Getter private Integer id;
|
||||
|
||||
private static SparseArray<MediaFolderType> reverseMap = new SparseArray<>(3);
|
||||
|
||||
@@ -46,8 +48,4 @@ public enum MediaFolderType {
|
||||
public static MediaFolderType getById(Integer id) {
|
||||
return reverseMap.get(id);
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,9 @@
|
||||
* Nextcloud Android client application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* @author Andy Scherzinger
|
||||
* Copyright (C) 2018 Mario Danic
|
||||
* Copyright (C) 2018 Andy Scherzinger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
@@ -22,35 +24,15 @@ package com.owncloud.android.datamodel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter @Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MediaFoldersModel {
|
||||
private List<String> imageMediaFolders;
|
||||
private List<String> videoMediaFolders;
|
||||
|
||||
/**
|
||||
* default constructor.
|
||||
*/
|
||||
public MediaFoldersModel() {
|
||||
// keep default constructor for GSON
|
||||
}
|
||||
|
||||
public MediaFoldersModel(List<String> imageMediaFolders, List<String> videoMediaFolders) {
|
||||
this.imageMediaFolders = imageMediaFolders;
|
||||
this.videoMediaFolders = videoMediaFolders;
|
||||
}
|
||||
|
||||
public List<String> getImageMediaFolders() {
|
||||
return imageMediaFolders;
|
||||
}
|
||||
|
||||
public void setImageMediaFolders(List<String> imageMediaFolders) {
|
||||
this.imageMediaFolders = imageMediaFolders;
|
||||
}
|
||||
|
||||
public List<String> getVideoMediaFolders() {
|
||||
return videoMediaFolders;
|
||||
}
|
||||
|
||||
public void setVideoMediaFolders(List<String> videoMediaFolders) {
|
||||
this.videoMediaFolders = videoMediaFolders;
|
||||
}
|
||||
}
|
||||