The Keyring Update

This commit is contained in:
vyvir
2024-12-23 14:22:37 +02:00
parent 9ada88f31a
commit fe7eed02aa
2 changed files with 14 additions and 17 deletions
+4 -4
View File
@@ -19,21 +19,21 @@ sudo add-apt-repository universe -y
``` ```
``` ```
sudo apt-get install binutils python3-pip python3-requests 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 sudo apt-get install binutils python3-pip python3-requests python3-keyring 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 psmisc
``` ```
Fedora: Fedora:
``` ```
sudo dnf install binutils python3-pip python3-requests git libappindicator-gtk3 usbmuxd libimobiledevice-devel libimobiledevice-utils wget curl avahi-compat-libdns_sd-devel dnf-plugins-core unzip usbutils psmisc sudo dnf install binutils python3-pip python3-requests python3-keyring git libappindicator-gtk3 usbmuxd libimobiledevice-devel libimobiledevice-utils wget curl avahi-compat-libdns_sd-devel dnf-plugins-core unzip usbutils psmisc
``` ```
Arch Linux: Arch Linux:
``` ```
sudo pacman -S binutils wget curl git python-pip python-requests python-gobject libappindicator-gtk3 usbmuxd libimobiledevice avahi zlib unzip usbutils psmisc libhandy sudo pacman -S binutils wget curl git python-pip python-requests python-gobject python-keyring libappindicator-gtk3 usbmuxd libimobiledevice avahi zlib unzip usbutils psmisc libhandy
``` ```
OpenSUSE: OpenSUSE:
``` ```
sudo zypper in binutils wget curl git python311-pip python311-requests python311-gobject-Gdk libhandy-devel libappindicator3-1 typelib-1_0-AppIndicator3-0_1 imobiledevice-tools libdns_sd libnotify-devel psmisc sudo zypper in binutils wget curl git python311-pip python311-requests python311-keyring python311-gobject-Gdk libhandy-devel libappindicator3-1 typelib-1_0-AppIndicator3-0_1 imobiledevice-tools libdns_sd libnotify-devel psmisc
``` ```
### Running althea ### Running althea
+10 -13
View File
@@ -10,6 +10,7 @@ import requests
import subprocess import subprocess
import signal import signal
import threading import threading
import keyring
from time import sleep from time import sleep
import platform import platform
@@ -250,28 +251,27 @@ def use_saved_credentials():
if response == Gtk.ResponseType.YES: if response == Gtk.ResponseType.YES:
global apple_id global apple_id
global password global password
f = open(f"{(altheapath)}/saved.txt", "r") apple_id = keyring.get_password("althea", "apple_id")
for line in f: password = keyring.get_password("althea", "password")
apple_id, password = line.strip().split(' ')
f.close()
print(apple_id, password) print(apple_id, password)
global savedcheck global savedcheck
savedcheck = True savedcheck = True
Login().on_click_me_clicked1() Login().on_click_me_clicked1()
else: else:
silent_remove(f"{(altheapath)}/saved.txt") apple_id = keyring.delete_password("althea", "apple_id")
password = keyring.delete_password("althea", "password")
win3 = Login() win3 = Login()
win3.show_all() win3.show_all()
dialog.destroy() dialog.destroy()
def win1(): def win1():
if os.path.isfile(f"{(altheapath)}/saved.txt"): if keyring.get_password("althea", "apple_id"):
use_saved_credentials() use_saved_credentials()
else: else:
openwindow(Login) openwindow(Login)
def win2(_): def win2(_):
if os.path.isfile(f"{(altheapath)}/saved.txt"): if keyring.get_password("althea", "apple_id"):
use_saved_credentials() use_saved_credentials()
else: else:
openwindow(Login) openwindow(Login)
@@ -522,7 +522,7 @@ class Login(Gtk.Window):
def on_click_me_clicked(self, button): def on_click_me_clicked(self, button):
silent_remove(f"{(altheapath)}/log.txt") silent_remove(f"{(altheapath)}/log.txt")
if not os.path.isfile(f"{(altheapath)}/saved.txt"): if not keyring.get_password("althea", "apple_id"):
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS) self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
dialog = Gtk.MessageDialog( dialog = Gtk.MessageDialog(
transient_for=self, transient_for=self,
@@ -536,11 +536,8 @@ class Login(Gtk.Window):
if response == Gtk.ResponseType.YES: if response == Gtk.ResponseType.YES:
apple_id = self.entry1.get_text().lower() apple_id = self.entry1.get_text().lower()
password = self.entry.get_text() password = self.entry.get_text()
f = open(f"{(altheapath)}/saved.txt", "x") keyring.set_password("althea", "apple_id", apple_id)
f.write(apple_id) keyring.set_password("althea", "password", password)
f.write(" ")
f.write(password)
f.close()
dialog.destroy() dialog.destroy()
self.entry.set_progress_pulse_step(0.2) self.entry.set_progress_pulse_step(0.2)
# Call self.do_pulse every 100 ms # Call self.do_pulse every 100 ms