-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the script a module for PyPi (#58)
* get ready for pypi publishing * add build and produce artifact action * move utils out of utils folder * makefile and bin/permasigner for args support * import version instead of executing it * change that here too * check if its the package first * use status output instead of checking the output * download ldid and dpkg-deb to permasigner's data directory when in package * use data dir all the time, not just on package * fix ldid check * make everything work, including data files! * modifications, custom logger with colors * more visual changes and code formatting changes * add fancy depictions * add disclaimer to run on linux * add bzip2 dependency to linux docs * rename copy module
- Loading branch information
1 parent
9598fbf
commit 5116b71
Showing
35 changed files
with
963 additions
and
754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build package and produce artifact | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'README.md' | ||
- 'docs/' | ||
branches: | ||
- "main" | ||
pull_request: | ||
paths-ignore: | ||
- 'README.md' | ||
- 'docs/' | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build module | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: Permasigner | ||
path: dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[pycodestyle] | ||
max_line_length = 130 | ||
ignore = ["E701", "E70", "E722", "E402", "E302", "E266", "E265", "E26"] | ||
ignore = ["E701", "E70", "E722", "E402", "E301", "E302", "E266", "E265", "E26", "E501"] | ||
in-place = true | ||
recursive = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"makefile.extensionOutputFolder": "./.vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include permasigner/data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.PHONY: build | ||
|
||
build: | ||
rm -rf dist/* build/* || true | ||
python3 setup.py sdist bdist_wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import os | ||
|
||
from permasigner import __main__ | ||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-c', '--codesign', action='store_true', | ||
help="uses codesign instead of ldid") | ||
parser.add_argument('-d', '--debug', action='store_true', | ||
help="shows some debug info, only useful for testing") | ||
parser.add_argument('-u', '--url', type=str, | ||
help="the direct URL of the IPA to be signed") | ||
parser.add_argument('-p', '--path', type=str, | ||
help="the direct local path of the IPA to be signed") | ||
parser.add_argument('-i', '--install', action='store_true', | ||
help="installs the application to your device") | ||
parser.add_argument('-n', '--noinstall', | ||
action='store_true', help="skips the install prompt") | ||
parser.add_argument('-o', '--output', type=str, | ||
help="specify output file") | ||
parser.add_argument('-b', '--bundleid', type=str, | ||
help="specify new bundle id") | ||
parser.add_argument('-N', '--name', type=str, | ||
help="specify new app name") | ||
parser.add_argument('-m', '--minver', type=str, | ||
help="specify new minimum app version (14.0 recommended)") | ||
parser.add_argument('-v', '--version', action='store_true', | ||
help='show current version',) | ||
args = parser.parse_args() | ||
|
||
if args.version: | ||
from permasigner import __version__ | ||
print(f"Permasigner v{__version__.__version__}") | ||
exit(0) | ||
|
||
__main__.main(args, in_package=True) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
--- | ||
description: Run Permasigner on Linux. | ||
description: Run Permasigner on Debian based Linux distros. | ||
--- | ||
|
||
# Run on Linux | ||
## Run from Package | ||
|
||
1. Open a terminal using Ctrl + Shift + T on most Linux distros | ||
2. Clone this repository with `git clone https://github.com/itsnebulalol/permasigner && cd permasigner` | ||
* Open a terminal using Ctrl + Shift + T on most Linux distros | ||
* Install [bzip2](https://command-not-found.com/bunzip2) using your package manager of choice; ex. `sudo apt install bzip2` | ||
* Install the package with `pip install permasigner` or `pip3 install permasigner` | ||
* If this fails, install python3 with your package manager of choice; ex. `sudo apt install python3`. | ||
* Run the script with `python -m permasigner` or `python3 -m permasigner` | ||
* Install the newly created deb file on your iDevice | ||
* You can use something like Dropbox or Mega; advanced users can use `openssh-sftp-server` from Procursus. | ||
* Reboot to stock, the app will still work! | ||
|
||
## Run from Source | ||
|
||
* Open a terminal using Ctrl + Shift + T on most Linux distros | ||
* Install [bzip2](https://command-not-found.com/bunzip2) using your package manager of choice; ex. `sudo apt install bzip2` | ||
* Clone this repository with `git clone https://github.com/itsnebulalol/permasigner && cd permasigner` | ||
* If this fails, install git with your package manager of choice; ex. `sudo apt install git`. | ||
3. Install all requirements with `pip install -r requirements.txt` or `pip3 install -r requirements.txt` | ||
* Install all requirements with `pip install -r requirements.txt` or `pip3 install -r requirements.txt` | ||
* If this fails, install python3 with your package manager of choice; ex. `sudo apt install python3`. | ||
|
||
{% hint style="info" %} | ||
If you have extra entitlements, add them in `data/entitlements.xml`. If you don't know what this means, you can keep it as is. | ||
{% endhint %} | ||
|
||
4. Run the script with `python main.py` or `python3 main.py` | ||
* If you get an error that curl isn't found, install it with your package manager of choice; ex. `sudo apt install curl`. | ||
5. Install the newly created deb file on your iDevice | ||
* Run the script with `python main.py` or `python3 main.py` | ||
* Install the newly created deb file on your iDevice | ||
* You can use something like Dropbox or Mega; advanced users can use `openssh-sftp-server` from Procursus. | ||
6. Reboot to stock, the app will still work! | ||
* Reboot to stock, the app will still work! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.