From 8c5359957c3d8a91a423f7edf692eb6e8f90cca9 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Fri, 17 Nov 2023 19:03:37 -0500 Subject: [PATCH 1/9] removed daemon execution, added new script to execute daemon --- windows_installer.ps1 | 7 +------ windows_reregister.ps1 | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 windows_reregister.ps1 diff --git a/windows_installer.ps1 b/windows_installer.ps1 index 42370b4..935a40d 100644 --- a/windows_installer.ps1 +++ b/windows_installer.ps1 @@ -64,9 +64,4 @@ $phoneIpVariable = Set-Variable -Name phoneIp -Value $phoneIp -Scope Global # Execute the `python demo.py` script with the phone IP address passed as a parameter. Write-Output "Registering" -python demo.py --phone $phoneIpVariable - -# Execute the daemon for reregistration -Write-Output "Executing the daemon" -python demo.py --daemon - +python demo.py --phone $phoneIpVariable diff --git a/windows_reregister.ps1 b/windows_reregister.ps1 new file mode 100644 index 0000000..7194278 --- /dev/null +++ b/windows_reregister.ps1 @@ -0,0 +1,12 @@ +cd "$env:USERPROFILE\pypush" + +# Activate the virtual environment +. "$env:USERPROFILE\AppData\Local\Python\VirtualEnvs\pypush\Scripts\activate.ps1" + +# Continuously run the demo script in daemon mode +while ($true) { + python ./demo.py --daemon + + # If the script disconnects, wait 5 minutes before restarting + Start-Sleep -Seconds 300 +} \ No newline at end of file From 1c1e5f187d9894716f8c2039212b410f7ee61b4e Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Fri, 17 Nov 2023 21:35:48 -0500 Subject: [PATCH 2/9] added first working version --- unix_installer.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/unix_installer.sh b/unix_installer.sh index e1b6b63..50bccd8 100644 --- a/unix_installer.sh +++ b/unix_installer.sh @@ -16,14 +16,22 @@ if [[ "$OS_NAME" == "Darwin" ]]; then brew install cmake brew install pkgconfig elif [[ "$OS_NAME" == "Linux" ]]; then - echo "The operating system is Linux." + echo "The operating system is Linux." + echo "Installing dependencies: cmake and pkgconfig" + sudo wget -O /usr/local/bin/pacapt https://github.com/icy/pacapt/raw/ng/pacapt + sudo chmod 755 /usr/local/bin/pacapt + sudo ln -sv /usr/local/bin/pacapt /usr/local/bin/pacman || true + sudo /usr/local/bin/pacapt -S cmake pkg-config git + echo "Removing temporary files" + sudo rm /usr/local/bin/pacapt + sudo rm /usr/local/bin/pacman else echo "Unknown operating system: $OS_NAME" fi # Create a virtual environment mkdir -p ~/.venv -python3.10 -m venv ~/.venv/pypush +python3 -m venv ~/.venv/pypush source ~/.venv/pypush/bin/activate # Clone the repo @@ -31,11 +39,14 @@ cd ~ git clone -b sms-registration https://github.com/beeper/pypush cd pypush +# Install dependencies +pip install -r requirements.txt + # Prompt the user for the IP address of their phone. -read -p "Enter the IP address of your phone: " PHONEIP +read -p "Enter the IP address of your phone(displayed in the Android helper app): " PHONEIP # Execute the `python demo.py` script with the phone IP address passed as a parameter. -python demo.py --phone $PHONEIP +python3 demo.py --phone $PHONEIP # Create a reregistration script cat > reregister.sh < Date: Fri, 17 Nov 2023 21:58:09 -0500 Subject: [PATCH 3/9] added git for mac install --- unix_installer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/unix_installer.sh b/unix_installer.sh index 50bccd8..d66f996 100644 --- a/unix_installer.sh +++ b/unix_installer.sh @@ -15,6 +15,7 @@ if [[ "$OS_NAME" == "Darwin" ]]; then fi brew install cmake brew install pkgconfig + brew install git elif [[ "$OS_NAME" == "Linux" ]]; then echo "The operating system is Linux." echo "Installing dependencies: cmake and pkgconfig" From b12c11f124432bfa6aae8b987de087af22c78a14 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Sun, 19 Nov 2023 21:33:58 -0500 Subject: [PATCH 4/9] Modified readme to use automated installers --- README.md | 81 ++++--------------------------------------------------- 1 file changed, 5 insertions(+), 76 deletions(-) diff --git a/README.md b/README.md index 972839a..46e46bf 100644 --- a/README.md +++ b/README.md @@ -19,86 +19,15 @@ In order for Apple to verify your number, a specialized message has to be sent f 4. Connect your phone to the same WiFi network as your host PC, and open the app. ### Pypush -Make sure you have git and Python installed. +Once you have the PNRgateway app installed on your phone, open it so it is displaying your IP address as you will need it for the next steps. -1. `git clone -b sms-registration https://github.com/beeper/pypush` -2. `cd pypush` +Use one of the automated installers for your operating system: [Windows](https://github.com/beeper/pypush/blob/sms-registration/windows_installer.ps1) or [MacOS/Linux](https://github.com/beeper/pypush/blob/sms-registration/unix_installer.sh) -# Number Registration on Linux/MacOS -It is *strongly* recommended to use a Python virtual environment to setup Pypush. This ensures changes in your system's Python installation does not -break compatibility with Pypush with system updates. +For Windows open up PowerShell and navigate to your downloads folder `cd Downloads` and then execute the installer `.\windows_installer.ps1` and follow the prompts. When initial registration has completed execute the file `windows_reregister.ps1` to handle reregistration. This file will reregister your number 5 minutes before registration expires and you must keep the PowerShell window open. Length of registration will gradually increase. -1. If you do not already have a directory where Python virtual environments are located then -create a directory for your Python virtual environment. If you already have one then skip this step. -Virtual environments are traditionally placed in a hidden folder in your home directory on Linux/MacOS. -It can be created anywhere you wish. These instructions will assume you created it in your home directory. -``` -mkdir ~/.venv -``` -2. Create a virtual environment using Python 3.10: -``` -python3.10 -m venv ~/.venv/pypush -``` -3. Activate the virtual environment: -``` -source ~/.venv/pypush/bin/activate -``` -4. Install the required packages using pip: -``` -pip install -r requirements.txt -``` -5. Run the demo script, replacing `[ip]` with your phone's local IP address: -``` -python demo.py --phone [ip] -``` -# Number reregistration option 1, automatic reregistration -Automatic reregistration is handled by determining when your imessage registration certificate expires -and reregistering 5 minutes before expiration. Put the following in a text file and save as `pypush_reregister.sh` in your home directory: -``` -#!/bin/bash -cd /path/to/pypush -source ~/.venv/pypush/bin/activate -python ./demo.py --daemon -``` -1. Make the reregistration script executable: -``` -chmod +x ~/pypush_reregister.sh -``` -2. Use [Screen](https://www.gnu.org/software/screen/manual/screen.html) to easily monitor reregistration status and set to run on boot, replacing "user" with your username: -``` -@reboot sleep 60;screen -S pypush -d -m /home/user/pypush_reregister.sh > /dev/null 2>&1 -``` -3. Reboot +For MacOS/Linux open up your terminal and navigate to your downloads folder `cd Downloads` or similar. Make the script executable by executing `chmod +x unix_installer.sh`. Execute the script `./unix_installer.sh`. Upon completion a shell script is created called `reregister.sh`. Execute this script in your terminal `./reregister.sh`. This file will reregister your number 5 minutes before registration expires and you must keep the terminal window open. Length of registration will gradually increase. -The basics of using screen are outlined below but this is not intended to be a tutorial in using screen. In order to see a more complete -guid please visit the following [guide](https://linuxize.com/post/how-to-use-linux-screen/). To monitor the status of registration you can -connect to the virtual screen you created. -``` -$ screen -r pypush -``` -To disconnect from the virtual screen press ctrl+a d. - -# Number reregistration option 2, registration every 30 minutes -Put the following in a text file and save as `pypush_reregister.sh` in your home directory: -``` -#!/bin/bash -cd /path/to/pypush -source ~/.venv/pypush/bin/activate -python ./demo.py --reregister -``` -1. Make the reregistration script executable: -``` -chmod +x ~/pypush_reregister.sh -``` -2. To automatically reregister every 30 minutes, execute the following: -```crontab -e -``` -3. Add the following to your crontab file, replacing "user" with your username: -``` -*/30 * * * * /home/user/pypush_reregister.sh -``` - -***Please note:*** This last script is the script you will be running continuously. We recommend every 30 minutes. +If you need help or run into errors please reach out on our [Discord](https://discord.gg/BtSbcExKJ9) server. ### Good to Know From e5f59c23f784e9444c9b5d13f5425ddc4bdeed8e Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Sun, 19 Nov 2023 21:43:09 -0500 Subject: [PATCH 5/9] added manual instructions with fixed errors --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/README.md b/README.md index 46e46bf..0413f07 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,82 @@ For MacOS/Linux open up your terminal and navigate to your downloads folder `cd If you need help or run into errors please reach out on our [Discord](https://discord.gg/BtSbcExKJ9) server. +### Pypush Manual Installation +Make sure you have git and Python installed. + +1. `git clone -b sms-registration https://github.com/beeper/pypush` +2. `cd pypush` + +# Number Registration on Linux/MacOS +It is *strongly* recommended to use a Python virtual environment to setup Pypush. This ensures changes in your system's Python installation does not +break compatibility with Pypush with system updates. + +1. If you do not already have a directory where Python virtual environments are located then +create a directory for your Python virtual environment. If you already have one then skip this step. +Virtual environments are traditionally placed in a hidden folder in your home directory on Linux/MacOS. +It can be created anywhere you wish. These instructions will assume you created it in your home directory. +``` +mkdir ~/.venv +``` +2. Create a virtual environment using Python 3.10: +``` +python -m venv ~/.venv/pypush +``` +3. Activate the virtual environment: +``` +source ~/.venv/pypush/bin/activate +``` +4. Install the required packages using pip: +``` +pip install -r requirements.txt +``` +5. Run the demo script, replacing `[ip]` with your phone's local IP address: +``` +python demo.py --phone [ip] +``` +# Number reregistration option 1, automatic reregistration +Automatic reregistration is handled by determining when your imessage registration certificate expires +and reregistering 5 minutes before expiration. Put the following in a text file and save as `pypush_reregister.sh` in your home directory: +``` +#!/bin/bash +cd ~/pypush +source ~/.venv/pypush/bin/activate +while true +do + python ./demo.py --daemon +# If it disconnects, wait 5 minutes before reconnecting to avoid spamming servers + sleep 300 +done +``` +1. Make the reregistration script executable: +``` +chmod +x ~/pypush_reregister.sh +``` +2. Execute the script +```./pypush_reregister.sh``` + +# Number reregistration option 2, registration using crontab +Put the following in a text file and save as `pypush_reregister.sh` in your home directory: +``` +#!/bin/bash +cd ~/pypush +source ~/.venv/pypush/bin/activate +python ./demo.py --cronreg +``` +1. Make the reregistration script executable: +``` +chmod +x ~/pypush_reregister.sh +``` +2. To automatically reregister every 30 minutes, execute the following: +```crontab -e +``` +3. Add the following to your crontab file, replacing "user" with your username: +``` +*/25 * * * * ~/pypush_reregister.sh > ~/pypush_log.out +``` + +***Please note:*** This last script is the script you will be running continuously. We recommend every 30 minutes. + ### Good to Know You will have to reregister your number every so often. This can last anywhere between 10 minutes to 48 hours, and *usually* the longer you run the script, the longer it takes to deregister. We may implement a feature to automatically detect deregistration in the future. From fe27e41e89ea03799fb94f46f1243f400089abe4 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Mon, 20 Nov 2023 21:09:08 -0500 Subject: [PATCH 6/9] updated links for new repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0413f07..b692428 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ In order for Apple to verify your number, a specialized message has to be sent f ### Pypush Once you have the PNRgateway app installed on your phone, open it so it is displaying your IP address as you will need it for the next steps. -Use one of the automated installers for your operating system: [Windows](https://github.com/beeper/pypush/blob/sms-registration/windows_installer.ps1) or [MacOS/Linux](https://github.com/beeper/pypush/blob/sms-registration/unix_installer.sh) +Use one of the automated installers for your operating system: [Windows](https://github.com/JJTech0130/pypush/blob/bacefed8b8eb78d5d3f295be5304830665464a04/windows_installer.ps1) or [MacOS/Linux](https://github.com/JJTech0130/pypush/blob/bacefed8b8eb78d5d3f295be5304830665464a04/unix_installer.sh) For Windows open up PowerShell and navigate to your downloads folder `cd Downloads` and then execute the installer `.\windows_installer.ps1` and follow the prompts. When initial registration has completed execute the file `windows_reregister.ps1` to handle reregistration. This file will reregister your number 5 minutes before registration expires and you must keep the PowerShell window open. Length of registration will gradually increase. From 210cc96f32d5e2317e36bb9175d2f849b2a8a671 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Mon, 20 Nov 2023 21:30:01 -0500 Subject: [PATCH 7/9] fixed some more links in the scripts --- README.md | 2 +- unix_installer.sh | 2 +- windows_installer.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b692428..906d7e0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ If you need help or run into errors please reach out on our [Discord](https://di ### Pypush Manual Installation Make sure you have git and Python installed. -1. `git clone -b sms-registration https://github.com/beeper/pypush` +1. `git clone -b sms-registration https://github.com/JJTech0170/pypush` 2. `cd pypush` # Number Registration on Linux/MacOS diff --git a/unix_installer.sh b/unix_installer.sh index d66f996..d70bc5c 100644 --- a/unix_installer.sh +++ b/unix_installer.sh @@ -37,7 +37,7 @@ source ~/.venv/pypush/bin/activate # Clone the repo cd ~ -git clone -b sms-registration https://github.com/beeper/pypush +git clone -b sms-registration https://github.com/JJTech0170/pypush cd pypush # Install dependencies diff --git a/windows_installer.ps1 b/windows_installer.ps1 index 935a40d..af02a4d 100644 --- a/windows_installer.ps1 +++ b/windows_installer.ps1 @@ -47,9 +47,9 @@ Write-Output "Activating virtual environment" cd "$env:USERPROFILE" -# Clone the "sms-registration" branch of the repository located at https://github.com/beeper/pypush using git. +# Clone the "sms-registration" branch of the repository located at https://github.com/JJTech0170/pypush using git. Write-Output "Cloning sms-registration branch" -git clone -b sms-registration https://github.com/beeper/pypush +git clone -b sms-registration https://github.com/JJTech0170/pypush # Change directories to the repository. Write-Output "Changing directories" From bf28e6a69c784bd6e99b38890777df12a49fcd2e Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Mon, 20 Nov 2023 21:45:43 -0500 Subject: [PATCH 8/9] Revert "fixed some more links in the scripts" This reverts commit 210cc96f32d5e2317e36bb9175d2f849b2a8a671. --- README.md | 2 +- unix_installer.sh | 2 +- windows_installer.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 906d7e0..b692428 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ If you need help or run into errors please reach out on our [Discord](https://di ### Pypush Manual Installation Make sure you have git and Python installed. -1. `git clone -b sms-registration https://github.com/JJTech0170/pypush` +1. `git clone -b sms-registration https://github.com/beeper/pypush` 2. `cd pypush` # Number Registration on Linux/MacOS diff --git a/unix_installer.sh b/unix_installer.sh index d70bc5c..d66f996 100644 --- a/unix_installer.sh +++ b/unix_installer.sh @@ -37,7 +37,7 @@ source ~/.venv/pypush/bin/activate # Clone the repo cd ~ -git clone -b sms-registration https://github.com/JJTech0170/pypush +git clone -b sms-registration https://github.com/beeper/pypush cd pypush # Install dependencies diff --git a/windows_installer.ps1 b/windows_installer.ps1 index af02a4d..935a40d 100644 --- a/windows_installer.ps1 +++ b/windows_installer.ps1 @@ -47,9 +47,9 @@ Write-Output "Activating virtual environment" cd "$env:USERPROFILE" -# Clone the "sms-registration" branch of the repository located at https://github.com/JJTech0170/pypush using git. +# Clone the "sms-registration" branch of the repository located at https://github.com/beeper/pypush using git. Write-Output "Cloning sms-registration branch" -git clone -b sms-registration https://github.com/JJTech0170/pypush +git clone -b sms-registration https://github.com/beeper/pypush # Change directories to the repository. Write-Output "Changing directories" From f9964390febfdd033c51149f6a235bab9e44b880 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Mon, 20 Nov 2023 21:46:24 -0500 Subject: [PATCH 9/9] fixed some more links in the scripts --- README.md | 2 +- unix_installer.sh | 2 +- windows_installer.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b692428..9061b52 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ If you need help or run into errors please reach out on our [Discord](https://di ### Pypush Manual Installation Make sure you have git and Python installed. -1. `git clone -b sms-registration https://github.com/beeper/pypush` +1. `git clone -b sms-registration https://github.com/JJTech0130/pypush` 2. `cd pypush` # Number Registration on Linux/MacOS diff --git a/unix_installer.sh b/unix_installer.sh index d66f996..4a534c5 100644 --- a/unix_installer.sh +++ b/unix_installer.sh @@ -37,7 +37,7 @@ source ~/.venv/pypush/bin/activate # Clone the repo cd ~ -git clone -b sms-registration https://github.com/beeper/pypush +git clone -b sms-registration https://github.com/JJTech0130/pypush cd pypush # Install dependencies diff --git a/windows_installer.ps1 b/windows_installer.ps1 index 935a40d..c38b71e 100644 --- a/windows_installer.ps1 +++ b/windows_installer.ps1 @@ -47,9 +47,9 @@ Write-Output "Activating virtual environment" cd "$env:USERPROFILE" -# Clone the "sms-registration" branch of the repository located at https://github.com/beeper/pypush using git. +# Clone the "sms-registration" branch of the repository located at https://github.com/JJTech0130/pypush using git. Write-Output "Cloning sms-registration branch" -git clone -b sms-registration https://github.com/beeper/pypush +git clone -b sms-registration https://github.com/JJTech0130/pypush # Change directories to the repository. Write-Output "Changing directories"