11 Commits

Author SHA1 Message Date
Vyvir 54be737871 adhere to normal versioning 2024-07-19 11:23:00 +03:00
Vyvir 7b7be95b9f correct repo links 2024-07-19 11:18:02 +03:00
Vyvir 18f096f0a3 0.5.0 4/4 2024-07-19 11:11:18 +03:00
Vyvir d86638c910 0.5.0 3/4 2024-07-19 11:10:15 +03:00
Vyvir 3dd181272d 0.5.0 2/4 2024-07-19 11:09:36 +03:00
yourfriend 69772cd23e Merge pull request #15 from Powsu/main 2023-10-12 08:57:09 +03:00
powder 5fa061757e Update README.md
Changes:
Made deprecation notice more clear, added FAQ (prone to update as we receive more questions)

Updated discord invite links.
2023-08-19 09:38:49 -04:00
yourfriend e632dc1507 Update main.py
update provision to 2.1.0
2023-06-10 23:07:44 +03:00
yourfriend 9618310e9e Fix #5 + reports in Discord 2023-04-30 18:05:17 +03:00
yourfriend 9fe1e96df2 Merge pull request #4 from Powsu/patch-1
Update README.md
2023-02-12 20:43:20 +02:00
powder 2699fcaebd Update README.md
Added un-maintained notice
2023-02-12 13:41:35 -05:00
4 changed files with 162 additions and 226 deletions
+6 -6
View File
@@ -1,9 +1,9 @@
Package: AltLinux Package: AltLinux
Name: AltLinux Name: AltLinux
Version: 0.4.2-2 Version: 0.5.0
Architecture: all Architecture: amd64
Author: maxasix <maxasix@disroot.org> Author: vyvir <the.uniformed630@aleeas.com>
Maintainer: maxasix <maxasix@disroot.org> Maintainer: vyvir <the.uniformed630@aleeas.com>
Description: GUI for AltServerLinux Description: GUI for AltServerLinux
Homepage: https://github.com/maxasix/AltLinux Homepage: https://github.com/i-love-altlinux/AltLinux
Depends: binutils, python3 (>= 3.8), gir1.2-appindicator3-0.1, usbmuxd, libimobiledevice6, libimobiledevice-utils, libavahi-compat-libdnssd-dev, unzip, usbutils, libhandy-1-0, libhandy-1-dev, curl Depends: binutils, python3 (>= 3.8), gir1.2-appindicator3-0.1, usbmuxd, libimobiledevice6, libimobiledevice-utils, libavahi-compat-libdnssd-dev, unzip, usbutils, libhandy-1-0, libhandy-1-dev, curl, python3-requests, gir1.2-notify-0.7, psmisc
+46 -107
View File
@@ -1,92 +1,50 @@
# AltLinux # AltLinux
<img src="https://github.com/i-love-altlinux/AltLinux/blob/main/resources/4.png" alt="AltLinux Logo"> <img src="https://github.com/i-love-altlinux/AltLinux/blob/main/resources/4.png" alt="AltLinux Logo">
AltLinux is a GUI for AltServer-Linux that allows to easily sideload apps onto an iPhone, an iPad, or an iPod Touch. It supports iOS 12.2 and later. AltLinux is a GUI for AltServer-Linux that allows to easily sideload apps onto an iPhone, an iPad, or an iPod Touch. It supports iOS 15 and later.
Features: This app is in a very early state, so if you're experiencing issues or want to help, you can create a [pull request](https://github.com/i-love-altlinux/AltLinux/pulls), [report an issue](https://github.com/i-love-altlinux/AltLinux/issues), or join [the Discord server](https://discord.gg/DZwRbyXq5Z).
- A straightforward GUI
- A tray menu that works just like on Windows
- Sideloading AltStore
- Sideloading apps without AltStore
- While the tray icon is present, AltServer runs in the background in tethered mode
- Launching the tray icon on start-up
The program is in its very early state, so if you're experiencing issues or want to help, you can join [the Discord server](https://discord.gg/vtvxYFAfAR). ## Instructions
## Install AltLinux ### Ubuntu
AltLinux is available for Ubuntu 22.04 and Ubuntu 20.04. Install the latest version from [releases](https://github.com/i-love-altlinux/AltLinux/releases/latest).
Derivatives, such as Linux Mint and Pop!_ OS should also work. To make sure which DEB package to pick, run the following command: ### Other Linux distributions
#### Dependencies
Ubuntu:
``` ```
python3 --version sudo apt install software-properties-common
``` ```
| Python 3.10 | Python 3.8 |
|:--------------------:|:-----------------:|
| Ubuntu 22.04 | Ubuntu 20.04 |
| Pop!_OS 22.04 | Pop!_OS 20.04 |
| Linux Mint 21 | Linux Mint 20 |
| elementary OS 7 | elementary OS 6 |
| Zorin OS 17 | Zorin OS 16 |
If you're running Ubuntu 22.04 or any distro based on it (such as Mint 21), install the DEB package [from here](https://github.com/i-love-altlinux/AltLinux/releases).
If you're running Ubuntu 20.04 or any distro based on it (such as Mint 20), run the following commands:
```
sudo add-apt-repository ppa:apandada1/libhandy-1
sudo apt update
sudo apt install libhandy-1-0 libhandy-1-dev
```
Then you can install the DEB package [from here](https://github.com/i-love-altlinux/AltLinux/releases).
If you use Arch Linux, you can use [the AUR package](https://aur.archlinux.org/packages/altlinux).
There is also a [git version](https://aur.archlinux.org/packages/altlinux-git) of AltLinux available as an AUR package.
If you use Fedora, you can [run the script without installing](#run-the-script-without-installing).
## Uninstall AltLinux
If you want to uninstall AltLinux, run the following commands:
```
sudo apt purge altlinux
```
```
sudo rm -rf /usr/lib/altlinux
```
```
rm -rf $HOME/.local/share/altlinux
```
## Run the script without installing
### Ubuntu:
Add the `universe` repository:
``` ```
sudo add-apt-repository universe -y sudo add-apt-repository universe -y
``` ```
Install the dependencies:
``` ```
sudo apt-get install binutils python3-pip git gir1.2-appindicator3-0.1 usbmuxd libimobiledevice6 libimobiledevice-utils wget curl libavahi-compat-libdnssd-dev zlib1g-dev unzip usbutils sudo apt-get install binutils python3-pip git gir1.2-appindicator3-0.1 usbmuxd libimobiledevice6 libimobiledevice-utils wget curl libavahi-compat-libdnssd-dev zlib1g-dev unzip usbutils libhandy-1-dev gir1.2-notify-0.7 python3-requests psmisc
``` ```
IF YOU'RE RUNNING UBUNTU 20.04 OR ITS [DERIVATIVES](https://github.com/i-love-altlinux/AltLinux#install-altlinux): Fedora:
``` ```
sudo add-apt-repository ppa:apandada1/libhandy-1 sudo dnf install binutils python3-pip git libappindicator-gtk3 usbmuxd libimobiledevice-devel libimobiledevice-utils wget curl avahi-compat-libdns_sd-devel dnf-plugins-core unzip usbutils psmisc
sudo apt update ```
sudo apt install libhandy-1-0 libhandy-1-dev Arch Linux:
```
sudo pacman -S binutils wget curl git python-pip libappindicator-gtk3 usbmuxd libimobiledevice avahi zlib unzip usbutils psmisc
``` ```
Run the following commands: OpenSUSE:
```
sudo zypper in binutils wget curl git python311-gobject-Gdk libhandy-devel libappindicator3-1 typelib-1_0-AppIndicator3-0_1 imobiledevice-tools libdns_sd libnotify-devel psmisc
```
#### Running AltLinux
Once the dependencies are installed, run the following commands:
``` ```
git clone https://github.com/i-love-altlinux/AltLinux git clone https://github.com/i-love-altlinux/AltLinux
``` ```
@@ -99,56 +57,28 @@ cd AltLinux
python3 main.py python3 main.py
``` ```
### Fedora: Note: if you're running OpenSUSE Leap, run the following command instead:
Install the dependencies:
``` ```
sudo dnf install binutils python3-pip git libappindicator-gtk3 usbmuxd libimobiledevice-devel libimobiledevice-utils wget curl avahi-compat-libdns_sd-devel dnf-plugins-core unzip usbutils python3.11 main.py
```
Run the following commands:
```
git clone https://github.com/i-love-altlinux/AltLinux
```
```
cd AltLinux
```
```
python3 main.py
```
### Arch Linux
Install the dependencies:
```
sudo pacman -S binutils wget curl git python-pip libappindicator-gtk3 usbmuxd libimobiledevice avahi zlib unzip usbutils
```
Run the following commands:
```
git clone https://github.com/i-love-altlinux/AltLinux
```
```
cd AltLinux
```
```
python3 main.py
``` ```
## Compile the DEB package ## Compile the DEB package
Feel free to create a [pull request](https://github.com/i-love-altlinux/AltLinux/pulls) or [report an issue](https://github.com/i-love-altlinux/AltLinux/issues).
Add the `universe` repository: Add the `universe` repository:
```
sudo apt install software-properties-common
```
``` ```
sudo add-apt-repository universe -y sudo add-apt-repository universe -y
``` ```
Install the dependencies: Install the dependencies:
``` ```
sudo apt-get install binutils python3-pip git gir1.2-appindicator3-0.1 usbmuxd libimobiledevice6 libimobiledevice-utils wget curl libavahi-compat-libdnssd-dev zlib1g-dev unzip usbutils sudo apt-get install binutils python3-pip git gir1.2-appindicator3-0.1 usbmuxd libimobiledevice6 libimobiledevice-utils wget curl libavahi-compat-libdnssd-dev zlib1g-dev unzip usbutils libhandy-1-dev gir1.2-notify-0.7 python3-requests psmisc pipx
``` ```
If you're running Ubuntu 20.04 or any distro based on it (such as Mint 20), run the following commands: If you're running Ubuntu 20.04 or any distro based on it (such as Mint 20), run the following commands:
@@ -160,10 +90,16 @@ sudo apt install libhandy-1-0 libhandy-1-dev
Install pyinstaller: Install pyinstaller:
Ubuntu 22.04:
``` ```
pip3 install pyinstaller pip3 install pyinstaller
``` ```
Ubuntu 24.04:
```
pip3 install pyinstaller --break-system-packages
```
Reboot your computer for changes to take effect. Reboot your computer for changes to take effect.
After that, proceed by running the following commands: After that, proceed by running the following commands:
@@ -182,8 +118,11 @@ cd AltLinux
The DEB file is ready! You can install it now. The DEB file is ready! You can install it now.
## Credits ## Credits
AltLinux made by [vyvir](https://github.com/vyvir)
AltServer-Linux made by [NyaMisty](https://github.com/NyaMisty) AltServer-Linux made by [NyaMisty](https://github.com/NyaMisty)
Artwork by [Nebula](https://github.com/itsnebulalol)
Provision by [Dadoum](https://github.com/Dadoum) Provision by [Dadoum](https://github.com/Dadoum)
Artwork by [Nebula](https://github.com/itsnebulalol)
+108 -111
View File
@@ -3,20 +3,28 @@ import os
import errno import errno
from re import T from re import T
from shutil import rmtree from shutil import rmtree
import gi import json
import urllib.request import urllib.request
from urllib.request import urlopen from urllib.request import urlopen
import urllib.parse
import requests import requests
import subprocess import subprocess
import signal import signal
import threading import threading
from time import sleep from time import sleep
# PyGObject
import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
gi.require_version("Handy", "1") gi.require_version("Handy", "1")
gi.require_version("AppIndicator3", "0.1")
gi.require_version("Notify", "0.7") gi.require_version("Notify", "0.7")
from gi.repository import Gtk, AppIndicator3 as appindicator try:
gi.require_version("AppIndicator3", "0.1")
from gi.repository import Gtk, AppIndicator3 as appindicator
except ValueError: # Fix for Solus and other Ayatana users
gi.require_version('AyatanaAppIndicator3', '0.1')
from gi.repository import Gtk, AyatanaAppIndicator3 as appindicator
from gi.repository import GLib from gi.repository import GLib
from gi.repository import GObject, Handy from gi.repository import GObject, Handy
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
@@ -27,21 +35,20 @@ GObject.type_ensure(Handy.ActionRow)
installedcheck = False installedcheck = False
def resource_path(relative_path): def resource_path(relative_path):
global installedcheck global installedcheck
CheckRun10 = subprocess.run( CheckRun10 = subprocess.run(
f"find /usr/lib/altlinux/altlinux 2>/dev/null >dev/null", shell=True f"find /usr/lib/altlinux/altlinux > /dev/null 2>&1", shell=True
) )
if CheckRun10.returncode == 0: if CheckRun10.returncode == 0:
installedcheck = True installedcheck = True
base_path = "/usr/lib/altlinux/altlinux" base_path = "/usr/lib/altlinux"
else: else:
base_path = os.path.abspath(".") base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path) return os.path.join(base_path, relative_path)
# List of global variables # Global variables
ermcheck = False # Checks if the IPA path has been defined by user ermcheck = False # Checks if the IPA path has been defined by user
savedcheck = False savedcheck = False
InsAltStore = subprocess.Popen( InsAltStore = subprocess.Popen(
@@ -52,12 +59,10 @@ AppleID = "lol"
Password = "lol" Password = "lol"
Warnmsg = "warn" Warnmsg = "warn"
Failmsg = "fail" Failmsg = "fail"
file_name = resource_path("resources/1.png") icon_name = "changes-prevent-symbolic"
icon_name = "view-conceal-symbolic.symbolic"
command_six = Gtk.CheckMenuItem(label="Launch at Login") command_six = Gtk.CheckMenuItem(label="Launch at Login")
AppIcon = resource_path("resources/2.png")
AltServer = "$HOME/.local/share/altlinux/AltServer" AltServer = "$HOME/.local/share/altlinux/AltServer"
AnisetteServer = "$HOME/.local/share/altlinux/anisette_server" AnisetteServer = "$HOME/.local/share/altlinux/anisette-server"
AltStore = "$HOME/.local/share/altlinux/AltStore.ipa" AltStore = "$HOME/.local/share/altlinux/AltStore.ipa"
PATH = AltStore PATH = AltStore
AutoStart = resource_path("resources/AutoStart.sh") AutoStart = resource_path("resources/AutoStart.sh")
@@ -79,56 +84,24 @@ def connectioncheck():
with open(resource_path("resources/version"), "r", encoding="utf-8") as f: with open(resource_path("resources/version"), "r", encoding="utf-8") as f:
LocalVersion = f.readline().strip() LocalVersion = f.readline().strip()
def main(): def main():
GLib.set_prgname("AltLinux") # Sets the global program name GLib.set_prgname("AltLinux") # Sets the global program name
global altlinuxpath global altlinuxpath
global file_name #global file_name
if not os.path.exists(altlinuxpath): # Creates $HOME/.local/share/altlinux if not os.path.exists(altlinuxpath): # Creates $HOME/.local/share/altlinux
os.mkdir(altlinuxpath) os.mkdir(altlinuxpath)
global installedcheck if Gtk.StatusIcon.is_embedded:
command1 = 'echo $XDG_CURRENT_DESKTOP | grep -q "GNOME"' # Check if the current DE is GNOME
CheckRun8 = subprocess.run(command1, shell=True)
if CheckRun8.returncode == 0:
file_name = resource_path("resources/1.png") # If GNOME, use the b&w tray icon
else:
command2 = 'echo $XDG_CURRENT_DESKTOP | grep -q "X-Cinnamon"' # Check if the current DE is Cinnamon
CheckRunLol = subprocess.run(command2, shell=True)
if CheckRunLol.returncode == 0:
file_name = resource_path(
"resources/1.png"
) # If Cinnamon, use the b&w tray icon
else:
file_name = resource_path(
"resources/2.png"
) # If other DE, use a colored tray icon
if CheckRun8.returncode == 1 or (
CheckRun8.returncode == 0 and Gtk.StatusIcon.is_embedded
):
if connectioncheck(): if connectioncheck():
global indicator global indicator
indicator = appindicator.Indicator.new( indicator = appindicator.Indicator.new(
"customtray", "altlinux-tray-icon",
os.path.abspath(file_name), resource_path("resources/1.png"),
appindicator.IndicatorCategory.APPLICATION_STATUS, appindicator.IndicatorCategory.APPLICATION_STATUS,
) )
indicator.set_status(appindicator.IndicatorStatus.ACTIVE) indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(menu()) indicator.set_menu(menu())
indicator.set_status(appindicator.IndicatorStatus.PASSIVE) indicator.set_status(appindicator.IndicatorStatus.PASSIVE)
if (
not os.path.isfile(f"{(altlinuxpath)}/AltServer")
or not os.path.isfile(f"{(altlinuxpath)}/AltStore.ipa")
or not os.path.isfile(f"{(altlinuxpath)}/anisette_server")
):
# If AltServer or AltStore aren't present, show splash screen
openwindow(SplashScreen) openwindow(SplashScreen)
else:
# If AltServer or AltStore are present, don't show splash screen
subprocess.run(
f"""export ALTSERVER_ANISETTE_SERVER='http://127.0.0.1:6969' & {(altlinuxpath)}/AltServer &""",
shell=True,
)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
else: else:
openwindow(OopsInternet) # Notify the user there is no Internet connection openwindow(OopsInternet) # Notify the user there is no Internet connection
else: else:
@@ -199,10 +172,10 @@ def on_abtdlg(self):
) )
about.set_logo(pixbuf) about.set_logo(pixbuf)
about.set_program_name("AltLinux") about.set_program_name("AltLinux")
about.set_version("0.4.2-2") about.set_version("0.5.0")
about.set_authors( about.set_authors(
[ [
"maxasix", "vyvir",
"AltServer-Linux", "AltServer-Linux",
"made by NyaMisty", "made by NyaMisty",
"Provision", "Provision",
@@ -211,9 +184,9 @@ def on_abtdlg(self):
) # , 'Provision made by', 'Dadoum']) ) # , 'Provision made by', 'Dadoum'])
about.set_artists(["nebula"]) about.set_artists(["nebula"])
about.set_comments("A GUI for AltServer-Linux written in Python.") about.set_comments("A GUI for AltServer-Linux written in Python.")
about.set_website("https://github.com/i-love-altlinux/AltLinux") about.set_website("https://github.com/vyvir/AltLinux")
about.set_website_label("Github") about.set_website_label("Github")
about.set_copyright("GUI by maxasix") about.set_copyright("GUI by vyvir")
about.set_position(Gtk.WindowPosition.CENTER_ALWAYS) about.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
about.run() about.run()
about.destroy() about.destroy()
@@ -296,20 +269,19 @@ class SplashScreen(Handy.Window):
GLib.timeout_add(200, self.wait_for_t, self.t) GLib.timeout_add(200, self.wait_for_t, self.t)
def lol321actualfunction(self): def lol321actualfunction(self):
global installedcheck self.lbl1.set_text("Checking if anisette-server is already running...")
self.lbl1.set_text("Checking if anisette_server is already running...")
self.loadaltlinux.set_fraction(0.1) self.loadaltlinux.set_fraction(0.1)
command = 'curl 127.0.0.1:6969 | grep -q "{"' command = 'curl 127.0.0.1:6969 | grep -q "{"'
CheckRun = subprocess.run(command, shell=True) CheckRun = subprocess.run(command, shell=True)
if not os.path.isfile(f"{(altlinuxpath)}/anisette_server"): if not os.path.isfile(f"{(altlinuxpath)}/anisette-server"):
self.lbl1.set_text("Downloading anisette_server...") self.lbl1.set_text("Downloading anisette-server...")
r = requests.get( r = requests.get(
"https://github.com/Dadoum/Provision/releases/download/1.1.0/anisette_server-x86_64", "https://github.com/vyvir/AltLinux/releases/download/v0.5.0/anisette-server-x86_64",
allow_redirects=True, allow_redirects=True,
) )
open(f"{(altlinuxpath)}/anisette_server", "wb").write(r.content) open(f"{(altlinuxpath)}/anisette-server", "wb").write(r.content)
subprocess.run(f"chmod +x {(altlinuxpath)}/anisette_server", shell=True) subprocess.run(f"chmod +x {(altlinuxpath)}/anisette-server", shell=True)
subprocess.run(f"chmod 755 {(altlinuxpath)}/anisette_server", shell=True) subprocess.run(f"chmod 755 {(altlinuxpath)}/anisette-server", shell=True)
self.loadaltlinux.set_fraction(0.2) self.loadaltlinux.set_fraction(0.2)
self.lbl1.set_text("Downloading Apple Music APK...") self.lbl1.set_text("Downloading Apple Music APK...")
r = requests.get( r = requests.get(
@@ -330,8 +302,8 @@ class SplashScreen(Handy.Window):
) )
silentremove(f"{(altlinuxpath)}/am.apk") silentremove(f"{(altlinuxpath)}/am.apk")
self.loadaltlinux.set_fraction(0.4) self.loadaltlinux.set_fraction(0.4)
self.lbl1.set_text("Starting anisette_server...") self.lbl1.set_text("Starting anisette-server...")
subprocess.run(f"cd {(altlinuxpath)} && ./anisette_server &", shell=True) subprocess.run(f"cd {(altlinuxpath)} && ./anisette-server &", shell=True)#-n 127.0.0.1 -p 6969 &", shell=True)
self.loadaltlinux.set_fraction(0.5) self.loadaltlinux.set_fraction(0.5)
finished = False finished = False
while not finished: while not finished:
@@ -350,22 +322,22 @@ class SplashScreen(Handy.Window):
open(f"{(altlinuxpath)}/AltServer", "wb").write(r.content) open(f"{(altlinuxpath)}/AltServer", "wb").write(r.content)
subprocess.run(f"chmod +x {(altlinuxpath)}/AltServer", shell=True) subprocess.run(f"chmod +x {(altlinuxpath)}/AltServer", shell=True)
subprocess.run(f"chmod 755 {(altlinuxpath)}/AltServer", shell=True) subprocess.run(f"chmod 755 {(altlinuxpath)}/AltServer", shell=True)
self.loadaltlinux.set_fraction(0.8)
if not os.path.isfile(f"{(altlinuxpath)}/AltStore.ipa"): if not os.path.isfile(f"{(altlinuxpath)}/AltStore.ipa"):
self.lbl1.set_text("Downloading AltStore...") self.lbl1.set_text("Downloading AltStore...")
self.loadaltlinux.set_fraction(0.7) altstoredownload("Download")
r = requests.get( else:
"https://cdn.altstore.io/file/altstore/altstore-beta.ipa", self.lbl1.set_text("Checking latest AltStore version...")
allow_redirects=True, if not altstoredownload("Check"):
) self.lbl1.set_text("Downloading new version of AltStore...")
open(f"{(altlinuxpath)}/AltStore.ipa", "wb").write(r.content) altstoredownload("Download")
subprocess.run(f"chmod 755 {(altlinuxpath)}/AltStore.ipa", shell=True)
self.lbl1.set_text("Starting AltServer...") self.lbl1.set_text("Starting AltServer...")
self.loadaltlinux.set_fraction(1.0) self.loadaltlinux.set_fraction(1.0)
subprocess.run(f"{(altlinuxpath)}/AltServer &", shell=True) subprocess.run(f"{(altlinuxpath)}/AltServer &", shell=True)
return 0 return 0
class login(Gtk.Window): class login(Gtk.Window):#
def __init__(self): def __init__(self):
super().__init__(title="Login") super().__init__(title="Login")
self.present() self.present()
@@ -399,12 +371,15 @@ class login(Gtk.Window):
grid.attach(self.entry, 1, 2, 1, 1) grid.attach(self.entry, 1, 2, 1, 1)
grid.attach_next_to(self.button, self.entry, Gtk.PositionType.RIGHT, 1, 1) grid.attach_next_to(self.button, self.entry, Gtk.PositionType.RIGHT, 1, 1)
silentremove(f"{(altlinuxpath)}/log.txt")
def on_click_me_clicked1(self): def on_click_me_clicked1(self):
self.realthread1 = threading.Thread(target=self.onclickmethread) self.realthread1 = threading.Thread(target=self.onclickmethread)
self.realthread1.start() self.realthread1.start()
GLib.idle_add(self.ermlol) GLib.idle_add(self.ermlol)
def on_click_me_clicked(self, button): def on_click_me_clicked(self, button):
silentremove(f"{(altlinuxpath)}/log.txt")
if not os.path.isfile(f"{(altlinuxpath)}/saved.txt"): if not os.path.isfile(f"{(altlinuxpath)}/saved.txt"):
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS) self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
dialog = Gtk.MessageDialog( dialog = Gtk.MessageDialog(
@@ -436,21 +411,7 @@ class login(Gtk.Window):
GLib.idle_add(self.ermlol) GLib.idle_add(self.ermlol)
def onclickmethread(self): def onclickmethread(self):
silentremove(f"{(altlinuxpath)}/ideviceinfo.txt") if checkiosver() >= "15.0":
subprocess.run(f"ideviceinfo > {(altlinuxpath)}/ideviceinfo.txt", shell=True)
result = "result"
pathsy = f"{(altlinuxpath)}/ideviceinfo.txt"
with open(pathsy) as file:
# Iterate through lines
for line in file.readlines():
# Find the start of the word
index = line.find("ProductVersion: ")
# If the word is inside the line
if index != -1:
result = line[:-1][16:]
silentremove(f"{(altlinuxpath)}/ideviceinfo.txt")
print(result)
if result >= "12.2":
global savedcheck global savedcheck
global AppleID global AppleID
global Password global Password
@@ -461,20 +422,20 @@ class login(Gtk.Window):
global InsAltStore global InsAltStore
print(PATH) print(PATH)
silentremove(f"{(altlinuxpath)}/log.txt") silentremove(f"{(altlinuxpath)}/log.txt")
f = open(f"{(altlinuxpath)}/log.txt", "w") #f = open(f"{(altlinuxpath)}/log.txt", "w")
f.close() #f.close()
if os.path.isdir(f'{ os.environ["HOME"] }/.adi'): if os.path.isdir(f'{ os.environ["HOME"] }/.adi'):
rmtree(f'{ os.environ["HOME"] }/.adi') rmtree(f'{ os.environ["HOME"] }/.adi')
InsAltStoreCMD = f"""export ALTSERVER_ANISETTE_SERVER='http://127.0.0.1:6969' & {(AltServer)} -u {UDID} -a {AppleID} -p {Password} {PATH} > {("$HOME/.local/share/altlinux/log.txt")}""" InsAltStoreCMD = f"""export ALTSERVER_ANISETTE_SERVER='http://127.0.0.1:6969' ; {(AltServer)} -u {UDID} -a {AppleID} -p {Password} {PATH} > {("$HOME/.local/share/altlinux/log.txt")}"""
InsAltStore = subprocess.Popen( InsAltStore = subprocess.Popen(
InsAltStoreCMD, InsAltStoreCMD,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
shell=True, shell=True,
) )
else: # If the iOS version is lower than 12.2, AltServer-Linux won't run else: # If the iOS version is lower than 15.0, AltServer-Linux won't run
global Failmsg global Failmsg
Failmsg = "iOS 12.2 or later is required." Failmsg = "iOS 15.0 or later is required."
dialog2 = DialogExample3(self) dialog2 = DialogExample3(self)
dialog2.run() dialog2.run()
dialog2.destroy() dialog2.destroy()
@@ -593,16 +554,17 @@ class login(Gtk.Window):
def on_icon_toggled(self, widget, icon, event): def on_icon_toggled(self, widget, icon, event):
global icon_name global icon_name
if icon_name == "view-conceal-symbolic.symbolic": if icon_name == "changes-prevent-symbolic":
icon_name = "view-reveal-symbolic.symbolic" icon_name = "changes-allow-symbolic"
self.entry.set_visibility(True) self.entry.set_visibility(True)
elif icon_name == "view-reveal-symbolic.symbolic": elif icon_name == "changes-allow-symbolic":
icon_name = "view-conceal-symbolic.symbolic" icon_name = "changes-prevent-symbolic"
self.entry.set_visibility(False) self.entry.set_visibility(False)
self.entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, icon_name) self.entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, icon_name)
def on_editable_toggled(self, widget): #
print("lol") #def on_editable_toggled(self, widget):
# print("lol")
class PairWindow(Handy.Window): class PairWindow(Handy.Window):
@@ -931,7 +893,7 @@ def notify():
if (connectioncheck()) == True: if (connectioncheck()) == True:
LatestVersion = ( LatestVersion = (
urllib.request.urlopen( urllib.request.urlopen(
"https://raw.githubusercontent.com/i-love-altlinux/AltLinux/main/resources/version" "https://raw.githubusercontent.com/vyvir/AltLinux/main/resources/version"
) )
.readline() .readline()
.rstrip() .rstrip()
@@ -939,21 +901,10 @@ def notify():
) )
if LatestVersion > LocalVersion: if LatestVersion > LocalVersion:
Notify.init("MyProgram") Notify.init("MyProgram")
command2 = 'echo $XDG_CURRENT_DESKTOP | grep -q "GNOME"'
command3 = 'echo $XDG_CURRENT_DESKTOP | grep -q "X-Cinnamon"'
CheckRun9 = subprocess.run(command2, shell=True)
if CheckRun9.returncode == 0:
file_name1 = resource_path("resources/1.png")
else:
CheckRun10 = subprocess.run(command3, shell=True)
if CheckRun10.returncode == 0:
file_name1 = resource_path("resources/1.png")
else:
file_name1 = resource_path("resources/2.png")
n = Notify.Notification.new( n = Notify.Notification.new(
"An update is available!", "An update is available!",
"Click 'Download Update' in the tray menu.", "Click 'Download Update' in the tray menu.",
os.path.abspath(file_name1), resource_path("resources/3.png"),
) )
n.set_timeout(Notify.EXPIRES_DEFAULT) n.set_timeout(Notify.EXPIRES_DEFAULT)
# n.add_action("newupd", "Download", actionCallback) # n.add_action("newupd", "Download", actionCallback)
@@ -967,7 +918,7 @@ def notify():
def showurl(_): def showurl(_):
Gtk.show_uri_on_window( Gtk.show_uri_on_window(
None, "https://github.com/maxasix/AltLinux/releases", Gdk.CURRENT_TIME None, "https://github.com/vyvir/AltLinux/releases", Gdk.CURRENT_TIME
) )
quitit() quitit()
@@ -989,12 +940,13 @@ def restartaltserver(_):
subprocess.run(f"killall {AnisetteServer}", shell=True) subprocess.run(f"killall {AnisetteServer}", shell=True)
subprocess.run("idevicepair pair", shell=True) subprocess.run("idevicepair pair", shell=True)
subprocess.run( subprocess.run(
f"""export ALTSERVER_ANISETTE_SERVER='http://127.0.0.1:6969' & {(altlinuxpath)}/AltServer &""", f"""export ALTSERVER_ANISETTE_SERVER='http://127.0.0.1:6969' ; {(altlinuxpath)}/AltServer &""",
shell=True, shell=True,
) )
def winerm(): def winerm():
silentremove(f"{(altlinuxpath)}/log.txt")
dialog = Gtk.MessageDialog( dialog = Gtk.MessageDialog(
# transient_for=self, # transient_for=self,
flags=0, flags=0,
@@ -1038,7 +990,7 @@ def win2(_):
def actionCallback(notification, action, user_data=None): def actionCallback(notification, action, user_data=None):
Gtk.show_uri_on_window( Gtk.show_uri_on_window(
None, "https://github.com/i-love-altlinux/AltLinux/releases", Gdk.CURRENT_TIME None, "https://github.com/vyvir/AltLinux/releases", Gdk.CURRENT_TIME
) )
quitit() quitit()
@@ -1061,6 +1013,51 @@ def silentremove(filename):
if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory
raise # re-raise exception if a different error occurred raise # re-raise exception if a different error occurred
def altstoredownload(value):
# setting the base URL value
baseUrl = "https://cdn.altstore.io/file/altstore/apps.json"
# retrieving data from JSON Data
json_data = requests.get(baseUrl)
if json_data.status_code == 200:
data = json_data.json()
for app in data['apps']:
if app['name'] == "AltStore":
if value == "Check":
size = app['versions'][0]['size']
return size == os.path.getsize(f'{(altlinuxpath)}/AltStore.ipa')
break
if value == "Download":
latest = app['versions'][0]['downloadURL']
r = requests.get(
latest,
allow_redirects=True,
)
latest_filename = latest.split('/')[-1]
open(f"{(altlinuxpath)}/{(latest_filename)}", "wb").write(r.content)
os.rename(f"{(altlinuxpath)}/{(latest_filename)}", f"{(altlinuxpath)}/AltStore.ipa")
subprocess.run(f"chmod 755 {(altlinuxpath)}/AltStore.ipa", shell=True)
break
return True
else:
return False
def checkiosver():
silentremove(f"{(altlinuxpath)}/ideviceinfo.txt")
subprocess.run(f"ideviceinfo > {(altlinuxpath)}/ideviceinfo.txt", shell=True)
result = "result"
pathsy = f"{(altlinuxpath)}/ideviceinfo.txt"
with open(pathsy) as file:
# Iterate through lines
for line in file.readlines():
# Find the start of the word
index = line.find("ProductVersion: ")
# If the word is inside the line
if index != -1:
result = line[:-1][16:]
silentremove(f"{(altlinuxpath)}/ideviceinfo.txt")
print(result)
return(result)
if __name__ == "__main__": if __name__ == "__main__":
main() main()
+1 -1
View File
@@ -1,2 +1,2 @@
0.4.2-1 0.5.0
x64 x64