Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite: APNs from the ground up #100

Merged
merged 30 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
44073df
initial structure
JJTech0130 May 11, 2024
b3374d5
restructure to use namespaces
JJTech0130 May 11, 2024
bbb7fbb
found a better way that doesn't require .vscode config
JJTech0130 May 11, 2024
c789465
implement basics of APNs with asyncio
JJTech0130 May 13, 2024
4b33e5e
add test for async with API
JJTech0130 May 13, 2024
ada147e
add folder structure for planned packages
JJTech0130 May 13, 2024
844c015
restructure under single pip package
JJTech0130 May 13, 2024
f0a99e7
readme: update installation instructions
JJTech0130 May 13, 2024
8119f54
add setuptools scm
JJTech0130 May 13, 2024
25e15cc
packaging: make setuptools generate _version.py
JJTech0130 May 13, 2024
e8c8928
apns: start anyio refactor
JJTech0130 May 14, 2024
037b477
wip: forwarding cli tool
JJTech0130 May 14, 2024
49b38ea
more refactoring
JJTech0130 May 15, 2024
866c3c4
protocol: automatically generate packet conversion
JJTech0130 May 15, 2024
354a402
depend on rich
JJTech0130 May 15, 2024
9239fc0
apns: implement more high level commands
JJTech0130 May 15, 2024
a7e59be
apns: wrap with CommandStream
JJTech0130 May 15, 2024
4dca8b6
apns: proxy at raw packet level, so can recover if parsing fails
JJTech0130 May 15, 2024
4905023
apns: try to decode topic when parsing SendMessage packet
JJTech0130 May 15, 2024
67b2a4c
cli: refactor
JJTech0130 May 16, 2024
bb727af
proxy: use SNI rather than localhost addresses
JJTech0130 May 16, 2024
897180f
apns: refactoring, new lifecycle management
JJTech0130 May 17, 2024
121c530
apns: lifecycle improvements
JJTech0130 May 17, 2024
8221d04
apns: refactor new api out of new
JJTech0130 May 17, 2024
468a65b
test: remove dep on aioapns
JJTech0130 May 17, 2024
33cc7e5
apns: _protocol.py: clean up and rename @auto_packet -> @command
JJTech0130 May 18, 2024
c1c061b
apns: protocol.py: handle unknown Type values better
JJTech0130 May 18, 2024
1973d5c
apns: fix minor type checking error
JJTech0130 May 18, 2024
72ee9a6
apns: protocol.py: suppress __repr__ for 29, 30, and 32 PubSub comman…
JJTech0130 May 18, 2024
1c10e01
bump minimum Python to 3.9 to reflect actual testing
JJTech0130 May 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
config.json
IMDAppleServices

pypush/_version.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
> [!WARNING]
> Pypush is broken at the moment. We thank you for your continued support of the project! The Pypush demo will not work without significant modification to the code to remediate challenges posed as a response to third party iMessage clients growing in popularity.
> `pypush` is undergoing a major rewrite. The current version is not stable and may not work as expected.

# pypush
`pypush` is a POC demo of my recent iMessage reverse-engineering.
Expand All @@ -8,33 +8,18 @@ It can currently register as a new device on an Apple ID, set up encryption keys
`pypush` is completely platform-independent, and does not require a Mac or other Apple device to use!

## Installation
It's pretty self explanatory:
1. `git clone https://github.com/JJTech0130/pypush`
2. If on a Mac, ensure `cmake` is installed. Otherwise, run `brew install cmake`
3. `pip3 install -r requirements.txt`
4. `python3 ./demo.py`

## Troubleshooting
If you have any issues, please join [the Discord](https://discord.gg/BVvNukmfTC) and ask for help.

## Operation
`pypush` will generate a `config.json` in the repository when you run demo.py. DO NOT SHARE THIS FILE.
It contains all the encryption keys necessary to log into you Apple ID and send iMessages as you.

Once it loads, it should prompt you with `>>`. Type `help` and press enter for a list of supported commands.

## Special Notes
### Unicorn dependency
`pypush` currently uses the Unicorn CPU emulator and a custom MachO loader to load a framework from an old version of macOS,
in order to call some obfuscated functions.

This is only necessary during initial registration, so theoretically you can register on one device, and then copy the `config.json`
to another device that doesn't support the Unicorn emulator. Or you could switch out the emulator for another x86 emulator if you really wanted to.

## "data.plist" and Mac serial numbers
This repository contains a sample [`data.plist`](https://github.com/JJTech0130/pypush/blob/main/emulated/data.plist), which contains the serial number and several other identifiers from a real Mac device. If you run into issues related to rate-limiting or messages failing to deliver, you may regenerate this file by cloning [nacserver](https://github.com/JJTech0130/nacserver) and running `build.sh` on a non-M1 Mac. It should place the generated file in the current directory, which you can then copy to the emulated/ folder in pypush.
Simple installation:
```bash
pip install git+https://github.com/JJTech0130/pypush
```
Editable installation (for development):
```bash
git clone https://github.com/JJTech0130/pypush
cd pypush
pip install -e .
```

## Licensing
This project is licensed under the terms of the [SSPL](https://www.mongodb.com/licensing/server-side-public-license). Portions of this project are based on [macholibre by Aaron Stephens](https://github.com/aaronst/macholibre/blob/master/LICENSE) under the Apache 2.0 license.
This project is licensed under the terms of the [SSPL](https://www.mongodb.com/licensing/server-side-public-license)

This project has been purchased by [Beeper](https://github.com/beeper), please contact them with any questions about licensing.
323 changes: 0 additions & 323 deletions apns.py

This file was deleted.

Loading