mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 17:57:01 +02:00
Compare commits
480
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fb51a7b25 | ||
|
|
cb728b376a | ||
|
|
4c7ee6c585 | ||
|
|
ad2c746c92 | ||
|
|
5ddbf32e66 | ||
|
|
3254d4660e | ||
|
|
c71af1920e | ||
|
|
49d7b7ce3c | ||
|
|
98de23aed8 | ||
|
|
93707b291c | ||
|
|
ef336c8e36 | ||
|
|
ff3c7998e5 | ||
|
|
34b57f8ab3 | ||
|
|
5d4f0065a1 | ||
|
|
286e5d27ef | ||
|
|
1c5e13d644 | ||
|
|
5e718b2929 | ||
|
|
ee8dd9f02d | ||
|
|
f171c76093 | ||
|
|
84bb033350 | ||
|
|
64c67e3c01 | ||
|
|
294732e99b | ||
|
|
0be469d16a | ||
|
|
ec829371c9 | ||
|
|
7df5d5028a | ||
|
|
28c6fb02d8 | ||
|
|
315de66663 | ||
|
|
11fe6f84df | ||
|
|
cad049dd41 | ||
|
|
228d4e9146 | ||
|
|
cd529b6216 | ||
|
|
3677c3e4c3 | ||
|
|
81ffa1bc24 | ||
|
|
d5dc274aa2 | ||
|
|
b8a94458c9 | ||
|
|
d8ec510665 | ||
|
|
b227524d1d | ||
|
|
b4fd3f4ae5 | ||
|
|
7e1c40b6cc | ||
|
|
c5ec80436d | ||
|
|
797192191a | ||
|
|
2485235978 | ||
|
|
77eed6a93b | ||
|
|
d4ad4c2809 | ||
|
|
33c4702b6d | ||
|
|
27d9e6fa40 | ||
|
|
2b76a9d8f1 | ||
|
|
20c4bb8145 | ||
|
|
1fbc971b84 | ||
|
|
0a441ba889 | ||
|
|
c1c4821e60 | ||
|
|
b24a3bd19e | ||
|
|
53a300851a | ||
|
|
19637412f9 | ||
|
|
a6af28aa8d | ||
|
|
693aaa192c | ||
|
|
e4f0b8a11c | ||
|
|
b8bd6e9522 | ||
|
|
6e4c7d623c | ||
|
|
98f5230408 | ||
|
|
404a43a82e | ||
|
|
785c3a515f | ||
|
|
efb5ce48c3 | ||
|
|
a9a1f775cb | ||
|
|
8291ac6d79 | ||
|
|
6580820616 | ||
|
|
ee256722d1 | ||
|
|
49ce775f36 | ||
|
|
5d588a2709 | ||
|
|
e1c0e31687 | ||
|
|
9ad1fbfc9b | ||
|
|
b4ba4de2dc | ||
|
|
4b4502884a | ||
|
|
0b53c98b44 | ||
|
|
dd00072f8c | ||
|
|
40b08c4117 | ||
|
|
712d66514d | ||
|
|
8e18f202c4 | ||
|
|
af25b17c8f | ||
|
|
99f4a37b00 | ||
|
|
64644ad7de | ||
|
|
3745a48e0d | ||
|
|
290bd1fbc3 | ||
|
|
7c121b34ba | ||
|
|
f2c916c4a1 | ||
|
|
4ce8407acb | ||
|
|
2c49e436b1 | ||
|
|
5b95d57577 | ||
|
|
ff264e51ae | ||
|
|
ce566ddcfd | ||
|
|
52df75e512 | ||
|
|
fb326d4359 | ||
|
|
4f259adbb1 | ||
|
|
d75b887b6d | ||
|
|
9e92dc604a | ||
|
|
8e8f0c2d6a | ||
|
|
1695a4ee02 | ||
|
|
357e143090 | ||
|
|
57377be996 | ||
|
|
7366f1aa0f | ||
|
|
4bec3567c2 | ||
|
|
f42742eb69 | ||
|
|
f19c6bc79b | ||
|
|
ec32190451 | ||
|
|
f61b44d1ba | ||
|
|
ed8c72a31c | ||
|
|
96d66c8086 | ||
|
|
ede835dda4 | ||
|
|
be00951b6e | ||
|
|
99db98159a | ||
|
|
fdb0ece56b | ||
|
|
defb841b3a | ||
|
|
c4f247d1cd | ||
|
|
12bfd18df2 | ||
|
|
978d89e814 | ||
|
|
d98a12b2e7 | ||
|
|
7b8acd1879 | ||
|
|
e30cfb3cbd | ||
|
|
28be81dc72 | ||
|
|
6dae613bf8 | ||
|
|
f16df47fb5 | ||
|
|
1e67309312 | ||
|
|
e56c1d2ce7 | ||
|
|
fef7fb7069 | ||
|
|
41ad530d70 | ||
|
|
a94efb1c7d | ||
|
|
042f55c5f1 | ||
|
|
59b4cb382b | ||
|
|
2be9955cc7 | ||
|
|
f460cf765f | ||
|
|
c4873c4d7c | ||
|
|
b2b99b4266 | ||
|
|
c7d85ed02f | ||
|
|
ae7985771c | ||
|
|
872741ab6e | ||
|
|
0824c53e78 | ||
|
|
a69092d78a | ||
|
|
f6c6a6eb5a | ||
|
|
61e87c3ccf | ||
|
|
813ca1abda | ||
|
|
21221f9c7a | ||
|
|
aab5f6d029 | ||
|
|
1032e63e7c | ||
|
|
0e9c4cb7ff | ||
|
|
fe2be9bf34 | ||
|
|
096e731044 | ||
|
|
ed56cfabbb | ||
|
|
6fc00a598b | ||
|
|
8d69a501ee | ||
|
|
aec48db4ff | ||
|
|
f3fad871ab | ||
|
|
49364f01a7 | ||
|
|
3adad5f85f | ||
|
|
a85bef8cd2 | ||
|
|
38c63a858e | ||
|
|
4bb8b7f68f | ||
|
|
12c4333ab0 | ||
|
|
452bd93830 | ||
|
|
8b1f0c1b71 | ||
|
|
4bf387042e | ||
|
|
4d99058450 | ||
|
|
bc7925ac34 | ||
|
|
bf4dc48386 | ||
|
|
e7b542c513 | ||
|
|
e49c3b1c23 | ||
|
|
336529b961 | ||
|
|
03820965c1 | ||
|
|
59138ef916 | ||
|
|
2cf6b7b48b | ||
|
|
c1c2d346bb | ||
|
|
c1cef9d425 | ||
|
|
2b2fbfdc68 | ||
|
|
6e61456d05 | ||
|
|
4e4aa8ac73 | ||
|
|
64e013d490 | ||
|
|
9813fb1f80 | ||
|
|
a37c276b2d | ||
|
|
19352d0595 | ||
|
|
92debd2786 | ||
|
|
98ebfed5cf | ||
|
|
bd1dfb0dc5 | ||
|
|
e64957c5a9 | ||
|
|
18e6a6553c | ||
|
|
abf2397558 | ||
|
|
8933d41fd2 | ||
|
|
41c3c8744a | ||
|
|
ec6cf3fd54 | ||
|
|
f2a36e124e | ||
|
|
c7cacfd9fc | ||
|
|
cc75c83f5e | ||
|
|
c451b3e719 | ||
|
|
706ed7af56 | ||
|
|
f7e19d5621 | ||
|
|
66e487312c | ||
|
|
1cc8b6c638 | ||
|
|
4b4666caa5 | ||
|
|
082bc85a4f | ||
|
|
407a01f74a | ||
|
|
89439f1976 | ||
|
|
2479260f2c | ||
|
|
1ac77c1454 | ||
|
|
ccfe0340f2 | ||
|
|
0892668996 | ||
|
|
eb8175d583 | ||
|
|
08b5c7edd8 | ||
|
|
09dc1fe573 | ||
|
|
6add9c0aa0 | ||
|
|
6ea6145f04 | ||
|
|
fc6cbaff76 | ||
|
|
9c6b99d73c | ||
|
|
f288948625 | ||
|
|
0c927853db | ||
|
|
19be77c628 | ||
|
|
e17f65a82b | ||
|
|
fd235db4e8 | ||
|
|
d53b023418 | ||
|
|
48cfe93842 | ||
|
|
61fe08316f | ||
|
|
e86b3ed2b1 | ||
|
|
a8100a985d | ||
|
|
3dbd18157f | ||
|
|
36e5d0cd07 | ||
|
|
080e00bd76 | ||
|
|
93a686bb38 | ||
|
|
45d80917c5 | ||
|
|
af07d5b7bb | ||
|
|
8bad24646c | ||
|
|
de30d94b5f | ||
|
|
4e4ffd71de | ||
|
|
c4162aa398 | ||
|
|
7f023ca3be | ||
|
|
3c3709d22a | ||
|
|
548570ade3 | ||
|
|
20175610fd | ||
|
|
57db0053d3 | ||
|
|
1f72cb748b | ||
|
|
0cf8155f36 | ||
|
|
4028b78a82 | ||
|
|
2b21d6a6ac | ||
|
|
1c1f7ba031 | ||
|
|
36867d4cf3 | ||
|
|
cc64d68927 | ||
|
|
c7357d0933 | ||
|
|
ad16347fab | ||
|
|
8d524fb238 | ||
|
|
8eadb00b20 | ||
|
|
7a83975cbb | ||
|
|
fafdfef2b6 | ||
|
|
c035a25b9e | ||
|
|
8dbc51e246 | ||
|
|
f081807550 | ||
|
|
de77d05065 | ||
|
|
9a176287d4 | ||
|
|
009818a44a | ||
|
|
5fc7e81b86 | ||
|
|
7beed5d2d8 | ||
|
|
f95924a084 | ||
|
|
7f69ebd54a | ||
|
|
10016b39b1 | ||
|
|
7d04b84fb0 | ||
|
|
9c919599cf | ||
|
|
a5dc6d23c6 | ||
|
|
77341ae548 | ||
|
|
61d51bf2ce | ||
|
|
5004fc99e4 | ||
|
|
e8ab701ee6 | ||
|
|
81490fd0b3 | ||
|
|
063e4e4160 | ||
|
|
0e2ecfb311 | ||
|
|
963f103378 | ||
|
|
4fb33ce3e5 | ||
|
|
780a1b79cc | ||
|
|
8468ae0362 | ||
|
|
d85582e304 | ||
|
|
5e6a755853 | ||
|
|
3fa0d9e761 | ||
|
|
3c3c2c3ae9 | ||
|
|
565bea9613 | ||
|
|
6ee66f4048 | ||
|
|
5759eb1576 | ||
|
|
c2810c1cdc | ||
|
|
2a2c838c70 | ||
|
|
f441d8be87 | ||
|
|
19ee15116e | ||
|
|
0983a722a8 | ||
|
|
49b3b53ef4 | ||
|
|
38154515a7 | ||
|
|
ceb1d203a8 | ||
|
|
35f5f1afc2 | ||
|
|
df5faff6e7 | ||
|
|
1317cca3b9 | ||
|
|
a67bd6dfc8 | ||
|
|
67d22b009c | ||
|
|
e6636e9ada | ||
|
|
591a759a8c | ||
|
|
295ecef2e3 | ||
|
|
cfb294b62f | ||
|
|
8fc7d71e4c | ||
|
|
421dda3e2f | ||
|
|
85d50c31ed | ||
|
|
7b679430af | ||
|
|
afa2b676e4 | ||
|
|
6a49eecda9 | ||
|
|
e1a8e3eafb | ||
|
|
4415d1286b | ||
|
|
b28847868a | ||
|
|
587ced3d5b | ||
|
|
fcec87d4f0 | ||
|
|
a8341ead23 | ||
|
|
845a249d72 | ||
|
|
0f27b27303 | ||
|
|
c2eae3b422 | ||
|
|
062505f656 | ||
|
|
371cafc89b | ||
|
|
7ebffff387 | ||
|
|
625263ceb1 | ||
|
|
1481b3d415 | ||
|
|
398e1e7cdf | ||
|
|
8ac632f577 | ||
|
|
39f73c2f3d | ||
|
|
387e1181e4 | ||
|
|
46b8e147c1 | ||
|
|
8fcee84fbe | ||
|
|
ea85f6f5fb | ||
|
|
9cfcf4c8d7 | ||
|
|
ceb4b947f5 | ||
|
|
99917611cb | ||
|
|
8f12d02274 | ||
|
|
612d9f4200 | ||
|
|
81b88747fc | ||
|
|
cc163c3f27 | ||
|
|
207df43bd6 | ||
|
|
cd26b9571b | ||
|
|
2e59d90750 | ||
|
|
db0af33bd2 | ||
|
|
f491e02898 | ||
|
|
8a47532cfd | ||
|
|
c5b949ed39 | ||
|
|
2389b5071e | ||
|
|
d40bbf1d89 | ||
|
|
4252eb3209 | ||
|
|
d0fd3c4850 | ||
|
|
9648db757b | ||
|
|
ba7aa1bfa6 | ||
|
|
7f6f18a76a | ||
|
|
bc61e31a64 | ||
|
|
db8dd78e50 | ||
|
|
47d969f0ff | ||
|
|
b7451f5b00 | ||
|
|
0b838e901e | ||
|
|
bfacc9c717 | ||
|
|
1751000ea5 | ||
|
|
5cfc0a3792 | ||
|
|
53ac0239b9 | ||
|
|
0a8a857729 | ||
|
|
cbcafaed10 | ||
|
|
7d2d47ff25 | ||
|
|
b8787a6148 | ||
|
|
29c250812c | ||
|
|
d350eeda91 | ||
|
|
4f38d94169 | ||
|
|
220671467c | ||
|
|
2f0a4404ed | ||
|
|
de421536f3 | ||
|
|
9b13144b5a | ||
|
|
62ed68bff7 | ||
|
|
d13764da1a | ||
|
|
5c47d33899 | ||
|
|
2c3dd2ce89 | ||
|
|
6d94d3222c | ||
|
|
e13b0c9a6a | ||
|
|
9af8bdf5cc | ||
|
|
a64584b35f | ||
|
|
461eba6285 | ||
|
|
a037d527d0 | ||
|
|
24dc2a00cc | ||
|
|
67e66242e2 | ||
|
|
359d497834 | ||
|
|
ab36ffd10a | ||
|
|
682886db26 | ||
|
|
fca40993e2 | ||
|
|
5990cab2ca | ||
|
|
b40b9e542f | ||
|
|
23a30d8da2 | ||
|
|
6add5c2066 | ||
|
|
62f4fff566 | ||
|
|
8292432cd2 | ||
|
|
d0b93c2b93 | ||
|
|
731587df63 | ||
|
|
42f3d83b7c | ||
|
|
4951715f62 | ||
|
|
4c0f701943 | ||
|
|
a3967298ef | ||
|
|
9389f73cb4 | ||
|
|
a5b611c0c7 | ||
|
|
88c9f50f60 | ||
|
|
9dd2a269ed | ||
|
|
8e16f01c17 | ||
|
|
22d4118eeb | ||
|
|
40ea6ecd08 | ||
|
|
168379b693 | ||
|
|
554eb0dbd5 | ||
|
|
706800c02f | ||
|
|
e500aaebc3 | ||
|
|
eaf1aff0c5 | ||
|
|
2ef65da751 | ||
|
|
0115e1894d | ||
|
|
bea4ebd914 | ||
|
|
3fd83e30de | ||
|
|
8535784790 | ||
|
|
319128fcf4 | ||
|
|
c966b295f8 | ||
|
|
36b3825b3c | ||
|
|
ed880e751d | ||
|
|
7f67026950 | ||
|
|
23167d83fb | ||
|
|
f85c88e63f | ||
|
|
5e122ae2a7 | ||
|
|
210aa17565 | ||
|
|
47944bf1bf | ||
|
|
d2d69d2bd2 | ||
|
|
fd2054654b | ||
|
|
cb482317bc | ||
|
|
cab6c0865d | ||
|
|
8069d52189 | ||
|
|
1a52843666 | ||
|
|
d21bae3c10 | ||
|
|
fd649e5239 | ||
|
|
91ca19f7b8 | ||
|
|
0f65caec0a | ||
|
|
09d9c67b60 | ||
|
|
b8c8f29390 | ||
|
|
7c3ea76f50 | ||
|
|
61c13fe698 | ||
|
|
e4940ab3b5 | ||
|
|
e40ae8ce89 | ||
|
|
2eb578fdd0 | ||
|
|
e207412ddb | ||
|
|
0823f35e80 | ||
|
|
9755d65054 | ||
|
|
eb3d56fae0 | ||
|
|
c567f240b5 | ||
|
|
7fc8ca55be | ||
|
|
5704842abf | ||
|
|
a2b67a1ec8 | ||
|
|
d8b0be1386 | ||
|
|
449ad3cf18 | ||
|
|
25e41ebb5f | ||
|
|
6762247a56 | ||
|
|
b508c95779 | ||
|
|
51b0386ac1 | ||
|
|
93a771d89b | ||
|
|
ad21f9e8e7 | ||
|
|
0005e86b1d | ||
|
|
355d10fc9d | ||
|
|
8652f49424 | ||
|
|
bb4a267fb4 | ||
|
|
8ed6b0c715 | ||
|
|
d37bb89761 | ||
|
|
212bc9f15c | ||
|
|
aa705a0898 | ||
|
|
c8b17299ba | ||
|
|
5ca34a8207 | ||
|
|
28c9fdc8b9 | ||
|
|
e4d4d0e137 | ||
|
|
64bb43cdc4 | ||
|
|
81c1d60c31 | ||
|
|
012f644cd0 | ||
|
|
a58627b102 | ||
|
|
56b6a14bba | ||
|
|
451617aaf5 | ||
|
|
9858204dd4 | ||
|
|
b07b88b6b7 | ||
|
|
9bf7e2f338 | ||
|
|
486ea269bd | ||
|
|
b6589f2ffd | ||
|
|
2b9dd9cda3 | ||
|
|
b4839bfe17 | ||
|
|
1a857156bc | ||
|
|
9173ae7353 |
No files matched your search
@@ -0,0 +1,29 @@
|
||||
---
|
||||
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.
|
||||
|
||||
@@ -1,785 +0,0 @@
|
||||
name: Build palera1n
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'docs/**'
|
||||
- 'patches/**'
|
||||
- 'include/**'
|
||||
- 'Makefile'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/build.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'docs/**'
|
||||
- 'patches/**'
|
||||
- 'include/**'
|
||||
- 'Makefile'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/build.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies (packages)
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install mandoc make
|
||||
|
||||
- name: Build Documentation
|
||||
run: |
|
||||
make -j$(nproc) docs
|
||||
mkdir ready
|
||||
cp docs/*.html docs/mandoc.css docs/palera1n.1 ready
|
||||
|
||||
- name: Upload artifact
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: wangyucode/[email protected]
|
||||
with:
|
||||
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
||||
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
||||
username: palera1n
|
||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||
forceUpload: true
|
||||
dryRun: false
|
||||
localDir: 'ready/'
|
||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
||||
|
||||
build-darwin:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86_64
|
||||
gnu_triple: x86_64-apple-darwin
|
||||
os: macosx
|
||||
minos: 10.8
|
||||
- arch: arm64
|
||||
gnu_triple: aarch64-apple-darwin
|
||||
os: macosx
|
||||
minos: 11.0
|
||||
- arch: arm64
|
||||
gnu_triple: aarch64-apple-darwin
|
||||
os: iphoneos
|
||||
minos: 7.0
|
||||
runs-on: macos-12
|
||||
env:
|
||||
MBEDTLS_VERSION: 3.3.0
|
||||
READLINE_VERSION: 8.2
|
||||
SLANG_VERSION: 2.3.3
|
||||
NEWT_VERSION: 0.52.23
|
||||
POPT_VERSION: 1.19
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies (packages)
|
||||
run: |
|
||||
sudo /usr/local/bin/pip3 install jsonschema jinja2
|
||||
brew install make autoconf automake pkg-config gnu-sed gettext
|
||||
sudo rm -rf /usr/local/Frameworks/Python*
|
||||
curl -LO https://github.com/ProcursusTeam/ldid/releases/download/v2.1.5-procursus7/ldid_macosx_x86_64
|
||||
sudo install -m755 ldid_macosx_x86_64 /usr/local/bin/ldid
|
||||
|
||||
- name: Download dependencies (embedded binaries)
|
||||
run: |
|
||||
echo "SDK=$(xcrun -sdk ${{ matrix.os }} --show-sdk-path)" >> $GITHUB_ENV
|
||||
|
||||
- name: Download dependencies (source code)
|
||||
run: |
|
||||
curl -LOOOOOO \
|
||||
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${{ env.MBEDTLS_VERSION }}.tar.gz \
|
||||
https://mirror-hk.koddos.net/gnu/readline/readline-${{ env.READLINE_VERSION }}.tar.gz \
|
||||
https://www.jedsoft.org/releases/slang/slang-${{ env.SLANG_VERSION }}.tar.bz2 \
|
||||
https://releases.pagure.org/newt/newt-${{ env.NEWT_VERSION }}.tar.gz \
|
||||
https://github.com/rpm-software-management/popt/archive/refs/tags/popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||
|
||||
tar -xf v${{ env.MBEDTLS_VERSION }}.tar.gz
|
||||
tar -xf readline-${{ env.READLINE_VERSION }}.tar.gz
|
||||
tar -xjf slang-${{ env.SLANG_VERSION }}.tar.bz2
|
||||
tar -xf newt-${{ env.NEWT_VERSION }}.tar.gz
|
||||
tar -xf popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libusbmuxd
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice
|
||||
|
||||
- name: Select correct Xcode
|
||||
run: |
|
||||
sudo xcode-select -s /Applications/Xcode_14.2.app
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
mkdir sysroot
|
||||
echo "DESTDIR=$(pwd)/sysroot" >> $GITHUB_ENV
|
||||
echo "PREFIX=/usr/local" >> $GITHUB_ENV
|
||||
echo "PKG_CONFIG_PATH=$(pwd)/sysroot/usr/local/lib/pkgconfig" >> $GITHUB_ENV
|
||||
echo "CONFIGURE_ARGS=--prefix=/usr/local --disable-shared --enable-static --build=x86_64-apple-darwin --host=${{ matrix.gnu_triple }}" >> $GITHUB_ENV
|
||||
echo "CC=$(xcrun --find cc)" >> $GITHUB_ENV
|
||||
echo "CXX=$(xcrun --find c++)" >> $GITHUB_ENV
|
||||
echo "CPP=$(xcrun --find cc) -E" >> $GITHUB_ENV
|
||||
echo "CFLAGS=-g -Os -arch ${{ matrix.arch }} -m${{ matrix.os }}-version-min=${{ matrix.minos }} -isysroot ${{ env.SDK }} -isystem $(pwd)/sysroot/usr/local/include -Os -g -flto=full -Wl,-object_path_lto,lto.o" >> $GITHUB_ENV
|
||||
echo "CPPFLAGS=-g -Os -arch ${{ matrix.arch }} -m${{ matrix.os }}-version-min=${{ matrix.minos }} -isysroot ${{ env.SDK }} -isystem $(pwd)/sysroot/usr/local/include -Wno-error-implicit-function-declaration -Os" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS=-stdlib=libc++ -g -Os -isysroot ${{ env.SDK }} -arch ${{ matrix.arch }} -m${{ matrix.os }}-version-min=${{ matrix.minos }} -isystem $(pwd)/sysroot/usr/local/include -Os" >> $GITHUB_ENV
|
||||
echo "LDFLAGS=-g -Wl,-dead_strip -arch ${{ matrix.arch }} -isysroot ${{ env.SDK }} -m${{ matrix.os }}-version-min=${{ matrix.minos }} -L$(pwd)/sysroot/usr/local/lib" >> $GITHUB_ENV
|
||||
echo "CFLAGS_FOR_BUILD=-arch $(uname -m) -isysroot $(xcrun -sdk macosx --show-sdk-path) -Os" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS_FOR_BUILD=-stdlib=libc++ -arch $(uname -m) -isysroot $(xcrun -sdk macosx --show-sdk-path) -Os" >> $GITHUB_ENV
|
||||
echo "CPPFLAGS_FOR_BUILD=-arch $(uname -m) -isysroot $(xcrun -sdk macosx --show-sdk-path) -Wno-error-implicit-function-declaration -Os" >> $GITHUB_ENV
|
||||
echo "LDFLAGS_FOR_BUILD=-Wl,-dead_strip" >> $GITHUB_ENV
|
||||
mkdir -p $(pwd)/sysroot/usr/local/lib
|
||||
ln -sf $(pwd)/sysroot/usr/local/lib{,64}
|
||||
|
||||
- name: Prepare iPhoneOS environment
|
||||
if: matrix.os == 'iphoneos'
|
||||
run: |
|
||||
echo "FAKE_PLATFORM=2" >> $GITHUB_ENV
|
||||
echo "FAKE_SDK=7.0" >> $GITHUB_ENV
|
||||
echo "FAKE_MINOS=7.0" >> $GITHUB_ENV
|
||||
|
||||
- name: Prepare headers
|
||||
if: matrix.os != 'macosx'
|
||||
run: |
|
||||
mkdir -p sysroot/{{,System}/Library/Frameworks,/usr/{local/include/{bsm,objc,os/internal,sys,firehose,CoreFoundation,FSEvents,IOKit/kext,libkern,kern,arm,{mach/,}machine,CommonCrypto,Security,CoreSymbolication,Kernel/{kern,IOKit,libkern},rpc,rpcsvc,xpc/private,ktrace,mach-o,dispatch},lib/pkgconfig,/local/lib}}
|
||||
MACOSX_SYSROOT=$(xcrun -sdk macosx --show-sdk-path)
|
||||
TARGET_SYSROOT=$(xcrun -sdk ${{ matrix.os }} --show-sdk-path)
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/{arpa,bsm,hfs,net,xpc,netinet,servers,timeconv.h,launch.h} sysroot/usr/local/include
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/objc/objc-runtime.h sysroot/usr/local/include/objc
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/libkern/{OSDebug.h,OSKextLib.h,OSReturn.h,OSThermalNotification.h,OSTypes.h,machine} sysroot/usr/local/include/libkern
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/kern sysroot/usr/local/include
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/sys/{tty*,ptrace,kern*,random,reboot,user,vnode,disk,vmmeter,conf}.h sysroot/usr/local/include/sys
|
||||
cp -af ${MACOSX_SYSROOT}/System/Library/Frameworks/Kernel.framework/Versions/Current/Headers/sys/disklabel.h sysroot/usr/local/include/sys
|
||||
cp -af ${MACOSX_SYSROOT}/System/Library/Frameworks/IOKit.framework/Headers/{AppleConvergedIPCKeys.h,IOBSD.h,IOCFBundle.h,IOCFPlugIn.h,IOCFURLAccess.h,IOKitServer.h,IORPC.h,IOSharedLock.h,IOUserServer.h,audio,avc,firewire,graphics,hid,hidsystem,i2c,iokitmig.h,kext,ndrvsupport,network,ps,pwr_mgt,sbp2,scsi,serial,storage,stream,usb,video} sysroot/usr/local/include/IOKit
|
||||
cp -af ${MACOSX_SYSROOT}/System/Library/Frameworks/Security.framework/Headers/{mds_schema,oidsalg,SecKeychainSearch,certextensions,Authorization,eisl,SecDigestTransform,SecKeychainItem,oidscrl,cssmcspi,CSCommon,cssmaci,SecCode,CMSDecoder,oidscert,SecRequirement,AuthSession,SecReadTransform,oids,cssmconfig,cssmkrapi,SecPolicySearch,SecAccess,cssmtpi,SecACL,SecEncryptTransform,cssmapi,cssmcli,mds,x509defs,oidsbase,SecSignVerifyTransform,cssmspi,cssmkrspi,SecTask,cssmdli,SecAsn1Coder,cssm,SecTrustedApplication,SecCodeHost,SecCustomTransform,oidsattr,SecIdentitySearch,cssmtype,SecAsn1Types,emmtype,SecTransform,SecTrustSettings,SecStaticCode,emmspi,SecTransformReadTransform,SecKeychain,SecDecodeTransform,CodeSigning,AuthorizationPlugin,cssmerr,AuthorizationTags,CMSEncoder,SecEncodeTransform,SecureDownload,SecAsn1Templates,AuthorizationDB,SecCertificateOIDs,cssmapple}.h sysroot/usr/local/include/Security
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/{ar,bootstrap,launch,libc,libcharset,localcharset,nlist,NSSystemDirectories,tzfile,vproc}.h sysroot/usr/local/include
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/mach/{*.defs,{mach_vm,shared_region}.h} sysroot/usr/local/include/mach
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/mach/machine/*.defs sysroot/usr/local/include/mach/machine
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/rpc/pmap_clnt.h sysroot/usr/local/include/rpc
|
||||
cp -af ${MACOSX_SYSROOT}/usr/include/rpcsvc/yp{_prot,clnt}.h sysroot/usr/local/include/rpcsvc
|
||||
cp -af ${TARGET_SYSROOT}/usr/include/mach/machine/thread_state.h sysroot/usr/local/include/mach/machine
|
||||
cp -af ${TARGET_SYSROOT}/usr/include/mach/arm sysroot/usr/local/include/mach
|
||||
cp -af ${MACOSX_SYSROOT}/System/Library/Frameworks/IOKit.framework/Headers/* sysroot/usr/local/include/IOKit
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/stdlib.h > sysroot/usr/local/include/stdlib.h
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/time.h > sysroot/usr/local/include/time.h
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/unistd.h > sysroot/usr/local/include/unistd.h
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/mach/task.h > sysroot/usr/local/include/mach/task.h
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/mach/mach_host.h > sysroot/usr/local/include/mach/mach_host.h
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/ucontext.h > sysroot/usr/local/include/ucontext.h
|
||||
gsed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < ${TARGET_SYSROOT}/usr/include/signal.h > sysroot/usr/local/include/signal.h
|
||||
gsed -E /'__API_UNAVAILABLE'/d < ${TARGET_SYSROOT}/usr/include/pthread.h > sysroot/usr/local/include/pthread.h
|
||||
gsed -i -E s/'__API_UNAVAILABLE\(.*\)'// sysroot/usr/local/include/IOKit/IOKitLib.h
|
||||
|
||||
- name: Build Mbed TLS
|
||||
run: |
|
||||
cd mbedtls-${{ env.MBEDTLS_VERSION }}
|
||||
cat ../patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch | patch -sN -d . -p1
|
||||
mkdir build
|
||||
cd build
|
||||
SDKROOT="${{ env.SDK }}" cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=true \
|
||||
-DCMAKE_SYSTEM_NAME=Darwin \
|
||||
-DCMAKE_C_COMPILER="${{ env.CC }}" \
|
||||
-DCMAKE_C_FLAGS='${{ env.CFLAGS }}' \
|
||||
-DCMAKE_FIND_ROOT_PATH="${{ env.DESTDIR }}" \
|
||||
-DCMAKE_INSTALL_PREFIX="${{ env.PREFIX }}" \
|
||||
-DMBEDTLS_PYTHON_EXECUTABLE="/usr/local/bin/python3" \
|
||||
-DENABLE_TESTING=OFF \
|
||||
-DENABLE_PROGRAMS=OFF \
|
||||
-DMBEDTLS_FATAL_WARNINGS=OFF \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR="/etc"
|
||||
gmake -j$(sysctl -n hw.ncpu) \
|
||||
SDKROOT="${{ env.SDK }}"
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build readline
|
||||
run: |
|
||||
cd readline-${{ env.READLINE_VERSION }}
|
||||
CC=clang CXX=clang++ ./configure ${{ env.CONFIGURE_ARGS }} ac_cv_type_sig_atomic_t=no
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build S-Lang
|
||||
run: |
|
||||
cd slang-${{ env.SLANG_VERSION }}
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }} \
|
||||
--without-x \
|
||||
--without-pcre \
|
||||
--without-onig \
|
||||
--without-z \
|
||||
--without-png \
|
||||
--without-iconv
|
||||
gmake -j$(sysctl -n hw.ncpu) static
|
||||
gmake -j$(sysctl -n hw.ncpu) install-static DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build popt
|
||||
run: |
|
||||
cd popt-popt-${{ env.POPT_VERSION }}-release
|
||||
autoreconf -fiv
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }} \
|
||||
--without-libiconv-prefix \
|
||||
--without-libintl-prefix \
|
||||
--disable-nls \
|
||||
--disable-werror
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build newt
|
||||
run: |
|
||||
cd newt-${{ env.NEWT_VERSION }}
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }} \
|
||||
--with-readline=gnu \
|
||||
--without-python \
|
||||
--without-tcl \
|
||||
--disable-nls
|
||||
gmake -j$(sysctl -n hw.ncpu) libnewt.a
|
||||
mkdir -p ${{ env.DESTDIR }}/usr/local/{lib/pkgconfig,include}
|
||||
install -m644 libnewt.pc ${{ env.DESTDIR }}/usr/local/lib/pkgconfig
|
||||
install -m644 libnewt.a ${{ env.DESTDIR }}/usr/local/lib
|
||||
install -m644 newt.h ${{ env.DESTDIR }}/usr/local/include
|
||||
cd ..
|
||||
|
||||
- name: Build libplist
|
||||
run: |
|
||||
cd libplist
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libimobiledevice-glue
|
||||
run: |
|
||||
cd libimobiledevice-glue
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libirecovery
|
||||
run: |
|
||||
sudo cp -a sysroot/usr/local/* /usr/local
|
||||
cd libirecovery
|
||||
autoreconf -fiv
|
||||
if [ "${{ matrix.os }}" != "macosx" ]; then
|
||||
gsed -i '/case kIOUSBTransactionTimeout/d' src/libirecovery.c
|
||||
fi
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
echo -e 'all:\ninstall:' > tools/Makefile
|
||||
make -j$(sysctl -n hw.ncpu) LIBS="-lncurses"
|
||||
make -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
install -m644 src/.libs/libirecovery-1.0.a ${{ env.DESTDIR }}${{ env.PREFIX }}/lib
|
||||
cd ..
|
||||
|
||||
- name: Build libusbmuxd
|
||||
run: |
|
||||
cd libusbmuxd
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libimobiledevice
|
||||
run: |
|
||||
cd libimobiledevice
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }} --with-mbedtls --enable-debug
|
||||
echo -e 'all:\ninstall:' > tools/Makefile
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build palera1n
|
||||
run: |
|
||||
cp -a sysroot/${{ env.PREFIX }}/{include,lib} dep_root
|
||||
find dep_root -name '*.dylib' -delete
|
||||
find dep_root -name '*.la' -delete
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
mkdir -p ready
|
||||
mv src/palera1n palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
dsymutil palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
strip palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
if [ "${{ matrix.os }}" == "macosx" ]; then
|
||||
ldid -S palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
else
|
||||
ldid -Ssrc/usb.xml palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
fi
|
||||
mkdir -p ready
|
||||
tar -zcf ready/dep_root-${{ matrix.os }}-${{ matrix.arch }}.tgz dep_root
|
||||
|
||||
- name: Upload artifact
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: wangyucode/[email protected]
|
||||
with:
|
||||
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
||||
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
||||
username: palera1n
|
||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||
forceUpload: true
|
||||
dryRun: false
|
||||
localDir: 'ready/'
|
||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
||||
|
||||
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||
retention-days: 1
|
||||
|
||||
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} debug symbols
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
|
||||
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
|
||||
retention-days: 1
|
||||
|
||||
darwin-dist:
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
runs-on: macos-latest
|
||||
needs: build-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Procursus
|
||||
uses: beerpiss/[email protected]
|
||||
with:
|
||||
packages: sed coreutils
|
||||
cache: true
|
||||
mirror: 'https://procursus.itsnebula.net/'
|
||||
|
||||
- name: Download all Darwin artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: Prepare artifact
|
||||
run: |
|
||||
find .
|
||||
lipo -create -arch arm64 ./palera1n-macosx-arm64/palera1n-macosx-arm64 -arch x86_64 ./palera1n-macosx-x86_64/palera1n-macosx-x86_64 -output palera1n-macos
|
||||
mkdir -p palera1n-macos.dSYM/Contents/Resources/DWARF
|
||||
cp ./palera1n-macosx-x86_64.dSYM/Contents/Info.plist palera1n-macos.dSYM/Contents
|
||||
lipo -create -arch arm64 palera1n-macosx-arm64.dSYM/Contents/Resources/DWARF/palera1n-macosx-arm64 -arch x86_64 palera1n-macosx-x86_64.dSYM/Contents/Resources/DWARF/palera1n-macosx-x86_64 -output palera1n-macos.dSYM/Contents/Resources/DWARF/palera1n-macos
|
||||
mkdir ready
|
||||
cp palera1n-macos ready/palera1n-macos-universal
|
||||
cp ./palera1n-macosx-x86_64/palera1n-macosx-x86_64 ready/palera1n-macos-x86_64
|
||||
cp ./palera1n-macosx-arm64/palera1n-macosx-arm64 ready/palera1n-macos-arm64
|
||||
cp ./palera1n-iphoneos-arm64/palera1n-iphoneos-arm64 ready/palera1n-ios
|
||||
zip -r9 ready/palera1n-ios.dSYM.zip palera1n-iphoneos-arm64.dSYM
|
||||
zip -r9 ready/palera1n-macos.dSYM.zip palera1n-macos.dSYM
|
||||
|
||||
- name: Build debs
|
||||
run: |
|
||||
make -j$(sysctl -n hw.ncpu) docs
|
||||
version=$(git describe --dirty --tags --abbrev=7 | sed 's|^v||' | sed 's|-beta|~beta|')
|
||||
|
||||
# Darwin x86_64
|
||||
mkdir -p stage/DEBIAN
|
||||
mkdir -p stage/opt/procursus/bin
|
||||
mkdir -p stage/opt/procursus/usr/share/man/man1
|
||||
cp packaging/control.macosx stage/DEBIAN/control
|
||||
|
||||
gsed 's|@DEB_ARCH@|darwin-amd64|g' -i stage/DEBIAN/control
|
||||
gsed "s|@DEB_VERSION@|$version|g" -i stage/DEBIAN/control
|
||||
|
||||
ginstall -Dm644 ready/palera1n-macos-x86_64 stage/opt/procursus/bin/palera1n
|
||||
ginstall -Dm644 docs/palera1n.1 stage/opt/procursus/usr/share/man/man1/palera1n.1
|
||||
chmod +x stage/opt/procursus/bin/palera1n
|
||||
|
||||
dpkg-deb -Zzstd -b stage palera1n_darwin-amd64.deb
|
||||
mv palera1n*.deb ready/
|
||||
rm -rf stage
|
||||
|
||||
# Darwin arm64
|
||||
mkdir -p stage/DEBIAN
|
||||
mkdir -p stage/opt/procursus/bin
|
||||
mkdir -p stage/opt/procursus/usr/share/man/man1
|
||||
cp packaging/control.macosx stage/DEBIAN/control
|
||||
|
||||
gsed 's|@DEB_ARCH@|darwin-arm64|g' -i stage/DEBIAN/control
|
||||
gsed "s|@DEB_VERSION@|$version|g" -i stage/DEBIAN/control
|
||||
|
||||
ginstall -Dm644 ready/palera1n-macos-arm64 stage/opt/procursus/bin/palera1n
|
||||
ginstall -Dm644 docs/palera1n.1 stage/opt/procursus/usr/share/man/man1/palera1n.1
|
||||
chmod +x stage/opt/procursus/bin/palera1n
|
||||
|
||||
dpkg-deb -Zzstd -b stage palera1n_darwin-arm64.deb
|
||||
mv palera1n*.deb ready/
|
||||
rm -rf stage
|
||||
|
||||
# iPhoneOS
|
||||
mkdir -p stage/DEBIAN
|
||||
mkdir -p stage/usr/bin
|
||||
mkdir -p stage/usr/share/man/man1
|
||||
cp packaging/control stage/DEBIAN/control
|
||||
|
||||
gsed 's|@DEB_ARCH@|iphoneos-arm|g' -i stage/DEBIAN/control
|
||||
gsed "s|@DEB_VERSION@|$version|g" -i stage/DEBIAN/control
|
||||
|
||||
ginstall -Dm644 ready/palera1n-ios stage/usr/bin/palera1n
|
||||
ginstall -Dm644 docs/palera1n.1 stage/usr/share/man/man1/palera1n.1
|
||||
chmod +x stage/usr/bin/palera1n
|
||||
|
||||
dpkg-deb -Zzstd -b stage palera1n_iphoneos-arm.deb
|
||||
mv palera1n*.deb ready/
|
||||
rm -rf stage
|
||||
|
||||
# iPhoneOS (rootless)
|
||||
mkdir -p stage/DEBIAN
|
||||
mkdir -p stage/var/jb/usr/bin
|
||||
mkdir -p stage/var/jb/usr/share/man/man1
|
||||
cp packaging/control stage/DEBIAN/control
|
||||
|
||||
gsed 's|@DEB_ARCH@|iphoneos-arm64|g' -i stage/DEBIAN/control
|
||||
gsed "s|@DEB_VERSION@|$version|g" -i stage/DEBIAN/control
|
||||
|
||||
ginstall -Dm644 ready/palera1n-ios stage/var/jb/usr/bin/palera1n
|
||||
ginstall -Dm644 docs/palera1n.1 stage/var/jb/usr/share/man/man1/palera1n.1
|
||||
chmod +x stage/var/jb/usr/bin/palera1n
|
||||
|
||||
dpkg-deb -Zzstd -b stage palera1n_iphoneos-arm64.deb
|
||||
mv palera1n*.deb ready/
|
||||
rm -rf stage
|
||||
|
||||
- name: Upload artifact
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: wangyucode/[email protected]
|
||||
with:
|
||||
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
||||
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
||||
username: palera1n
|
||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||
forceUpload: true
|
||||
dryRun: false
|
||||
localDir: 'ready/'
|
||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
||||
|
||||
build-Linux:
|
||||
strategy:
|
||||
matrix:
|
||||
triple:
|
||||
- i486-linux-musl
|
||||
- x86_64-linux-musl
|
||||
- armel-linux-musleabi
|
||||
- aarch64-linux-musl
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
MBEDTLS_VERSION: 3.3.0
|
||||
LIBUSB_VERSION: 1.0.26
|
||||
READLINE_VERSION: 8.2
|
||||
SLANG_VERSION: 2.3.3
|
||||
NEWT_VERSION: 0.52.23
|
||||
GPM_VERSION: 1.20.7
|
||||
POPT_VERSION: 1.19
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install build dependencies (packages)
|
||||
run: |
|
||||
sudo apt-get remove -y libssl-dev libreadline-dev
|
||||
sudo apt-get install -y pkg-config autoconf automake autopoint mandoc
|
||||
sudo pip3 install jsonschema jinja2
|
||||
|
||||
- name: Download toolchain checksum
|
||||
run: |
|
||||
curl -LO https://musl.cc/SHA512SUMS
|
||||
echo "TOOLCHAIN_CHECKSUM="$(grep ${{ matrix.triple }}-cross.tgz SHA512SUMS | cut -d' ' -f1) >> $GITHUB_ENV
|
||||
|
||||
- name: Download toolchain (cached)
|
||||
id: toolchain_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ matrix.triple }}-cross.tgz
|
||||
key: ${{ matrix.triple }}-${{ env.TOOLCHAIN_CHECKSUM }}-toolchain
|
||||
|
||||
- name: Download toolchain
|
||||
if: steps.toolchain_cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
curl -LO https://musl.cc/${{ matrix.triple }}-cross.tgz
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
tar -xf ${{ matrix.triple }}-cross.tgz
|
||||
mkdir sysroot
|
||||
echo "$(pwd)/${{ matrix.triple }}-cross/bin" >> $GITHUB_PATH
|
||||
case ${{ matrix.triple }} in
|
||||
i486-linux-musl)
|
||||
echo "CHECKRA1N_NAME=linux-x86" >> $GITHUB_ENV
|
||||
echo "ARCH_NAME=i386" >> $GITHUB_ENV
|
||||
;;
|
||||
x86_64-linux-musl)
|
||||
echo "CHECKRA1N_NAME=linux-x86_64" >> $GITHUB_ENV
|
||||
echo "ARCH_NAME=amd64" >> $GITHUB_ENV
|
||||
;;
|
||||
armel-linux-musleabi)
|
||||
echo "CHECKRA1N_NAME=linux-armel" >> $GITHUB_ENV
|
||||
echo "ARCH_NAME=armel" >> $GITHUB_ENV
|
||||
;;
|
||||
aarch64-linux-musl)
|
||||
echo "CHECKRA1N_NAME=linux-arm64" >> $GITHUB_ENV
|
||||
echo "ARCH_NAME=arm64" >> $GITHUB_ENV
|
||||
;;
|
||||
esac
|
||||
echo "PKG_CONFIG_PATH=$(pwd)/sysroot/usr/local/lib/pkgconfig" >> $GITHUB_ENV
|
||||
echo "CFLAGS=-g -fdata-sections -ffunction-sections -I$(pwd)/sysroot/usr/local/include -L$(pwd)/sysroot/usr/local/lib" >> $GITHUB_ENV
|
||||
echo "CXXFLAGS=-g -fdata-sections -ffunction-sections -I$(pwd)/sysroot/usr/local/include -L$(pwd)/sysroot/usr/local/lib" >> $GITHUB_ENV
|
||||
echo "LDFLAGS=-g -Wl,--gc-sections -fdata-sections -ffunction-sections -I$(pwd)/sysroot/usr/local/include -L$(pwd)/sysroot/usr/local/lib" >> $GITHUB_ENV
|
||||
echo "INSTALL=$(command -v install) --strip-program=${{ matrix.triple }}-strip" >> $GITHUB_ENV
|
||||
echo "DESTDIR=$(pwd)/sysroot" >> $GITHUB_ENV
|
||||
echo "PREFIX=/usr/local" >> $GITHUB_ENV
|
||||
echo "CONFIGURE_ARGS=--build=x86_64-linux-gnu --host=${{ matrix.triple }} --prefix=/usr/local --disable-shared --enable-static" >> $GITHUB_ENV
|
||||
echo "CROSS_COMPILE=${{ matrix.triple }}-" >> $GITHUB_ENV
|
||||
mkdir -p $(pwd)/sysroot/usr/local/lib
|
||||
ln -sf $(pwd)/sysroot/usr/local/lib{,64}
|
||||
|
||||
- name: Download dependencies (source code)
|
||||
run: |
|
||||
curl -LOOOOOOO \
|
||||
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${{ env.MBEDTLS_VERSION }}.tar.gz \
|
||||
https://github.com/libusb/libusb/releases/download/v${{ env.LIBUSB_VERSION }}/libusb-${{ env.LIBUSB_VERSION }}.tar.bz2 \
|
||||
https://mirror-hk.koddos.net/gnu/readline/readline-${{ env.READLINE_VERSION }}.tar.gz \
|
||||
https://www.jedsoft.org/releases/slang/slang-${{ env.SLANG_VERSION }}.tar.bz2 \
|
||||
https://releases.pagure.org/newt/newt-${{ env.NEWT_VERSION }}.tar.gz \
|
||||
https://github.com/telmich/gpm/archive/refs/tags/${{ env.GPM_VERSION }}.tar.gz \
|
||||
https://github.com/rpm-software-management/popt/archive/refs/tags/popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||
|
||||
tar -xf v${{ env.MBEDTLS_VERSION }}.tar.gz
|
||||
tar -xjf libusb-${{ env.LIBUSB_VERSION }}.tar.bz2
|
||||
tar -xf readline-${{ env.READLINE_VERSION }}.tar.gz
|
||||
tar -xjf slang-${{ env.SLANG_VERSION }}.tar.bz2
|
||||
tar -xf newt-${{ env.NEWT_VERSION }}.tar.gz
|
||||
tar -xf ${{ env.GPM_VERSION }}.tar.gz
|
||||
tar -xf popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libusbmuxd
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice
|
||||
|
||||
- name: Build Mbed TLS
|
||||
run: |
|
||||
cd mbedtls-${{ env.MBEDTLS_VERSION }}
|
||||
cat ../patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch | patch -sN -d . -p1
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=true \
|
||||
-DCMAKE_SYSTEM_NAME=Linux \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(echo ${{ matrix.triple }} | cut -d- -f1) \
|
||||
-DCMAKE_C_COMPILER='${{ env.CROSS_COMPILE }}gcc' \
|
||||
-DCMAKE_C_FLAGS='${{ env.CFLAGS }}' \
|
||||
-DCMAKE_CXX_FLAGS='${{ env.CXXFLAGS }}' \
|
||||
-DCMAKE_FIND_ROOT_PATH="${{ env.DESTDIR }}" \
|
||||
-DCMAKE_INSTALL_PREFIX="${{ env.PREFIX }}" \
|
||||
-DENABLE_TESTING=OFF \
|
||||
-DENABLE_PROGRAMS=OFF \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR="/etc"
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libusb
|
||||
run: |
|
||||
cd libusb-${{ env.LIBUSB_VERSION }}
|
||||
./configure ${{ env.CONFIGURE_ARGS }} --disable-udev
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build readline
|
||||
run: |
|
||||
cd readline-${{ env.READLINE_VERSION }}
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build S-Lang
|
||||
run: |
|
||||
cd slang-${{ env.SLANG_VERSION }}
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }} \
|
||||
--without-x \
|
||||
--without-pcre \
|
||||
--without-onig \
|
||||
--without-z \
|
||||
--without-png \
|
||||
--without-iconv
|
||||
gmake -j$(sysctl -n hw.ncpu) static
|
||||
gmake -j$(sysctl -n hw.ncpu) install-static DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build GPM
|
||||
run: |
|
||||
cd gpm-${{ env.GPM_VERSION }}
|
||||
cat ../patches/gpm/*.patch | patch -sN -d . -p1
|
||||
./autogen.sh
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }}
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build popt
|
||||
run: |
|
||||
cd popt-popt-${{ env.POPT_VERSION }}-release
|
||||
autoreconf -fiv
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }} \
|
||||
--without-libiconv-prefix \
|
||||
--without-libintl-prefix \
|
||||
--disable-nls \
|
||||
--disable-werror
|
||||
gmake -j$(sysctl -n hw.ncpu)
|
||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build newt
|
||||
run: |
|
||||
cd newt-${{ env.NEWT_VERSION }}
|
||||
./configure \
|
||||
${{ env.CONFIGURE_ARGS }} \
|
||||
--with-readline=gnu \
|
||||
--without-python \
|
||||
--without-tcl \
|
||||
--disable-nls \
|
||||
--with-gpm-support
|
||||
gmake -j$(sysctl -n hw.ncpu) libnewt.a
|
||||
mkdir -p ${{ env.DESTDIR }}/usr/local/{lib/pkgconfig,include}
|
||||
install -m644 libnewt.pc ${{ env.DESTDIR }}/usr/local/lib/pkgconfig
|
||||
install -m644 libnewt.a ${{ env.DESTDIR }}/usr/local/lib
|
||||
install -m644 newt.h ${{ env.DESTDIR }}/usr/local/include
|
||||
cd ..
|
||||
|
||||
- name: Build libplist
|
||||
run: |
|
||||
cd libplist
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libimobiledevice-glue
|
||||
run: |
|
||||
cd libimobiledevice-glue
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libirecovery (sorta)
|
||||
run: |
|
||||
sudo mv /usr/local /usr/local.bak
|
||||
sudo ln -s ${{ env.DESTDIR }}${{ env.PREFIX }} /usr/local
|
||||
cd libirecovery
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
echo -e 'all:\ninstall:' > tools/Makefile
|
||||
make -ij$(nproc)
|
||||
make -ij$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
install -m644 src/.libs/libirecovery-1.0.a ${{ env.DESTDIR }}${{ env.PREFIX }}/lib
|
||||
cd ..
|
||||
|
||||
- name: Build libusbmuxd
|
||||
run: |
|
||||
cd libusbmuxd
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }}
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
|
||||
- name: Build libimobiledevice
|
||||
run: |
|
||||
cd libimobiledevice
|
||||
autoreconf -fiv
|
||||
./configure ${{ env.CONFIGURE_ARGS }} --with-mbedtls --enable-debug
|
||||
echo -e 'all:\ninstall:' > tools/Makefile
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||
cd ..
|
||||
sudo rm /usr/local
|
||||
sudo mv /usr/local.bak /usr/local
|
||||
|
||||
- name: Build palera1n
|
||||
run: |
|
||||
cp -a sysroot/${{ env.PREFIX }}/{include,lib} dep_root
|
||||
find dep_root -name '*.so' -delete
|
||||
find dep_root -name '*.la' -delete
|
||||
CC="${{ matrix.triple }}-gcc" make -j$(nproc)
|
||||
|
||||
- name: Seperate debug symbols
|
||||
run: |
|
||||
${{ matrix.triple }}-objcopy --only-keep-debug src/palera1n palera1n.debug
|
||||
${{ matrix.triple }}-strip --strip-debug --strip-unneeded src/palera1n
|
||||
${{ matrix.triple }}-objcopy --add-gnu-debuglink=palera1n.debug src/palera1n
|
||||
chmod -x palera1n.debug
|
||||
|
||||
- name: Prepare artifact
|
||||
run: |
|
||||
mkdir ready
|
||||
mv palera1n.debug ready/palera1n-${{ env.CHECKRA1N_NAME }}.debug
|
||||
mv src/palera1n ready/palera1n-${{ env.CHECKRA1N_NAME }}
|
||||
tar -zcf ready/dep_root_${{ matrix.triple }}.tgz dep_root
|
||||
|
||||
- name: Build debs
|
||||
run: |
|
||||
version=$(git describe --dirty --tags --abbrev=7 | sed 's|^v||' | sed 's|-beta|~beta|')
|
||||
|
||||
make -j$(nproc) docs
|
||||
mkdir -p stage/DEBIAN
|
||||
mkdir -p stage/usr/bin
|
||||
mkdir -p stage/usr/share/man/man1
|
||||
cp packaging/control stage/DEBIAN/control
|
||||
|
||||
sed 's|@DEB_ARCH@|${{ env.ARCH_NAME }}|g' -i stage/DEBIAN/control
|
||||
sed "s|@DEB_VERSION@|$version|g" -i stage/DEBIAN/control
|
||||
|
||||
install -Dm644 ready/palera1n-${{ env.CHECKRA1N_NAME }} stage/usr/bin/palera1n
|
||||
install -Dm644 docs/palera1n.1 stage/usr/share/man/man1/palera1n.1
|
||||
chmod +x stage/usr/bin/palera1n
|
||||
|
||||
dpkg-deb -b stage palera1n_${{ env.ARCH_NAME }}.deb
|
||||
mv palera1n*.deb ready/
|
||||
rm -rf stage
|
||||
|
||||
- name: Upload artifact
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: wangyucode/[email protected]
|
||||
with:
|
||||
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
||||
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
||||
username: palera1n
|
||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||
forceUpload: true
|
||||
dryRun: false
|
||||
localDir: 'ready/'
|
||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
||||
@@ -0,0 +1,27 @@
|
||||
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: |
|
||||
git submodule update --remote
|
||||
|
||||
- name: Commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Update submodules
|
||||
+21
-24
@@ -1,25 +1,22 @@
|
||||
contrib/**
|
||||
dep_root/**
|
||||
!dep_root/.keep
|
||||
!contrib/.keep
|
||||
contrib/
|
||||
*.o
|
||||
.vscode
|
||||
checkra1n*
|
||||
payload.c
|
||||
src/palera1n
|
||||
!xxd-embedded.h
|
||||
src/binpack.dmg
|
||||
src/ramdisk.dmg
|
||||
src/xxd-*.c
|
||||
.DS_Store
|
||||
!palera1n.1
|
||||
palera1n.1.html
|
||||
Payload
|
||||
docs/*.html
|
||||
build
|
||||
src/*.dmg.c
|
||||
.idea
|
||||
src/stage2/
|
||||
src/libcheckra1nhelper.dylib*
|
||||
src/Pongo.bin
|
||||
*/.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
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "ramdisk"]
|
||||
path = ramdisk
|
||||
url = https://github.com/palera1n/ramdisk
|
||||
@@ -0,0 +1,51 @@
|
||||
# Changelog
|
||||
|
||||
## 1.4.2
|
||||
- Add iOS 16.4 support
|
||||
- Various fixes
|
||||
|
||||
## 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
|
||||
+306
@@ -0,0 +1,306 @@
|
||||
|
||||
# Common Issues
|
||||
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. ["Booted device" but not booted](#booted-device-but-not-booted)
|
||||
2. [NewTerm not launching](#newterm-not-launching)
|
||||
3. [palera1n/mineek repo not working](#palera1nmineek-repo-not-working)
|
||||
4. [Procursus "killed 9"](#procursus-killed-9)
|
||||
5. [App crashes on open](#app-crashes-on-open)
|
||||
6. ["Killed" issue (*not* "Killed: 9")](#killed-issue-not-killed-9)
|
||||
7. [Please reinstall Sileo via SSH](#please-reinstall-sileo-via-ssh)
|
||||
8. [Loader app not appearing](#loader-app-not-appearing)
|
||||
9. [Your local changes would be overwritten by checkout](#your-local-changes-would-be-overwritten-by-checkout)
|
||||
10. [Could not connect to lockdownd](#could-not-connect-to-lockdownd)
|
||||
11. [Package is in a very bad inconsistent state](#package-is-in-a-very-bad-inconsistent-state)
|
||||
12. [Error installing bootstrap. Status: -1](#error-installing-bootstrap-status--1)
|
||||
13. [jbinit DIED!](#jbinit-died)
|
||||
14. [Daemons crashing on iOS 16.2+](#daemons-crashing-on-ios-162)
|
||||
15. [Panics making loader not appear](#panics-making-loader-not-appear)
|
||||
16. [libhooker wants to install?](#libhooker-wants-to-install)
|
||||
17. [Pressing "install" on each jb](#pressing-install-on-each-jb)
|
||||
18. [--restorerootfs still keeps app icons??](#--restorerootfs-still-keeps-app-icons)
|
||||
19. [Device boots out of DFU](#device-boots-out-of-dfu)
|
||||
20. [How to fix RocketBootstrap](#how-to-fix-rocketbootstrap)
|
||||
21. [SEP Panic: :skg /skgs](#sep-panic-skg-skgs)
|
||||
22. [Cannot download apps from the App Store](#cannot-download-apps-from-the-app-store)
|
||||
23. [Snowboard theming incorrectly](#snowboard-theming-incorrectly)
|
||||
24. [End-of-central-directory signature not found](#end-of-central-directory-signature-not-found)
|
||||
25. [Filza crashing on launch](#filza-crashing-on-launch)
|
||||
26. [dpkg error: Read-only file system](#dpkg-error-read-only-file-system)
|
||||
27. [Library not loaded: /usr/lib/libSystem.B.dylib](#library-not-loaded-usrliblibsystembdylib)
|
||||
28. [Stuck at waiting for network](#stuck-at-waiting-for-network)
|
||||
29. [No space left on device](#no-space-left-on-device)
|
||||
30. [Found the USB handle followed by an error occurred](#found-the-usb-handle-followed-by-an-error-occurred)
|
||||
31. [pip error: legacy-install-failure](#pip-error-legacy-install-failure)
|
||||
|
||||
## \"Booted device\" but not booted
|
||||
This may happen when the downloading and patching process is interrupted. Please run `./palera1n.sh clean` (use with `sudo` if on Linux), then try again.
|
||||
If that doesn't fix it, it may be caused by an update from the Procursus repo. The quickest way to fix it is to [restore rootfs](https://ios.cfw.guide/removing-palera1n/). Alternatively, you can manually restore `/usr/libexec/dirs_cleaner` from the rootfs snapshot using the SSHRD script.
|
||||
|
||||
## NewTerm not launching
|
||||
Install NewTerm 2 from [https://apt.itsnebula.net/](https://apt.itsnebula.net/ "https://apt.itsnebula.net/") or get NewTerm3 beta.
|
||||
|
||||
## palera1n\/mineek repo not working
|
||||
[https://repo.palera.in/](https://repo.palera.in/ "https://repo.palera.in/") and [https://mineek.github.io/repo](https://mineek.github.io/repo "https://mineek.github.io/repo") are supposed to be used on rootless jailbreaks, not with any rootful jailbreaks with fakefs or tethered that have root access.
|
||||
|
||||
## Procursus \"killed 9\"
|
||||
Binaries will need to be resigned by the Procursus Team to fix Killed: 9. In the meantime, use the palera1n strap repo. you can install it from [nebula’s repo](https://apt.itsnebula.net).
|
||||
|
||||
## App crashes on open
|
||||
Refer to [this](#how-to-fix-rocketbootstrap) first.
|
||||
|
||||
Otherwise, run this in NewTerm or SSH
|
||||
- `ldid -s /Applications/<appname>.app`
|
||||
- Don't include the <>
|
||||
|
||||
## \"Killed\" issue \(*not* \"Killed: 9\"\)
|
||||
You ran out of RAM on the Linux Live CD.
|
||||
|
||||
Ways to fix the issue, ordered by which to try first:
|
||||
1. Close some apps, like Discord
|
||||
2. Attempt a shallow clone, `git clone --depth=1` in place of `git clone`
|
||||
3. Clone palera1n onto persistent storage[note 1]
|
||||
4. Install Linux onto your computer.
|
||||
|
||||
**Note 1: How to use persistent storage from Linux Live, with terminal**
|
||||
1. If you have already cloned palera1n, please delete it! Usually this can be done with `sudo rm -rf ~/palera1n` (assuming palera1n cloned into home directory)
|
||||
2. You may want to install ntfs-3g first, on Ubuntu this can be done by running `sudo apt install ntfs-3g`
|
||||
3. Run `sudo lsblk` to list your disks
|
||||
4. Locate the persistent storage you want to use, for example a Windows C: drive would be of type "ntfs" and at least 10 GB in size, take a note of the device name, which starts with /dev
|
||||
5. Mount disk onto `/mnt` *(example, please don’t paste as is)*: `sudo mount -t ntfs /dev/sda3 /mnt`
|
||||
6. Change the working directory into `/mnt`: `cd /mnt`
|
||||
7. Try to clone palera1n again
|
||||
|
||||
**Note 2: Most Linux Installers will set up swap areas automatically during the install if you use guided partitioning (if such option exists)**
|
||||
In order to create a 2GB swap area as root:
|
||||
1. Run `dd if=/dev/zero of=/swapfile bs=1M count=2048`
|
||||
2. Run `chmod 600 /swapfile`
|
||||
3. Format by running `mkswap /swapfile`
|
||||
4. Open /etc/fstab in an editor like `nano`, then add a line that is `/swapfile none swap sw 0 0`
|
||||
5. Run `swapon /swapfile`
|
||||
|
||||
## Please reinstall Sileo via SSH
|
||||
If you have AutoSign installed and you reinstall/update Sileo, you'll get the error message shown in the screenshot. Here's how to fix it.
|
||||
|
||||
1. Get access to a terminal by either using SSH or NewTerm
|
||||
2. Run `sudo apt remove autosign`. Unless you changed it, the password is `alpine`
|
||||
3. Once it's done, run `sudo apt reinstall org.coolstar.sileo`
|
||||
4. Try running Sileo again. Feel free to upgrade it if that was what you were planning to do.
|
||||
5. Install AutoSign again
|
||||
|
||||
It should be fixed after these steps.
|
||||
|
||||
Example image:
|
||||

|
||||
|
||||
|
||||
**Note**: Some tweaks (e.g. Watusi) are known to not work with this method.
|
||||
|
||||
## Loader app not appearing
|
||||
Try these steps:
|
||||
1. Check if [this shortcut](https://www.icloud.com/shortcuts/8cd5f489c8854ee0ab9ee38f2e62f87d) opens it
|
||||
2. Check for any panic logs by going to
|
||||
1. Settings
|
||||
2. Privacy
|
||||
3. Analytics & Improvements
|
||||
4. Analytics Data
|
||||
- If there are any, send the **latest** one that starts with `panic-full`
|
||||
- **Please do not send any other device log**
|
||||
3. If these steps above don't work, [restore rootfs](https://ios.cfw.guide/removing-palera1n/) and rejailbreak
|
||||
|
||||
If none of these help, make sure you're waiting enough time [for the respring] (15-30 seconds).
|
||||
|
||||
On iPads, if other apps don’t appear along side the loader, try installing TrollStore Helper from the [Havoc repo](https://havoc.app) and use it to install TrollStore.
|
||||
|
||||
## Your local changes would be overwritten by checkout
|
||||
Run the following commands, and then try again:
|
||||
- `cd ramdisk`
|
||||
- `git stash`
|
||||
- `git stash drop`
|
||||
- `cd ..`
|
||||
|
||||
## Could not connect to lockdownd
|
||||
**Mux error (-8)**
|
||||
- Unplug and plug your device back in
|
||||
|
||||
**Pairing dialog response pending (-19)**
|
||||
- Accept the prompt to trust the computer on your device.
|
||||
|
||||
**Invalid HostID (-21)**
|
||||
1. Run `idevicepair pair` (use `sudo` on Linux)
|
||||
2. Accept the prompt to trust the computer on your device if needed
|
||||
3. Run `idevicepair pair` again (use `sudo` on Linux)
|
||||
- Alternatively, try entering [recovery mode manually](https://support.apple.com/en-us/HT201263 "enter recovery mode") before jailbreaking.
|
||||
|
||||
## Package is in a very bad inconsistent state
|
||||
You can fix this by running this command in a terminal:
|
||||
- `sudo dpkg -r --force-remove-reinstreq <PACKAGE_NAME>`
|
||||
- Don't include the <>
|
||||
|
||||
## Error installing bootstrap. Status: \-1
|
||||
You're not jailbroken. Sideloading the loader app on its own **will not work**.
|
||||
|
||||
Please run the palera1n script on your computer to jailbreak your device.
|
||||
|
||||
## jbinit DIED!
|
||||
Your device may get stuck on a verbose boot screen, and if you look closely you'll see a "jbinit DIED!" error near the top.
|
||||
|
||||
The simplest way to fix this is `rm -rf blobs` (use `sudo` if on Linux), then force reboot your device and try to jailbreak again.
|
||||
|
||||
**For advanced users**:
|
||||
You can also try re-copying the `other/rootfs` files manually to the device using SSHRD.
|
||||
|
||||
## Daemons crashing on iOS 16.2+
|
||||
Substitute may cause daemons to crash on iOS 16.2 and above. It's recommended to downgrade to iOS 16.1.2 or below for now.
|
||||
- If you don't have blobs saved, you can downgrade to 15.6 RC and delay OTA to 16.1.2. This expires in a month.
|
||||
|
||||
Or you can try using ElleKit instead, but note that some tweaks don't yet work with it.
|
||||
<details>
|
||||
<summary>How to Install ElleKit</summary>
|
||||
<code>sudo rmdir /usr/lib/TweakInject
|
||||
sudo ln -s /Library/MobileSubstrate/DynamicLibraries /usr/lib/TweakInject
|
||||
sudo mv /Library/MobileSubstrate/DynamicLibraries/MobileSafety.dylib{,.disabled}
|
||||
sudo mkdir -p /Library/Frameworks/CydiaSubstrate.framework
|
||||
sudo ln -s /usr/lib/libsubstrate.dylib /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate
|
||||
sudo /usr/libexec/ellekit/loader
|
||||
sudo mkdir -p /etc/rc.d
|
||||
sudo ln -s /usr/libexec/ellekit/loader /etc/rc.d/ellekit-loader
|
||||
launchctl reboot userspace</code>
|
||||
|
||||
Then launch daemons in loader.
|
||||
</details>
|
||||
|
||||
## Panics making loader not appear
|
||||
You may be encountering some issue related to panics and the loader “not appearing”, on A10+ make sure you have your passcode **disabled** before jailbreaking.
|
||||
|
||||
## libhooker wants to install?
|
||||
**Remove the Chimera and Odyssey repo immediately!**
|
||||
|
||||
These repos are not meant to be used with palera1n and are able to break your jailbreak if you install anything from them.
|
||||
|
||||
## Pressing \"install\" on each jb
|
||||
**DO NOT DO THIS.** It resets your package lists and will likely break your jailbreak install eventually. Instead, press the gear icon, and then press Do All.
|
||||
|
||||
If you managed to mess up your jailbreak this way, [restore rootfs](https://ios.cfw.guide/removing-palera1n/).
|
||||
|
||||
## --restorerootfs still keeps app icons??
|
||||
There's an issue with restoring rootfs where it doesn’t uicache. **There is no need to worry**; this happens on a couple of other jailbreaks and serves no harm to the user or device.
|
||||
|
||||
Example image:
|
||||

|
||||
|
||||
## Device boots out of DFU
|
||||
Make sure to use a USB-A cable, and follow one of the methods below to enter DFU.
|
||||
|
||||
**Method 1**
|
||||
1. Make sure your device is in either normal or recovery mode.
|
||||
2. Connect your device to your computer.
|
||||
3. Run `./palera1n.sh dfuhelper` (use `sudo` if on Linux).
|
||||
4. Follow the on-screen instructions.
|
||||
|
||||
**Method 2**
|
||||
1. Power off your device.
|
||||
2. Connect it to your computer or a charger.
|
||||
3. As soon as the Apple logo comes on, start doing the [DFU mode sequence](https://help.ifixit.com/article/108-dfu-restore).
|
||||
|
||||
## How to fix RocketBootstrap
|
||||
If you have Ryan Petrich's RocketBootstrap installed on iOS 15 or above, it may cause nearly every app to crash or even respring loops, especially when Cephei is also installed. To fix this, follow the steps below.
|
||||
|
||||
1. Uninstall any existing version of RocketBootstrap you have installed
|
||||
2. Remove the Odyssey repo if you have it
|
||||
3. Install RocketBootstrap from [this repo](https://rpetri.ch/repo).
|
||||
4. Install RocketBootstrapFix from [this repo](https://repo.alexia.lol/).
|
||||
|
||||
This is an updated fix that should work with more tweaks than the Odyssey version.
|
||||
|
||||
## SEP Panic: :skg /skgs
|
||||
This happens due to having a passcode set on A10-A11 devices when jailbreaking (or having previously set a passcode on iOS 16, even if it's currently turned off).
|
||||
|
||||
If you are on A10, use [checkp4le](https://github.com/guacaplushy/checkp4le).
|
||||
<details>
|
||||
<summary>Why?</summary>
|
||||
checkp4le boots with checkra1n using a custom kernel patchfinder, which allows SEP to be re-enabled on A10
|
||||
</details>
|
||||
|
||||
If you are on A11
|
||||
- iOS 15
|
||||
- Turn off your passcode and try jailbreaking again.
|
||||
- iOS 16
|
||||
1. Turn off your passcode
|
||||
2. Backup your device
|
||||
3. Erase from settings or restore from iTunes/Finder
|
||||
4. Restore the backup.
|
||||
5. Then try jailbreaking again.
|
||||
|
||||
If you don't want to use checkp4le and just want to have a passcode, or if you're on A11, you can use FakePass from [this repo](https://repo.alexia.lol/) to have a passcode. However, this will only work in a jailbroken state (it can be bypassed by simply rebooting the device).
|
||||
|
||||
## Cannot download apps from the App Store
|
||||
Install Choicy from [this repo](https://opa334.github.io) and disable tweak injection into the App Store.
|
||||
|
||||
Alternatively, disable tweak injection globally in the Substitute app and respring. You can re-enable it after downloading the apps you wanted.
|
||||
|
||||
## Snowboard theming incorrectly
|
||||
You may be encountering an issue with Snowboard not theming correctly or not theming at all. To fix this, make sure you have Snowboard from [SparkDev's repo](https://sparkdev.me).
|
||||
|
||||
Example image:
|
||||

|
||||
|
||||
## End-of-central-directory signature not found
|
||||
If the unzip error message it cannot find "`palera1n.zip(.ZIP, period.)`", you are running an outdated version of palera1n and need to update using `git pull`. If this doesn't work, reclone the palera1n repository by running `cd .. && sudo rm -rf palera1n && sudo git clone --recursive --depth=1 --shallow-submodules https://github.com/palera1n/palera1n && cd palera1n`.
|
||||
|
||||
Otherwise, this error most likely indicates a problem with your internet connection, and you simply need to try running palera1n again.
|
||||
|
||||
## Filza crashing on launch
|
||||
Install the latest version of Filza from the [TIGI Software repo](https://www.tigisoftware.com/repo). **The version on BigBoss is outdated**. You do not need AutoSign or FilzaFixer anymore.
|
||||
|
||||
## dpkg error: Read-only file system
|
||||
- Open the palera1n loader app
|
||||
- Press the gear icon
|
||||
- Remount R/W
|
||||
|
||||
Then try again.
|
||||
|
||||
## Library not loaded: /usr/lib/libSystem.B.dylib
|
||||
This usually means the fakefs wasn't created properly. It might be left over from a restore. [Restore rootfs](https://ios.cfw.guide/removing-palera1n/) and try jailbreaking again.
|
||||
|
||||
## Stuck at `waiting for network`
|
||||
This is usually caused by a network issue.
|
||||
|
||||
1. Make sure you're on the latest commit (`git pull`)
|
||||
2. Make sure you can access [this site](https://static.palera.in/)
|
||||
|
||||
If you can access it but the script still doesn't work, your network may be unstable or certain outgoing requests may be blocked. If you cannot access it, this may mean that your network is blocking it, or it's currently down.
|
||||
|
||||
## No space left on device
|
||||
This means that either your iDevice or your computer does not have enough storage.
|
||||
|
||||
If you're live booting Linux and have a low amount of RAM, follow [this](#killed-issue-not-killed-9).
|
||||
|
||||
If you're using semi-tethered and have less than 10GB available on the iDevice, this may be the issue. Please [restore rootfs](https://ios.cfw.guide/removing-palera1n/) and clear some space on your device. Usually if this is the issue, the console is spammed many times with `No space left on device` or `File or directory not found.`
|
||||
|
||||
## Found the USB handle followed by an error occurred
|
||||
This will happen if the device is in a bad DFU state, which could randomly happen, or if you held the 2nd DFU button for too long (volume down on iPhone X, for example).
|
||||
|
||||
Reboot the device and rerun the script, and make sure to follow the DFU helper exactly, and let go as soon as it says it found the device in DFU.
|
||||
|
||||
## pip error: legacy-install-failure
|
||||
- **Ubuntu/Debian**
|
||||
- `sudo apt install python3-dev`
|
||||
- **Fedora**
|
||||
- `sudo dnf install python3-devel`
|
||||
- **openSUSE**
|
||||
- `sudo zypper install python3-devel`
|
||||
- **macOS**
|
||||
- Install the Xcode Command Line Tools by running
|
||||
- `xcode-select --install`
|
||||
|
||||
- If it still doesn't work, try this command:
|
||||
- `ARCHFLAGS="-arch $(uname -m)" python3 -m pip install --compile pyimg4`
|
||||
|
||||
<br>
|
||||
|
||||
### If none of these solve your issue, please join the [Discord server](https://dsc.gg/palera1n).
|
||||
@@ -1,20 +1,674 @@
|
||||
Copyright 2023 palera1n team
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
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:
|
||||
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.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
Preamble
|
||||
|
||||
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 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,88 +0,0 @@
|
||||
NAME = bakepale
|
||||
|
||||
SRC = $(shell pwd)
|
||||
DEP = $(SRC)/dep_root
|
||||
STRIP = strip
|
||||
CC ?= cc
|
||||
CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC)
|
||||
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\"
|
||||
CFLAGS += -Wno-unused-variable -I$(SRC)/src -std=c99 -pedantic-errors -D_C99_SOURCE -D_POSIX_C_SOURCE=200112L
|
||||
LIBS += $(DEP)/lib/libimobiledevice-1.0.a $(DEP)/lib/libirecovery-1.0.a $(DEP)/lib/libusbmuxd-2.0.a
|
||||
LIBS += $(DEP)/lib/libimobiledevice-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread
|
||||
ifeq ($(TARGET_OS),)
|
||||
TARGET_OS = $(shell uname -s)
|
||||
endif
|
||||
ifeq ($(TARGET_OS),Darwin)
|
||||
CFLAGS += -Wno-nullability-extension
|
||||
ifeq (,$(findstring version-min=, $(CFLAGS)))
|
||||
CFLAGS += -mmacosx-version-min=10.8
|
||||
endif
|
||||
LDFLAGS += -Wl,-dead_strip
|
||||
LIBS += -framework CoreFoundation -framework IOKit
|
||||
else
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
LDFLAGS += -static -no-pie -Wl,--gc-sections
|
||||
endif
|
||||
LIBS += $(DEP)/lib/libmbedtls.a $(DEP)/lib/libmbedcrypto.a $(DEP)/lib/libmbedx509.a $(DEP)/lib/libreadline.a
|
||||
|
||||
ifeq ($(TUI),1)
|
||||
LIBS += $(DEP)/lib/libnewt.a $(DEP)/lib/libpopt.a $(DEP)/lib/libslang.a
|
||||
ifeq ($(TARGET_OS),Linux)
|
||||
LIBS += $(DEP)/lib/libgpm.a
|
||||
endif
|
||||
endif
|
||||
ifeq ($(DEV_BUILD),1)
|
||||
CFLAGS += -O0 -g -DDEV_BUILD -fno-omit-frame-pointer
|
||||
ifeq ($(ASAN),1)
|
||||
BUILD_STYLE=ASAN
|
||||
CFLAGS += -fsanitize=address,undefined -fsanitize-address-use-after-return=runtime
|
||||
else ifeq ($(TSAN),1)
|
||||
BUILD_STYLE=TSAN
|
||||
CFLAGS += -fsanitize=thread,undefined
|
||||
else
|
||||
BUILD_STYLE = DEVELOPMENT
|
||||
endif
|
||||
else
|
||||
CFLAGS += -Os -g
|
||||
BUILD_STYLE = RELEASE
|
||||
endif
|
||||
LIBS += -lc
|
||||
|
||||
ifneq ($(BAKERAIN_DEVELOPE_R),)
|
||||
CFLAGS += -DBAKERAIN_DEVELOPE_R="\"$(BAKERAIN_DEVELOPE_R)\""
|
||||
endif
|
||||
|
||||
BUILD_DATE := $(shell LANG=C date)
|
||||
BUILD_NUMBER := $(shell git rev-list --count HEAD)
|
||||
BUILD_TAG := $(shell git describe --dirty --tags --abbrev=7)
|
||||
BUILD_WHOAMI := $(shell whoami)
|
||||
BUILD_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||
BUILD_COMMIT := $(shell git rev-parse HEAD)
|
||||
|
||||
CFLAGS += -DBUILD_STYLE="\"$(BUILD_STYLE)\"" -DBUILD_DATE="\"$(BUILD_DATE)\""
|
||||
CFLAGS += -DBUILD_WHOAMI="\"$(BUILD_WHOAMI)\"" -DBUILD_TAG="\"$(BUILD_TAG)\""
|
||||
CFLAGS += -DBUILD_NUMBER="\"$(BUILD_NUMBER)\"" -DBUILD_BRANCH="\"$(BUILD_BRANCH)\""
|
||||
CFLAGS += -DBUILD_COMMIT="\"$(BUILD_COMMIT)\""
|
||||
|
||||
export SRC DEP CC CFLAGS LDFLAGS LIBS TARGET_OS DEV_BUILD BUILD_DATE BUILD_TAG BUILD_WHOAMI BUILD_STYLE BUILD_NUMBER BUILD_BRANCH
|
||||
|
||||
all: palera1n
|
||||
|
||||
palera1n: download-deps
|
||||
$(MAKE) -C src
|
||||
|
||||
clean:
|
||||
$(MAKE) -C src clean
|
||||
$(MAKE) -C docs clean
|
||||
|
||||
download-deps:
|
||||
$(MAKE) -C src checkra1n-macos checkra1n-linux-arm64 checkra1n-linux-armel checkra1n-linux-x86 checkra1n-linux-x86_64 checkra1n-kpf-pongo ramdisk.dmg binpack.dmg Pongo.bin
|
||||
|
||||
docs:
|
||||
$(MAKE) -C docs
|
||||
|
||||
distclean: clean
|
||||
rm -rf palera1n-* palera1n*.dSYM src/checkra1n-* src/checkra1n-kpf-pongo src/ramdisk.dmg src/binpack.dmg src/Pongo.bin
|
||||
|
||||
.PHONY: all palera1n clean docs distclean
|
||||
|
||||
@@ -1,75 +1,88 @@
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://cdn.discordapp.com/attachments/1028398976640229380/1088049124441604136/IMG_0033.png">
|
||||
<img align="left" height="120" src="https://cdn.discordapp.com/attachments/1017854329887129611/1073858292159352862/thing.png" alt="palera1n logo" style="float: left;"/>
|
||||
</picture>
|
||||
<h3 align="right">An iOS 15.0-16.4.1 work-in-progress, <br>semi-tethered checkm8 jailbreak</h3>
|
||||
<img align="left" height="120" src="https://cdn.discordapp.com/attachments/1017854329887129611/1073858292159352862/thing.png" alt="palera1n logo" style="float: left;"/>
|
||||
<h3 align="right">An iOS 15.0-16.3.1 work-in-progress, <br>(semi-)tethered checkm8 jailbreak</h3>
|
||||
|
||||
<p align="right" >
|
||||
<strong><a href="https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.4/palera1n.1.html">Usage</a></strong>
|
||||
<p align="right" >
|
||||
<strong><a href="https://ios.cfw.guide/installing-palera1n">Guide</a></strong>
|
||||
•
|
||||
<strong><a href="https://github.com/palera1n/palera1n/graphs/contributors">Contributors</a></strong>
|
||||
<strong><a href="COMMONISSUES.md">Common Issues</a></strong>
|
||||
•
|
||||
<strong><a href="https://dsc.gg/palera1n">Discord</a></strong>
|
||||
<strong><a href="CHANGELOG.md">Changelog</a></strong>
|
||||
•
|
||||
<strong><a href="https://twitter.com/palera1n">Twitter</a></strong>
|
||||
<strong><a href="https://dsc.gg/palera1n">Discord</a></strong>
|
||||
•
|
||||
<strong><a href="https://twitter.com/palera1n">Twitter</a></strong>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
|
||||
## If you want a jailbreak, you should read the [guide](https://palera.in).
|
||||
### Warning
|
||||
palera1n.sh (also known as "legacy") is deprecated, don't expect it to work properly like it used to (such as, bootstrapping).
|
||||
|
||||
### You can obtain v2.0.0 beta [here](https://github.com/palera1n/palera1n/releases).
|
||||
If you need an older v2.0.0 beta, please get it [here](https://github.com/palera1n/palera1n-c/releases/tag/v2.0.0-beta.4).
|
||||
# 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.
|
||||
|
||||
# Warnings
|
||||
- This palera1n rewrite has noticeably different arguments compared to the shell version of palera1n.
|
||||
- Highly recommended that you take a look at how to use palera1n-c [here](https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.1/palera1n.1.html).
|
||||
- We are **NOT** responsible for any data loss, or the result of a device being bricked. 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 refuses to boot after using palera1n please use `iTunes` or `Finder` to restore iOS (or if you used tethered, use `--restorerootfs` at the end of your palera1n command).
|
||||
|
||||
- This does **NOT** support tethered creation or booting. You must use the older [shell version of palera1n](https://github.com/palera1n/palera1n/tree/legacy) (clone with `-b legacy`).
|
||||
|
||||
- We are **NOT** responsible for any data loss, or the result of a device being bricked. 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 futurerestore `--exit-recovery`, or use `irecovery -n`.
|
||||
|
||||
- palera1n will never work in VirtualBox, VMware or any virtual machine that doesn't support PCI passthrough.
|
||||
- palera1n will never work in VirtualBox, VMware or any virtual machine that doesn't support a PCI passthrough.
|
||||
|
||||
# Requirements
|
||||
- A checkm8 vulnerable iOS device on iOS 15.x or 16.x (`A8` - `A11`)
|
||||
- If using rootful, you will need **5-10GB of space** for the fakefs. This means 16GB devices cannot use the full fakefs creation. However, you can change the arguments to `-Bf` to create a fakefs with bind mounts, so it uses a smaller size, at the expense having unwritable parts in rarely-written paths, and then boot it
|
||||
- On `A11`, **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to **reset your device** before proceeding with palera1n).
|
||||
- Needs a checkm8 vulnerable iOS device on iOS 15.x or 16.x (`A8` - `A11`)
|
||||
- If you want the device to be semi-tethered, **you will need 5-10GB of space** for the fakefs. This means that 16GB devices cannot be semi-tethered
|
||||
- If you are on `A10(X)`, use [palera1n-c](https://github.com/palera1n/palera1n-c) instead for full SEP functionality (Passcode, TouchID, Apple Pay)
|
||||
- On `A11`, **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to reset your device before proceeding with palera1n `A11`).
|
||||
- palera1n is currently broken on iOS 16.4
|
||||
|
||||
- **USB-A** cables are recommended to use, USB-C may have issues with palera1n and getting into DFU mode.<details><summary>Technical explanation</summary>The BootROM will only enter DFU if it detects USB voltage, which boils down to checking whether a certain pin is asserted from the Tristar chip. The Tristar does this based on the cable's accessory ID, and apparently USB-A and USB-C cables have different accessory IDs, and the one of the USB-C cables makes the Tristar not assert the USB voltage pin.</details>
|
||||
- **USB-A** cables are recommended to use, USB-C may have issues with palera1n and getting into DFU mode.
|
||||
|
||||
- A Linux or macOS computer
|
||||
- AMD CPUs (not AMD Mobile) have an issue [with (likely) their USB controllers] that causes them to have a very low success rate with checkm8. It is not recommended that you use them with palera1n.
|
||||
- Python 3 must be installed.
|
||||
- AMD CPUs have an issue [with (likely) their USB controllers] that causes them to have a very low success rate with checkm8. It is not recommended that you use them with palera1n.
|
||||
- If your device does not successfully jailbreak, try a computer with an Intel or other CPU
|
||||
|
||||
# Need help?
|
||||
# Still need help?
|
||||
|
||||
Make sure you provide full details on your device, such as:
|
||||
- iDevice
|
||||
- iOS Version
|
||||
- Passcode enabled?
|
||||
- Logs, if panicked then send latest `panic-full` log from your iDevice.
|
||||
|
||||
Using `-V` and `-v` would help with debugging.
|
||||
|
||||
Join the [Support Discord](https://dsc.gg/palera1n), and create a thread in [#support](https://discord.com/channels/1028398973452570725/1028730487700738130) or ask in [#general](https://discord.com/channels/1028398973452570725/1028398976640229380).
|
||||
Join the [Support Discord](https://dsc.gg/palera1n) if you need help with palera1n :)
|
||||
|
||||
# Credits
|
||||
<details><summary>palera1n-c Contributors and Credits</summary>
|
||||
<details><summary>palera1n Contributors</summary>
|
||||
<p>
|
||||
|
||||
- [Nick Chan](https://github.com/asdfugil) for the rewrite
|
||||
- [Nebula](https://github.com/itsnebulalol) - palera1n owner and manager
|
||||
- [Mineek](https://github.com/mineek)
|
||||
- [Tom](https://github.com/plooshi) for updated ploosh kpf and universal loader
|
||||
- [Lakhan Lothiyi](https://github.com/llsc12) for palera1n loader app
|
||||
- [checkra1n](https://github.com/checkra1n) for the base of the kpf
|
||||
- [the Procursus Team](https://github.com/ProcursusTeam) for the amazing [bootstrap](https://github.com/ProcursusTeam/Procursus)
|
||||
- [Évelyne](https://github.com/evelyneee) for [ElleKit](https://github.com/evelyneee/ellekit), rootless tweak injection
|
||||
- [Sam Bingner](https://github.com/sbingner) for [Substitute](https://github.com/sbingner/substitute), rootful tweak injection
|
||||
- [Nathan](https://github.com/verygenericname) for part of palera1n's development.
|
||||
- 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 more part of palera1n's development.
|
||||
- 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)
|
||||
- Work on jbinit, together with [Nick Chan](https://github.com/asdfugil)
|
||||
- [Tom](https://github.com/plooshi) for a couple patches and bugfixes
|
||||
- For maintaining [Kernel64Patcher](https://github.com/palera1n/Kernel64Patcher)
|
||||
- [Serena](https://github.com/SerenaKit) for helping with boot ramdisk.
|
||||
- [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
|
||||
- [alexia](https://github.com/0xallie) for the script to help get into DFU
|
||||
|
||||
</details>
|
||||
<details><summary>Other credits for tools used in palera1n</summary>
|
||||
|
||||
- [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
|
||||
- [the Procursus Team](https://github.com/ProcursusTeam) for the amazing [bootstrap](https://github.com/ProcursusTeam/Procursus)
|
||||
- [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)
|
||||
- [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
|
||||
- [Sam Bingner](https://github.com/sbingner) for [Substitute](https://github.com/sbingner/substitute)
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<br>
|
||||
<p align="center">
|
||||
@@ -82,10 +95,10 @@ Thank you so much to our Patreons that make the future development possible! You
|
||||
<a href="https://twitter.com/0xSp00kyb0t"><img width=64 style="border-radius: 25%;" src="https://pbs.twimg.com/profile_images/1603601553226620935/1t4yD1bD_400x400.jpg"></img></a>
|
||||
<a href="https://chariz.com"><img width=64 src="https://chariz.com/img/favicon.png"></img></a>
|
||||
<a href="https://twitter.com/stars6220"><img width=64 style="border-radius: 25%;" src="https://pbs.twimg.com/profile_images/1621062976982728706/pWVZQ-NO_400x400.jpg"></img></a>
|
||||
<a href="https://github.com/TheFunnyMan16"><img width=64 style="border-radius: 25%;" src="https://cdn.discordapp.com/attachments/1050068822473842778/1082867264807772281/IMG_3942.jpg">
|
||||
<a href="https://github.com/beast9265"><img width=64 style="border-radius: 25%;" src="https://avatars.githubusercontent.com/u/79794946?v=4"></img></a>
|
||||
<a href="https://twitter.com/0x7FF7"><img width=64 style="border-radius: 25%;" src="https://pbs.twimg.com/profile_images/1630818481191919618/8MWaJ1F7_400x400.jpg"></img></a>
|
||||
<a href="https://twitter.com/0x7FF7"><img width=64 style="border-radius: 25%;" src="https://pbs.twimg.com/profile_images/1616888462665306113/AsjJvtyt_400x400.jpg">
|
||||
<a href="https://github.com/TheFunnyMan16"><img width=64 style="border-radius: 25%;" src="https://cdn.discordapp.com/attachments/1050068822473842778/1082867264807772281/IMG_3942.jpg">
|
||||
</img></a>
|
||||
<a href="https://sideloadly.io/"><img width=64 style="border-radius: 25%;" src="https://sideloadly.io/icon.png"></img></a>
|
||||
<a href="https://blog.stevesec.com/"><img width=64 style="border-radius: 25%;" src="https://blog.stevesec.com/img/avatar.jpg"></img>
|
||||
<a href="https://github.com/0xilis/"><img width=64 style="border-radius: 25%;" src="https://github.com/0xilis.png"></img></a>
|
||||
<a href="https://blog.stevesec.com/"><img width=64 style="border-radius: 25%;" src="https://blog.stevesec.com/img/avatar.jpg"></img></a>
|
||||
</p>
|
||||
@@ -0,0 +1,674 @@
|
||||
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>.
|
||||
@@ -0,0 +1,674 @@
|
||||
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>.
|
||||
@@ -0,0 +1,165 @@
|
||||
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
@@ -0,0 +1,502 @@
|
||||
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!
|
||||
@@ -0,0 +1,165 @@
|
||||
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.
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Whitespace-only changes.
@@ -1,9 +0,0 @@
|
||||
PAGES = palera1n.1.html
|
||||
|
||||
all: $(PAGES)
|
||||
|
||||
%.1.html: %.1
|
||||
mandoc -T html -O style=mandoc.css palera1n.1 > palera1n.1.html
|
||||
|
||||
clean:
|
||||
rm -f $(PAGES)
|
||||
-269
@@ -1,269 +0,0 @@
|
||||
/* $OpenBSD: mandoc.css,v 1.35 2021/03/30 19:23:50 schwarze Exp $ */
|
||||
/*
|
||||
* Standard style sheet for mandoc(1) -Thtml and man.cgi(8).
|
||||
*
|
||||
* Written by Ingo Schwarze <[email protected]>.
|
||||
* I place this file into the public domain.
|
||||
* Permission to use, copy, modify, and distribute it for any purpose
|
||||
* with or without fee is hereby granted, without any conditions.
|
||||
*/
|
||||
|
||||
/* Global defaults. */
|
||||
|
||||
html {
|
||||
--bg: #FFFFFF;
|
||||
--fg: #000000; }
|
||||
body { background: var(--bg);
|
||||
color: var(--fg);
|
||||
font-family: monospace,Helvetica,Arial,sans-serif;
|
||||
max-width: 80ch;
|
||||
margin: 1em auto;
|
||||
padding: 0 1ch;
|
||||
}
|
||||
h1 { font-size: 110%; }
|
||||
table { margin-top: 0em;
|
||||
margin-bottom: 0em;
|
||||
border-collapse: collapse; }
|
||||
/* Some browsers set border-color in a browser style for tbody,
|
||||
* but not for table, resulting in inconsistent border styling. */
|
||||
tbody { border-color: inherit; }
|
||||
tr { border-color: inherit; }
|
||||
td { vertical-align: top;
|
||||
padding-left: 0.2em;
|
||||
padding-right: 0.2em;
|
||||
border-color: inherit; }
|
||||
ul, ol, dl { margin-top: 0em;
|
||||
margin-bottom: 0em; }
|
||||
li, dt { margin-top: 1em; }
|
||||
pre { font-family: inherit; }
|
||||
|
||||
.permalink { border-bottom: thin dotted;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
text-decoration: inherit; }
|
||||
* { clear: both }
|
||||
|
||||
/* Search form and search results. */
|
||||
|
||||
form {
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
background-color: var(--bg);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
fieldset { border: thin solid silver;
|
||||
border-radius: 0.3em;
|
||||
text-align: center; }
|
||||
input[name=expr] {
|
||||
width: 25%; }
|
||||
|
||||
table.results { margin-top: 1em;
|
||||
margin-left: 2em;
|
||||
font-size: smaller; }
|
||||
|
||||
/* Header and footer lines. */
|
||||
|
||||
table.head { width: 100%;
|
||||
border-bottom: 1px dotted #808080;
|
||||
margin-bottom: 1em;
|
||||
font-size: smaller;
|
||||
overflow-wrap: anywhere; }
|
||||
td.head-vol { text-align: center; }
|
||||
td.head-rtitle {
|
||||
text-align: right; }
|
||||
|
||||
table.foot { width: 100%;
|
||||
border-top: 1px dotted #808080;
|
||||
margin-top: 1em;
|
||||
font-size: smaller;
|
||||
overflow-wrap: anywhere; }
|
||||
td.foot-os { text-align: right; }
|
||||
|
||||
table.Nm {
|
||||
overflow-wrap:anywhere;
|
||||
}
|
||||
|
||||
/* Sections and paragraphs. */
|
||||
|
||||
.manual-text {
|
||||
margin-left: 3.8em; }
|
||||
h1.Sh { margin-top: 1.2em;
|
||||
margin-bottom: 0.6em;
|
||||
margin-left: -3.2em; }
|
||||
h2.Ss { margin-top: 1.2em;
|
||||
margin-bottom: 0.6em;
|
||||
margin-left: -1.2em;
|
||||
font-size: 105%; }
|
||||
.Pp { margin: 0.6em 0em; }
|
||||
|
||||
/* Displays and lists. */
|
||||
|
||||
.Bd-indent { margin-left: 3.8em; }
|
||||
|
||||
.Bl-bullet { list-style-type: disc;
|
||||
padding-left: 1em; }
|
||||
.Bl-dash { list-style-type: none;
|
||||
padding-left: 0em; }
|
||||
.Bl-dash > li:before {
|
||||
content: "\2014 "; }
|
||||
.Bl-item { list-style-type: none;
|
||||
padding-left: 0em; }
|
||||
.Bl-compact > li {
|
||||
margin-top: 0em; }
|
||||
|
||||
.Bl-enum { padding-left: 2em; }
|
||||
.Bl-compact > li {
|
||||
margin-top: 0em; }
|
||||
|
||||
.Bl-diag > dt {
|
||||
font-style: normal;
|
||||
font-weight: bold; }
|
||||
.Bl-diag > dd {
|
||||
margin-left: 0em; }
|
||||
.Bl-hang > dd {
|
||||
margin-left: 5.5em; }
|
||||
.Bl-inset > dd {
|
||||
margin-left: 0em; }
|
||||
.Bl-ohang > dd {
|
||||
margin-left: 0em; }
|
||||
.Bl-tag { margin-top: 0.6em;
|
||||
margin-left: 5.5em; }
|
||||
.Bl-tag > dt {
|
||||
float: left;
|
||||
margin-top: 0em;
|
||||
margin-left: -5.5em;
|
||||
padding-right: 0.5em;
|
||||
vertical-align: top; }
|
||||
.Bl-tag > dd {
|
||||
clear: right;
|
||||
column-count: 1; /* Force block formatting context. */
|
||||
width: 100%;
|
||||
margin-top: 0em;
|
||||
margin-left: 0em;
|
||||
margin-bottom: 0.6em;
|
||||
vertical-align: top; }
|
||||
.Bl-compact { margin-top: 0em; }
|
||||
.Bl-compact > dd {
|
||||
margin-bottom: 0em; }
|
||||
.Bl-compact > dt {
|
||||
margin-top: 0em; }
|
||||
|
||||
.Bl-column > tbody > tr > td {
|
||||
margin-top: 1em; }
|
||||
.Bl-compact > tbody > tr > td {
|
||||
margin-top: 0em; }
|
||||
|
||||
.Rs { font-style: normal;
|
||||
font-weight: normal; }
|
||||
.RsB { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.RsI { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.RsJ { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.RsT { text-decoration: underline; }
|
||||
|
||||
.tbl td { vertical-align: middle; }
|
||||
|
||||
.HP { margin-left: 3.8em;
|
||||
text-indent: -3.8em; }
|
||||
|
||||
/* Semantic markup for command line utilities. */
|
||||
|
||||
code.Nm { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit;
|
||||
overflow-wrap: normal; }
|
||||
.Fl { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Cm { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Ar { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Op { display: inline; }
|
||||
.Ic { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Ev { font-style: normal;
|
||||
font-weight: normal;
|
||||
font-family: monospace; }
|
||||
.Pa { font-style: italic;
|
||||
font-weight: normal; }
|
||||
|
||||
/* Semantic markup for function libraries. */
|
||||
|
||||
code.In { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Fd { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Ft { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Fn { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Fa { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Vt { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Va { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Dv { font-style: normal;
|
||||
font-weight: normal;
|
||||
font-family: monospace; }
|
||||
.Er { font-style: normal;
|
||||
font-weight: normal;
|
||||
font-family: monospace; }
|
||||
|
||||
/* Various semantic markup. */
|
||||
|
||||
.Cd { font-style: normal;
|
||||
font-weight: bold;
|
||||
font-family: inherit; }
|
||||
.Ad { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Ms { font-style: normal;
|
||||
font-weight: bold; }
|
||||
|
||||
/* Physical markup. */
|
||||
|
||||
.Bf { display: inline; }
|
||||
.No { font-style: normal;
|
||||
font-weight: normal; }
|
||||
.Em { font-style: italic;
|
||||
font-weight: normal; }
|
||||
.Sy { font-style: normal;
|
||||
font-weight: bold; }
|
||||
.Li { font-style: normal;
|
||||
font-weight: normal;
|
||||
font-family: monospace; }
|
||||
|
||||
/* Overrides to avoid excessive margins on small devices. */
|
||||
|
||||
@media (max-width: 37.5em) {
|
||||
.manual-text {
|
||||
margin-left: 0.5em; }
|
||||
h1.Sh, h2.Ss { margin-left: 0em; }
|
||||
.Bd-indent { margin-left: 2em; }
|
||||
.Bl-hang > dd {
|
||||
margin-left: 2em; }
|
||||
.Bl-tag { margin-left: 2em; }
|
||||
.Bl-tag > dt {
|
||||
margin-left: -2em; }
|
||||
.HP { margin-left: 2em;
|
||||
text-indent: -2em; }
|
||||
}
|
||||
|
||||
/* Overrides for a dark color scheme for accessibility. */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html { --bg: #000000;
|
||||
--fg: #FFFFFF; }
|
||||
:link { color: #BAD7FF; }
|
||||
:visited { color: #BAD7FF; }
|
||||
}
|
||||
|
||||
-344
@@ -1,344 +0,0 @@
|
||||
.\"-
|
||||
.\" Copyright (c) 2023 Nick Chan
|
||||
.\" SPDX-License-Identifier: MIT
|
||||
.\"
|
||||
.Dd "20 March 2023"
|
||||
.Dt palera1n 1
|
||||
.Sh NAME
|
||||
.Nm palera1n
|
||||
.Nd iOS 15.0-16.4.1 arm64 iOS/iPadOS jailbreaking tool
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl cCdDEfhIlLnpRsSvV
|
||||
.Op Fl e Ar Boot arguments
|
||||
.Op Fl k Ar Pongo image
|
||||
.Op Fl o Ar overlay file
|
||||
.Op Fl r Ar ramdisk file
|
||||
.Op Fl K Ar KPF file
|
||||
.Op Fl i Ar checkra1n file
|
||||
.Op Fl -version
|
||||
.Op Fl -force-revert
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.4.1,
|
||||
utilizing the
|
||||
.Em checkm8
|
||||
bootROM exploit.
|
||||
.Pp
|
||||
.Nm
|
||||
is able to jailbreak the device in fakefs-rootful mode, where /
|
||||
is writable, as well as rootless mode, where / cannot be written to.
|
||||
.Pp
|
||||
Due to the nature of the
|
||||
.Em checkm8
|
||||
exploit,
|
||||
.Nm
|
||||
is semi-tethered. That is, you must run the
|
||||
.Nm
|
||||
tool after the device reboot in order to enter the jailbroken state.
|
||||
However, it is not required for the device to boot.
|
||||
.Pp
|
||||
On A11 devices, that is, iPhone 8, iPhone 8 Plus and iPhone X, the passcode cannot
|
||||
be used.
|
||||
.Pp
|
||||
On iOS 15, the passcode must be off while jailbroken.
|
||||
.Pp
|
||||
On iOS 16, the passcode must be off since restore, and
|
||||
.Sy Reset All Contents and Settings
|
||||
from settings app counts as a restore.
|
||||
A backup may be used in this case.
|
||||
.Pp
|
||||
In the remainder of this document, the term "iOS" and "iPadOS" will be used interchangably
|
||||
as the difference is negligible as far as the jailbreak is concerened.
|
||||
.Pp
|
||||
.Sh SUPPORTED DEVICES
|
||||
As described above, arm64 iOS 15.0-16.4.1 devices are supported, here is an explicit
|
||||
list of supported devicecs:
|
||||
|
||||
.Bl -tag -compact
|
||||
.It iPhone 6s
|
||||
.It iPhone 6s Plus
|
||||
.It iPhone SE (2016)
|
||||
.It iPhone 7
|
||||
.It iPhone 7 Plus
|
||||
.It iPhone 8
|
||||
.It iPhone 8 Plus
|
||||
.It iPhone X
|
||||
.El
|
||||
|
||||
.Bl -tag -compact
|
||||
.It iPad mini 4
|
||||
.It iPad Air 2
|
||||
.It iPad (5th generation)
|
||||
.It iPad (6th generation)
|
||||
.It iPad (7th generation)
|
||||
.It iPad Pro (9.7")
|
||||
.It iPad Pro (12.9") (1st generation)
|
||||
.It iPad Pro (10.5")
|
||||
.It iPad Pro (12.9") (2nd generation)
|
||||
.El
|
||||
|
||||
.Bl -tag -compact
|
||||
.It iPod Touch (7th generation)
|
||||
.El
|
||||
|
||||
Support for other arm64 Darwin devices, including Apple TV, HomePod and iBridge
|
||||
on Darwin 21 and above could be added, but they are currently unsupported.
|
||||
|
||||
arm64e devices will NEVER be supported.
|
||||
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width -indent
|
||||
.It Fl -version
|
||||
Prints the program version and exit.
|
||||
.It Fl -force-revert
|
||||
Remove the jailbreak while keeping user data. Some jailbreak files may remain
|
||||
after running this command. Additionally, jailbreak apps will remain on the
|
||||
home screen on for a while even when the files are deleted as the icon cache
|
||||
still has their icons. When used with
|
||||
.Fl f , -fakefs ,
|
||||
this will actually boot the device in rootless mode then delete the jailbreak
|
||||
files. As a result, using the loader app to install the jailbreak environment
|
||||
is not supported when this option is used together with
|
||||
.Fl f , -fakefs
|
||||
\[char46]
|
||||
.It Fl B , -setup-fakefs-partial
|
||||
Like
|
||||
.Fl c , -setup-fakefs
|
||||
but the size of the created fakefs is smaller at the expense of having unwritable
|
||||
parts in rarely-written paths. When jailbreaking 16 GB devices, this option must be used
|
||||
when setting up fakefs for rootful, as they do not have enough storage for full fakefs.
|
||||
This option currently does not work on iOS 16.
|
||||
.It Fl c , -setup-fakefs
|
||||
When used with
|
||||
.Fl f , -fakefs ,
|
||||
creates the new APFS volume required for rootful. Will fail if one already exists.
|
||||
.It Fl d , -demote
|
||||
Set the effective production fuse to 0, so as to enable hardware debugging features.
|
||||
.It Fl D , -dfuhelper
|
||||
Execute the DFU helper to guide the user into putting the device into DFU mode
|
||||
then exit.
|
||||
.It Fl e , -boot-args Ar boot arguments
|
||||
Specify custom XNU kernel command line. The
|
||||
.Em rootdev=md0
|
||||
argument is used by
|
||||
.Nm
|
||||
and cannot be overriden. Additionally, the
|
||||
.Em wdt=-1
|
||||
argument is used during fakefs setup.
|
||||
.It Fl E , -enter-recovery
|
||||
Exit after entering recovery mode.
|
||||
.It Fl f , -fakefs
|
||||
Proceed in rootful mode. This applies to both full fakefs and partial fakefs.
|
||||
.It Fl h , -help
|
||||
Prints help text.
|
||||
.It Fl i , -checkra1n-file Ar checkra1n file
|
||||
Specify the path to a custom checkra1n file.
|
||||
.It Fl k , -override-pongo Ar pongo file
|
||||
Override PongoOS image. The raw image, named
|
||||
.Em Pongo.bin
|
||||
when built, should be used. PongoOS 2.6.0 or later is required.
|
||||
.It Fl K , -override-kpf Ar KPF file
|
||||
Override the kernel patchfinder PongoOS module. The module is required to support setting
|
||||
root filesystem in paleinfo with
|
||||
.Em rootfs
|
||||
command. If in doubt, use
|
||||
.Sy https://github.com/guacaplushy/PongoOS
|
||||
iOS15 branch or your own fork of it.
|
||||
.It Fl l , -rootless
|
||||
Proceed in rootless mode, this is the default when neither
|
||||
.Fl l , -rootless
|
||||
and
|
||||
.Fl f , -fakefs
|
||||
is specified.
|
||||
.Fl L , -jbinit-log-to-file
|
||||
Makes jbinit log to
|
||||
.Em /cores/jbinit.log
|
||||
This file may be viewed from sandboxed applications while jailbroken.
|
||||
.It Fl n , -exit-recovery
|
||||
Exit recovery mode and exit.
|
||||
.It Fl o , -override-overlay Ar overlay file
|
||||
Specify the path to a custom overlay file, which is then mounted onto /cores/binpack
|
||||
during boot, if the default ramdisk is used. The default ramdisk expects the overlay
|
||||
to contain a folder named
|
||||
.Em Applications
|
||||
at the root of it, as well as a dmg named
|
||||
.Em loader.dmg
|
||||
at the root of it. Otherwise, the device will not boot. It is also expected that it
|
||||
contains a shell, a ssh server, and various command line utilities.
|
||||
.It Fl p , -pongo-shell
|
||||
Exit after booting into a clean PongoOS shell
|
||||
.It Fl P , -pongo-full
|
||||
Like
|
||||
.Fl p , -pongo-shell
|
||||
but default images and options have been uploaded and applied respectively.
|
||||
.It Fl r , -override-ramdisk Ar ramdisk file
|
||||
Override the ramdisk. At a very minimum, it should contain a
|
||||
.Em /sbin/launchd
|
||||
as well as a fake dyld
|
||||
.Em /usr/lib/dyld
|
||||
where the logic is expected to be in.
|
||||
.It Fl R , -reboot-device
|
||||
Reboot device in normal mode and exit.
|
||||
.It Fl s , -safe-mode
|
||||
Enter safe mode. An alert will be displayed. Jailbreak daemons nor early boot executable files
|
||||
specified (see
|
||||
.Sy FILES
|
||||
section below) will be executed. The loader app and the built in SSH server can still be used,
|
||||
as well as any jailbreak-specific apps you have installed.
|
||||
.It Fl S , -no-colors
|
||||
Disable colors on the command line. External programs like checkra1n clones may still output colors.
|
||||
.It Fl v , -debug-logging
|
||||
Enable debug logging. The option may be repeated for extra verbosity.
|
||||
.It Fl V , -verbose-boot
|
||||
Boots the device in verbose mode, allowing boot logs to be seen.
|
||||
.It Fl I , -device-info
|
||||
Prints info about device and exits.
|
||||
.El
|
||||
.Sh ENVIRONMENTAL VARIABLES
|
||||
.Bl -tag -width -indent
|
||||
.It Ev TMPDIR
|
||||
This environmental variable should contain the a directory for temporary
|
||||
files. Without the
|
||||
.Fl i , -override-checkra1n
|
||||
option, files must be executable from it as the built-in checkra1n file
|
||||
is extracted and executed here. When not set, /tmp is used.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
To (re-)jailbreak in rootless mode:
|
||||
.Pp
|
||||
.Dl "palera1n"
|
||||
.Pp
|
||||
To setup fakefs for rootful mode:
|
||||
.Pp
|
||||
.Dl "palera1n -fc"
|
||||
.Pp
|
||||
After the device has rebooted, follow the following example.
|
||||
.Pp
|
||||
To re-jailbreak in rootful mode:
|
||||
.Pp
|
||||
.Dl "palera1n -f"
|
||||
.Pp
|
||||
To remove the jailbreak in rootful mode:
|
||||
.Pp
|
||||
.Dl "palera1n --force-revert -f"
|
||||
.Pp
|
||||
To remove the jailbreak in rootless mode:
|
||||
.Pp
|
||||
.Dl "palera1n --force-revert"
|
||||
.Pp
|
||||
To verbose boot in rootful mode:
|
||||
.Pp
|
||||
.Dl "palera1n -Vf"
|
||||
.Pp
|
||||
To create a partial fakefs with bind mounts:
|
||||
.Pp
|
||||
.Dl "palera1n -Bf"
|
||||
.Pp
|
||||
To exit recovery mode:
|
||||
.Pp
|
||||
.Dl "palera1n -n"
|
||||
.Pp
|
||||
.Sh CAVEATS
|
||||
.Pp
|
||||
.Em -v
|
||||
is not a real XNU boot argument. It is interpreted by iBoot. However, since XNU
|
||||
boot arguments are set in PongoOS, which is ran after iBoot has ran, it does nothing.
|
||||
To verbose boot, use the
|
||||
.Fl V , -verbose-boot
|
||||
option when jailbreaking.
|
||||
.Pp
|
||||
Fakefs takes up around 5-10 GB of storage, and take up to 10 minutes to setup.
|
||||
.Pp
|
||||
iOS 15.0 requires DER entitlements, and iOS 15.1 requires hash agility in code signatures.
|
||||
As a result, binaries with the old code signature format need to be resigned with a recent
|
||||
version of the Procursus fork of
|
||||
.Xr ldid 1
|
||||
before they can be ran on a device jailbroken with
|
||||
.Nm
|
||||
\[char46]
|
||||
.Pp
|
||||
When using rootful mode, the
|
||||
.Fl f , -fakefs
|
||||
flag must be specified at all times. It does not matter whether you want to create fakefs,
|
||||
create partial fakefs, rejailbreak or remove jailbreak.
|
||||
.Sh POST INSTALLATION
|
||||
The palera1n loader app will take up to 30 seconds to appear on the homescreen after the
|
||||
device has booted. If it does not appear, you can try using the shortcut:
|
||||
.Pp
|
||||
.Lk https://www.icloud.com/shortcuts/8cd5f489c8854ee0ab9ee38f2e62f87d
|
||||
.Pp
|
||||
to open it. After opening the loader app, press install to install a bootstrap as well as
|
||||
the
|
||||
.Em Sileo
|
||||
package manager.
|
||||
You can install other package managers from settings of the loader app.
|
||||
.Sh FILES
|
||||
During the jailbreak process, a temporary filesystem is mounted on /cores as a place
|
||||
to stash jailbreak files needed during the boot process. No files are ever written
|
||||
onto the actual disk if you do not use the SSH server to write files or using the
|
||||
loader app to install additional jailbreak files.
|
||||
|
||||
.Bl -tag -width "/var/jb/Library/LaunchDaemons"
|
||||
.It Pa /cores
|
||||
The location of the temporary filesystem where jailbreak files are stash during boot.
|
||||
.It Pa /cores/jbinit.log
|
||||
When
|
||||
.Fl L
|
||||
is used, the log file of jbinit.
|
||||
.It Pa /Library/LaunchDaemons
|
||||
The directory where jailbreak-specific
|
||||
.Xr launchd.plist 5
|
||||
property list files should be placed on rootful.
|
||||
.It Pa /var/jb/Library/LaunchDaemons
|
||||
The directory where jailbreak-specific
|
||||
.Xr launchd.plist 5
|
||||
property list files should be placed on rootless.
|
||||
.It Pa /etc/rc.d
|
||||
The directory where executable filse that needs to be executed during boot, before
|
||||
daemons are launched, are placed rootful. They are executed after all filesystems
|
||||
has been mounted.
|
||||
.It Pa /var/jb/etc/rc.d
|
||||
The directory where executable files that needs to be executed during boot, before
|
||||
daemons are launched, are placed on rootless. They are executed after all filesystems
|
||||
has been mounted.
|
||||
.El
|
||||
.Sh BUGS
|
||||
.Nm
|
||||
may crash if the machine it is running on:
|
||||
.Pp
|
||||
.Dl "- Has non-compliant USB devices plugged in"
|
||||
.Pp
|
||||
The exploit may also work less reliably on some hosts, like AMD desktops, or some MediaTek devices.
|
||||
.Pp
|
||||
The device may randomly crash and reboot due to launchd exiting with code 7.
|
||||
.Sh NOTES
|
||||
.Nm
|
||||
injects a dylib into launchd to allow the
|
||||
.Sy launchctl runstats
|
||||
command to be used on the device.
|
||||
.Sh DEPRECATED AND REMOVED FUNCTIONALITY
|
||||
There was an option in
|
||||
.Nm
|
||||
to force create the fakefs even when one already exists (which would overwrite
|
||||
the existing fakefs), by setting the palerain_option_setup_rootful_forced flag
|
||||
in palera1n flags. This option was removed because using
|
||||
.Fl -force-revert
|
||||
and
|
||||
.Fl c
|
||||
at the same time has exactly the same effect.
|
||||
.Sh SEE ALSO
|
||||
.Xr launchd 8
|
||||
.Xr launchd.plist 5
|
||||
.Xr ldid 1
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
jailbreak was first written by Nebula and Mineek on September 26, 2022, as a shell
|
||||
script. Tweak support with DEVELOPMENT kernels are added on October 2, 2022. RELEASE
|
||||
kernel support is added on November 14, 2022. iOS 16 Support is added on
|
||||
December 13, 2022. Later, the first attempt to rewrite palera1n into C begins on January
|
||||
01 2023. The
|
||||
.Nm
|
||||
utility described here is the second attempt, which first started on January 16, 2023,
|
||||
using checkra1n 1337 and the plush KPF.
|
||||
@@ -1,20 +0,0 @@
|
||||
curl -LOOOOOO \
|
||||
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.3.0.tar.gz \
|
||||
https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 \
|
||||
https://mirror-hk.koddos.net/gnu/readline/readline-8.2.tar.gz \
|
||||
https://www.jedsoft.org/releases/slang/slang-2.3.3.tar.bz2 \
|
||||
https://releases.pagure.org/newt/newt-0.52.23.tar.gz \
|
||||
https://github.com/rpm-software-management/popt/archive/master-release.tar.gz
|
||||
|
||||
tar xf v3.3.0.tar.gz
|
||||
tar xf libusb-1.0.26.tar.bz2
|
||||
tar xf readline-8.2.tar.gz
|
||||
tar xf slang-2.3.3.tar.bz2
|
||||
tar xf newt-0.52.23.tar.gz
|
||||
tar xf master-release.tar.gz
|
||||
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libusbmuxd
|
||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* This is free and unencumbered software released into the public domain.
|
||||
*
|
||||
* For more information, please refer to <https://unlicense.org>
|
||||
*/
|
||||
|
||||
#ifndef ANSI_COLOR_CODES_H
|
||||
#define ANSI_COLOR_CODES_H
|
||||
|
||||
//Regular text
|
||||
#define BLK "\033[0;30m"
|
||||
#define RED "\033[0;31m"
|
||||
#define GRN "\033[0;32m"
|
||||
#define YEL "\033[0;33m"
|
||||
#define BLU "\033[0;34m"
|
||||
#define MAG "\033[0;35m"
|
||||
#define CYN "\033[0;36m"
|
||||
#define WHT "\033[0;37m"
|
||||
|
||||
//Regular bold text
|
||||
#define BBLK "\033[1;30m"
|
||||
#define BRED "\033[1;31m"
|
||||
#define BGRN "\033[1;32m"
|
||||
#define BYEL "\033[1;33m"
|
||||
#define BBLU "\033[1;34m"
|
||||
#define BMAG "\033[1;35m"
|
||||
#define BCYN "\033[1;36m"
|
||||
#define BWHT "\033[1;37m"
|
||||
|
||||
//Regular underline text
|
||||
#define UBLK "\033[4;30m"
|
||||
#define URED "\033[4;31m"
|
||||
#define UGRN "\033[4;32m"
|
||||
#define UYEL "\033[4;33m"
|
||||
#define UBLU "\033[4;34m"
|
||||
#define UMAG "\033[4;35m"
|
||||
#define UCYN "\033[4;36m"
|
||||
#define UWHT "\033[4;37m"
|
||||
|
||||
//Regular background
|
||||
#define BLKB "\033[40m"
|
||||
#define REDB "\033[41m"
|
||||
#define GRNB "\033[42m"
|
||||
#define YELB "\033[43m"
|
||||
#define BLUB "\033[44m"
|
||||
#define MAGB "\033[45m"
|
||||
#define CYNB "\033[46m"
|
||||
#define WHTB "\033[47m"
|
||||
|
||||
//High intensty background
|
||||
#define BLKHB "\033[0;100m"
|
||||
#define REDHB "\033[0;101m"
|
||||
#define GRNHB "\033[0;102m"
|
||||
#define YELHB "\033[0;103m"
|
||||
#define BLUHB "\033[0;104m"
|
||||
#define MAGHB "\033[0;105m"
|
||||
#define CYNHB "\033[0;106m"
|
||||
#define WHTHB "\033[0;107m"
|
||||
|
||||
//High intensty text
|
||||
#define HBLK "\033[0;90m"
|
||||
#define HRED "\033[0;91m"
|
||||
#define HGRN "\033[0;92m"
|
||||
#define HYEL "\033[0;93m"
|
||||
#define HBLU "\033[0;94m"
|
||||
#define HMAG "\033[0;95m"
|
||||
#define HCYN "\033[0;96m"
|
||||
#define HWHT "\033[0;97m"
|
||||
|
||||
//Bold high intensity text
|
||||
#define BHBLK "\033[1;90m"
|
||||
#define BHRED "\033[1;91m"
|
||||
#define BHGRN "\033[1;92m"
|
||||
#define BHYEL "\033[1;93m"
|
||||
#define BHBLU "\033[1;94m"
|
||||
#define BHMAG "\033[1;95m"
|
||||
#define BHCYN "\033[1;96m"
|
||||
#define BHWHT "\033[1;97m"
|
||||
|
||||
//Reset
|
||||
#define reset "\033[0m"
|
||||
#define CRESET "\033[0m"
|
||||
#define COLOR_RESET "\033[0m"
|
||||
|
||||
#endif
|
||||
@@ -1,130 +0,0 @@
|
||||
/*
|
||||
* pongoOS - https://checkra.in
|
||||
*
|
||||
* Copyright (C) 2019-2022 checkra1n team
|
||||
*
|
||||
* This file is part of pongoOS.
|
||||
*
|
||||
* 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 _KERNINFO_H
|
||||
#define _KERNINFO_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define MAX_BOOTARGS_LEN 256
|
||||
|
||||
#define checkrain_option_none 0x00000000
|
||||
#define checkrain_option_all 0x7fffffff
|
||||
#define checkrain_option_failure 0x80000000
|
||||
|
||||
// Host options
|
||||
#define checkrain_option_verbose_logging (1 << 0)
|
||||
#define checkrain_option_demote (1 << 1)
|
||||
#define checkrain_option_early_exit (1 << 2)
|
||||
#define checkrain_option_quick_mode (1 << 3)
|
||||
#define checkrain_option_pongo_shell (1 << 4)
|
||||
#define checkrain_option_pongo_full (1 << 5)
|
||||
|
||||
// KPF options
|
||||
#define checkrain_option_verbose_boot (1 << 0)
|
||||
|
||||
// Global options
|
||||
#define checkrain_option_safemode (1 << 0)
|
||||
#define checkrain_option_bind_mount (1 << 1)
|
||||
#define checkrain_option_overlay (1 << 2)
|
||||
#define checkrain_option_force_revert (1 << 7) /* keep this at 7 */
|
||||
|
||||
// palera1n option
|
||||
#define palerain_option_rootful (1 << 0) /* rootful jailbreak */
|
||||
#define palerain_option_jbinit_log_to_file (1 << 1) /* log to /cores/jbinit.log */
|
||||
#define palerain_option_setup_rootful (1 << 2) /* create fakefs */
|
||||
#define palerain_option_setup_rootful_forced (1 << 3) /* create fakefs over an existing one */
|
||||
#define palerain_option_setup_partial_root (1 << 4) /* fakefs creating should be partial */
|
||||
#define palerain_option_checkrain_is_clone (1 << 5) /* supplied checkra1n is checkra1n clone */
|
||||
#define palerain_option_rootless_livefs (1 << 6) /* mount root livefs on rootless */
|
||||
|
||||
#ifdef DEV_BUILD
|
||||
#define palerain_option_test1 (1 << 29)
|
||||
#define palerain_option_test2 (1 << 30)
|
||||
#endif
|
||||
|
||||
// palerain host options
|
||||
#define host_option_dfuhelper_only (1 << 0) /* dfuhelper only */
|
||||
#define host_option_pongo_exit (1 << 1) /* boot to clean pongo shell */
|
||||
#ifdef TUI
|
||||
#define host_option_tui (1 << 2) /* use terminal user interface */
|
||||
#else
|
||||
#define host_option_res1 (1 << 2) /* reserved */
|
||||
#endif
|
||||
#define host_option_demote (1 << 3) /* Demote effective production fuse status */
|
||||
// (1 << 4) is removed
|
||||
#define host_option_pongo_full (1 << 5) /* Boot to pongo with default images and options */
|
||||
#define host_option_palerain_version (1 << 6) /* Print version */
|
||||
#define host_option_exit_recovery (1 << 7) /* Exit recovery mode */
|
||||
#define host_option_reboot_device (1 << 8) /* Reboot device in normal mode */
|
||||
#define host_option_enter_recovery (1 << 9) /* Enter recovery mode */
|
||||
#define host_option_device_info (1 << 10) /* Print device info */
|
||||
#define host_option_no_colors (1 << 11) /* no colors */
|
||||
|
||||
#define PALEINFO_MAGIC 'PLSH'
|
||||
#define PALEINFO_CIGAM 'HSLP'
|
||||
|
||||
typedef uint32_t checkrain_option_t, *checkrain_option_p;
|
||||
|
||||
typedef enum {
|
||||
jailbreak_capability_tfp0 = 1 << 0,
|
||||
jailbreak_capability_userspace_reboot = 1 << 1,
|
||||
jailbreak_capability_dyld_ignore_os = 1 << 2, // TODO: This needs a better name
|
||||
} jailbreak_capability_t, *jailbreak_capability_p;
|
||||
|
||||
#define DEFAULT_CAPABILITIES (jailbreak_capability_tfp0|jailbreak_capability_userspace_reboot)
|
||||
struct kerninfo {
|
||||
uint64_t size;
|
||||
uint64_t base;
|
||||
uint64_t slide;
|
||||
checkrain_option_t flags;
|
||||
};
|
||||
struct paleinfo {
|
||||
uint32_t magic; // 'PLSH' / 0x504c5348
|
||||
uint32_t version; // 1
|
||||
checkrain_option_t flags;
|
||||
char rootdev[0x10];
|
||||
};
|
||||
struct kpfinfo {
|
||||
struct kerninfo k;
|
||||
checkrain_option_t kpf_flags;
|
||||
char bootargs[MAX_BOOTARGS_LEN];
|
||||
};
|
||||
|
||||
#define checkrain_set_option(options, option, enabled) do { \
|
||||
if (enabled) \
|
||||
options = (checkrain_option_t)(options | option); \
|
||||
else \
|
||||
options = (checkrain_option_t)(options & ~option); \
|
||||
} while (0);
|
||||
|
||||
static inline bool checkrain_options_enabled(checkrain_option_t flags, checkrain_option_t opt)
|
||||
{
|
||||
return (flags & opt) != 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,236 +0,0 @@
|
||||
#ifndef PALERAIN_H
|
||||
#define PALERAIN_H
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#define NSIG __DARWIN_NSIG
|
||||
#endif
|
||||
|
||||
#include "xxd-embedded.h"
|
||||
#include "kerninfo.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <usbmuxd.h>
|
||||
#include <libirecovery.h>
|
||||
#include <libimobiledevice/libimobiledevice.h>
|
||||
|
||||
#define LOG(loglevel, ...) p1_log(loglevel, __FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||
#define CLEAR() printf("\33[2K\r");
|
||||
#define palerain_option_case(x) (512 + x)
|
||||
#define palerain_option_version 129
|
||||
#define CMD_LEN_MAX 512
|
||||
#define OVERRIDE_MAGIC 0xd803b376
|
||||
|
||||
#define palerain_option_case_version palerain_option_case(0)
|
||||
#define palerain_option_case_force_revert palerain_option_case(1)
|
||||
|
||||
#ifdef USE_LIBUSB
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
#define USB_RET_SUCCESS LIBUSB_SUCCESS
|
||||
#define USB_RET_NOT_RESPONDING LIBUSB_ERROR_OTHER
|
||||
#define USB_RET_IO LIBUSB_ERROR_IO
|
||||
#define USB_RET_NO_DEVICE LIBUSB_ERROR_NO_DEVICE
|
||||
typedef int usb_ret_t;
|
||||
typedef libusb_device_handle *usb_device_handle_t;
|
||||
|
||||
typedef struct stuff
|
||||
{
|
||||
pthread_t th;
|
||||
libusb_device *dev;
|
||||
usb_device_handle_t handle;
|
||||
} stuff_t;
|
||||
usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, int len);
|
||||
#else
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wpedantic"
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#define USB_RET_SUCCESS KERN_SUCCESS
|
||||
#define USB_RET_NOT_RESPONDING kIOReturnNotResponding
|
||||
#define USB_RET_IO kIOReturnNotReady
|
||||
#define USB_RET_NO_DEVICE kIOReturnNoDevice
|
||||
|
||||
typedef IOReturn usb_ret_t;
|
||||
typedef IOUSBInterfaceInterface245 **usb_device_handle_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pthread_t th;
|
||||
volatile uint64_t regID;
|
||||
IOUSBDeviceInterface245 **dev;
|
||||
usb_device_handle_t handle;
|
||||
} stuff_t;
|
||||
usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len);
|
||||
#endif
|
||||
|
||||
#ifndef PALERAIN_VERSION
|
||||
#define PALERAIN_VERSION "2.0.0"
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <mach-o/loader.h>
|
||||
#include <mach-o/ldsyms.h>
|
||||
#else
|
||||
#define MH_MAGIC_64 0xfeedfacf
|
||||
#define MH_CIGAM_64 0xcffaedfe
|
||||
#define MH_KEXT_BUNDLE 0xb
|
||||
|
||||
typedef int cpu_type_t;
|
||||
typedef int cpu_subtype_t;
|
||||
|
||||
#define CPU_ARCH_ABI64 0x01000000
|
||||
#define CPU_TYPE_ARM ((cpu_type_t) 12)
|
||||
#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
|
||||
|
||||
struct mach_header_64
|
||||
{
|
||||
uint32_t magic; /* mach magic number identifier */
|
||||
cpu_type_t cputype; /* cpu specifier */
|
||||
cpu_subtype_t cpusubtype; /* machine specifier */
|
||||
uint32_t filetype; /* type of file */
|
||||
uint32_t ncmds; /* number of load commands */
|
||||
uint32_t sizeofcmds; /* the size of all the load commands */
|
||||
uint32_t flags; /* flags */
|
||||
uint32_t reserved; /* reserved */
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef void *(*pthread_start_t)(void *);
|
||||
|
||||
// Keep in sync with Pongo
|
||||
#define PONGO_USB_VENDOR 0x05ac
|
||||
#define PONGO_USB_PRODUCT 0x4141
|
||||
#define CMD_LEN_MAX 512
|
||||
#define UPLOADSZ_MAX (1024 * 1024 * 128)
|
||||
|
||||
typedef enum {
|
||||
LOG_FATAL = 0,
|
||||
LOG_ERROR = 1,
|
||||
LOG_WARNING = 2,
|
||||
LOG_INFO = 3,
|
||||
LOG_VERBOSE = 4,
|
||||
LOG_VERBOSE2 = 5,
|
||||
LOG_VERBOSE3 = 6,
|
||||
LOG_VERBOSE4 = 7,
|
||||
LOG_VERBOSE5 = 8,
|
||||
} log_level_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t ecid;
|
||||
char* productType;
|
||||
char* productVersion;
|
||||
char* buildVersion;
|
||||
char* CPUArchitecture;
|
||||
const char* displayName;
|
||||
} devinfo_t;
|
||||
|
||||
typedef struct {
|
||||
int mode;
|
||||
unsigned int cpid;
|
||||
char product_type[0x20];
|
||||
char display_name[0x20];
|
||||
char iboot_ver[0x20];
|
||||
} recvinfo_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t magic; /* 0xd803b376*/
|
||||
unsigned char* ptr; /* pointer to the override file in memory */
|
||||
unsigned int len; /* length of override file */
|
||||
unsigned char* orig_ptr; /* pointer to the overriden file */
|
||||
unsigned int orig_len; /* length of the overriden file */
|
||||
int fd; /* file descriptor of the override file */
|
||||
} override_file_t;
|
||||
|
||||
typedef unsigned char niarelap_file_t[];
|
||||
|
||||
extern unsigned int verbose;
|
||||
|
||||
extern char* pongo_path;
|
||||
#ifdef TUI
|
||||
extern bool tui_started;
|
||||
#endif
|
||||
|
||||
extern checkrain_option_t host_flags;
|
||||
extern checkrain_option_p host_flags_p;
|
||||
|
||||
extern pthread_t dfuhelper_thread, pongo_thread;
|
||||
extern int pongo_thr_running, dfuhelper_thr_running;
|
||||
|
||||
extern niarelap_file_t *kpf_to_upload_1, *ramdisk_to_upload_1, *overlay_to_upload_1;
|
||||
extern niarelap_file_t **kpf_to_upload, **ramdisk_to_upload, **overlay_to_upload;
|
||||
extern override_file_t override_ramdisk, override_kpf, override_overlay;
|
||||
|
||||
extern uint32_t checkrain_flags, palerain_flags, kpf_flags;
|
||||
extern pthread_mutex_t log_mutex;
|
||||
|
||||
extern pthread_mutex_t spin_mutex, found_pongo_mutex, ecid_dfu_wait_mutex;
|
||||
|
||||
extern int pongo_thr_running, dfuhelper_thr_running;
|
||||
extern bool device_has_booted;
|
||||
extern char xargs_cmd[0x270];
|
||||
extern char checkrain_flags_cmd[0x20];
|
||||
extern char palerain_flags_cmd[0x20];
|
||||
extern char kpf_flags_cmd[0x20];
|
||||
extern char dtpatch_cmd[0x20];
|
||||
extern char rootfs_cmd[512];
|
||||
extern char* ext_checkra1n;
|
||||
|
||||
void thr_cleanup(void* ptr);
|
||||
void* dfuhelper(void* ptr);
|
||||
int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxname, const char* __restrict format, ...);
|
||||
/* devhelper helpers */
|
||||
void devinfo_free(devinfo_t *dev);
|
||||
bool cpid_is_arm64(unsigned int cpid);
|
||||
/* devhelper commands */
|
||||
int subscribe_cmd(usbmuxd_event_cb_t device_event_cb, irecv_device_event_cb_t irecv_event_cb);
|
||||
int unsubscribe_cmd(void);
|
||||
int devinfo_cmd(devinfo_t *dev, const char *udid);
|
||||
int enter_recovery_cmd(const char* udid);
|
||||
int reboot_cmd(const char* udid);
|
||||
int passstat_cmd(unsigned char* status, const char* udid);
|
||||
int recvinfo_cmd(recvinfo_t* info, const uint64_t ecid);
|
||||
int autoboot_cmd(const uint64_t ecid);
|
||||
int exitrecv_cmd(const uint64_t ecid);
|
||||
|
||||
int exec_checkra1n(void);
|
||||
int override_file(override_file_t *finfo, niarelap_file_t** orig, unsigned int *orig_len, char *filename);
|
||||
void* pongo_helper(void* ptr);
|
||||
const unsigned char *
|
||||
boyermoore_horspool_memmem(const unsigned char* haystack, size_t hlen,
|
||||
const unsigned char* needle, size_t nlen);
|
||||
|
||||
|
||||
extern void* pongo_usb_callback(stuff_t* arg);
|
||||
usb_ret_t USBControlTransfer(usb_device_handle_t handle, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t wLength, void *data, uint32_t *wLenDone);
|
||||
const char *usb_strerror(usb_ret_t err);
|
||||
int wait_for_pongo(void);
|
||||
int upload_pongo_file(usb_device_handle_t, unsigned char*, unsigned int);
|
||||
int issue_pongo_command(usb_device_handle_t, char*);
|
||||
int tui(void);
|
||||
int optparse(int argc, char* argv[]);
|
||||
|
||||
bool get_spin(void);
|
||||
bool set_spin(bool val);
|
||||
bool get_found_pongo(void);
|
||||
void* pongo_helper(void* _);
|
||||
bool set_found_pongo(bool val);
|
||||
uint64_t get_ecid_wait_for_dfu(void);
|
||||
uint64_t set_ecid_wait_for_dfu(uint64_t ecid);
|
||||
|
||||
void write_stdout(char *buf, uint32_t len);
|
||||
void io_start(stuff_t *stuff);
|
||||
void io_stop(stuff_t *stuff);
|
||||
|
||||
void print_credits(void);
|
||||
|
||||
#ifdef TUI
|
||||
#include <newt.h>
|
||||
newtComponent get_tui_log();
|
||||
newtComponent set_tui_log(newtComponent co);
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
#ifndef TUI_H
|
||||
#define TUI_H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <newt.h>
|
||||
#include <kerninfo.h>
|
||||
|
||||
#define WIDTH 76
|
||||
#define HEIGHT 19
|
||||
|
||||
#define PI_LOG_COLOR NEWT_COLORSET_CUSTOM(0)
|
||||
#define PI_STEP_CURRENT NEWT_COLORSET_CUSTOM(1)
|
||||
#define PI_STEP_OTHER NEWT_COLORSET_CUSTOM(2)
|
||||
|
||||
#define CHECKBOX_STATE(flags, opt) checkrain_options_enabled(flags, opt) ? '*' : ' '
|
||||
|
||||
typedef enum tui_screens {
|
||||
ERROR_SCREEN = -1,
|
||||
EXIT_SCREEN = 0,
|
||||
MAIN_SCREEN = 1,
|
||||
OPTIONS_SCREEN = 2,
|
||||
ENTER_DFU_SCREEN = 3,
|
||||
JAILBREAKING_SCREEN = 4,
|
||||
ENTER_RECOVERY_SCREEN = 5
|
||||
} tui_screen_t;
|
||||
|
||||
typedef struct bitfield_checkbox_info {
|
||||
checkrain_option_p flags_p;
|
||||
checkrain_option_t opt;
|
||||
} tui_bit_info_t;
|
||||
|
||||
tui_screen_t tui_screen_main();
|
||||
tui_screen_t tui_screen_options();
|
||||
tui_screen_t tui_screen_enter_recovery();
|
||||
tui_screen_t tui_screen_enter_dfu();
|
||||
tui_screen_t tui_screen_jailbreak();
|
||||
|
||||
int redraw_screen();
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,28 +0,0 @@
|
||||
#ifndef XXD_EMBEDDED_H
|
||||
#define XXD_EMBEDDED_H
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
|
||||
extern unsigned char checkra1n[];
|
||||
extern unsigned int checkra1n_len;
|
||||
|
||||
extern unsigned char checkra1n_kpf_pongo[];
|
||||
extern unsigned int checkra1n_kpf_pongo_len;
|
||||
|
||||
extern unsigned char ramdisk_dmg[];
|
||||
extern unsigned int ramdisk_dmg_len;
|
||||
|
||||
extern unsigned char binpack_dmg[];
|
||||
extern unsigned int binpack_dmg_len;
|
||||
|
||||
extern unsigned char Pongo_bin[];
|
||||
extern unsigned int Pongo_bin_len;
|
||||
|
||||
#if defined(__APPLE__) && (TARGET_OS_IPHONE || defined(DEV_BUILD))
|
||||
extern unsigned char libcheckra1nhelper_dylib[];
|
||||
extern unsigned int libcheckra1nhelper_dylib_len;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
+11
@@ -0,0 +1,11 @@
|
||||
binpack=/jbin/binpack
|
||||
|
||||
# uicache loader app
|
||||
$binpack/bin/rm -rf /var/.palera1n/loader.app
|
||||
$binpack/usr/bin/uicache -p /jbin/loader.app
|
||||
|
||||
# respring
|
||||
$binpack/usr/bin/killall -9 SpringBoard
|
||||
|
||||
echo "[post.sh] done"
|
||||
exit
|
||||
@@ -1,17 +0,0 @@
|
||||
Package: palera1n
|
||||
Name: palera1n
|
||||
Version: @DEB_VERSION@
|
||||
Architecture: @DEB_ARCH@
|
||||
Maintainer: palera1n team
|
||||
Author: palera1n team
|
||||
Depends: usbmuxd
|
||||
Section: Utilities
|
||||
Priority: optional
|
||||
Homepage: https://palera.in
|
||||
Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
|
||||
palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
|
||||
based on the checkm8 exploit.
|
||||
.
|
||||
palera1n is able to jailbreak the device in fakefs-rootful mode,
|
||||
where / is writable, as well as rootless mode, where / cannot be
|
||||
written to.
|
||||
@@ -1,16 +0,0 @@
|
||||
Package: palera1n
|
||||
Name: palera1n
|
||||
Version: @DEB_VERSION@
|
||||
Architecture: @DEB_ARCH@
|
||||
Maintainer: palera1n team
|
||||
Author: palera1n team
|
||||
Section: Utilities
|
||||
Priority: optional
|
||||
Homepage: https://palera.in
|
||||
Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
|
||||
palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
|
||||
based on the checkm8 exploit.
|
||||
.
|
||||
palera1n is able to jailbreak the device in fakefs-rootful mode,
|
||||
where / is writable, as well as rootless mode, where / cannot be
|
||||
written to.
|
||||
Executable
+1125
File diff suppressed because it is too large.
Load diff
@@ -1,23 +0,0 @@
|
||||
Description: Add no-op option -V for compatibility
|
||||
|
||||
Index: b/src/daemon/cmdline.c
|
||||
===================================================================
|
||||
--- a/src/daemon/cmdline.c 2008-05-29 02:26:08.000000000 +0300
|
||||
+++ b/src/daemon/cmdline.c 2008-06-11 05:46:23.000000000 +0300
|
||||
@@ -32,7 +32,7 @@
|
||||
void cmdline(int argc, char **argv)
|
||||
{
|
||||
extern struct options option;
|
||||
- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23";
|
||||
+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV23";
|
||||
int opt;
|
||||
|
||||
/* initialize for the dual mouse */
|
||||
@@ -81,6 +81,7 @@ void cmdline(int argc, char **argv)
|
||||
case 'u': option.autodetect = 1; break;
|
||||
case 'T': opt_test++; break;
|
||||
case 'v': printf(GPM_MESS_VERSION "\n"); exit(0);
|
||||
+ case 'V': /* Compat code */ break;
|
||||
case '2': (which_mouse->opt_three) = -1; break;
|
||||
case '3': (which_mouse->opt_three) = 1; break;
|
||||
default: exit(usage("commandline"));
|
||||
@@ -1,39 +0,0 @@
|
||||
Description: source code of gpm_has_mouse_control helper
|
||||
|
||||
Index: b/contrib/control/gpm_has_mouse_control.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ b/contrib/control/gpm_has_mouse_control.c 2007-12-10 08:25:45.000000000 +0200
|
||||
@@ -0,0 +1,20 @@
|
||||
+#include <sys/fcntl.h>
|
||||
+#include <sys/kd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+
|
||||
+int main (int argc, char **argv)
|
||||
+{
|
||||
+ int fd;
|
||||
+ int mode;
|
||||
+ fd = open ("/dev/tty0", O_RDONLY);
|
||||
+ if (fd == -1)
|
||||
+ fd = open ("/dev/vc/0", O_RDONLY);
|
||||
+ if (fd == -1)
|
||||
+ perror ("open");
|
||||
+ if (ioctl (fd, KDGETMODE, &mode) != 0)
|
||||
+ perror ("ioctl");
|
||||
+ exit(mode);
|
||||
+}
|
||||
+
|
||||
Index: b/contrib/control/Makefile
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ b/contrib/control/Makefile 2007-12-10 08:25:45.000000000 +0200
|
||||
@@ -0,0 +1,7 @@
|
||||
+CC := gcc
|
||||
+
|
||||
+all: gpm_has_mouse_control.c
|
||||
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o gpm_has_mouse_control -Wall gpm_has_mouse_control.c
|
||||
+
|
||||
+clean:
|
||||
+ -rm -f gpm_has_mouse_control
|
||||
@@ -1,107 +0,0 @@
|
||||
Description: Use MAX_NR_CONSOLES instead of MAX_VC
|
||||
|
||||
--- a/src/daemon/gpm.c
|
||||
+++ b/src/daemon/gpm.c
|
||||
@@ -93,7 +93,7 @@
|
||||
int fifofd=-1;
|
||||
|
||||
int eventFlag=0;
|
||||
-Gpm_Cinfo *cinfo[MAX_VC+1];
|
||||
+Gpm_Cinfo *cinfo[MAX_NR_CONSOLES+1];
|
||||
|
||||
time_t last_selection_time;
|
||||
time_t opt_age_limit = 0;
|
||||
--- a/src/daemon/old_main.c
|
||||
+++ b/src/daemon/old_main.c
|
||||
@@ -141,7 +141,7 @@
|
||||
signal(SIGWINCH,gpm_killed); /* reinstall handler */
|
||||
|
||||
/* and notify clients */
|
||||
- for(i=0; i<MAX_VC+1; i++) {
|
||||
+ for(i=0; i<=MAX_NR_CONSOLES; i++) {
|
||||
Gpm_Cinfo *ci;
|
||||
for (ci = cinfo[i]; ci; ci = ci->next) kill(ci->data.pid,SIGWINCH);
|
||||
}
|
||||
@@ -214,7 +214,7 @@
|
||||
/*........................ got request */
|
||||
|
||||
/* itz 10-22-96 check _all_ clients, not just those on top! */
|
||||
- for (i=0; pending && (i<=MAX_VC); i++) {
|
||||
+ for (i=0; pending && (i<=MAX_NR_CONSOLES); i++) {
|
||||
Gpm_Cinfo* ci;
|
||||
for (ci = cinfo[i]; pending && ci; ci = ci->next) {
|
||||
if (FD_ISSET(ci->fd,&selSet)) {
|
||||
--- a/src/daemon/processconn.c
|
||||
+++ b/src/daemon/processconn.c
|
||||
@@ -67,8 +67,8 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if((vc = request->vc) > MAX_VC) {
|
||||
- gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
|
||||
+ if((vc = request->vc) > MAX_NR_CONSOLES) {
|
||||
+ gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_NR_CONSOLES);
|
||||
free(info);
|
||||
close(newfd);
|
||||
return -1;
|
||||
--- a/src/daemon/processrequest.c
|
||||
+++ b/src/daemon/processrequest.c
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc);
|
||||
|
||||
- if (vc>MAX_VC) return -1;
|
||||
+ if (vc>MAX_NR_CONSOLES) return -1;
|
||||
|
||||
/* itz 10-22-96 this shouldn't happen now */
|
||||
if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD);
|
||||
--- a/src/headers/daemon.h
|
||||
+++ b/src/headers/daemon.h
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
#include "gpm.h" /* Gpm_Event */
|
||||
#include <sys/select.h> /* fd_set */
|
||||
+#include <linux/vt.h> /* for cinfo -- to be moved to os/linux in 2.x! */
|
||||
|
||||
/*************************************************************************
|
||||
* Types / structures
|
||||
@@ -104,13 +105,6 @@
|
||||
* Macros
|
||||
*/
|
||||
|
||||
-/* How many virtual consoles are managed? */
|
||||
-#ifndef MAX_NR_CONSOLES
|
||||
-# define MAX_NR_CONSOLES 64 /* this is always sure */
|
||||
-#endif
|
||||
-
|
||||
-#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */
|
||||
-
|
||||
/* for adding a mouse; add_mouse */
|
||||
#define GPM_ADD_DEVICE 0
|
||||
#define GPM_ADD_TYPE 1
|
||||
@@ -174,7 +168,7 @@
|
||||
extern int eventFlag;
|
||||
extern struct winsize win;
|
||||
|
||||
-extern Gpm_Cinfo *cinfo[MAX_VC+1];
|
||||
+extern Gpm_Cinfo *cinfo[MAX_NR_CONSOLES+1];
|
||||
|
||||
extern struct mouse_features mouse_table[3],
|
||||
*which_mouse; /*the current one*/
|
||||
--- a/src/headers/gpmCfg.h
|
||||
+++ b/src/headers/gpmCfg.h
|
||||
@@ -32,14 +32,6 @@
|
||||
#include <linux/tty.h>
|
||||
#endif
|
||||
|
||||
-/* FIXME: still needed ?? */
|
||||
-/* How many virtual consoles are managed? */
|
||||
-#ifndef MAX_NR_CONSOLES
|
||||
-# define MAX_NR_CONSOLES 64 /* this is always sure */
|
||||
-#endif
|
||||
-
|
||||
-#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */
|
||||
-
|
||||
/* How many buttons may the mouse have? */
|
||||
/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
Description: Add AC_CANONICAL_HOST
|
||||
|
||||
--- a/configure.ac.footer
|
||||
+++ b/configure.ac.footer
|
||||
@@ -35,6 +35,8 @@
|
||||
# Find programs
|
||||
#
|
||||
|
||||
+AC_CANONICAL_HOST
|
||||
+
|
||||
AC_PROG_CC
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
@@ -1,16 +0,0 @@
|
||||
Description: Fix FTBFS with -Wformat-security
|
||||
Author: Axel Beckert <[email protected]>
|
||||
Bug-Debian: https://bugs.debian.org/888792
|
||||
Bug-Debian: https://bugs.debian.org/888797
|
||||
|
||||
--- a/src/lib/report-lib.c
|
||||
+++ b/src/lib/report-lib.c
|
||||
@@ -47,7 +47,7 @@
|
||||
log_level = LOG_CRIT; break;
|
||||
}
|
||||
#ifdef HAVE_VSYSLOG
|
||||
- syslog(log_level, string);
|
||||
+ syslog(log_level, "%s", string);
|
||||
vsyslog(log_level, text, ap);
|
||||
#else
|
||||
fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
|
||||
@@ -1,133 +0,0 @@
|
||||
Description: Fix spelling errors found by lintian
|
||||
Author: Axel Beckert <[email protected]>
|
||||
|
||||
--- a/doc/FAQ
|
||||
+++ b/doc/FAQ
|
||||
@@ -132,7 +132,7 @@
|
||||
to keep hold of processor time for at least 1 second).
|
||||
- no pnp vendor will be able to support three buttons any more (no
|
||||
more mouse protocols, all mice must behave the same).
|
||||
- - similary, only 1200 baud devices (any serial device) are supported,
|
||||
+ - similarly, only 1200 baud devices (any serial device) are supported,
|
||||
because the initialization string of pnp devices only tells
|
||||
the vendor and release, with no information about required
|
||||
port configuration.
|
||||
--- a/doc/doc.gpm.in
|
||||
+++ b/doc/doc.gpm.in
|
||||
@@ -394,7 +394,7 @@
|
||||
automatically forces the @emph{repeater} (@samp{\-R}) option on.
|
||||
|
||||
@item \-o @var{list-of-extra-options}
|
||||
- The option works similary to the ``\-o'' option of mount; it is
|
||||
+ The option works similarly to the ``\-o'' option of mount; it is
|
||||
used to specify a list of ``extra options'' that are specific
|
||||
to each mouse type. The list is comma-separated. The options
|
||||
@samp{dtr}, @samp{rts} or @samp{both} are used by the serial
|
||||
--- a/src/daemon/old_main.c
|
||||
+++ b/src/daemon/old_main.c
|
||||
@@ -190,7 +190,7 @@
|
||||
/*....................................... got mouse, process event */
|
||||
/*
|
||||
* Well, actually, run a loop to maintain inlining of functions without
|
||||
- * lenghtening the file. This is not too clean a code, but it works....
|
||||
+ * lengthening the file. This is not too clean a code, but it works....
|
||||
*/
|
||||
|
||||
for (i=1; i <= 1+opt_double; i++) {
|
||||
--- a/src/mice.c
|
||||
+++ b/src/mice.c
|
||||
@@ -122,7 +122,7 @@
|
||||
break;
|
||||
}
|
||||
if (p->type == ARGV_END) { /* not found */
|
||||
- fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n",
|
||||
+ fprintf(stderr, "%s: Unknown option \"%s\" for pointer \"%s\"\n",
|
||||
option.progname, argv[i], argv[0]);
|
||||
errors++;
|
||||
continue;
|
||||
--- a/src/prog/mouse-test.c
|
||||
+++ b/src/prog/mouse-test.c
|
||||
@@ -524,7 +524,7 @@
|
||||
Gpm_Event event;
|
||||
|
||||
if (packetsize!=cur->this->packetlen) {
|
||||
- REMOVETYPE(cur,"different packet lenght");
|
||||
+ REMOVETYPE(cur,"different packet length");
|
||||
continue;
|
||||
}
|
||||
|
||||
--- a/src/synaptics.c
|
||||
+++ b/src/synaptics.c
|
||||
@@ -2471,7 +2471,7 @@
|
||||
#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */
|
||||
|
||||
|
||||
-/* Normal ps2 responce */
|
||||
+/* Normal ps2 response */
|
||||
#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/
|
||||
#define PS2_ACK 0xFA /* Command acknowledge */
|
||||
#define PS2_READY 0xAA /* Send after a calibration or ERROR */
|
||||
@@ -2538,7 +2538,7 @@
|
||||
}
|
||||
|
||||
# ifdef DEBUG_PUTBYTE_ACK
|
||||
- gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b);
|
||||
+ gpm_report(GPM_PR_DEBUG,"Response %X to byte %X",ack,b);
|
||||
# endif
|
||||
|
||||
return ack;
|
||||
@@ -2565,11 +2565,11 @@
|
||||
|
||||
/* Do some sanity checking */
|
||||
if((response[0] & 0xFC) != 0x84) {
|
||||
- gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid");
|
||||
+ gpm_report (GPM_PR_ERR,"Byte 0 of stick device response is not valid");
|
||||
return -1;
|
||||
}
|
||||
if((response[3] & 0xCC) != 0xC4) {
|
||||
- gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid");
|
||||
+ gpm_report (GPM_PR_ERR,"Byte 3 of stick device response is not valid");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -2844,7 +2844,7 @@
|
||||
byte status,id_code = PS2_MOUSE_IDCODE;
|
||||
byte reset_cmd = PS2_RESET;
|
||||
|
||||
- gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad"));
|
||||
+ gpm_report(GPM_PR_DEBUG,"Resetting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad"));
|
||||
|
||||
/* Send reset command without eating the ack. */
|
||||
if(!stick) {
|
||||
@@ -2871,11 +2871,11 @@
|
||||
usleep(750000);
|
||||
|
||||
if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){
|
||||
- gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n"
|
||||
+ gpm_report(GPM_PR_ERR,"Resetting PS/2 Device failed: No READY, got %02X.\n"
|
||||
"Check pc_keyb.c for reconnect smartness.\n",status);
|
||||
}
|
||||
if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){
|
||||
- gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code);
|
||||
+ gpm_report(GPM_PR_ERR,"Resetting PS/2 Device failed: Wrong ID, got %02X.\n",id_code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3155,7 +3155,7 @@
|
||||
|
||||
void syn_serial_reset(int fd)
|
||||
{
|
||||
- gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad.");
|
||||
+ gpm_report (GPM_PR_INFO,"Resetting Synaptic Serial Touchpad.");
|
||||
|
||||
syn_serial_set_mode (fd, (RELATIVE_MODE |
|
||||
HIGH_REPORT_RATE |
|
||||
@@ -3247,7 +3247,7 @@
|
||||
|
||||
void syn_ps2_reset (int fd)
|
||||
{
|
||||
- gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad.");
|
||||
+ gpm_report (GPM_PR_INFO,"Resetting Synaptic PS/2 Touchpad.");
|
||||
|
||||
/* Stop incoming motion data (of whatever kind absolute/relative). */
|
||||
tp_ps2_disable_data(fd);
|
||||
@@ -1,63 +0,0 @@
|
||||
Origin: http://download.nutyx.org/x86_64/rolling/cli/gpm/gpm-1.20.7-consolidated-1.patch
|
||||
Bug: https://github.com/telmich/gpm/issues/21
|
||||
Bug-Debian: https://bugs.debian.org/886903
|
||||
Bug-LFS: https://wiki.linuxfromscratch.org/blfs/ticket/9616#ticket
|
||||
Author: tnut from nutyx.org, https://github.com/tnut
|
||||
Description: Fix FTBFS with glibc 2.26
|
||||
|
||||
--- a/src/daemon/open_console.c
|
||||
+++ b/src/daemon/open_console.c
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <sys/ioctl.h> /* ioctl */
|
||||
#include <sys/types.h> /* major() */
|
||||
|
||||
+#ifdef HAVE_SYS_SYSMACROS_H
|
||||
+#include <sys/sysmacros.h> /* major() w/newer glibc */
|
||||
+#endif
|
||||
+
|
||||
/* Linux specific (to be outsourced in gpm2 */
|
||||
#include <linux/serial.h> /* for serial console check */
|
||||
#include <asm/ioctls.h> /* for serial console check */
|
||||
--- a/src/prog/gpm-root.y
|
||||
+++ b/src/prog/gpm-root.y
|
||||
@@ -443,6 +443,7 @@
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
+#if 0
|
||||
static int f_debug_one(FILE *f, Draw *draw)
|
||||
{
|
||||
DrawItem *ip;
|
||||
@@ -465,6 +466,7 @@
|
||||
#undef LINE
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
int f_debug(int mode, DrawItem *self, int uid)
|
||||
{
|
||||
@@ -960,10 +962,8 @@
|
||||
/*------------*/
|
||||
static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
|
||||
{
|
||||
- int x,y, dumpfd;
|
||||
+ int dumpfd;
|
||||
char dumpname[20];
|
||||
-
|
||||
- x=buffer[2]; y=buffer[3];
|
||||
|
||||
/* WILL NOT WORK WITH DEVFS! FIXME! */
|
||||
sprintf(dumpname,"/dev/vcsa%i",vc);
|
||||
@@ -1196,11 +1196,7 @@
|
||||
LOG_DAEMON : LOG_USER);
|
||||
/* reap your zombies */
|
||||
childaction.sa_handler=reap_children;
|
||||
-#if defined(__GLIBC__)
|
||||
- __sigemptyset(&childaction.sa_mask);
|
||||
-#else /* __GLIBC__ */
|
||||
- childaction.sa_mask=0;
|
||||
-#endif /* __GLIBC__ */
|
||||
+ sigemptyset(&childaction.sa_mask);
|
||||
childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
|
||||
sigaction(SIGCHLD,&childaction,NULL);
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
Description: FTBFS with gcc-10 due to -fno-commons
|
||||
Author: Sergei Trofimovich <[email protected]>
|
||||
Reviewed-By: Helmut Grohne <[email protected]>
|
||||
Origin: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f7e2ac82fc5a1847c132057fb7de1a996d66c76
|
||||
Forwarded: https://github.com/telmich/gpm/pull/37
|
||||
Bug: https://github.com/telmich/gpm/pull/37
|
||||
Bug-Gentoo: https://bugs.gentoo.org/705878
|
||||
Bug-Debian: https://bugs.debian.org/953266
|
||||
|
||||
--- a/src/headers/daemon.h
|
||||
+++ b/src/headers/daemon.h
|
||||
@@ -176,7 +176,7 @@
|
||||
extern Gpm_Type mice[];
|
||||
extern Gpm_Type *repeated_type;
|
||||
|
||||
-time_t last_selection_time;
|
||||
+extern time_t last_selection_time;
|
||||
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
Description: Add musl support
|
||||
* Use SA_NODEFER instead of its non-standard alias SA_NOMASK.
|
||||
* Add missing sys/select.h and fcntl.h includes.
|
||||
* Use standard sigemptyset unconditionally.
|
||||
* Define SA_INTERRUPT if it's not defined (historical no-op).
|
||||
* With these changes gpm builds against musl libc.
|
||||
Author: Szabolcs Nagy <[email protected]>
|
||||
Bug-Debian: https://bugs.debian.org/813751
|
||||
|
||||
--- a/src/lib/liblow.c
|
||||
+++ b/src/lib/liblow.c
|
||||
@@ -179,7 +179,7 @@
|
||||
/* Reincarnation. Prepare for another death early. */
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_handler = gpm_suspend_hook;
|
||||
- sa.sa_flags = SA_NOMASK;
|
||||
+ sa.sa_flags = SA_NODEFER;
|
||||
sigaction (SIGTSTP, &sa, 0);
|
||||
|
||||
/* Pop the gpm stack by closing the useless connection */
|
||||
@@ -386,7 +386,7 @@
|
||||
|
||||
/* if signal was originally ignored, job control is not supported */
|
||||
if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) {
|
||||
- sa.sa_flags = SA_NOMASK;
|
||||
+ sa.sa_flags = SA_NODEFER;
|
||||
sa.sa_handler = gpm_suspend_hook;
|
||||
sigaction(SIGTSTP, &sa, 0);
|
||||
}
|
||||
--- a/src/prog/display-buttons.c
|
||||
+++ b/src/prog/display-buttons.c
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <stdio.h> /* printf() */
|
||||
#include <time.h> /* time() */
|
||||
#include <errno.h> /* errno */
|
||||
+#include <sys/select.h> /* fd_set, FD_ZERO */
|
||||
#include <gpm.h> /* gpm information */
|
||||
|
||||
/* display resulting data */
|
||||
--- a/src/prog/display-coords.c
|
||||
+++ b/src/prog/display-coords.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <stdio.h> /* printf() */
|
||||
#include <time.h> /* time() */
|
||||
#include <errno.h> /* errno */
|
||||
+#include <sys/select.h> /* fd_set, FD_ZERO */
|
||||
#include <gpm.h> /* gpm information */
|
||||
|
||||
/* display resulting data */
|
||||
--- a/src/prog/gpm-root.y
|
||||
+++ b/src/prog/gpm-root.y
|
||||
@@ -1197,6 +1197,9 @@
|
||||
/* reap your zombies */
|
||||
childaction.sa_handler=reap_children;
|
||||
sigemptyset(&childaction.sa_mask);
|
||||
+#ifndef SA_INTERRUPT
|
||||
+#define SA_INTERRUPT 0
|
||||
+#endif
|
||||
childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
|
||||
sigaction(SIGCHLD,&childaction,NULL);
|
||||
|
||||
--- a/contrib/control/gpm_has_mouse_control.c
|
||||
+++ b/contrib/control/gpm_has_mouse_control.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-#include <sys/fcntl.h>
|
||||
+#include <fcntl.h>
|
||||
#include <sys/kd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -1,35 +0,0 @@
|
||||
From 632cdb6de3f1693fb90d60d81552b723e8dd5e84 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Chan <[email protected]>
|
||||
Date: Wed, 25 Jan 2023 01:53:00 +0800
|
||||
Subject: [PATCH] Allow empty x509 cert issuer
|
||||
|
||||
---
|
||||
library/x509_crt.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/library/x509_crt.c b/library/x509_crt.c
|
||||
index 0eee97cb6..46702f683 100644
|
||||
--- a/library/x509_crt.c
|
||||
+++ b/library/x509_crt.c
|
||||
@@ -1185,14 +1185,14 @@ static int x509_crt_parse_der_core( mbedtls_x509_crt *crt,
|
||||
if( ( ret = mbedtls_asn1_get_tag( &p, end, &len,
|
||||
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 )
|
||||
{
|
||||
- mbedtls_x509_crt_free( crt );
|
||||
- return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_FORMAT, ret ) );
|
||||
+ // mbedtls_x509_crt_free( crt );
|
||||
+ // return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_FORMAT, ret ) );
|
||||
}
|
||||
|
||||
if( ( ret = mbedtls_x509_get_name( &p, p + len, &crt->issuer ) ) != 0 )
|
||||
{
|
||||
- mbedtls_x509_crt_free( crt );
|
||||
- return( ret );
|
||||
+ // mbedtls_x509_crt_free( crt );
|
||||
+ // return( ret );
|
||||
}
|
||||
|
||||
crt->issuer_raw.len = p - crt->issuer_raw.p;
|
||||
--
|
||||
2.39.1
|
||||
|
||||
Submodule
+1
Submodule ramdisk added at 2cff81b1e9.
-154
@@ -1,154 +0,0 @@
|
||||
all: palera1n
|
||||
|
||||
OBJECTS = main.o dfuhelper.o devhelper.o lockdown_helper.o
|
||||
OBJECTS += optparse.o override_file.o log.o lock_vars.o credits.o
|
||||
OBJECTS += fake_embedded.o exec_checkra1n.o pongo_helper.o
|
||||
OBJECTS += boyermoore_memmem.o
|
||||
|
||||
ifeq (,$(findstring macosx, $(CFLAGS)))
|
||||
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
||||
OBJECTS += xxd-libcheckra1nhelper.dylib.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(FORCE_HELPER),1)
|
||||
OBJECTS += xxd-libcheckra1nhelper.dylib.o
|
||||
CFLAGS += -DFORCE_HELPER
|
||||
BUILD_OPTIONS += FORCE_HELPER
|
||||
endif
|
||||
|
||||
ifneq ($(NO_RAMDISK),1)
|
||||
OBJECTS += xxd-ramdisk.dmg.o
|
||||
else
|
||||
CFLAGS += -DNO_RAMDISK
|
||||
BUILD_OPTIONS += NO_RAMDISK
|
||||
endif
|
||||
ifneq ($(NO_KPF),1)
|
||||
OBJECTS += xxd-checkra1n-kpf-pongo.o
|
||||
else
|
||||
CFLAGS += -DNO_KPF
|
||||
BUILD_OPTIONS += NO_KPF
|
||||
endif
|
||||
ifneq ($(NO_OVERLAY),1)
|
||||
OBJECTS += xxd-binpack.dmg.o
|
||||
else
|
||||
CFLAGS += -DNO_OVERLAY
|
||||
BUILD_OPTIONS += NO_OVERLAY
|
||||
endif
|
||||
ifneq ($(NO_CHECKRAIN),1)
|
||||
OBJECTS += xxd-checkra1n.o
|
||||
else
|
||||
CFLAGS += -DNO_CHECKRAIN
|
||||
BUILD_OPTIONS += NO_CHECKRAIN
|
||||
endif
|
||||
|
||||
ifneq ($(NO_CUSTOM_PONGO),1)
|
||||
OBJECTS += xxd-Pongo.bin.o
|
||||
else
|
||||
CFLAGS += -DNO_CUSTOM_PONGO
|
||||
BUILD_OPTIONS += NO_CUSTOM_PONGO
|
||||
endif
|
||||
|
||||
ifeq ($(TUI),1)
|
||||
OBJECTS += tui_screen_enter_recovery.o tui_screen_enter_dfu.o tui_main.o
|
||||
OBJECTS += tui_screen_jailbreak.o tui_screen_main.o tui_screen_options.o
|
||||
BUILD_OPTIONS += TUI
|
||||
CFLAGS += -DTUI
|
||||
endif
|
||||
|
||||
CHECKRA1N_VERSION ?= 0.1337.1
|
||||
LIPO = lipo
|
||||
LDID = ldid
|
||||
|
||||
ifeq ($(TARGET_OS),Darwin)
|
||||
ifneq ($(USE_LIBUSB),1)
|
||||
OBJECTS += usb_iokit.o
|
||||
else
|
||||
LIBS += -framework SystemConfiguration -framework Security
|
||||
BUILD_OPTIONS += USE_LIBUSB
|
||||
endif
|
||||
# add lto and debug symbols for lto
|
||||
CFLAGS += -flto=full -g
|
||||
LDFLAGS += -Wl,-object_path_lto,lto.o
|
||||
else
|
||||
USE_LIBUSB = 1
|
||||
endif
|
||||
|
||||
ifeq ($(USE_LIBUSB),1)
|
||||
OBJECTS += usb_libusb.o
|
||||
CFLAGS += -DUSE_LIBUSB=1
|
||||
LIBS += $(DEP)/lib/libusb-1.0.a
|
||||
endif
|
||||
|
||||
ifneq ($(ROOTFUL),0)
|
||||
CFLAGS += -DROOTFUL=1
|
||||
BUILD_OPTIONS += ROOTFUL
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_OPTIONS),)
|
||||
BUILD_OPTIONS = (none)
|
||||
endif
|
||||
|
||||
CFLAGS += -DBUILD_OPTIONS=\""$(BUILD_OPTIONS)"\"
|
||||
|
||||
checkra1n-%:
|
||||
curl -LO https://assets.checkra.in/downloads/preview/$(CHECKRA1N_VERSION)/$@
|
||||
chmod 755 $@
|
||||
|
||||
checkra1n: checkra1n-macos usb.xml
|
||||
ifeq ($(TARGET_OS),Darwin)
|
||||
ifneq (,$(findstring arm64, $(CFLAGS)))
|
||||
$(LIPO) -thin arm64 -output checkra1n checkra1n-macos
|
||||
else ifneq (,$(findstring x86_64, $(CFLAGS)))
|
||||
$(LIPO) -thin x86_64 -output checkra1n checkra1n-macos
|
||||
else ifeq ($(shell arch),i386)
|
||||
$(LIPO) -thin x86_64 -output checkra1n checkra1n-macos
|
||||
else
|
||||
$(LIPO) -thin $(shell arch) -output checkra1n checkra1n-macos
|
||||
endif
|
||||
ifeq (,$(findstring macosx, $(CFLAGS)))
|
||||
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
||||
vtool -remove-build-version 1 -replace -output checkra1n checkra1n
|
||||
vtool -set-build-version $(FAKE_PLATFORM) $(FAKE_MINOS) $(FAKE_SDK) -replace -output checkra1n checkra1n
|
||||
install_name_tool -change /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit /System/Library/Frameworks/IOKit.framework/IOKit checkra1n
|
||||
install_name_tool -change /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation checkra1n
|
||||
$(LDID) -Susb.xml checkra1n
|
||||
endif
|
||||
endif
|
||||
else
|
||||
cp checkra1n-$(CHECKRA1N_NAME) checkra1n
|
||||
endif
|
||||
|
||||
xxd-%.c: %
|
||||
xxd -iC $< > $@
|
||||
|
||||
%.o: %.c $(wildcard ../include/*.h)
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
palera1n: $(OBJECTS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o palera1n
|
||||
ifeq (,$(findstring macosx, $(CFLAGS)))
|
||||
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
||||
$(LDID) -Susb.xml palera1n
|
||||
endif
|
||||
endif
|
||||
|
||||
libcheckra1nhelper.dylib: chkstk.S
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -shared chkstk.S -o libcheckra1nhelper.dylib
|
||||
|
||||
checkra1n-kpf-pongo:
|
||||
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/kpf/checkra1n-kpf-pongo
|
||||
|
||||
ramdisk.dmg:
|
||||
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/jbinit_rootless/ramdisk.dmg
|
||||
|
||||
binpack.dmg:
|
||||
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg
|
||||
|
||||
Pongo.bin:
|
||||
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/kpf/Pongo.bin
|
||||
|
||||
clean:
|
||||
rm -rf *.o palera1n checkra1n checkra1n.c palera1n.dSYM libcheckra1nhelper.dylib
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -1,59 +0,0 @@
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
const unsigned char *
|
||||
boyermoore_horspool_memmem(const unsigned char* haystack, size_t hlen,
|
||||
const unsigned char* needle, size_t nlen)
|
||||
{
|
||||
size_t scan = 0;
|
||||
size_t bad_char_skip[UCHAR_MAX + 1]; /* Officially called:
|
||||
* bad character shift */
|
||||
|
||||
/* Sanity checks on the parameters */
|
||||
if (nlen <= 0 || !haystack || !needle)
|
||||
return NULL;
|
||||
|
||||
/* ---- Preprocess ---- */
|
||||
/* Initialize the table to default value */
|
||||
/* When a character is encountered that does not occur
|
||||
* in the needle, we can safely skip ahead for the whole
|
||||
* length of the needle.
|
||||
*/
|
||||
for (scan = 0; scan <= UCHAR_MAX; scan = scan + 1)
|
||||
bad_char_skip[scan] = nlen;
|
||||
|
||||
/* C arrays have the first byte at [0], therefore:
|
||||
* [nlen - 1] is the last byte of the array. */
|
||||
size_t last = nlen - 1;
|
||||
|
||||
/* Then populate it with the analysis of the needle */
|
||||
for (scan = 0; scan < last; scan = scan + 1)
|
||||
bad_char_skip[needle[scan]] = last - scan;
|
||||
|
||||
/* ---- Do the matching ---- */
|
||||
|
||||
/* Search the haystack, while the needle can still be within it. */
|
||||
while (hlen >= nlen)
|
||||
{
|
||||
/* scan from the end of the needle */
|
||||
for (scan = last; haystack[scan] == needle[scan]; scan = scan - 1)
|
||||
if (scan == 0) /* If the first byte matches, we've found it. */
|
||||
{
|
||||
return haystack;
|
||||
}
|
||||
|
||||
/* otherwise, we need to skip some bytes and start again.
|
||||
Note that here we are getting the skip value based on the last byte
|
||||
of needle, no matter where we didn't match. So if needle is: "abcd"
|
||||
then we are skipping based on 'd' and that value will be 4, and
|
||||
for "abcdd" we again skip on 'd' but the value will be only 1.
|
||||
The alternative of pretending that the mismatched character was
|
||||
the last character is slower in the normal case (E.g. finding
|
||||
"abcd" in "...azcd..." gives 4 by using 'd' but only
|
||||
4-2==2 using 'z'. */
|
||||
hlen -= bad_char_skip[haystack[last]];
|
||||
haystack += bad_char_skip[haystack[last]];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
#define _PTHREAD_STRUCT_DIRECT_STACKADDR_OFFSET -48
|
||||
#define _PTHREAD_STRUCT_DIRECT_STACKBOTTOM_OFFSET -40
|
||||
|
||||
.align 4
|
||||
_thread_chkstk_darwin:
|
||||
.globl ___chkstk_darwin
|
||||
___chkstk_darwin: // %w9/x9 == alloca size
|
||||
stp x10, x11, [sp, #-16]
|
||||
|
||||
// validate that the frame pointer is on our stack (no alt stack)
|
||||
mrs x10, TPIDRRO_EL0
|
||||
|
||||
// (%sp - pthread_self()->stackaddr) > 0 ?
|
||||
#if defined(__ARM64_ARCH_8_32__)
|
||||
ubfx x9, x9, #0, #32
|
||||
ldur w11, [x10, _PTHREAD_STRUCT_DIRECT_STACKADDR_OFFSET]
|
||||
#else
|
||||
ldur x11, [x10, _PTHREAD_STRUCT_DIRECT_STACKADDR_OFFSET]
|
||||
#endif
|
||||
subs x11, sp, x11
|
||||
b.hs Lprobe
|
||||
|
||||
// %sp <= pthread_self()->stackbottom ?
|
||||
#if defined(__ARM64_ARCH_8_32__)
|
||||
ldur w11, [x10, _PTHREAD_STRUCT_DIRECT_STACKBOTTOM_OFFSET]
|
||||
#else
|
||||
ldur x11, [x10, _PTHREAD_STRUCT_DIRECT_STACKBOTTOM_OFFSET]
|
||||
#endif
|
||||
mov x10, sp
|
||||
cmp x10, x11
|
||||
b.ls Lprobe
|
||||
|
||||
// %sp - (uintptr_t)%x9 < pthread_self()->stackbottom ?
|
||||
subs x10, x10, x9
|
||||
b.lo Lcrash
|
||||
cmp x10, x11
|
||||
b.lo Lcrash
|
||||
|
||||
Lexit:
|
||||
ldp x10, x11, [sp, #-16]
|
||||
ret
|
||||
|
||||
Lcrash:
|
||||
// POSIX mandates that stack overflow crashes with SIGSEGV
|
||||
// so load an address in the guard page and dereference it
|
||||
//
|
||||
// x11 contains pthread_self()->stackbottom already
|
||||
ldr x11, [x11, #-8]
|
||||
// if main_thread caused stack growth with setrlimit()
|
||||
// fall into Lprobe and eventually cause SIGSEGV.
|
||||
|
||||
Lprobe:
|
||||
mov x10, sp
|
||||
cmp x9, #0x1000
|
||||
b.lo Lend
|
||||
Lloop:
|
||||
sub x10, x10, #0x1000
|
||||
ldr x11, [x10]
|
||||
sub x9, x9, #0x1000
|
||||
cmp x9, #0x1000
|
||||
b.hi Lloop
|
||||
Lend:
|
||||
sub x10, x10, x9
|
||||
ldr x11, [x10]
|
||||
b Lexit
|
||||
@@ -1,23 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef BAKERAIN_DEVELOPE_R
|
||||
#define BAKERAIN_DEVELOPE_R "kok3shidoll"
|
||||
#endif
|
||||
#define THE_PLUSH "Ploosh"
|
||||
|
||||
#define T void
|
||||
#define R print_credits(void) {
|
||||
#define O fprintf
|
||||
#define U (
|
||||
#define B stderr
|
||||
#define L ,
|
||||
#define E "# == palera1n-c == \n#\n"
|
||||
#define M "# Made by: Nick Chan, " THE_PLUSH ", Samara, Nebula, staturnz, " BAKERAIN_DEVELOPE_R " \n#\n"
|
||||
#define A "# Thanks to: pythonplayer123, llsc12, Mineek, tihmstar, nikias\n"
|
||||
#define K "# (libimobiledevice), checkra1n team (Siguza, axi0mx, littlelailo\n"
|
||||
#define I "# et al.), Procursus Team (Hayden Seay, Cameron Katri, Keto et.al)\n\n"
|
||||
#define N )
|
||||
#define G ;
|
||||
#define S }
|
||||
|
||||
T R O U B L E M A K I N G S
|
||||
-406
@@ -1,406 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <libirecovery.h>
|
||||
#include <usbmuxd.h>
|
||||
|
||||
#include <libimobiledevice/libimobiledevice.h>
|
||||
#include <libimobiledevice/lockdown.h>
|
||||
#include <libimobiledevice/diagnostics_relay.h>
|
||||
#include <plist/plist.h>
|
||||
|
||||
#include "lockdown_helper.h"
|
||||
|
||||
#ifdef HAVE_LIB_TV_CONTROL
|
||||
#include <libtvcontrol.h>
|
||||
#endif
|
||||
|
||||
#include <palerain.h>
|
||||
|
||||
irecv_device_event_context_t irecvctx = NULL;
|
||||
usbmuxd_subscription_context_t usbmuxdctx = NULL;
|
||||
|
||||
void devinfo_free(devinfo_t *dev) {
|
||||
free(dev->buildVersion);
|
||||
free(dev->productType);
|
||||
free(dev->productVersion);
|
||||
free(dev->CPUArchitecture);
|
||||
return;
|
||||
}
|
||||
|
||||
bool cpid_is_arm64(unsigned int cpid) {
|
||||
/*
|
||||
* ========== 0x6000 ===========
|
||||
* M1 Pro, M1 Max, etc.
|
||||
* ========== 0x7000 ===========
|
||||
* (ARM64) A8(X)
|
||||
* ========== 0x7002 ===========
|
||||
* S1
|
||||
* ========== 0x8000 ===========
|
||||
* (ARM64) A9 (Samsung), A9X
|
||||
* ========== 0x8002 ===========
|
||||
* S1P, S2, T1
|
||||
* ========== 0x8003 ===========
|
||||
* (ARM64) A9 (TSMC)
|
||||
* ========== 0x8004 ===========
|
||||
* S3 - S5
|
||||
* ========== 0x8010 ===========
|
||||
* (ARM64) A10(X) - A11, T2
|
||||
* ========== 0x8020 ===========
|
||||
* A12, M1, M2, etc
|
||||
* ========== 0x8700 ===========
|
||||
* iPod SoCs
|
||||
* ========== 0x8747 ===========
|
||||
* Haywire
|
||||
* ========== 0x8900 ===========
|
||||
* S5L8900 - A6(X)
|
||||
* ========== 0x8960 ===========
|
||||
* (ARM64) A7
|
||||
*/
|
||||
return (
|
||||
cpid == 0x8960 || cpid == 0x7000 || cpid == 0x7001 ||
|
||||
cpid == 0x8000 || cpid == 0x8001 || cpid == 0x8003 ||
|
||||
cpid == 0x8010 || cpid == 0x8011 || cpid == 0x8012 ||
|
||||
cpid == 0x8015
|
||||
);
|
||||
}
|
||||
|
||||
int subscribe_cmd(usbmuxd_event_cb_t device_event_cb, irecv_device_event_cb_t irecv_event_cb)
|
||||
{
|
||||
int ret;
|
||||
if ((ret = usbmuxd_events_subscribe(&usbmuxdctx, device_event_cb, NULL))) return ret;
|
||||
if ((ret = irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL))) return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int unsubscribe_cmd(void)
|
||||
{
|
||||
int ret;
|
||||
if ((ret = usbmuxd_events_unsubscribe(usbmuxdctx))) return ret;
|
||||
if ((ret = irecv_device_event_unsubscribe(irecvctx))) return ret;
|
||||
irecvctx = NULL;
|
||||
usbmuxdctx = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int devinfo_cmd(devinfo_t *dev, const char *udid)
|
||||
{
|
||||
uint64_t this_ecid = 0;
|
||||
char *productType = NULL;
|
||||
char *productVersion = NULL;
|
||||
char *buildVersion = NULL;
|
||||
const char *displayName = NULL;
|
||||
char *CPUArchitecture = NULL;
|
||||
idevice_t device = NULL;
|
||||
lockdownd_client_t lockdown = NULL;
|
||||
if (idevice_new(&device, udid) != IDEVICE_E_SUCCESS)
|
||||
{
|
||||
LOG(LOG_ERROR, "Error connecting to device.");
|
||||
return -1;
|
||||
}
|
||||
if (lockdownd_client_new(device, &lockdown, "palera1n") != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
(void)idevice_free(device);
|
||||
LOG(LOG_ERROR, "Device is not in normal mode.");
|
||||
return -1;
|
||||
}
|
||||
plist_t node = NULL;
|
||||
if (lockdownd_get_value(lockdown, NULL, "UniqueChipID", &node) != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
(void)lockdownd_client_free(lockdown);
|
||||
(void)idevice_free(device);
|
||||
LOG(LOG_ERROR, "Error getting ECID");
|
||||
return -1;
|
||||
}
|
||||
plist_get_uint_val(node, &this_ecid);
|
||||
plist_free(node);
|
||||
|
||||
node = NULL;
|
||||
if (lockdownd_get_value(lockdown, NULL, "ProductType", &node) != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
(void)lockdownd_client_free(lockdown);
|
||||
(void)idevice_free(device);
|
||||
LOG(LOG_ERROR, "Error getting product type");
|
||||
return -1;
|
||||
}
|
||||
plist_get_string_val(node, &productType);
|
||||
plist_free(node);
|
||||
|
||||
node = NULL;
|
||||
if (lockdownd_get_value(lockdown, NULL, "CPUArchitecture", &node) != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
(void)lockdownd_client_free(lockdown);
|
||||
(void)idevice_free(device);
|
||||
LOG(LOG_ERROR, "Error getting CPU type");
|
||||
return -1;
|
||||
}
|
||||
plist_get_string_val(node, &CPUArchitecture);
|
||||
plist_free(node);
|
||||
|
||||
node = NULL;
|
||||
if (lockdownd_get_value(lockdown, NULL, "ProductVersion", &node) != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
(void)lockdownd_client_free(lockdown);
|
||||
(void)idevice_free(device);
|
||||
LOG(LOG_ERROR, "Error getting product version");
|
||||
return -1;
|
||||
}
|
||||
plist_get_string_val(node, &productVersion);
|
||||
plist_free(node);
|
||||
|
||||
node = NULL;
|
||||
if (lockdownd_get_value(lockdown, NULL, "BuildVersion", &node) != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
(void)lockdownd_client_free(lockdown);
|
||||
(void)idevice_free(device);
|
||||
LOG(LOG_ERROR, "Error getting build version");
|
||||
return -1;
|
||||
}
|
||||
plist_get_string_val(node, &buildVersion);
|
||||
plist_free(node);
|
||||
(void)lockdownd_client_free(lockdown);
|
||||
(void)idevice_free(device);
|
||||
|
||||
irecv_device_t rcvydev;
|
||||
if (irecv_devices_get_device_by_product_type(productType, &rcvydev) == IRECV_E_SUCCESS)
|
||||
{
|
||||
displayName = rcvydev->display_name;
|
||||
} else
|
||||
{
|
||||
displayName = productType;
|
||||
}
|
||||
dev->buildVersion = buildVersion;
|
||||
dev->ecid = this_ecid;
|
||||
dev->CPUArchitecture = CPUArchitecture;
|
||||
dev->displayName = displayName;
|
||||
dev->productType = productType;
|
||||
dev->productVersion = productVersion;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int enter_recovery_cmd(const char* udid) {
|
||||
idevice_t device = NULL;
|
||||
lockdownd_client_t lockdown = NULL;
|
||||
if (idevice_new(&device, udid) != IDEVICE_E_SUCCESS) {
|
||||
LOG(LOG_ERROR, "Could not connect to device");
|
||||
return -1;
|
||||
}
|
||||
lockdownd_error_t ldret = lockdownd_client_new(device, &lockdown, "palera1n");
|
||||
if (ldret != LOCKDOWN_E_SUCCESS) {
|
||||
LOG(LOG_ERROR, "Could not connect to lockdownd: %s", lockdownd_strerror(ldret));
|
||||
return -1;
|
||||
}
|
||||
ldret = lockdownd_enter_recovery(lockdown);
|
||||
if (ldret == LOCKDOWN_E_SESSION_INACTIVE) {
|
||||
lockdownd_client_free(lockdown);
|
||||
lockdown = NULL;
|
||||
ldret = lockdownd_client_new_with_handshake(device, &lockdown, "palera1n");
|
||||
if (ldret != LOCKDOWN_E_SUCCESS) {
|
||||
LOG(LOG_ERROR, "Could not connect to lockdownd: %s", lockdownd_strerror(ldret));
|
||||
return -1;
|
||||
}
|
||||
ldret = lockdownd_enter_recovery(lockdown);
|
||||
}
|
||||
if (ldret != LOCKDOWN_E_SUCCESS) {
|
||||
LOG(LOG_ERROR, "Could not trigger entering recovery mode: %s", lockdownd_strerror(ldret));
|
||||
return -1;
|
||||
}
|
||||
lockdownd_client_free(lockdown);
|
||||
idevice_free(device);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int reboot_cmd(const char* udid) {
|
||||
idevice_t device = NULL;
|
||||
lockdownd_client_t lockdown = NULL;
|
||||
if (idevice_new(&device, udid) != IDEVICE_E_SUCCESS) {
|
||||
LOG(LOG_ERROR, "Could not connect to device");
|
||||
return -1;
|
||||
} else {
|
||||
diagnostics_relay_client_t diag = NULL;
|
||||
if (diagnostics_relay_client_start_service(device, &diag, "palera1n") == DIAGNOSTICS_RELAY_E_SUCCESS) {
|
||||
if (diagnostics_relay_restart(diag, DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT) != DIAGNOSTICS_RELAY_E_SUCCESS) {
|
||||
LOG(LOG_ERROR, "Could not reboot device.");
|
||||
}
|
||||
(void)diagnostics_relay_goodbye(diag);
|
||||
(void)diagnostics_relay_client_free(diag);
|
||||
} else {
|
||||
LOG(LOG_ERROR, "Could not connect to device.");
|
||||
return -1;
|
||||
}
|
||||
idevice_free(device);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int passstat_cmd(unsigned char* status, const char* udid) {
|
||||
lockdownd_error_t lerr = LOCKDOWN_E_SUCCESS;
|
||||
diagnostics_relay_error_t derr = DIAGNOSTICS_RELAY_E_SUCCESS;
|
||||
|
||||
idevice_t dev = NULL;
|
||||
lockdownd_client_t lockdown = NULL;
|
||||
lockdownd_service_descriptor_t service = NULL;
|
||||
diagnostics_relay_client_t diagnostics_client = NULL;
|
||||
plist_t node = NULL;
|
||||
plist_t keys = NULL;
|
||||
plist_t status_node = NULL;
|
||||
plist_t value_node = NULL;
|
||||
|
||||
if (idevice_new(&dev, udid) != IDEVICE_E_SUCCESS)
|
||||
{
|
||||
LOG(LOG_ERROR, "Error detecting device type");
|
||||
return -1;
|
||||
}
|
||||
lerr = lockdownd_client_new_with_handshake(dev, &lockdown, "idevicediagnostics");
|
||||
if ((lerr != LOCKDOWN_E_SUCCESS) || !lockdown)
|
||||
{
|
||||
idevice_free(dev);
|
||||
LOG(LOG_ERROR, "Error connecting to lockdownd (lockdownd error %d: (%s))", lerr, lockdownd_strerror(lerr));
|
||||
return -1;
|
||||
}
|
||||
lerr = lockdownd_start_service(lockdown, "com.apple.mobile.diagnostics_relay", &service);
|
||||
if ((lerr != LOCKDOWN_E_SUCCESS) || !service)
|
||||
lerr = lockdownd_start_service(lockdown, "com.apple.iosdiagnostics.relay", &service);
|
||||
|
||||
lockdownd_client_free(lockdown);
|
||||
if ((lerr != LOCKDOWN_E_SUCCESS) || !service)
|
||||
{
|
||||
idevice_free(dev);
|
||||
LOG(LOG_ERROR, "Error starting diagnostics service (lockdownd error %d: (%s))\nUnlock the device and try again.", lerr, lockdownd_strerror(lerr));
|
||||
return -1;
|
||||
}
|
||||
derr = diagnostics_relay_client_new(dev, service, &diagnostics_client);
|
||||
if ((derr != DIAGNOSTICS_RELAY_E_SUCCESS) || !diagnostics_client)
|
||||
{
|
||||
lockdownd_service_descriptor_free(service);
|
||||
idevice_free(dev);
|
||||
LOG(LOG_ERROR, "Error starting diagnostics client (diagnostics error %d)", derr);
|
||||
return -1;
|
||||
}
|
||||
keys = plist_new_array();
|
||||
plist_array_append_item(keys, plist_new_string("xsaMbRQ5rQ+eyKMKG+ZSSg"));
|
||||
derr = diagnostics_relay_query_mobilegestalt(diagnostics_client, keys, &node);
|
||||
|
||||
plist_free(keys);
|
||||
(void)diagnostics_relay_client_free(diagnostics_client);
|
||||
(void)lockdownd_service_descriptor_free(service);
|
||||
(void)idevice_free(dev);
|
||||
|
||||
if (derr != DIAGNOSTICS_RELAY_E_SUCCESS || !node)
|
||||
{
|
||||
LOG(LOG_ERROR, "Error getting passcode state (lockdownd error %d: (%s))", lerr, lockdownd_strerror(lerr));
|
||||
return -1;
|
||||
}
|
||||
status_node = plist_access_path(node, 2, "MobileGestalt", "Status");
|
||||
if (!status_node)
|
||||
{
|
||||
plist_free(node);
|
||||
LOG(LOG_ERROR, "Error getting passcode state (invalid status node)");
|
||||
return -1;
|
||||
}
|
||||
char* passstat_status;
|
||||
plist_get_string_val(status_node, &passstat_status);
|
||||
if (!status || strncmp(passstat_status, "Succ", 4))
|
||||
{
|
||||
if (passstat_status)
|
||||
free(passstat_status);
|
||||
passstat_status = NULL;
|
||||
plist_free(node);
|
||||
LOG(LOG_ERROR, "Error getting passcode state (invalid status)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(passstat_status);
|
||||
value_node = plist_access_path(node, 2, "MobileGestalt", "xsaMbRQ5rQ+eyKMKG+ZSSg");
|
||||
if (!value_node)
|
||||
{
|
||||
plist_free(node);
|
||||
LOG(LOG_ERROR, "Error getting passcode state (invalid value node)");
|
||||
return -1;
|
||||
}
|
||||
uint8_t passcode_state = 2;
|
||||
plist_get_bool_val(value_node, &passcode_state);
|
||||
plist_free(node);
|
||||
*status = passcode_state;
|
||||
LOG(LOG_VERBOSE4, "Passcode state: %hhu", *status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int recvinfo_cmd(recvinfo_t* info, const uint64_t ecid) {
|
||||
irecv_client_t client = NULL;
|
||||
irecv_error_t err = irecv_open_with_ecid(&client, ecid);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
int mode = 0;
|
||||
err = irecv_get_mode(client, &mode);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
char *ibootver = NULL;
|
||||
err = irecv_getenv(client, "build-version", &ibootver);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
irecv_device_t device;
|
||||
err = irecv_devices_get_device_by_client(client, &device);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
info->mode = mode;
|
||||
info->cpid = device->chip_id;
|
||||
snprintf(info->product_type, 0x20, "%s", device->product_type);
|
||||
snprintf(info->display_name, 0x20, "%s", device->display_name);
|
||||
snprintf(info->iboot_ver, 0x20, "%s", (ibootver) ? ibootver : "");
|
||||
free(ibootver);
|
||||
irecv_close(client);
|
||||
return 0;
|
||||
err:
|
||||
LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int autoboot_cmd(const uint64_t ecid) {
|
||||
irecv_client_t client = NULL;
|
||||
irecv_error_t err = irecv_open_with_ecid(&client, ecid);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_setenv(client, "auto-boot", "true");
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_saveenv(client);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_close(client);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
return 0;
|
||||
err:
|
||||
LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int exitrecv_cmd(const uint64_t ecid) {
|
||||
irecv_client_t client = NULL;
|
||||
irecv_error_t err = irecv_open_with_ecid(&client, ecid);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_setenv(client, "auto-boot", "true");
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_saveenv(client);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_reboot(client);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
err = irecv_close(client);
|
||||
if (err != IRECV_E_SUCCESS) goto err;
|
||||
return 0;
|
||||
err:
|
||||
LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
|
||||
return -1;
|
||||
}
|
||||
-300
@@ -1,300 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <libimobiledevice/libimobiledevice.h>
|
||||
#include <libimobiledevice/lockdown.h>
|
||||
#include <libimobiledevice/diagnostics_relay.h>
|
||||
#include <plist/plist.h>
|
||||
#include <libirecovery.h>
|
||||
#include <usbmuxd.h>
|
||||
|
||||
#include <ANSI-color-codes.h>
|
||||
#include <palerain.h>
|
||||
|
||||
#define FORMAT_KEY_VALUE 1
|
||||
#define FORMAT_XML 2
|
||||
|
||||
#define NOHOME (cpid == 0x8015 || (cpid == 0x8010 && (bdid == 0x08 || bdid == 0x0a || bdid == 0x0c || bdid == 0x0e)))
|
||||
|
||||
int dfuhelper_thr_running = false;
|
||||
|
||||
void step(int time, int time2, char *text, bool (*cond)(uint64_t), uint64_t cond_arg) {
|
||||
for (int i = time2; i < time; i++) {
|
||||
printf(
|
||||
checkrain_options_enabled(host_flags, host_option_no_colors)
|
||||
? "\r\033[K%s (%d)"
|
||||
: BCYN "\r\033[K%s (%d)" CRESET, text, time - i + time2
|
||||
);
|
||||
fflush(stdout);
|
||||
sleep(1);
|
||||
if (cond != NULL && cond(cond_arg)) pthread_exit(NULL);
|
||||
}
|
||||
printf(
|
||||
checkrain_options_enabled(host_flags, host_option_no_colors)
|
||||
? "\r%s (%d)"
|
||||
: CYN "\r%s (%d)" CRESET, text, time2
|
||||
);
|
||||
if (time2 == 0) puts("");
|
||||
}
|
||||
|
||||
int connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
|
||||
devinfo_t dev;
|
||||
int ret;
|
||||
ret = devinfo_cmd(&dev, usbmuxd_device->udid);
|
||||
if (ret != 0) {
|
||||
LOG(LOG_ERROR, "Unable to get device information");
|
||||
return 0;
|
||||
}
|
||||
if (strncmp(dev.CPUArchitecture, "arm64", strlen("arm64"))) {
|
||||
devinfo_free(&dev);
|
||||
LOG(LOG_WARNING, "Ignoring non-arm64 device...");
|
||||
LOG(LOG_WARNING, "palera1n doesn't and never will work on A12+ (arm64e)");
|
||||
return -1;
|
||||
}
|
||||
if (!strncmp(dev.productType, "iPhone10,", strlen("iPhone10,"))) {
|
||||
if (!checkrain_options_enabled(host_flags, host_option_device_info))
|
||||
LOG(LOG_VERBOSE2, "Product %s requires passcode to be disabled", dev.productType);
|
||||
unsigned char passcode_state = 0;
|
||||
ret = passstat_cmd(&passcode_state, usbmuxd_device->udid);
|
||||
if (ret != 0) {
|
||||
LOG(LOG_ERROR, "Failed to get passcode state");
|
||||
devinfo_free(&dev);
|
||||
return -1;
|
||||
}
|
||||
if (passcode_state) {
|
||||
LOG(LOG_ERROR, "Passcode must be disabled on this device");
|
||||
if (!checkrain_options_enabled(host_flags, host_option_device_info))
|
||||
LOG(LOG_ERROR, "Additionally, passcode must never be set since a restore on iOS 16+");
|
||||
devinfo_free(&dev);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (checkrain_options_enabled(host_flags, host_option_device_info)) {
|
||||
printf("Mode: normal\n");
|
||||
printf("ProductType: %s\n", dev.productType);
|
||||
printf("Architecture: %s\n", dev.CPUArchitecture);
|
||||
printf("Version: %s\n", dev.productVersion);
|
||||
printf("DisplayName: %s\n", dev.displayName);
|
||||
|
||||
device_has_booted = true;
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
return 0;
|
||||
}
|
||||
LOG(LOG_INFO, "Telling device with udid %s to enter recovery mode immediately", usbmuxd_device->udid);
|
||||
enter_recovery_cmd(usbmuxd_device->udid);
|
||||
devinfo_free(&dev);
|
||||
if (checkrain_options_enabled(host_flags, host_option_enter_recovery)) {
|
||||
device_has_booted = true;
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool conditional(uint64_t ecid) {
|
||||
return get_ecid_wait_for_dfu() != ecid;
|
||||
}
|
||||
|
||||
void* connected_recovery_mode(struct irecv_device_info* info) {
|
||||
int ret;
|
||||
uint64_t ecid;
|
||||
uint32_t cpid, bdid;
|
||||
cpid = info->cpid;
|
||||
ecid = info->ecid;
|
||||
bdid = info->bdid;
|
||||
info = NULL;
|
||||
if (!cpid_is_arm64(cpid)) {
|
||||
LOG(LOG_WARNING, "Ignoring non-arm64 device...");
|
||||
return NULL;
|
||||
}
|
||||
sleep(1);
|
||||
ret = autoboot_cmd(ecid);
|
||||
if (ret) {
|
||||
LOG(LOG_ERROR, "Cannot set auto-boot back to true");
|
||||
return NULL;
|
||||
}
|
||||
LOG(LOG_INFO, "Press Enter when ready for DFU mode");
|
||||
getchar();
|
||||
step(3, 0, "Get ready", NULL, 0);
|
||||
if (NOHOME)
|
||||
step(4, 2, "Hold volume down + side button", NULL, 0);
|
||||
else
|
||||
step(4, 2, "Hold home + power button", NULL, 0);
|
||||
set_ecid_wait_for_dfu(ecid);
|
||||
ret = exitrecv_cmd(ecid);
|
||||
if (ret) {
|
||||
LOG(LOG_ERROR, "Cannot exit recovery mode");
|
||||
set_ecid_wait_for_dfu(0);
|
||||
return NULL;
|
||||
}
|
||||
printf("\r\033[K");
|
||||
if (NOHOME) {
|
||||
step(2, 0, "Hold volume down + side button", NULL, 0);
|
||||
step(10, 0, "Hold volume down button", conditional, ecid);
|
||||
} else {
|
||||
step(2, 0, "Hold home + power button", NULL, 0);
|
||||
step(10, 0, "Hold home button", conditional, ecid);
|
||||
}
|
||||
if (get_ecid_wait_for_dfu() == ecid) {
|
||||
LOG(LOG_WARNING, "Whoops, device did not enter DFU mode");
|
||||
LOG(LOG_INFO, "Waiting for device to reconnect...");
|
||||
set_ecid_wait_for_dfu(0);
|
||||
return NULL;
|
||||
}
|
||||
set_ecid_wait_for_dfu(0);
|
||||
pthread_exit(NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* connected_dfu_mode(struct irecv_device_info* info) {
|
||||
if (get_ecid_wait_for_dfu() == info->ecid) {
|
||||
set_ecid_wait_for_dfu(0);
|
||||
puts("");
|
||||
LOG(LOG_INFO, "Device entered DFU mode successfully");
|
||||
}
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
pthread_exit(NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void device_event_cb(const usbmuxd_event_t *event, void* userdata) {
|
||||
if (event->device.conn_type != CONNECTION_TYPE_USB) return;
|
||||
switch (event->event) {
|
||||
case UE_DEVICE_ADD:
|
||||
LOG(LOG_VERBOSE, "Normal mode device connected");
|
||||
if (checkrain_options_enabled(host_flags, host_option_exit_recovery)) {
|
||||
break;
|
||||
} else if (checkrain_options_enabled(host_flags, host_option_reboot_device)) {
|
||||
int ret = reboot_cmd(event->device.udid);
|
||||
if (!ret) {
|
||||
LOG(LOG_INFO, "Restarted device");
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
}
|
||||
pthread_exit(NULL);
|
||||
break;
|
||||
}
|
||||
connected_normal_mode(&event->device);
|
||||
break;
|
||||
case UE_DEVICE_REMOVE:
|
||||
LOG(LOG_VERBOSE, "Normal mode device disconnected");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) {
|
||||
pthread_t recovery_thread, dfu_thread;
|
||||
int ret;
|
||||
|
||||
switch(event->type) {
|
||||
case IRECV_DEVICE_ADD:
|
||||
if (event->mode == IRECV_K_RECOVERY_MODE_1 ||
|
||||
event->mode == IRECV_K_RECOVERY_MODE_2 ||
|
||||
event->mode == IRECV_K_RECOVERY_MODE_3 ||
|
||||
event->mode == IRECV_K_RECOVERY_MODE_4) {
|
||||
if (!checkrain_options_enabled(host_flags, host_option_device_info))
|
||||
LOG(LOG_VERBOSE, "Recovery mode device %ld connected", event->device_info->ecid);
|
||||
if (checkrain_options_enabled(host_flags, host_option_exit_recovery)) {
|
||||
ret = exitrecv_cmd(event->device_info->ecid);
|
||||
if (!ret) {
|
||||
LOG(LOG_INFO, "Exited recovery mode");
|
||||
device_has_booted = true;
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
} else {
|
||||
LOG(LOG_WARNING, "Could not exit recovery mode");
|
||||
}
|
||||
if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
|
||||
pthread_exit(NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (checkrain_options_enabled(host_flags, host_option_device_info)) {
|
||||
recvinfo_t info;
|
||||
ret = recvinfo_cmd(&info, event->device_info->ecid);
|
||||
if (ret) {
|
||||
LOG(LOG_WARNING, "Could not get info from device");
|
||||
} else {
|
||||
printf("Mode: Recovery\n");
|
||||
printf("ProductType: %s\n", info.product_type);
|
||||
printf("DisplayName: %s\n", info.display_name);
|
||||
|
||||
device_has_booted = true;
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
}
|
||||
if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
|
||||
pthread_exit(NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (checkrain_options_enabled(host_flags, host_option_enter_recovery) ||
|
||||
checkrain_options_enabled(host_flags, host_option_reboot_device)) return;
|
||||
pthread_create(&recovery_thread, NULL, (pthread_start_t)connected_recovery_mode, event->device_info);
|
||||
} else if (event->mode == IRECV_K_DFU_MODE) {
|
||||
if (!checkrain_options_enabled(host_flags, host_option_device_info))
|
||||
LOG(LOG_VERBOSE, "DFU mode device %ld connected", event->device_info->ecid);
|
||||
|
||||
if (checkrain_options_enabled(host_flags, host_option_device_info)) {
|
||||
recvinfo_t info;
|
||||
ret = recvinfo_cmd(&info, event->device_info->ecid);
|
||||
if (ret) {
|
||||
LOG(LOG_WARNING, "Could not get info from device");
|
||||
} else {
|
||||
printf("Mode: DFU\n");
|
||||
printf("ProductType: %s\n", info.product_type);
|
||||
printf("DisplayName: %s\n", info.display_name);
|
||||
|
||||
device_has_booted = true;
|
||||
set_spin(0);
|
||||
unsubscribe_cmd();
|
||||
}
|
||||
if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
|
||||
pthread_exit(NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (
|
||||
checkrain_options_enabled(host_flags, host_option_exit_recovery) ||
|
||||
checkrain_options_enabled(host_flags, host_option_enter_recovery) ||
|
||||
checkrain_options_enabled(host_flags, host_option_reboot_device)) {
|
||||
break;
|
||||
}
|
||||
pthread_create(&dfu_thread, NULL, (pthread_start_t)connected_dfu_mode, event->device_info);
|
||||
}
|
||||
break;
|
||||
case IRECV_DEVICE_REMOVE:
|
||||
LOG(LOG_VERBOSE, "Recovery mode device disconnected");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void *dfuhelper(void* ptr) {
|
||||
dfuhelper_thr_running = true;
|
||||
set_spin(1);
|
||||
subscribe_cmd(device_event_cb, irecv_device_event_cb);
|
||||
while (get_spin()) {
|
||||
sleep(1);
|
||||
};
|
||||
dfuhelper_thr_running = false;
|
||||
return 0;
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <spawn.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#include <palerain.h>
|
||||
#include <xxd-embedded.h>
|
||||
char* pongo_path = NULL;
|
||||
bool external_pongo = false;
|
||||
char* ext_checkra1n = NULL;
|
||||
|
||||
#define tmpdir getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")
|
||||
|
||||
int exec_checkra1n(void) {
|
||||
LOG(LOG_INFO, "About to execute checkra1n");
|
||||
int fd_checkra1n, fd_pongo, ret;
|
||||
char* checkra1n_path = NULL;
|
||||
if (ext_checkra1n != NULL) {
|
||||
checkra1n_path = ext_checkra1n;
|
||||
goto checkra1n_exec;
|
||||
}
|
||||
#ifndef NO_CUSTOM_PONGO
|
||||
if (pongo_path == NULL) {
|
||||
pongo_path = malloc(strlen(tmpdir) + 20);
|
||||
snprintf(pongo_path, strlen(tmpdir) + 20, "%s/Pongo.bin.XXXXXX", tmpdir);
|
||||
fd_pongo = mkstemp(pongo_path);
|
||||
if (fd_pongo == -1) {
|
||||
LOG(LOG_FATAL, "Cannot open temporary file %s: %d (%s)", pongo_path, errno, strerror(errno));
|
||||
free(pongo_path);
|
||||
return -1;
|
||||
}
|
||||
ssize_t didWrite_Pongo_bin = write(fd_pongo, Pongo_bin, Pongo_bin_len);
|
||||
if (didWrite_Pongo_bin != (ssize_t)Pongo_bin_len) {
|
||||
LOG(LOG_FATAL, "Size written to %s does not match expected: %lld != %d: %d (%s)", pongo_path, didWrite_Pongo_bin, Pongo_bin_len, errno, strerror(errno));
|
||||
close(fd_pongo);
|
||||
unlink(pongo_path);
|
||||
free(pongo_path);
|
||||
pongo_path = NULL;
|
||||
return -1;
|
||||
}
|
||||
} else external_pongo = true;
|
||||
#endif
|
||||
checkra1n_path = malloc(strlen(tmpdir) + 20);
|
||||
snprintf(checkra1n_path, strlen(tmpdir) + 20, "%s/checkra1n.XXXXXX", tmpdir);
|
||||
fd_checkra1n = mkstemp(checkra1n_path);
|
||||
if (fd_checkra1n == -1) {
|
||||
LOG(LOG_FATAL, "Cannot open temporary file %s: %d (%s)", checkra1n_path, errno, strerror(errno));
|
||||
free(checkra1n_path);
|
||||
checkra1n_path = NULL;
|
||||
return -1;
|
||||
}
|
||||
ssize_t didWrite_checkra1n = write(fd_checkra1n, checkra1n, checkra1n_len);
|
||||
if (didWrite_checkra1n != (ssize_t)checkra1n_len) {
|
||||
LOG(LOG_FATAL, "Size written to %s does not match expected: %lld != %d: %d (%s)", checkra1n_path, didWrite_checkra1n, checkra1n_len, errno, strerror(errno));
|
||||
close(fd_checkra1n);
|
||||
unlink(checkra1n_path);
|
||||
free(checkra1n_path);
|
||||
checkra1n_path = NULL;
|
||||
return -1;
|
||||
}
|
||||
close(fd_checkra1n);
|
||||
ret = chmod(checkra1n_path, 0700);
|
||||
if (ret) {
|
||||
LOG(LOG_FATAL, "Cannot chmod %s: %d (%s)", checkra1n_path, errno, strerror(errno));
|
||||
unlink(checkra1n_path);
|
||||
free(checkra1n_path);
|
||||
checkra1n_path = NULL;
|
||||
return -1;
|
||||
}
|
||||
#if defined(__APPLE__) && defined(__arm64__) && (TARGET_OS_IPHONE || defined(FORCE_HELPER))
|
||||
char* libcheckra1nhelper_dylib_path = NULL;
|
||||
{
|
||||
struct utsname name;
|
||||
uname(&name);
|
||||
unsigned long darwinMajor = strtoul(name.release, NULL, 10);
|
||||
assert(darwinMajor != 0);
|
||||
#if !defined(FORCE_HELPER)
|
||||
if (darwinMajor < 20) {
|
||||
#endif
|
||||
libcheckra1nhelper_dylib_path = malloc(strlen(tmpdir) + 40);
|
||||
snprintf(libcheckra1nhelper_dylib_path, strlen(tmpdir) + 40, "%s/libcheckra1nhelper.dylib.XXXXXX", tmpdir);
|
||||
int helper_fd = mkstemp(libcheckra1nhelper_dylib_path);
|
||||
if (helper_fd == -1) {
|
||||
LOG(LOG_FATAL, "Cannot open temporary file: %d (%s)", errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
ssize_t didWrite_libcheckra1nhelper = write(helper_fd, libcheckra1nhelper_dylib, libcheckra1nhelper_dylib_len);
|
||||
if ((unsigned int)didWrite_libcheckra1nhelper != libcheckra1nhelper_dylib_len) {
|
||||
LOG(LOG_FATAL, "Size written does not match expected: %lld != %d: %d (%s)", didWrite_libcheckra1nhelper, libcheckra1nhelper_dylib_len, errno, strerror(errno));
|
||||
close(helper_fd);
|
||||
unlink(libcheckra1nhelper_dylib_path);
|
||||
return -1;
|
||||
}
|
||||
close(helper_fd);
|
||||
ret = chmod(libcheckra1nhelper_dylib_path, 0700);
|
||||
if (ret) {
|
||||
LOG(LOG_FATAL, "Cannot chmod %s: %d (%s)", libcheckra1nhelper_dylib_path, errno, strerror(errno));
|
||||
unlink(libcheckra1nhelper_dylib_path);
|
||||
return -1;
|
||||
}
|
||||
setenv("DYLD_INSERT_LIBRARIES", libcheckra1nhelper_dylib_path, 1);
|
||||
#if !defined(FORCE_HELPER)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
checkra1n_exec: {};
|
||||
char args[0x10] = "-E";
|
||||
if (checkrain_options_enabled(host_flags, host_option_demote)) strncat(args, "d", 0xf);
|
||||
if (!checkrain_options_enabled(host_flags, palerain_option_checkrain_is_clone)) {
|
||||
strncat(args, "p", 0xf);
|
||||
if (verbose >= 2) strncat(args, "v", 0xf);
|
||||
if (checkrain_options_enabled(host_flags, host_option_no_colors)) strncat(args, "n", 0xf);
|
||||
} else {
|
||||
strncat(args, "R", 0xf);
|
||||
}
|
||||
LOG(LOG_VERBOSE5, args);
|
||||
if (pongo_path != NULL) LOG(LOG_VERBOSE5, pongo_path);
|
||||
pid_t pid;
|
||||
if (pongo_path != NULL) {
|
||||
ret = posix_spawn(&pid, checkra1n_path, NULL, NULL, (char* []){
|
||||
checkra1n_path,
|
||||
args,
|
||||
"-k",
|
||||
pongo_path,
|
||||
NULL
|
||||
}, environ);
|
||||
} else {
|
||||
ret = posix_spawn(&pid, checkra1n_path, NULL, NULL, (char* []){
|
||||
checkra1n_path,
|
||||
args,
|
||||
NULL
|
||||
}, environ);
|
||||
}
|
||||
if (ret) {
|
||||
LOG(LOG_FATAL, "Cannot posix spawn %s: %d (%s)", checkra1n_path, errno, strerror(errno));
|
||||
if (ext_checkra1n != NULL) unlink(checkra1n_path);
|
||||
return -1;
|
||||
}
|
||||
LOG(LOG_VERBOSE2, "%s spawned successfully", checkra1n_path);
|
||||
sleep(2);
|
||||
if (ext_checkra1n == NULL) {
|
||||
unlink(checkra1n_path);
|
||||
free(checkra1n_path);
|
||||
checkra1n_path = NULL;
|
||||
}
|
||||
waitpid(pid, NULL, 0);
|
||||
if (!external_pongo && pongo_path != NULL) {
|
||||
unlink(pongo_path);
|
||||
}
|
||||
if (pongo_path != NULL) free(pongo_path);
|
||||
pongo_path = NULL;
|
||||
#if defined(__APPLE__) && defined(__arm64__) && (TARGET_OS_IPHONE || defined(FORCE_HELPER))
|
||||
if (libcheckra1nhelper_dylib_path != NULL) {
|
||||
unlink(libcheckra1nhelper_dylib_path);
|
||||
unsetenv("DYLD_INSERT_LIBRARIES");
|
||||
unsetenv("DYLD_FORCE_FLAT_NAMESPACE");
|
||||
free(libcheckra1nhelper_dylib_path);
|
||||
libcheckra1nhelper_dylib_path = NULL;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef NO_KPF
|
||||
unsigned char* checkra1n_kpf_pongo = NULL;
|
||||
unsigned int checkra1n_kpf_pongo_len = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NO_RAMDISK
|
||||
unsigned char* ramdisk_dmg = NULL;
|
||||
unsigned int ramdisk_dmg_len = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NO_CHECKRAIN
|
||||
unsigned char* checkra1n = NULL;
|
||||
unsigned int checkra1n_len = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NO_OVERLAY
|
||||
unsigned char* binpack_dmg = NULL;
|
||||
unsigned int binpack_dmg_len = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NO_CUSTOM_PONGO
|
||||
unsigned char* Pongo_bin = NULL;
|
||||
unsigned int Pongo_bin_len = 0;
|
||||
#endif
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
#include <inttypes.h>
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
#include <sys/mman.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <libimobiledevice/libimobiledevice.h>
|
||||
|
||||
#include <ANSI-color-codes.h>
|
||||
#include <palerain.h>
|
||||
#include <xxd-embedded.h>
|
||||
#include <kerninfo.h>
|
||||
|
||||
pthread_mutex_t spin_mutex, found_pongo_mutex, ecid_dfu_wait_mutex;
|
||||
#ifdef TUI
|
||||
#include <newt.h>
|
||||
pthread_mutex_t tui_log_mutex;
|
||||
newtComponent tui_log_output = NULL;
|
||||
#endif
|
||||
|
||||
bool spin, found_pongo = 0;
|
||||
uint64_t ecid_wait_for_dfu = 0;
|
||||
|
||||
static bool get_locked_bool(bool* val, pthread_mutex_t* mutex) {
|
||||
// fprintf(stderr, "%s: val = %p mutex = %p\n", __func__, (void*)val, (void*)mutex);
|
||||
pthread_mutex_lock(mutex);
|
||||
bool ret = *val;
|
||||
pthread_mutex_unlock(mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool set_locked_bool(bool* val, bool newval, pthread_mutex_t* mutex) {
|
||||
// fprintf(stderr, "%s: val = %p mutex = %p, newval = %d\n", __func__, (void*)val, (void*)mutex, newval);
|
||||
pthread_mutex_lock(mutex);
|
||||
*val = newval;
|
||||
pthread_mutex_unlock(mutex);
|
||||
return newval;
|
||||
}
|
||||
|
||||
bool get_spin(void) {
|
||||
return get_locked_bool(&spin, &spin_mutex);
|
||||
}
|
||||
|
||||
bool set_spin(bool newval) {
|
||||
return set_locked_bool(&spin, newval, &spin_mutex);
|
||||
}
|
||||
|
||||
bool get_found_pongo(void) {
|
||||
return get_locked_bool(&found_pongo, &found_pongo_mutex);
|
||||
}
|
||||
|
||||
bool set_found_pongo(bool val) {
|
||||
return set_locked_bool(&found_pongo, val, &found_pongo_mutex);
|
||||
}
|
||||
|
||||
uint64_t get_ecid_wait_for_dfu(void) {
|
||||
LOG(LOG_VERBOSE5, "locking ecid wait for dfu mutex for get");
|
||||
pthread_mutex_lock(&ecid_dfu_wait_mutex);
|
||||
uint64_t ret = ecid_wait_for_dfu;
|
||||
LOG(LOG_VERBOSE5, "UN-locking ecid wait for dfu mutex, ecid_wait_for_dfu value is %llu", ret);
|
||||
pthread_mutex_unlock(&ecid_dfu_wait_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint64_t set_ecid_wait_for_dfu(uint64_t ecid) {
|
||||
LOG(LOG_VERBOSE5, "locking ecid wait for dfu mutex for set ecid_wait_for_dfu = %llu", ecid);
|
||||
pthread_mutex_lock(&ecid_dfu_wait_mutex);
|
||||
ecid_wait_for_dfu = ecid;
|
||||
LOG(LOG_VERBOSE5, "UN-locking ecid wait for dfu mutex afrer setting ecid_wait_for_dfu");
|
||||
pthread_mutex_unlock(&ecid_dfu_wait_mutex);
|
||||
return ecid;
|
||||
}
|
||||
|
||||
#ifdef TUI
|
||||
newtComponent get_tui_log() {
|
||||
pthread_mutex_lock(&tui_log_mutex);
|
||||
newtComponent ret = tui_log_output;
|
||||
pthread_mutex_unlock(&tui_log_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
newtComponent set_tui_log(newtComponent co) {
|
||||
pthread_mutex_lock(&tui_log_mutex);
|
||||
tui_log_output = co;
|
||||
pthread_mutex_unlock(&tui_log_mutex);
|
||||
return co;
|
||||
}
|
||||
#endif
|
||||
@@ -1,245 +0,0 @@
|
||||
#ifndef HAVE_LIBIMOBILEDEVICE
|
||||
#include "lockdown_helper.h"
|
||||
#include <usbmuxd.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define log_debug(...) fprintf(stderr, __VA_ARGS__); fputc('\n', stderr)
|
||||
#else
|
||||
#define log_debug(...) do {} while (0)
|
||||
#endif
|
||||
#define log_error(...) fprintf(stderr, __VA_ARGS__); fputc('\n', stderr)
|
||||
|
||||
int lockdown_connect_handle(uint32_t handle) {
|
||||
int fd = usbmuxd_connect(handle, 62078);
|
||||
if (fd < 0) {
|
||||
log_debug("Can't connect to lockownd on device #%u", handle);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
int lockdown_connect_udid(const char* udid) {
|
||||
usbmuxd_device_info_t device;
|
||||
if (usbmuxd_get_device_by_udid(udid, &device) < 0) {
|
||||
log_debug("Can't find device %s", udid);
|
||||
return -ENOENT;
|
||||
}
|
||||
return lockdown_connect_handle(device.handle);
|
||||
}
|
||||
|
||||
void lockdown_disconnect(int fd) {
|
||||
usbmuxd_disconnect(fd);
|
||||
}
|
||||
|
||||
int lockdown_check_type(int fd, const char* type_match);
|
||||
|
||||
static const char QUERY_TYPE_REQUEST[] = "____<plist version=\"1.0\"><dict><key>Label</key><string>palera1n</string><key>Request</key><string>QueryType</string></dict></plist>";
|
||||
static const char GET_VALUE_DOMAIN_REQUEST_FMT[] = "____<plist version=\"1.0\"><dict><key>Label</key><string>palera1n</string><key>Domain</key><string>%s</string><key>Key</key><string>%s</string><key>Request</key><string>GetValue</string></dict></plist>";
|
||||
static const char GET_VALUE_REQUEST_FMT[] = "____<plist version=\"1.0\"><dict><key>Label</key><string>palera1n</string><key>Key</key><string>%s</string><key>Request</key><string>GetValue</string></dict></plist>";
|
||||
static const char VALUE_KEY_NODE[] = "<key>Value</key>";
|
||||
static const char INTEGER_NODE[] = "<integer>";
|
||||
static const char STRING_NODE[] = "<string>";
|
||||
static const char ENTER_RECOVERY_REQUEST[] = "____<plist version=\"1.0\"><dict><key>Label</key><string>palera1n</string><key>Request</key><string>EnterRecovery</string></dict></plist>";
|
||||
static const char ERROR_KEY_NODE[] = "<key>Error</key>";
|
||||
static const char ENTER_RECOVERY_STRING_NODE[] = "<string>EnterRecovery</string>";
|
||||
static const int VALUE_KEY_NODE_SIZE = sizeof(VALUE_KEY_NODE)-1;
|
||||
static const int INTEGER_NODE_SIZE = sizeof(INTEGER_NODE)-1;
|
||||
static const int STRING_NODE_SIZE = sizeof(STRING_NODE)-1;
|
||||
static const int ERROR_KEY_NODE_SIZE = sizeof(ERROR_KEY_NODE)-1;
|
||||
|
||||
static void skip_ws(char** cur, char* end) {
|
||||
char* p = *cur;
|
||||
while (p < end && ((*p == ' ') || (*p == '\t') || (*p == '\r') || (*p == '\n'))) {
|
||||
p++;
|
||||
}
|
||||
*cur = p;
|
||||
}
|
||||
|
||||
static char* _send_request_and_get_reply(int fd, const char* request, uint32_t len, uint32_t* received) {
|
||||
uint32_t sent_bytes = 0;
|
||||
usbmuxd_send(fd, request, len, &sent_bytes);
|
||||
if (sent_bytes != len) {
|
||||
usbmuxd_disconnect(fd);
|
||||
log_error("Failed to send data payload");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32_t recv_bytes = 0;
|
||||
uint32_t besize = 0;
|
||||
int r = usbmuxd_recv(fd, (char*)&besize, sizeof(besize), &recv_bytes);
|
||||
if (recv_bytes != sizeof(besize)) {
|
||||
usbmuxd_disconnect(fd);
|
||||
log_error("Failed to get size of packet (%d)", r);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32_t resp_size = ntohl(besize);
|
||||
char* resp = (char*)malloc(resp_size+1);
|
||||
|
||||
recv_bytes = 0;
|
||||
usbmuxd_recv(fd, resp, resp_size, &recv_bytes);
|
||||
if (recv_bytes != resp_size) {
|
||||
usbmuxd_disconnect(fd);
|
||||
free(resp);
|
||||
log_error("Failed to receive payload");
|
||||
return NULL;
|
||||
}
|
||||
resp[resp_size] = '\0';
|
||||
*received = resp_size;
|
||||
return resp;
|
||||
}
|
||||
|
||||
int lockdown_check_type(int fd, const char* type_match) {
|
||||
unsigned char tmp[512];
|
||||
uint32_t len = (uint32_t)snprintf((char*)tmp, 512, QUERY_TYPE_REQUEST);
|
||||
uint32_t belen = htonl(len-4);
|
||||
*(uint32_t*)tmp = belen;
|
||||
uint32_t resp_size = 0;
|
||||
char* resp = _send_request_and_get_reply(fd, (char*)tmp, len, &resp_size);
|
||||
if (!resp) {
|
||||
log_error("Failed to get lockdown type");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int result = (strstr(resp, type_match) == NULL) ? -1 : 0;
|
||||
free(resp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int lockdown_get_uint_value(int fd, const char* domain, const char* key, uint64_t* value) {
|
||||
char tmp[1024];
|
||||
uint32_t len;
|
||||
if (domain) {
|
||||
len = snprintf(tmp, 1024, GET_VALUE_DOMAIN_REQUEST_FMT, domain, key);
|
||||
} else {
|
||||
len = snprintf(tmp, 1024, GET_VALUE_REQUEST_FMT, key);
|
||||
}
|
||||
*(uint32_t*)&tmp = htonl(len-4);
|
||||
|
||||
uint32_t resp_size = 0;
|
||||
char* resp = _send_request_and_get_reply(fd, tmp, len, &resp_size);
|
||||
if (!resp) {
|
||||
log_error("Failed to get value for key %s", key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
char* p = strstr(resp, VALUE_KEY_NODE);
|
||||
if (!p) {
|
||||
log_debug("Failed to get Value key node?!");
|
||||
return -1;
|
||||
}
|
||||
p += VALUE_KEY_NODE_SIZE;
|
||||
skip_ws(&p, resp+resp_size);
|
||||
if (p >= resp+resp_size) {
|
||||
log_debug("Failed to get value node");
|
||||
return -1;
|
||||
}
|
||||
if (strncmp(p, INTEGER_NODE, INTEGER_NODE_SIZE) != 0) {
|
||||
log_debug("Failed to parse value node");
|
||||
return -1;
|
||||
}
|
||||
p += INTEGER_NODE_SIZE;
|
||||
*value = (uint64_t)strtoll(p, NULL, 10);
|
||||
free(resp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lockdown_get_string_value(int fd, const char* domain, const char* key, char** value) {
|
||||
char tmp[1024];
|
||||
uint32_t len;
|
||||
if (domain) {
|
||||
len = snprintf(tmp, 1024, GET_VALUE_DOMAIN_REQUEST_FMT, domain, key);
|
||||
} else {
|
||||
len = snprintf(tmp, 1024, GET_VALUE_REQUEST_FMT, key);
|
||||
}
|
||||
*(uint32_t*)&tmp = htonl(len-4);
|
||||
|
||||
uint32_t resp_size = 0;
|
||||
char* resp = _send_request_and_get_reply(fd, tmp, len, &resp_size);
|
||||
if (!resp) {
|
||||
log_error("Failed to get value for key %s", key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
char* p = strstr(resp, VALUE_KEY_NODE);
|
||||
if (!p) {
|
||||
log_debug("Failed to get Value key node?!");
|
||||
free(resp);
|
||||
return -1;
|
||||
}
|
||||
p += VALUE_KEY_NODE_SIZE;
|
||||
skip_ws(&p, resp+resp_size);
|
||||
if (p >= resp+resp_size) {
|
||||
log_debug("Failed to get value node");
|
||||
free(resp);
|
||||
return -1;
|
||||
}
|
||||
if (strncmp(p, STRING_NODE, STRING_NODE_SIZE) != 0) {
|
||||
log_debug("Failed to parse value node");
|
||||
free(resp);
|
||||
return -1;
|
||||
}
|
||||
p += STRING_NODE_SIZE;
|
||||
char* str_start = p;
|
||||
while (*p != '<' && *p != '\0') p++;
|
||||
if (*p == '\0') {
|
||||
log_debug("Failed to parse string value node");
|
||||
free(resp);
|
||||
return -1;
|
||||
}
|
||||
size_t str_len = p - str_start;
|
||||
*value = (char*)malloc(str_len + 1);
|
||||
snprintf(*value, str_len, "%s", str_start);
|
||||
(*value)[str_len] = '\0';
|
||||
free(resp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lockdown_enter_recovery(int fd) {
|
||||
char tmp[512];
|
||||
uint32_t len = (uint32_t)snprintf(tmp, 512, ENTER_RECOVERY_REQUEST);
|
||||
*(uint32_t*)&tmp = htonl(len-4);
|
||||
uint32_t resp_size = 0;
|
||||
char* resp = _send_request_and_get_reply(fd, tmp, len, &resp_size);
|
||||
if (!resp) {
|
||||
log_error("Failed to enter recover?");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int result = -1;
|
||||
char* p = strstr(resp, ERROR_KEY_NODE);
|
||||
if (p) {
|
||||
char* str_start = NULL;
|
||||
size_t str_len = 0;
|
||||
p += ERROR_KEY_NODE_SIZE;
|
||||
skip_ws(&p, resp+resp_size);
|
||||
if (*p && !strncmp(p, STRING_NODE, STRING_NODE_SIZE)) {
|
||||
p += STRING_NODE_SIZE;
|
||||
str_start = p;
|
||||
while (*p != '<' && *p != '\0') p++;
|
||||
if (*p == '<') {
|
||||
str_len = p - str_start;
|
||||
}
|
||||
}
|
||||
if (str_start && str_len > 0) {
|
||||
log_error("ERROR: Failed to make device enter recovery mode: %.*s", (int)str_len, str_start);
|
||||
} else {
|
||||
log_error("ERROR: Failed to make device enter recovery mode: (unknown error)");
|
||||
}
|
||||
result = -2;
|
||||
} else {
|
||||
result = (strstr(resp, ENTER_RECOVERY_STRING_NODE) == NULL) ? -1 : 0;
|
||||
}
|
||||
free(resp);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef __LOCKDOWN_HELPER_H
|
||||
#define __LOCKDOWN_HELPER_H
|
||||
|
||||
#ifndef HAVE_LIBIMOBILEDEVICE
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int lockdown_connect_udid(const char* udid);
|
||||
int lockdown_connect_handle(uint32_t handle);
|
||||
|
||||
void lockdown_disconnect(int fd);
|
||||
|
||||
int lockdown_check_type(int fd, const char* type_match);
|
||||
|
||||
int lockdown_get_uint_value(int fd, const char* domain, const char* key, uint64_t* value);
|
||||
int lockdown_get_string_value(int fd, const char* domain, const char* key, char** value);
|
||||
|
||||
int lockdown_enter_recovery(int fd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,111 +0,0 @@
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <ANSI-color-codes.h>
|
||||
#include <palerain.h>
|
||||
|
||||
int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxname, const char *__restrict format, ...)
|
||||
{
|
||||
if (verbose >= 5
|
||||
#ifdef TUI
|
||||
&& !checkrain_options_enabled(host_flags, host_option_tui)
|
||||
#endif
|
||||
) fprintf(stderr, "p1_log: loglevel %d from %s:%d:%s()\n", loglevel, fname, lineno, fxname);
|
||||
int ret = 0;
|
||||
char type[0x10];
|
||||
char colour[0x10];
|
||||
char colour_bold[0x10];
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
if (verbose < (loglevel - 3) && loglevel > LOG_INFO) {
|
||||
if (verbose >= 5
|
||||
#ifdef TUI
|
||||
&& !tui_started
|
||||
#endif
|
||||
) fprintf(stderr, "p1_log: hid log with high log level (%d < %d)\n", verbose, loglevel - 3);
|
||||
return 0;
|
||||
}
|
||||
switch (loglevel) {
|
||||
case LOG_FATAL:
|
||||
snprintf(type, 0x10, "%s", "!");
|
||||
snprintf(colour, 0x10, "%s", RED);
|
||||
snprintf(colour_bold, 0x10, "%s", BRED);
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
snprintf(type, 0x10, "%s", "Error");
|
||||
snprintf(colour, 0x10, "%s", RED);
|
||||
snprintf(colour_bold, 0x10, "%s", BRED);
|
||||
break;
|
||||
case LOG_WARNING:
|
||||
snprintf(type, 0x10, "%s", "Warning");
|
||||
snprintf(colour, 0x10, "%s", YEL);
|
||||
snprintf(colour_bold, 0x10, "%s", BYEL);
|
||||
break;
|
||||
case LOG_INFO:
|
||||
snprintf(type, 0x10, "%s", "Info");
|
||||
snprintf(colour, 0x10, "%s", CYN);
|
||||
snprintf(colour_bold, 0x10, "%s", BCYN);
|
||||
break;
|
||||
default:
|
||||
assert(loglevel >= 0);
|
||||
snprintf(type, 0x10, "%s", "Verbose");
|
||||
snprintf(colour, 0x10, "%s", WHT);
|
||||
snprintf(colour_bold, 0x10, "%s", BWHT);
|
||||
break;
|
||||
}
|
||||
if (checkrain_options_enabled(host_flags, host_option_no_colors)) {
|
||||
colour[0] = '\0';
|
||||
colour_bold[0] = '\0';
|
||||
}
|
||||
#ifdef TUI
|
||||
if (checkrain_options_enabled(host_flags, host_option_tui) && tui_started) {
|
||||
newtComponent co = get_tui_log();
|
||||
if (co == NULL) {
|
||||
return 0; /* 0 bytes printed */
|
||||
}
|
||||
char printbuf[0x200];
|
||||
ret = vsnprintf(printbuf, 0x200, format, args);
|
||||
pthread_mutex_lock(&log_mutex);
|
||||
newtTextboxSetText(co, printbuf);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
pthread_mutex_lock(&log_mutex);
|
||||
char timestring[0x80];
|
||||
time_t curtime;
|
||||
time(&curtime);
|
||||
struct tm* timeinfo = localtime(&curtime);
|
||||
if (!checkrain_options_enabled(host_flags, host_option_no_colors))
|
||||
snprintf(timestring, 0x80, "%s[%s%02d/%02d/%d %02d:%02d:%02d%s]", CRESET, HBLK, timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_year - 100, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, CRESET);
|
||||
else
|
||||
snprintf(timestring, 0x80, "[%02d/%02d/%d %02d:%02d:%02d]", timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_year - 100, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
||||
if (verbose >= 2 && !checkrain_options_enabled(host_flags, host_option_no_colors)) {
|
||||
printf("%s| - %s%s <%s> " CRESET "%s" HBLU "%s" CRESET ":" BLU "%d" CRESET ":" BMAG "%s()" CRESET ": \n%s| ----> ", colour_bold, timestring, colour_bold, type, WHT, fname, lineno, fxname, colour_bold);
|
||||
} else if (!checkrain_options_enabled(host_flags, host_option_no_colors)) {
|
||||
printf(" - %s %s<%s>%s: ", timestring, colour_bold, type, CRESET);
|
||||
} else if (verbose >= 2 && checkrain_options_enabled(host_flags, host_option_no_colors)) {
|
||||
printf("%s| - %s%s <%s> %s:%d:%s(): \n%s| ----> ", colour_bold, timestring, colour_bold, type, fname, lineno, fxname, colour_bold);
|
||||
} else if (checkrain_options_enabled(host_flags, host_option_no_colors)) {
|
||||
printf(" - %s %s<%s>: ", timestring, colour_bold, type);
|
||||
}
|
||||
printf("%s", colour);
|
||||
ret = vprintf(format, args);
|
||||
va_end(args);
|
||||
|
||||
if (verbose < 2 && !checkrain_options_enabled(host_flags, host_option_no_colors))
|
||||
printf(CRESET "\n");
|
||||
else if (!checkrain_options_enabled(host_flags, host_option_no_colors))
|
||||
printf("\n%s-%s\n", colour, CRESET);
|
||||
else if (verbose < 2)
|
||||
printf("\n");
|
||||
else
|
||||
printf("\n%s-\n", colour);
|
||||
fflush(stdout);
|
||||
}
|
||||
pthread_mutex_unlock(&log_mutex);
|
||||
return ret;
|
||||
}
|
||||
-190
@@ -1,190 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
#include <sys/mman.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <libimobiledevice/libimobiledevice.h>
|
||||
|
||||
#include <ANSI-color-codes.h>
|
||||
#include <palerain.h>
|
||||
#include <xxd-embedded.h>
|
||||
#include <kerninfo.h>
|
||||
|
||||
#define CMD_LEN_MAX 512
|
||||
#define OVERRIDE_MAGIC 0xd803b376
|
||||
|
||||
unsigned int verbose = 0;
|
||||
char xargs_cmd[0x270] = "xargs ", checkrain_flags_cmd[0x20] = "deadbeef", palerain_flags_cmd[0x20] = "deadbeef";
|
||||
char kpf_flags_cmd[0x20] = "deadbeef", dtpatch_cmd[0x20] = "deadbeef", rootfs_cmd[512] = "deadbeef";
|
||||
extern char** environ;
|
||||
|
||||
niarelap_file_t* kpf_to_upload_1 = &checkra1n_kpf_pongo;
|
||||
niarelap_file_t* ramdisk_to_upload_1 = &ramdisk_dmg;
|
||||
niarelap_file_t* overlay_to_upload_1 = &binpack_dmg;
|
||||
|
||||
niarelap_file_t** kpf_to_upload = &kpf_to_upload_1;
|
||||
niarelap_file_t** ramdisk_to_upload = &ramdisk_to_upload_1;
|
||||
niarelap_file_t** overlay_to_upload = &overlay_to_upload_1;
|
||||
|
||||
override_file_t override_ramdisk, override_kpf, override_overlay;
|
||||
|
||||
uint32_t checkrain_flags = 0, palerain_flags = 0, kpf_flags = 0;
|
||||
|
||||
pthread_mutex_t log_mutex;
|
||||
pthread_t dfuhelper_thread, pongo_thread;
|
||||
|
||||
void thr_cleanup(void* ptr) {
|
||||
*(int*)ptr = 0;
|
||||
}
|
||||
|
||||
int build_checks(void) {
|
||||
#ifndef NO_CHECKRAIN
|
||||
#if defined(__APPLE__)
|
||||
struct mach_header_64* c1_header = (struct mach_header_64*)&checkra1n[0];
|
||||
if (c1_header->magic != MH_MAGIC_64 && c1_header->magic != MH_CIGAM_64) {
|
||||
LOG(LOG_FATAL, "Broken build: checkra1n is not a thin Mach-O");
|
||||
return -1;
|
||||
}
|
||||
if (c1_header->cputype != _mh_execute_header.cputype) {
|
||||
LOG(LOG_FATAL, "Broken build: checkra1n CPU type does not match palera1n CPU type");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
if (checkra1n_len <= (UCHAR_MAX + 1)) {
|
||||
LOG(LOG_FATAL, "checkra1n too small");
|
||||
}
|
||||
if (boyermoore_horspool_memmem(&checkra1n[0], checkra1n_len, (const unsigned char *)"[ra1npoc15-part] thanks to", strlen("[ra1npoc15-part] thanks to")) != NULL) {
|
||||
host_flags |= palerain_option_checkrain_is_clone;
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_KPF
|
||||
struct mach_header_64 *kpf_hdr = (struct mach_header_64 *)checkra1n_kpf_pongo;
|
||||
if (kpf_hdr->magic != MH_MAGIC_64 && kpf_hdr->magic != MH_CIGAM_64) {
|
||||
LOG(LOG_FATAL, "Broken build: Invalid kernel patchfinder: Not thin 64-bit Mach-O");
|
||||
return -1;
|
||||
} else if (kpf_hdr->filetype != MH_KEXT_BUNDLE) {
|
||||
LOG(LOG_FATAL, "Broken build: Invalid kernel patchfinder: Not a kext bundle");
|
||||
return -1;
|
||||
} else if (kpf_hdr->cputype != CPU_TYPE_ARM64) {
|
||||
LOG(LOG_FATAL, "Broken build: Invalid kernel patchfinder: CPU type is not arm64");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TUI
|
||||
bool tui_started = false;
|
||||
#endif
|
||||
|
||||
#ifdef USE_LIBUSB
|
||||
void log_cb(libusb_context *ctx, enum libusb_log_level level, const char *str) {
|
||||
LOG(level + 0, str);
|
||||
}
|
||||
#endif
|
||||
|
||||
int palera1n(int argc, char *argv[]) {
|
||||
print_credits();
|
||||
int ret = 0;
|
||||
pthread_mutex_init(&log_mutex, NULL);
|
||||
pthread_mutex_init(&spin_mutex, NULL);
|
||||
pthread_mutex_init(&found_pongo_mutex, NULL);
|
||||
pthread_mutex_init(&ecid_dfu_wait_mutex, NULL);
|
||||
if ((ret = build_checks())) return ret;
|
||||
if ((ret = optparse(argc, argv))) goto cleanup;
|
||||
if (!checkrain_options_enabled(host_flags, host_option_device_info) && checkrain_options_enabled(host_flags, host_option_palerain_version)) goto normal_exit;
|
||||
#ifdef TUI
|
||||
if (checkrain_options_enabled(host_flags, host_option_tui)) {
|
||||
ret = tui();
|
||||
if (ret) goto cleanup;
|
||||
else goto normal_exit;
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_LIBUSB
|
||||
{
|
||||
libusb_set_log_cb(NULL, log_cb, LIBUSB_LOG_CB_GLOBAL);
|
||||
libusb_context* ctx = NULL;
|
||||
int test_libusb = libusb_init(&ctx);
|
||||
if (test_libusb) {
|
||||
LOG(LOG_ERROR, "cannot initialize libusb: %d (%s)\n", test_libusb, libusb_strerror(test_libusb));
|
||||
libusb_exit(ctx);
|
||||
goto cleanup;
|
||||
}
|
||||
libusb_exit(ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!checkrain_options_enabled(host_flags, host_option_device_info))
|
||||
LOG(LOG_INFO, "Waiting for devices");
|
||||
|
||||
if (access("/var/run/usbmuxd", F_OK) != 0)
|
||||
LOG(LOG_WARNING, "/var/run/usbmuxd not found, normal mode device detection will not work.");
|
||||
|
||||
pthread_create(&pongo_thread, NULL, pongo_helper, NULL);
|
||||
pthread_create(&dfuhelper_thread, NULL, dfuhelper, NULL);
|
||||
pthread_join(dfuhelper_thread, NULL);
|
||||
set_spin(0);
|
||||
if (checkrain_options_enabled(host_flags, host_option_dfuhelper_only |
|
||||
host_option_reboot_device |
|
||||
host_option_exit_recovery |
|
||||
host_option_enter_recovery |
|
||||
host_option_device_info
|
||||
) || device_has_booted)
|
||||
goto normal_exit;
|
||||
if (exec_checkra1n()) goto cleanup;
|
||||
|
||||
if (checkrain_options_enabled(host_flags, host_option_pongo_exit | host_option_demote))
|
||||
goto normal_exit;
|
||||
set_spin(1);
|
||||
sleep(2);
|
||||
pthread_create(&pongo_thread, NULL, pongo_helper, NULL);
|
||||
pthread_join(pongo_thread, NULL);
|
||||
while (get_spin())
|
||||
{
|
||||
sleep(1);
|
||||
}
|
||||
normal_exit:
|
||||
cleanup:
|
||||
if (override_kpf.magic == OVERRIDE_MAGIC) {
|
||||
munmap(override_kpf.ptr, (size_t)override_kpf.len);
|
||||
close(override_kpf.fd);
|
||||
}
|
||||
if (override_ramdisk.magic == OVERRIDE_MAGIC) {
|
||||
munmap(override_ramdisk.ptr, (size_t)override_ramdisk.len);
|
||||
close(override_ramdisk.fd);
|
||||
}
|
||||
if (override_overlay.magic == OVERRIDE_MAGIC) {
|
||||
munmap(override_overlay.ptr, (size_t)override_overlay.len);
|
||||
close(override_overlay.fd);
|
||||
}
|
||||
if (ext_checkra1n != NULL) free(ext_checkra1n);
|
||||
pthread_mutex_destroy(&log_mutex);
|
||||
pthread_mutex_destroy(&spin_mutex);
|
||||
pthread_mutex_destroy(&found_pongo_mutex);
|
||||
pthread_mutex_destroy(&ecid_dfu_wait_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char* argv[]) {
|
||||
return palera1n(argc, argv);
|
||||
}
|
||||
-402
@@ -1,402 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <palerain.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
checkrain_option_t host_flags = 0;
|
||||
checkrain_option_p host_flags_p = &host_flags;
|
||||
static bool force_use_verbose_boot = false;
|
||||
|
||||
static struct option longopts[] = {
|
||||
{"setup-partial-fakefs", no_argument, NULL, 'B'},
|
||||
{"setup-fakefs", no_argument, NULL, 'c'},
|
||||
{"dfuhelper", no_argument, NULL, 'D'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"pongo-shell", no_argument, NULL, 'p'},
|
||||
{"pongo-full", no_argument, NULL, 'P'},
|
||||
{"debug-logging", no_argument, NULL, 'v'},
|
||||
{"verbose-boot", no_argument, NULL, 'V'},
|
||||
{"boot-args", required_argument, NULL, 'e'},
|
||||
{"fakefs", no_argument, NULL, 'f'},
|
||||
{"rootless", no_argument, NULL, 'l'},
|
||||
{"jbinit-log-to-file", no_argument, NULL, 'L'},
|
||||
{"demote", no_argument, NULL, 'd'},
|
||||
{"force-revert", no_argument, NULL, palerain_option_case_force_revert},
|
||||
{"no-colors", no_argument, NULL, 'S'},
|
||||
{"safe-mode", no_argument, NULL, 's'},
|
||||
{"version", no_argument, NULL, palerain_option_case_version},
|
||||
{"override-pongo", required_argument, NULL, 'k'},
|
||||
{"override-overlay", required_argument, NULL, 'o'},
|
||||
{"override-ramdisk", required_argument, NULL, 'r'},
|
||||
{"override-kpf", required_argument, NULL, 'K'},
|
||||
{"override-checkra1n", required_argument, NULL, 'i'},
|
||||
{"reboot-device", no_argument, NULL, 'R'},
|
||||
{"exit-recovery", no_argument, NULL, 'n'},
|
||||
{"enter-recovery", no_argument, NULL, 'E'},
|
||||
{"device-info", no_argument, NULL, 'I'},
|
||||
#ifdef DEV_BUILD
|
||||
{"test1", no_argument, NULL, '1'},
|
||||
{"test2", no_argument, NULL, '2'},
|
||||
#endif
|
||||
#ifdef TUI
|
||||
{"tui", no_argument, NULL, 't'},
|
||||
#endif
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
static int usage(int e, char* prog_name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-"
|
||||
"DEhpvVldsSLRnPI"
|
||||
#ifdef DEV_BUILD
|
||||
"12"
|
||||
#endif
|
||||
#ifdef ROOTFUL
|
||||
"cfB"
|
||||
#endif
|
||||
#ifdef TUI
|
||||
"t"
|
||||
#endif
|
||||
"] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n"
|
||||
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
||||
"iOS/iPadOS 15.0-16.4.1 arm64 jailbreaking tool\n\n"
|
||||
"\t--version\t\t\t\tPrint version\n"
|
||||
"\t--force-revert\t\t\t\tRemove jailbreak\n"
|
||||
#ifdef DEV_BUILD
|
||||
"\t-1, --test1\t\t\t\tSet palerain_option_test1\n"
|
||||
"\t-2, --test2\t\t\t\tSet palerain_option_test2\n"
|
||||
#endif
|
||||
#ifdef ROOTFUL
|
||||
"\t-B, --setup-partial-fakefs\t\tSetup partial fakefs\n"
|
||||
"\t-c, --setup-fakefs\t\t\tSetup fakefs\n"
|
||||
#endif
|
||||
"\t-d, --demote\t\t\t\tDemote\n"
|
||||
"\t-D, --dfuhelper\t\t\t\tExit after entering DFU\n"
|
||||
"\t-e, --boot-args <boot arguments>\tXNU boot arguments\n"
|
||||
"\t-E, --enter-recovery\t\t\tEnter recovery mode\n"
|
||||
#ifdef ROOTFUL
|
||||
"\t-f, --fakefs \t\t\t\tBoots fakefs\n"
|
||||
#endif
|
||||
"\t-h, --help\t\t\t\tShow this help\n"
|
||||
"\t-i, --override-checkra1n <file>\t\tOverride checkra1n\n"
|
||||
"\t-k, --override-pongo <file>\t\tOverride Pongo image\n"
|
||||
"\t-K, --override-kpf <file>\t\tOverride kernel patchfinder\n"
|
||||
"\t-l, --rootless\t\t\t\tBoots rootless. This is the default\n"
|
||||
"\t-L, --jbinit-log-to-file\t\tMake jbinit log to /cores/jbinit.log (can be read from sandbox while jailbroken)\n"
|
||||
"\t-n, --exit-recovery\t\t\tExit recovery mode\n"
|
||||
"\t-I, --device-info\t\t\tPrint info about the connected device\n"
|
||||
"\t-o, --override-overlay <file>\t\tOverride overlay\n"
|
||||
"\t-p, --pongo-shell\t\t\tBoots to PongoOS shell\n"
|
||||
"\t-P, --pongo-full\t\t\tBoots to a PongoOS shell with default images already uploaded\n"
|
||||
"\t-r, --override-ramdisk <file>\t\tOverride ramdisk\n"
|
||||
"\t-R, --reboot-device\t\t\tReboot connected device in normal mode\n"
|
||||
"\t-s, --safe-mode\t\t\t\tEnter safe mode\n"
|
||||
"\t-S, --no-colors\t\t\t\tDisable colors on the command line\n"
|
||||
"\t-v, --debug-logging\t\t\tEnable debug logging\n"
|
||||
"\t\tThis option can be repeated for extra verbosity.\n"
|
||||
"\t-V, --verbose-boot\t\t\tVerbose boot\n"
|
||||
|
||||
#ifdef TUI
|
||||
"\t-t, --tui\t\t\t\tTerminal user interface\n"
|
||||
#endif
|
||||
"\nEnvironmental variables:\n"
|
||||
"\tTMPDIR\t\ttemporary diretory (path the built-in checkra1n will be extracted to)\n"
|
||||
,
|
||||
prog_name);
|
||||
exit(e);
|
||||
}
|
||||
|
||||
int optparse(int argc, char* argv[]) {
|
||||
int opt;
|
||||
int index;
|
||||
while ((opt = getopt_long(argc, argv,
|
||||
"DEhpvVldsSLtRnPIe:o:r:K:k:i:"
|
||||
#ifdef DEV_BUILD
|
||||
"12"
|
||||
#endif
|
||||
"fcB"
|
||||
,longopts, NULL)) != -1)
|
||||
{
|
||||
switch (opt) {
|
||||
case 'B':
|
||||
palerain_flags |= palerain_option_setup_partial_root;
|
||||
palerain_flags |= palerain_option_setup_rootful;
|
||||
kpf_flags |= checkrain_option_verbose_boot;
|
||||
break;
|
||||
case 'c':
|
||||
palerain_flags |= palerain_option_setup_rootful;
|
||||
kpf_flags |= checkrain_option_verbose_boot;
|
||||
break;
|
||||
case 'p':
|
||||
host_flags |= host_option_pongo_exit;
|
||||
break;
|
||||
case 'P':
|
||||
host_flags |= host_option_pongo_full;
|
||||
break;
|
||||
case 'D':
|
||||
host_flags |= host_option_dfuhelper_only;
|
||||
break;
|
||||
case 'h':
|
||||
usage(0, argv[0]);
|
||||
assert(0);
|
||||
case 'v':
|
||||
verbose++;
|
||||
break;
|
||||
case 'V':
|
||||
kpf_flags |= checkrain_option_verbose_boot;
|
||||
force_use_verbose_boot = true;
|
||||
break;
|
||||
case 'e':
|
||||
if (strstr(optarg, "rootdev=") != NULL) {
|
||||
LOG(LOG_FATAL, "The boot arg rootdev= is already used by palera1n and cannot be overriden");
|
||||
return -1;
|
||||
} else if (strlen(optarg) > (sizeof(xargs_cmd) - 0x20)) {
|
||||
LOG(LOG_FATAL, "Boot arguments too long");
|
||||
return -1;
|
||||
}
|
||||
snprintf(xargs_cmd, sizeof(xargs_cmd), "xargs %s", optarg);
|
||||
break;
|
||||
case 'f':
|
||||
snprintf(rootfs_cmd, sizeof(rootfs_cmd), "rootfs %s", optarg);
|
||||
snprintf(dtpatch_cmd, 0x20, "dtpatch %s", optarg);
|
||||
palerain_flags |= palerain_option_rootful;
|
||||
break;
|
||||
case 'l':
|
||||
palerain_flags &= ~palerain_option_rootful;
|
||||
break;
|
||||
case 'L':
|
||||
palerain_flags |= palerain_option_jbinit_log_to_file;
|
||||
break;
|
||||
case 'd':
|
||||
host_flags |= host_option_demote;
|
||||
break;
|
||||
case 'E':
|
||||
host_flags |= host_option_enter_recovery;
|
||||
break;
|
||||
case 's':
|
||||
checkrain_flags |= checkrain_option_safemode;
|
||||
break;
|
||||
case 'k':
|
||||
if (access(optarg, F_OK) != 0) {
|
||||
LOG(LOG_FATAL, "Cannot access pongo file at %s: %d (%s)", optarg, errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
pongo_path = malloc(strlen(optarg) + 1);
|
||||
strcpy(pongo_path, optarg);
|
||||
break;
|
||||
case 'o':
|
||||
if (override_file(&override_overlay, overlay_to_upload, &binpack_dmg_len, optarg))
|
||||
return 1;
|
||||
break;
|
||||
case 'r':
|
||||
if (override_file(&override_ramdisk, ramdisk_to_upload, &ramdisk_dmg_len, optarg))
|
||||
return 1;
|
||||
break;
|
||||
case 'K':
|
||||
if (override_file(&override_kpf, kpf_to_upload, &checkra1n_kpf_pongo_len, optarg))
|
||||
return 1;
|
||||
struct mach_header_64* hdr = (struct mach_header_64*)override_kpf.ptr;
|
||||
if (hdr->magic != MH_MAGIC_64 && hdr->magic != MH_CIGAM_64) {
|
||||
LOG(LOG_FATAL, "Invalid kernel patchfinder: Not thin 64-bit Mach-O");
|
||||
return -1;
|
||||
} else if (hdr->filetype != MH_KEXT_BUNDLE) {
|
||||
LOG(LOG_FATAL, "Invalid kernel patchfinder: Not a kext bundle");
|
||||
return -1;
|
||||
} else if (hdr->cputype != CPU_TYPE_ARM64) {
|
||||
LOG(LOG_FATAL, "Invalid kernel patchfinder: CPU type is not arm64");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 'i': {};
|
||||
struct stat st;
|
||||
if (stat(optarg, &st) != 0) {
|
||||
LOG(LOG_FATAL, "cannot stat external checkra1n file: %d (%s)", errno, strerror(errno));
|
||||
return -1;
|
||||
} else if (!(st.st_mode & S_IXUSR) && !(st.st_mode & S_IXGRP) && !(st.st_mode & S_IXOTH)) {
|
||||
LOG(LOG_FATAL, "%s is not executable", optarg);
|
||||
return -1;
|
||||
} else if (!S_ISREG(st.st_mode)) {
|
||||
LOG(LOG_FATAL, "%s is not a regular file", optarg);
|
||||
return -1;
|
||||
}
|
||||
if (st.st_size < (UCHAR_MAX+1)) {
|
||||
LOG(LOG_FATAL, "%s too small", optarg);
|
||||
return -1;
|
||||
}
|
||||
int checkra1n_fd = open(optarg, O_RDONLY);
|
||||
if (checkra1n_fd == -1) {
|
||||
LOG(LOG_FATAL, "Cannot open %s: %d (%s)", optarg, errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
void* addr = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, checkra1n_fd, 0);
|
||||
if (addr == MAP_FAILED) {
|
||||
LOG(LOG_ERROR, "Failed to map file %s: %d (%s)", optarg, errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (boyermoore_horspool_memmem(addr, st.st_size, (const unsigned char*)"[ra1npoc15-part] thanks to", strlen("[ra1npoc15-part] thanks to")) != NULL)
|
||||
{
|
||||
host_flags |= palerain_option_checkrain_is_clone;
|
||||
LOG(LOG_VERBOSE3, "%s is checkra1n clone", optarg);
|
||||
}
|
||||
else
|
||||
{
|
||||
host_flags &= ~palerain_option_checkrain_is_clone;
|
||||
LOG(LOG_VERBOSE3, "%s is checkra1n", optarg);
|
||||
}
|
||||
munmap(addr, st.st_size);
|
||||
close(checkra1n_fd);
|
||||
ext_checkra1n = calloc(1, strlen(optarg) + 1);
|
||||
snprintf(ext_checkra1n, strlen(optarg) + 1, "%s", optarg);
|
||||
break;
|
||||
case 'R':
|
||||
host_flags |= host_option_reboot_device;
|
||||
break;
|
||||
case 'n':
|
||||
host_flags |= host_option_exit_recovery;
|
||||
break;
|
||||
case 'I':
|
||||
host_flags |= host_option_device_info;
|
||||
break;
|
||||
case 'S':
|
||||
host_flags |= host_option_no_colors;
|
||||
break;
|
||||
#ifdef TUI
|
||||
case 't':
|
||||
host_flags |= host_option_tui;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DEV_BUILD
|
||||
case '1':
|
||||
palerain_flags |= palerain_option_test1;
|
||||
break;
|
||||
case '2':
|
||||
palerain_flags |= palerain_option_test2;
|
||||
break;
|
||||
#endif
|
||||
case palerain_option_case_force_revert:
|
||||
checkrain_flags |= checkrain_option_force_revert;
|
||||
break;
|
||||
case palerain_option_case_version:
|
||||
host_flags |= host_option_palerain_version;
|
||||
break;
|
||||
default:
|
||||
usage(1, argv[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (checkrain_options_enabled(host_flags, host_option_palerain_version)) {
|
||||
printf(
|
||||
"palera1n " PALERAIN_VERSION "\n"
|
||||
BUILD_COMMIT " " BUILD_NUMBER " (" BUILD_BRANCH ")\n\n"
|
||||
"Build date: " BUILD_DATE "\n"
|
||||
"Build style: " BUILD_STYLE "\n"
|
||||
"Build tag: " BUILD_TAG "\n"
|
||||
"Built by: " BUILD_WHOAMI "\n"
|
||||
#ifdef USE_LIBUSB
|
||||
"USB backend: libusb\n"
|
||||
#else
|
||||
"USB backend: IOKit\n"
|
||||
#endif
|
||||
"Build options: " BUILD_OPTIONS "\n"
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful)) {
|
||||
kpf_flags &= ~checkrain_option_verbose_boot;
|
||||
}
|
||||
|
||||
snprintf(checkrain_flags_cmd, 0x20, "checkra1n_flags 0x%x", checkrain_flags);
|
||||
snprintf(palerain_flags_cmd, 0x20, "palera1n_flags 0x%x", palerain_flags);
|
||||
snprintf(kpf_flags_cmd, 0x20, "kpf_flags 0x%x", kpf_flags);
|
||||
LOG(LOG_VERBOSE3, "checkrain_flags: %s", checkrain_flags_cmd);
|
||||
LOG(LOG_VERBOSE3, "palerain_flags: %s", palerain_flags_cmd);
|
||||
LOG(LOG_VERBOSE3, "kpf_flags: %s", kpf_flags_cmd);
|
||||
LOG(LOG_VERBOSE3, "host_flags: 0x%x", host_flags);
|
||||
if (override_kpf.magic == OVERRIDE_MAGIC) {
|
||||
LOG(LOG_VERBOSE4, "kpf override length %u -> %u", override_kpf.orig_len, checkra1n_kpf_pongo_len);
|
||||
LOG(LOG_VERBOSE4, "kpf override ptr %p -> %p", override_kpf.orig_ptr, **kpf_to_upload);
|
||||
}
|
||||
if (override_ramdisk.magic == OVERRIDE_MAGIC) {
|
||||
LOG(LOG_VERBOSE4, "ramdisk override length %u -> %u", override_ramdisk.orig_len, ramdisk_dmg_len);
|
||||
LOG(LOG_VERBOSE4, "ramdisk override ptr %p -> %p", override_ramdisk.orig_ptr, **ramdisk_to_upload);
|
||||
}
|
||||
if (override_overlay.magic == OVERRIDE_MAGIC) {
|
||||
LOG(LOG_VERBOSE4, "overlay override length %u -> %u", override_overlay.orig_len, binpack_dmg_len);
|
||||
LOG(LOG_VERBOSE4, "overlay override ptr %p -> %p", override_overlay.orig_ptr, **overlay_to_upload);
|
||||
}
|
||||
|
||||
if (!checkrain_options_enabled(palerain_flags, palerain_option_rootful)) {
|
||||
if (checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful) || checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful_forced)) {
|
||||
LOG(LOG_FATAL, "Cannot setup rootful when rootless is requested. Use -f to enable rootful mode.");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (!(
|
||||
checkrain_options_enabled(host_flags, host_option_dfuhelper_only) ||
|
||||
checkrain_options_enabled(host_flags, host_option_enter_recovery) ||
|
||||
checkrain_options_enabled(host_flags, host_option_exit_recovery) ||
|
||||
checkrain_options_enabled(host_flags, host_option_reboot_device)))
|
||||
{
|
||||
#ifdef NO_CHECKRAIN
|
||||
if (checkra1n_len == 0 && ext_checkra1n == NULL)
|
||||
{
|
||||
LOG(LOG_FATAL, "checkra1n omitted in build but no override specified");
|
||||
return -1;
|
||||
}
|
||||
if (!(checkrain_options_enabled(host_flags, host_option_pongo_exit) || checkrain_options_enabled(host_flags, host_option_pongo_exit)))
|
||||
{
|
||||
#ifdef NO_KPF
|
||||
if (checkra1n_kpf_pongo_len == 0)
|
||||
{
|
||||
LOG(LOG_FATAL, "kernel patchfinder omitted in build but no override specified");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
for (index = optind; index < argc; index++)
|
||||
{
|
||||
if (!strcmp("windows", argv[index]))
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Windows not really using for manipulating OSX images,\n"
|
||||
"compiled in mingw tool for this working unstable and incorrectly\n");
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: unknown argument: %s\n", argv[0], argv[index]);
|
||||
usage(1, argv[0]);
|
||||
}
|
||||
}
|
||||
if (verbose >= 2) setenv("LIBUSB_DEBUG", "1", 1);
|
||||
|
||||
if (verbose >= 3)
|
||||
{
|
||||
libusbmuxd_set_debug_level(verbose - 2);
|
||||
irecv_set_debug_level(1);
|
||||
setenv("LIBUSB_DEBUG", "2", 1);
|
||||
}
|
||||
if (verbose >= 4) {
|
||||
idevice_set_debug_level(1);
|
||||
setenv("LIBUSB_DEBUG", "3", 1);
|
||||
}
|
||||
if (verbose >= 5)
|
||||
setenv("LIBUSB_DEBUG", "4", 1);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#include <palerain.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
int override_file(override_file_t *finfo, niarelap_file_t** orig, unsigned int *orig_len, char *filename) {
|
||||
int ret = 0;
|
||||
int fd = open(filename, O_RDONLY);
|
||||
LOG(LOG_VERBOSE5, "override_file() called!");
|
||||
if (fd == -1) {
|
||||
LOG(LOG_ERROR, "Cannot open file %s: %d (%s)", filename, errno, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
LOG(LOG_VERBOSE5, "override_file: opened %s!", filename);
|
||||
struct stat st;
|
||||
ret = fstat(fd, &st);
|
||||
if (ret) {
|
||||
LOG(LOG_ERROR, "Cannot fstat fd from file %s: %d (%s)", filename, errno, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
LOG(LOG_VERBOSE5, "override_file: fstat fd %d succeeded!", fd);
|
||||
void *addr = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
if (addr == MAP_FAILED) {
|
||||
LOG(LOG_ERROR, "Failed to map file %s: %d (%s)", filename, errno, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
LOG(LOG_VERBOSE5, "override_file: Override file mapped successfully");
|
||||
finfo->magic = OVERRIDE_MAGIC;
|
||||
finfo->fd = fd;
|
||||
finfo->len = (unsigned int)st.st_size;;
|
||||
finfo->ptr = *(niarelap_file_t*)addr;
|
||||
finfo->orig_len = *orig_len;
|
||||
finfo->orig_ptr = **orig;
|
||||
*orig = (niarelap_file_t*)addr;
|
||||
*orig_len = (unsigned int)st.st_size;
|
||||
LOG(LOG_VERBOSE5, "override_file() finished!");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h> // open
|
||||
#include <pthread.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // exit, strtoull
|
||||
#include <string.h> // strlen, strerror, memcpy, memmove
|
||||
#include <unistd.h> // close
|
||||
#include <sys/mman.h> // mmap, munmap
|
||||
#include <sys/stat.h> // fstst
|
||||
|
||||
#include <palerain.h>
|
||||
#include <ANSI-color-codes.h>
|
||||
|
||||
bool device_has_booted = 0;
|
||||
int pongo_thr_running = 0;
|
||||
|
||||
#define ERR(...) LOG(LOG_VERBOSE, __VA_ARGS__)
|
||||
|
||||
void* pongo_helper(void* ptr) {
|
||||
pongo_thr_running = 1;
|
||||
pthread_cleanup_push(thr_cleanup, &pongo_thr_running);
|
||||
wait_for_pongo();
|
||||
while (get_spin()) {
|
||||
sleep(1);
|
||||
}
|
||||
pthread_cleanup_pop(1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *pongo_usb_callback(stuff_t *arg) {
|
||||
if (get_found_pongo())
|
||||
return NULL;
|
||||
set_found_pongo(1);
|
||||
if (checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful)) {
|
||||
strncat(xargs_cmd, " wdt=-1", 0x270 - strlen(xargs_cmd) - 1);
|
||||
}
|
||||
LOG(LOG_INFO, "Found PongoOS USB Device");
|
||||
usb_device_handle_t handle = arg->handle;
|
||||
issue_pongo_command(handle, NULL);
|
||||
issue_pongo_command(handle, "fuse lock");
|
||||
issue_pongo_command(handle, "sep auto");
|
||||
upload_pongo_file(handle, **kpf_to_upload, checkra1n_kpf_pongo_len);
|
||||
issue_pongo_command(handle, "modload");
|
||||
issue_pongo_command(handle, kpf_flags_cmd);
|
||||
issue_pongo_command(handle, checkrain_flags_cmd);
|
||||
issue_pongo_command(handle, palerain_flags_cmd);
|
||||
if (checkrain_options_enabled(palerain_flags, palerain_option_rootful))
|
||||
{
|
||||
issue_pongo_command(handle, "rootfs");
|
||||
}
|
||||
#ifdef NO_RAMDISK
|
||||
if (ramdisk_dmg_len != 0)
|
||||
#endif
|
||||
{
|
||||
strncat(xargs_cmd, " rootdev=md0", 0x270 - strlen(xargs_cmd) - 1);
|
||||
upload_pongo_file(handle, **ramdisk_to_upload, ramdisk_dmg_len);
|
||||
issue_pongo_command(handle, "ramdisk");
|
||||
}
|
||||
#ifdef NO_OVERLAY
|
||||
if (binpack_dmg_len != 0)
|
||||
#endif
|
||||
{
|
||||
upload_pongo_file(handle, **overlay_to_upload, binpack_dmg_len);
|
||||
issue_pongo_command(handle, "overlay");
|
||||
}
|
||||
issue_pongo_command(handle, xargs_cmd);
|
||||
if (checkrain_options_enabled(host_flags, host_option_pongo_full)) goto done;
|
||||
issue_pongo_command(handle, "bootx");
|
||||
LOG(LOG_INFO, "Booting Kernel...");
|
||||
if (checkrain_options_enabled(palerain_flags, palerain_option_setup_partial_root)) {
|
||||
LOG(LOG_INFO, "Please wait up to 5 minutes for the bindfs to be created.");
|
||||
LOG(LOG_INFO, "Once the device boots up to iOS, run again without the -B (Create BindFS) option to jailbreak.");
|
||||
} else if (checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful)) {
|
||||
LOG(LOG_INFO, "Please wait up to 10 minutes for the fakefs to be created.");
|
||||
LOG(LOG_INFO, "Once the device boots up to iOS, run again without the -c (Create FakeFS) option to jailbreak.");
|
||||
}
|
||||
if (dfuhelper_thr_running) {
|
||||
pthread_cancel(dfuhelper_thread);
|
||||
dfuhelper_thr_running = false;
|
||||
}
|
||||
done:
|
||||
device_has_booted = true;
|
||||
#ifdef USE_LIBUSB
|
||||
libusb_unref_device(arg->dev);
|
||||
#endif
|
||||
set_spin(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int issue_pongo_command(usb_device_handle_t handle, char *command)
|
||||
{
|
||||
uint32_t outpos = 0;
|
||||
uint32_t outlen = 0;
|
||||
int ret = USB_RET_SUCCESS;
|
||||
uint8_t in_progress = 1;
|
||||
if (command == NULL) goto fetch_output;
|
||||
size_t len = strlen(command);
|
||||
char command_buf[512];
|
||||
char stdout_buf[0x2000];
|
||||
if (len > (CMD_LEN_MAX - 2))
|
||||
{
|
||||
LOG(LOG_ERROR, "Pongo command %s too long (max %d)", command, CMD_LEN_MAX - 2);
|
||||
return EINVAL;
|
||||
}
|
||||
if (verbose < 3 || verbose > 4) {
|
||||
LOG(LOG_VERBOSE, "Executing PongoOS command: '%s'", command);
|
||||
} else {
|
||||
printf("%s\n", command);
|
||||
}
|
||||
snprintf(command_buf, 512, "%s\n", command);
|
||||
len = strlen(command_buf);
|
||||
ret = USBControlTransfer(handle, 0x21, 4, 1, 0, 0, NULL, NULL);
|
||||
if (ret)
|
||||
goto bad;
|
||||
ret = USBControlTransfer(handle, 0x21, 3, 0, 0, (uint32_t)len, command_buf, NULL);
|
||||
fetch_output:
|
||||
while (in_progress) {
|
||||
ret = USBControlTransfer(handle, 0xa1, 2, 0, 0, (uint32_t)sizeof(in_progress), &in_progress, NULL);
|
||||
if (ret == USB_RET_SUCCESS)
|
||||
{
|
||||
ret = USBControlTransfer(handle, 0xa1, 1, 0, 0, 0x1000, stdout_buf + outpos, &outlen);
|
||||
if (ret == USB_RET_SUCCESS)
|
||||
{
|
||||
write_stdout(stdout_buf + outpos, outlen);
|
||||
outpos += outlen;
|
||||
if (outpos > 0x1000)
|
||||
{
|
||||
memmove(stdout_buf, stdout_buf + outpos - 0x1000, 0x1000);
|
||||
outpos = 0x1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ret != USB_RET_SUCCESS)
|
||||
{
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
bad:
|
||||
if (ret != USB_RET_SUCCESS)
|
||||
{
|
||||
if (command != NULL && (!strncmp("boot", command, 4))) {
|
||||
if (ret == USB_RET_IO || ret == USB_RET_NO_DEVICE || ret == USB_RET_NOT_RESPONDING)
|
||||
return 0;
|
||||
}
|
||||
LOG(LOG_ERROR, "USB error: %s", usb_strerror(ret));
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
int upload_pongo_file(usb_device_handle_t handle, unsigned char *buf, unsigned int buf_len)
|
||||
{
|
||||
int ret = 0;
|
||||
ret = USBControlTransfer(handle, 0x21, 1, 0, 0, 4, &buf_len, NULL);
|
||||
if (ret == USB_RET_SUCCESS)
|
||||
{
|
||||
ret = USBBulkUpload(handle, buf, buf_len);
|
||||
if (ret == USB_RET_SUCCESS)
|
||||
{
|
||||
if (verbose < 3 || verbose > 4) {
|
||||
LOG(LOG_VERBOSE, "Uploaded %llu bytes to PongoOS", (unsigned long long)buf_len);
|
||||
} else {
|
||||
if (checkrain_options_enabled(host_flags, host_option_no_colors))
|
||||
printf("/send mem:%p:%p\nUploaded %llu bytes]\n", (void*)buf, (void*)(buf + buf_len), (unsigned long long)buf_len);
|
||||
else
|
||||
printf("/send mem:%p:%p\n" BCYN "[Uploaded %llu bytes]\n" CRESET, (void*)buf, (void*)(buf + buf_len), (unsigned long long)buf_len);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (verbose >= 3) printf("pongoOS> ");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void io_start(stuff_t *stuff)
|
||||
{
|
||||
int r = pthread_create(&stuff->th, NULL, (pthread_start_t)pongo_usb_callback, stuff);
|
||||
if(r != 0)
|
||||
{
|
||||
ERR("pthread_create: %s", strerror(r));
|
||||
set_spin(0);
|
||||
return;
|
||||
}
|
||||
pthread_join(stuff->th, NULL);
|
||||
}
|
||||
|
||||
void io_stop(stuff_t *stuff)
|
||||
{
|
||||
int r = pthread_cancel(stuff->th);
|
||||
if(r != 0)
|
||||
{
|
||||
ERR("pthread_cancel: %s", strerror(r));
|
||||
set_spin(0);
|
||||
return;
|
||||
}
|
||||
r = pthread_join(stuff->th, NULL);
|
||||
if(r != 0)
|
||||
{
|
||||
ERR("pthread_join: %s", strerror(r));
|
||||
set_spin(0);
|
||||
return;
|
||||
}
|
||||
#ifdef USE_LIBUSB
|
||||
libusb_unref_device(stuff->dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
void write_stdout(char *buf, uint32_t len)
|
||||
{
|
||||
while(len > 0) {
|
||||
if (verbose >= 3) {
|
||||
ssize_t s = write(1, buf, len);
|
||||
if(s < 0) {
|
||||
LOG(LOG_ERROR, "write: %s", strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
buf += s;
|
||||
len -= s;
|
||||
} else break;
|
||||
}
|
||||
}
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <tui.h>
|
||||
|
||||
int redraw_screen() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int destroy_window() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int init_window() {
|
||||
setlocale(LC_ALL, NULL);
|
||||
setenv(
|
||||
"NEWT_COLORS",
|
||||
"root=,black\n"
|
||||
"border=lightgray,black\n"
|
||||
"title=lightgray,black\n"
|
||||
"roottext=red,black\n"
|
||||
"label=lightgray,black\n"
|
||||
"entry=lightgray,black\n"
|
||||
"window=red,black\n"
|
||||
"textbox=lightgray,black\n"
|
||||
"button=black,lightgray\n"
|
||||
"compactbutton=lightgray,black\n"
|
||||
"listbox=lightgray,black\n"
|
||||
"actlistbox=black,lightgray\n"
|
||||
"actsellistbox=black,lightgray\n"
|
||||
"checkbox=lightgray,black\n"
|
||||
"actcheckbox=black,lightgray\n",
|
||||
0);
|
||||
|
||||
tui_started = true;
|
||||
newtInit();
|
||||
int cols, rows;
|
||||
newtGetScreenSize(&cols, &rows);
|
||||
if (cols < 80 || rows < 24) {
|
||||
newtFinished();
|
||||
tui_started = false;
|
||||
LOG(LOG_FATAL, "Terminal size must be at least 80x24");
|
||||
return -1;
|
||||
}
|
||||
LOG(LOG_VERBOSE3, "cols: %d, rows: %d\n", cols, rows);
|
||||
newtCls();
|
||||
newtSetColor(PI_LOG_COLOR, "yellow", "black");
|
||||
newtSetColor(PI_STEP_CURRENT, "lightgray", "black");
|
||||
newtSetColor(PI_STEP_OTHER, "gray", "black");
|
||||
newtDrawRootText(0, 0, "palera1n version 2.0.0");
|
||||
newtPushHelpLine(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tui() {
|
||||
int ret = 0;
|
||||
if ((ret = init_window())) return ret;
|
||||
ret = MAIN_SCREEN;
|
||||
while (1) {
|
||||
switch (ret) {
|
||||
case ERROR_SCREEN:
|
||||
goto out;
|
||||
break;
|
||||
case EXIT_SCREEN:
|
||||
goto out;
|
||||
break;
|
||||
case MAIN_SCREEN:
|
||||
ret = tui_screen_main();
|
||||
break;
|
||||
case OPTIONS_SCREEN:
|
||||
ret = tui_screen_options();
|
||||
break;
|
||||
case ENTER_RECOVERY_SCREEN:
|
||||
ret = tui_screen_enter_recovery();
|
||||
break;
|
||||
case ENTER_DFU_SCREEN:
|
||||
ret = tui_screen_enter_dfu();
|
||||
break;
|
||||
case JAILBREAKING_SCREEN:
|
||||
ret = tui_screen_jailbreak();
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
goto out;
|
||||
}
|
||||
newtPopWindow();
|
||||
}
|
||||
out:
|
||||
newtFinished();
|
||||
tui_started = false;
|
||||
return 0;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <tui.h>
|
||||
|
||||
tui_screen_t tui_screen_enter_dfu() { return JAILBREAKING_SCREEN; }
|
||||
@@ -1,15 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <tui.h>
|
||||
|
||||
tui_screen_t tui_screen_enter_recovery() { return ENTER_DFU_SCREEN; }
|
||||
@@ -1,15 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <tui.h>
|
||||
|
||||
tui_screen_t tui_screen_jailbreak() { return EXIT_SCREEN; }
|
||||
@@ -1,47 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <tui.h>
|
||||
|
||||
tui_screen_t tui_screen_main() {
|
||||
int ret = MAIN_SCREEN;
|
||||
bool can_start = false;
|
||||
newtCenteredWindow(WIDTH, HEIGHT, NULL);
|
||||
newtComponent optionsButton = newtCompactButton(46, 18, "Options");
|
||||
newtComponent startButton = newtCompactButton(57, 18, "Start");
|
||||
newtComponent exitButton = newtCompactButton(66, 18, "Exit");
|
||||
newtComponent welcome = newtLabel(1, 0, "Welcome to palera1n!");
|
||||
newtComponent deviceMsg = newtTextbox(1, 2, 40, 3, NEWT_FLAG_WRAP);
|
||||
set_tui_log(deviceMsg);
|
||||
LOG(LOG_INFO, "Connect your iPhone, iPad or iPod Touch to begin.");
|
||||
newtTextboxSetColors(deviceMsg, PI_LOG_COLOR, PI_LOG_COLOR);
|
||||
set_tui_log(deviceMsg);
|
||||
newtComponent form = newtForm(NULL, NULL, 0);
|
||||
newtFormAddComponents(form, optionsButton, startButton, exitButton, welcome,
|
||||
deviceMsg, NULL);
|
||||
newtRunForm(form);
|
||||
newtRefresh();
|
||||
newtComponent buttonPressed = newtFormGetCurrent(form);
|
||||
if (buttonPressed == optionsButton) {
|
||||
ret = OPTIONS_SCREEN;
|
||||
} else if (buttonPressed == startButton) {
|
||||
if (can_start)
|
||||
ret = ENTER_RECOVERY_SCREEN;
|
||||
else
|
||||
ret = MAIN_SCREEN;
|
||||
} else if (buttonPressed == exitButton) {
|
||||
ret = EXIT_SCREEN;
|
||||
}
|
||||
set_tui_log(NULL);
|
||||
newtFormDestroy(form);
|
||||
return ret;
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <tui.h>
|
||||
|
||||
void bitfield_check_cb(newtComponent box, void* data) {
|
||||
if (newtCheckboxGetValue(box) == ' ') {
|
||||
*((tui_bit_info_t*)data)->flags_p = *((tui_bit_info_t*)data)->flags_p &~ ((tui_bit_info_t*)data)->opt;
|
||||
} else if (newtCheckboxGetValue(box) == '*') {
|
||||
*((tui_bit_info_t*)data)->flags_p |= ((tui_bit_info_t*)data)->opt;
|
||||
} else assert(0);
|
||||
}
|
||||
|
||||
|
||||
tui_screen_t tui_screen_options() {
|
||||
tui_bit_info_t verbose_info = { &kpf_flags, checkrain_option_verbose_boot };
|
||||
tui_bit_info_t rootful_info = { &palerain_flags, palerain_option_rootful };
|
||||
tui_bit_info_t setup_rootful_info = { &palerain_flags, palerain_option_setup_rootful };
|
||||
tui_bit_info_t force_revert_info = { &checkrain_flags, checkrain_option_force_revert };
|
||||
tui_bit_info_t safemode_info = { &checkrain_flags, checkrain_option_safemode };
|
||||
|
||||
static checkrain_option_t flower_flags = 0, flower_option_flower_chain = (1 << 0);
|
||||
tui_bit_info_t flower_chain_info = { &flower_flags, flower_option_flower_chain };
|
||||
|
||||
const char* bootargs_entered = NULL;
|
||||
int ret = MAIN_SCREEN;
|
||||
|
||||
newtCenteredWindow(WIDTH, HEIGHT, NULL);
|
||||
newtComponent backButton = newtCompactButton(66, 18, "Back");
|
||||
|
||||
newtComponent optionsNotice = newtTextbox(1, 0, WIDTH - 2, 3, NEWT_FLAG_WRAP);
|
||||
newtTextboxSetText(optionsNotice, "You may set the following options. If you don't know what they mean you'll probably have no reason to set them.");
|
||||
// newtTextboxSetColors(optionsNotice, NEWT_COLORSET_LABEL, NEWT_COLORSET_LABEL);
|
||||
|
||||
newtComponent verboseBootBox = newtCheckbox(1, 3, "Verbose boot", CHECKBOX_STATE(kpf_flags, checkrain_option_verbose_boot), NULL, NULL);
|
||||
newtComponent rootfulBox = newtCheckbox(1, 4, "Rootful", CHECKBOX_STATE(palerain_flags, palerain_option_rootful), NULL, NULL);
|
||||
newtComponent rootfulSetupBox = newtCheckbox(1, 5, "Setup fakefs", CHECKBOX_STATE(palerain_flags, palerain_option_setup_rootful), NULL, NULL);
|
||||
newtComponent forceRevertBox = newtCheckbox(1, 6, "Restore system", CHECKBOX_STATE(checkrain_flags, checkrain_option_force_revert), NULL, NULL);
|
||||
newtComponent safeModeBox = newtCheckbox(1, 7, "Safe mode", CHECKBOX_STATE(checkrain_flags, checkrain_option_safemode), NULL, NULL);
|
||||
|
||||
newtComponentAddCallback(verboseBootBox, bitfield_check_cb, &verbose_info);
|
||||
newtComponentAddCallback(rootfulBox, bitfield_check_cb, &rootful_info);
|
||||
newtComponentAddCallback(rootfulSetupBox, bitfield_check_cb, &setup_rootful_info);
|
||||
newtComponentAddCallback(forceRevertBox, bitfield_check_cb, &force_revert_info);
|
||||
newtComponentAddCallback(safeModeBox, bitfield_check_cb, &safemode_info);
|
||||
|
||||
newtComponent bootCmdlineLabel = newtLabel(1, 8, "Kernel command line:");
|
||||
newtComponent bootCmdlineEntry = newtEntry(1, 9, &xargs_cmd[6], WIDTH - 2, &bootargs_entered, NEWT_ENTRY_SCROLL);
|
||||
|
||||
newtComponent flowerChainBox = newtCheckbox(1, 10, "Flower chain", CHECKBOX_STATE(flower_flags, flower_option_flower_chain), NULL, NULL);
|
||||
newtComponentAddCallback(flowerChainBox, bitfield_check_cb, &flower_chain_info);
|
||||
|
||||
|
||||
newtComponent form = newtForm(NULL, NULL, 0);
|
||||
newtFormAddComponents(form, backButton, verboseBootBox, rootfulBox,
|
||||
rootfulSetupBox, forceRevertBox, safeModeBox, bootCmdlineLabel,
|
||||
bootCmdlineEntry, flowerChainBox, optionsNotice,
|
||||
NULL);
|
||||
newtRunForm(form);
|
||||
newtRefresh();
|
||||
snprintf(xargs_cmd, 0x270, "xargs %s", bootargs_entered);
|
||||
newtComponent buttonPressed = newtFormGetCurrent(form);
|
||||
if (buttonPressed == backButton) {
|
||||
ret = MAIN_SCREEN;
|
||||
} else ret = MAIN_SCREEN;
|
||||
newtFormDestroy(form);
|
||||
return ret;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>platform-application</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.no-container</key>
|
||||
<true/>
|
||||
<key>com.apple.private.skip-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.iokit-user-client-class</key>
|
||||
<array>
|
||||
<string>IOUserClient</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
-252
@@ -1,252 +0,0 @@
|
||||
/*
|
||||
* pongoOS - https://checkra.in
|
||||
*
|
||||
* Copyright (C) 2019-2022 checkra1n team
|
||||
*
|
||||
* This file is part of pongoOS.
|
||||
*
|
||||
* 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 <errno.h>
|
||||
#include <fcntl.h> // open
|
||||
#include <pthread.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // exit, strtoull
|
||||
#include <string.h> // strlen, strerror, memcpy, memmove
|
||||
#include <unistd.h> // close
|
||||
#include <wordexp.h>
|
||||
#include <sys/mman.h> // mmap, munmap
|
||||
#include <sys/stat.h> // fstst
|
||||
#include <mach/mach.h>
|
||||
|
||||
#include <palerain.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#define ERR(...) LOG(LOG_VERBOSE, __VA_ARGS__)
|
||||
|
||||
const char *usb_strerror(usb_ret_t err)
|
||||
{
|
||||
return mach_error_string(err);
|
||||
}
|
||||
|
||||
usb_ret_t USBControlTransfer(usb_device_handle_t handle, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t wLength, void *data, uint32_t *wLenDone)
|
||||
{
|
||||
IOUSBDevRequest request =
|
||||
{
|
||||
.bmRequestType = bmRequestType,
|
||||
.bRequest = bRequest,
|
||||
.wValue = wValue,
|
||||
.wIndex = wIndex,
|
||||
.wLength = wLength,
|
||||
.pData = data,
|
||||
};
|
||||
usb_ret_t ret = (*handle)->ControlRequest(handle, 0, &request);
|
||||
if(wLenDone) *wLenDone = request.wLenDone;
|
||||
return ret;
|
||||
}
|
||||
|
||||
usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len)
|
||||
{
|
||||
return (*handle)->WritePipe(handle, 2, data, len);
|
||||
}
|
||||
|
||||
static void FoundDevice(void *refCon, io_iterator_t it)
|
||||
{
|
||||
stuff_t *stuff = refCon;
|
||||
if(stuff->regID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
io_service_t usbDev = MACH_PORT_NULL;
|
||||
while((usbDev = IOIteratorNext(it)))
|
||||
{
|
||||
uint64_t regID;
|
||||
kern_return_t ret = IORegistryEntryGetRegistryEntryID(usbDev, ®ID);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("IORegistryEntryGetRegistryEntryID: %s", mach_error_string(ret));
|
||||
goto next;
|
||||
}
|
||||
SInt32 score = 0;
|
||||
IOCFPlugInInterface **plugin = NULL;
|
||||
ret = IOCreatePlugInInterfaceForService(usbDev, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugin, &score);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("IOCreatePlugInInterfaceForService(usbDev): %s", mach_error_string(ret));
|
||||
goto next;
|
||||
}
|
||||
HRESULT result = (*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID*)&stuff->dev);
|
||||
(*plugin)->Release(plugin);
|
||||
if(result != 0)
|
||||
{
|
||||
ERR("QueryInterface(dev): 0x%x", result);
|
||||
goto next;
|
||||
}
|
||||
ret = (*stuff->dev)->USBDeviceOpenSeize(stuff->dev);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("USBDeviceOpenSeize: %s", mach_error_string(ret));
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (*stuff->dev)->SetConfiguration(stuff->dev, 1);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("SetConfiguration: %s", mach_error_string(ret));
|
||||
}
|
||||
else
|
||||
{
|
||||
IOUSBFindInterfaceRequest request =
|
||||
{
|
||||
.bInterfaceClass = kIOUSBFindInterfaceDontCare,
|
||||
.bInterfaceSubClass = kIOUSBFindInterfaceDontCare,
|
||||
.bInterfaceProtocol = kIOUSBFindInterfaceDontCare,
|
||||
.bAlternateSetting = kIOUSBFindInterfaceDontCare,
|
||||
};
|
||||
io_iterator_t iter = MACH_PORT_NULL;
|
||||
ret = (*stuff->dev)->CreateInterfaceIterator(stuff->dev, &request, &iter);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("CreateInterfaceIterator: %s", mach_error_string(ret));
|
||||
}
|
||||
else
|
||||
{
|
||||
io_service_t usbIntf = MACH_PORT_NULL;
|
||||
while((usbIntf = IOIteratorNext(iter)))
|
||||
{
|
||||
ret = IOCreatePlugInInterfaceForService(usbIntf, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &plugin, &score);
|
||||
IOObjectRelease(usbIntf);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("IOCreatePlugInInterfaceForService(usbIntf): %s", mach_error_string(ret));
|
||||
continue;
|
||||
}
|
||||
result = (*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID*)&stuff->handle);
|
||||
(*plugin)->Release(plugin);
|
||||
if(result != 0)
|
||||
{
|
||||
ERR("QueryInterface(intf): 0x%x", result);
|
||||
continue;
|
||||
}
|
||||
ret = (*stuff->handle)->USBInterfaceOpen(stuff->handle);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("USBInterfaceOpen: %s", mach_error_string(ret));
|
||||
}
|
||||
else
|
||||
{
|
||||
io_start(stuff);
|
||||
stuff->regID = regID;
|
||||
while((usbIntf = IOIteratorNext(iter))) IOObjectRelease(usbIntf);
|
||||
IOObjectRelease(iter);
|
||||
while((usbDev = IOIteratorNext(it))) IOObjectRelease(usbDev);
|
||||
IOObjectRelease(usbDev);
|
||||
return;
|
||||
}
|
||||
(*stuff->handle)->Release(stuff->handle);
|
||||
stuff->handle = NULL;
|
||||
}
|
||||
IOObjectRelease(iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
next:;
|
||||
if(stuff->dev)
|
||||
{
|
||||
(*stuff->dev)->USBDeviceClose(stuff->dev);
|
||||
(*stuff->dev)->Release(stuff->dev);
|
||||
stuff->dev = NULL;
|
||||
}
|
||||
IOObjectRelease(usbDev);
|
||||
}
|
||||
}
|
||||
|
||||
static void LostDevice(void *refCon, io_iterator_t it)
|
||||
{
|
||||
stuff_t *stuff = refCon;
|
||||
io_service_t usbDev = MACH_PORT_NULL;
|
||||
while((usbDev = IOIteratorNext(it)))
|
||||
{
|
||||
uint64_t regID;
|
||||
kern_return_t ret = IORegistryEntryGetRegistryEntryID(usbDev, ®ID);
|
||||
IOObjectRelease(usbDev);
|
||||
if(ret == KERN_SUCCESS && stuff->regID == regID)
|
||||
{
|
||||
io_stop(stuff);
|
||||
stuff->regID = 0;
|
||||
(*stuff->handle)->USBInterfaceClose(stuff->handle);
|
||||
(*stuff->handle)->Release(stuff->handle);
|
||||
(*stuff->dev)->USBDeviceClose(stuff->dev);
|
||||
(*stuff->dev)->Release(stuff->dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const int pongo_usb_vendor = PONGO_USB_VENDOR;
|
||||
static const int pongo_usb_product = PONGO_USB_PRODUCT;
|
||||
|
||||
int wait_for_pongo(void) {
|
||||
kern_return_t ret;
|
||||
stuff_t stuff;
|
||||
io_iterator_t found, lost;
|
||||
|
||||
void* cfdict_keys[3];
|
||||
void* cfdict_values[3];
|
||||
|
||||
cfdict_keys[0] = (void*)CFSTR("IOProviderClass");
|
||||
cfdict_keys[1] = (void*)CFSTR("idVendor");
|
||||
cfdict_keys[2] = (void*)CFSTR("idProduct");
|
||||
|
||||
cfdict_values[0] = (void*)CFSTR("IOUSBDevice");
|
||||
cfdict_values[1] = (void*)CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &pongo_usb_vendor);
|
||||
cfdict_values[2] = (void*)CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &pongo_usb_product);
|
||||
|
||||
CFDictionaryRef cfdict = CFDictionaryCreate(kCFAllocatorDefault, (const void**)cfdict_keys, (const void**)cfdict_values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
IONotificationPortRef notifyPort = IONotificationPortCreate(kIOMasterPortDefault);
|
||||
|
||||
CFRetain(cfdict);
|
||||
// CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notifyPort), kCFRunLoopDefaultMode);
|
||||
|
||||
ret = IOServiceAddMatchingNotification(notifyPort, kIOFirstMatchNotification, cfdict, &FoundDevice, &stuff, &found);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("IOServiceAddMatchingNotification: %s", mach_error_string(ret));
|
||||
return -1;
|
||||
}
|
||||
FoundDevice(&stuff, found);
|
||||
|
||||
CFRetain(cfdict);
|
||||
ret = IOServiceAddMatchingNotification(notifyPort, kIOTerminatedNotification, cfdict, &LostDevice, &stuff, &lost);
|
||||
if(ret != KERN_SUCCESS)
|
||||
{
|
||||
ERR("IOServiceAddMatchingNotification: %s", mach_error_string(ret));
|
||||
return -1;
|
||||
}
|
||||
LostDevice(&stuff, lost);
|
||||
// CFRunLoopRun();
|
||||
while (get_spin()) {
|
||||
sleep(1);
|
||||
}
|
||||
CFRelease(cfdict);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,268 +0,0 @@
|
||||
/*
|
||||
* pongoOS - https://checkra.in
|
||||
*
|
||||
* Copyright (C) 2019-2023 checkra1n team
|
||||
*
|
||||
* This file is part of pongoOS.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifdef USE_LIBUSB
|
||||
#include <errno.h>
|
||||
#include <fcntl.h> // open
|
||||
#include <pthread.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // exit, strtoull
|
||||
#include <string.h> // strlen, strerror, memcpy, memmove
|
||||
#include <unistd.h> // close
|
||||
#include <sys/mman.h> // mmap, munmap
|
||||
#include <sys/stat.h> // fstst
|
||||
|
||||
#include <palerain.h>
|
||||
#define ERR(...) LOG(LOG_ERROR, __VA_ARGS__)
|
||||
|
||||
void io_start(stuff_t *stuff);
|
||||
void io_stop(stuff_t *stuff);
|
||||
|
||||
const char *usb_strerror(usb_ret_t err)
|
||||
{
|
||||
return libusb_error_name(err);
|
||||
}
|
||||
|
||||
usb_ret_t USBControlTransfer(usb_device_handle_t handle, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t wLength, void *data, uint32_t *wLenDone)
|
||||
{
|
||||
usb_ret_t r = libusb_control_transfer(handle, bmRequestType, bRequest, wValue, wIndex, data, wLength, 0);
|
||||
if(r < 0) return r;
|
||||
if(wLenDone) *wLenDone = r;
|
||||
return USB_RET_SUCCESS;
|
||||
}
|
||||
|
||||
usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, int len)
|
||||
{
|
||||
static uint32_t maxLen = 0;
|
||||
int transferred = 0;
|
||||
usb_ret_t r;
|
||||
if(maxLen == 0)
|
||||
{
|
||||
r = libusb_bulk_transfer(handle, 2, data, len, &transferred, 0);
|
||||
if(r == LIBUSB_SUCCESS)
|
||||
{
|
||||
return transferred == len ? USB_RET_SUCCESS : LIBUSB_ERROR_INTERRUPTED;
|
||||
}
|
||||
else if(r != LIBUSB_ERROR_NO_MEM)
|
||||
{
|
||||
return r;
|
||||
}
|
||||
#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)) return r;
|
||||
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) return r;
|
||||
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;
|
||||
r = libusb_bulk_transfer(handle, 2, (unsigned char*)data + done, chunk, &transferred, 0);
|
||||
done += transferred;
|
||||
if(r == LIBUSB_SUCCESS) continue;
|
||||
if(r != LIBUSB_ERROR_NO_MEM || maxLen <= 0x40) return r;
|
||||
maxLen /= 2;
|
||||
}
|
||||
return LIBUSB_SUCCESS;
|
||||
}
|
||||
|
||||
static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
|
||||
{
|
||||
LOG(LOG_VERBOSE, "PongoOS USB Device connected");
|
||||
stuff_t *stuff = arg;
|
||||
if(stuff->handle)
|
||||
{
|
||||
return LIBUSB_SUCCESS;
|
||||
}
|
||||
|
||||
libusb_device_handle *handle;
|
||||
int r = libusb_open(dev, &handle);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_open: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
/* nah there would not be a kernel driver for pongoOS in Darwin */
|
||||
#if !defined(__APPLE__)
|
||||
r = libusb_detach_kernel_driver(handle, 0);
|
||||
if(r != LIBUSB_SUCCESS && r != LIBUSB_ERROR_NOT_FOUND)
|
||||
{
|
||||
ERR("libusb_detach_kernel_driver: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
r = libusb_set_configuration(handle, 1);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_set_configuration: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
r = libusb_claim_interface(handle, 0);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_claim_interface: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
stuff->dev = dev;
|
||||
stuff->handle = handle;
|
||||
io_start(stuff);
|
||||
|
||||
return LIBUSB_SUCCESS;
|
||||
}
|
||||
|
||||
static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
|
||||
{
|
||||
LOG(LOG_VERBOSE, "PongoOS USB Device disconnected");
|
||||
stuff_t *stuff = arg;
|
||||
if(stuff->dev != dev)
|
||||
{
|
||||
return LIBUSB_SUCCESS;
|
||||
}
|
||||
|
||||
io_stop(stuff);
|
||||
libusb_close(stuff->handle);
|
||||
libusb_unref_device(dev);
|
||||
stuff->handle = NULL;
|
||||
stuff->dev = NULL;
|
||||
|
||||
return LIBUSB_SUCCESS;
|
||||
}
|
||||
|
||||
int wait_for_pongo(void)
|
||||
{
|
||||
stuff_t stuff;
|
||||
libusb_hotplug_callback_handle hp[2];
|
||||
libusb_context* ctx = NULL;
|
||||
|
||||
int r = libusb_init(&ctx);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_init: %s", libusb_error_name(r));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG))
|
||||
{
|
||||
ERR("libusb: no hotplug capability");
|
||||
libusb_exit(ctx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, FoundDevice, &stuff, &hp[0]);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_hotplug: %s", libusb_error_name(r));
|
||||
libusb_exit(ctx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, LostDevice, &stuff, &hp[1]);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_hotplug: %s", libusb_error_name(r));
|
||||
libusb_exit(ctx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
libusb_device **list;
|
||||
ssize_t sz = libusb_get_device_list(ctx, &list);
|
||||
if(sz < 0)
|
||||
{
|
||||
ERR("libusb_get_device_list: %s", libusb_error_name((int)sz));
|
||||
libusb_exit(ctx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for(ssize_t i = 0; i < sz; ++i)
|
||||
{
|
||||
struct libusb_device_descriptor desc;
|
||||
r = libusb_get_device_descriptor(list[i], &desc);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_get_device_descriptor: %s", libusb_error_name(r));
|
||||
// continue anyway
|
||||
}
|
||||
if(desc.idVendor != PONGO_USB_VENDOR || desc.idProduct != PONGO_USB_PRODUCT)
|
||||
{
|
||||
libusb_unref_device(list[i]);
|
||||
continue;
|
||||
}
|
||||
r = FoundDevice(ctx, list[i], LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, &stuff);
|
||||
for(ssize_t j = i + 1; j < sz; ++j)
|
||||
{
|
||||
libusb_unref_device(list[j]);
|
||||
}
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
libusb_free_device_list(list, 0);
|
||||
libusb_exit(ctx);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
libusb_free_device_list(list, 0);
|
||||
|
||||
while(get_spin())
|
||||
{
|
||||
r = libusb_handle_events(ctx);
|
||||
if(r != LIBUSB_SUCCESS)
|
||||
{
|
||||
ERR("libusb_handle_events: %s", libusb_error_name(r));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
libusb_exit(ctx);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user