diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..18c4433 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lints + +on: + pull_request: + branches: [ "main" ] + paths: + - '.github/workflows/lint.yml' + - 'pypush/**' + - 'tests/**' + - 'pyproject.toml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + if: '! github.event.pull_request.draft' + runs-on: ${{ matrix.os }} + + strategy: + matrix: + python-version: [ 3.9, "3.10", "3.11", "3.12" ] + os: [ ubuntu-latest, macos-latest, windows-latest ] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - uses: chartboost/ruff-action@v1 + - name: Test install + run: | + python -m pip install --upgrade pip + python -m pip install -e '.[test,cli]' -U + - name: Tests + run: pytest \ No newline at end of file diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yml deleted file mode 100644 index bfad777..0000000 --- a/.github/workflows/pyright.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Pyright -on: [push, pull_request] -jobs: - pyright: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - cache: 'pip' - - - run: | - python -m venv .venv - source .venv/bin/activate - pip install -e '.[test,cli]' - - - run: echo "$PWD/.venv/bin" >> $GITHUB_PATH - - uses: jakebailey/pyright-action@v2 diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml deleted file mode 100644 index b268138..0000000 --- a/.github/workflows/ruff.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Ruff -on: [push, pull_request] -jobs: - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: chartboost/ruff-action@v1 diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml new file mode 100644 index 0000000..74c4099 --- /dev/null +++ b/.github/workflows/upload.yml @@ -0,0 +1,26 @@ +name: Upload + +on: + release: + types: [ created ] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U build setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m build + twine upload dist/* diff --git a/README.md b/README.md index 1a7d237..06b8b59 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,21 @@ > [!WARNING] -> `pypush` is undergoing a major rewrite. The current version is not stable and may not work as expected. +> `pypush` is undergoing a major rewrite. The current version is not stable and may not work as expected. Many features have been temporarily removed. +> +> Versioning starts at 2.0.0 due to conflicts with the original package to have the `pypush` name. Do not expect stability until 3.0.0. # pypush -`pypush` is a POC demo of my recent iMessage reverse-engineering. -It can currently register as a new device on an Apple ID, set up encryption keys, and ***send and receive iMessages***! +`pypush` was originally a POC demo of my recent iMessage reverse-engineering. +It is now being developed into a community library aiming to cover all of Apple's internal API surface. -`pypush` is completely platform-independent, and does not require a Mac or other Apple device to use! +Currently, the rewritten version supports using the client side of Apple's internal APNs API, meaning it can activate as an +Apple device and receive push notifications. Stay tuned for future updates as we bring back the iMessage API and more! + +`pypush` is completely platform-independent, though it may require device identifiers to use some APIs. ## Installation Simple installation: ```bash -pip install git+https://github.com/JJTech0130/pypush +pip install pypush[cli] ``` Editable installation (for development): ```bash diff --git a/pyproject.toml b/pyproject.toml index 287497e..be431c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,15 +5,35 @@ build-backend = "setuptools.build_meta" [project] name = "pypush" dynamic = ["version"] +authors = [ + { name = "JJTech", email = "jjtech@jjtech.dev" }, +] +description = "Interact with Apple Private API" + +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Programming Language :: Python :: 3", + "Development Status :: 3 - Alpha", + "Operating System :: OS Independent", + "License :: Other/Proprietary License", +] +license = {text = "Server Side Public License (SSPL)"} +keywords = ["apple", "api", "reverse engineering", "imessage", "apns"] + dependencies = [ "anyio", - "httpx", + "httpx[http2]", "cryptography", "typing-extensions", "exceptiongroup", 'importlib_metadata; python_version>="3.9"', ] +[project.urls] +Homepage = "https://github.com/JJTech0130/pypush" +Issues = "https://github.com/JJTech0130/pypush/issues" + [project.scripts] pypush = "pypush.cli:main"