Skip to content

Commit 9d70270

Browse files
authored
done for mac
1 parent bd3133e commit 9d70270

File tree

1 file changed

+57
-41
lines changed

1 file changed

+57
-41
lines changed

macOS/UXTU4Unix.py

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def get_codename():
8787
cpu_stepping = int(words[stepping_index].rstrip(','))
8888
if cpu == 'Intel':
8989
cfg.set('Info', 'Type', 'Intel')
90+
cfg.set('Info', 'Architecture', 'Intel')
91+
cfg.set('Info', 'Family', 'Intel')
92+
cfg.set('Info', 'Type', 'Intel')
9093
else:
9194
if cpu_family == 23:
9295
cfg.set('Info', 'Architecture', 'Zen 1 - Zen 2')
@@ -170,9 +173,6 @@ def get_presets():
170173
elif "G" in cpu_model:
171174
loca = "Assets.Presets.AMDAPUPreMatisse_G"
172175
from Assets.Presets.AMDAPUPreMatisse_G import PRESETS
173-
else:
174-
loca = "Assets.Presets.AMDCPU"
175-
from Assets.Presets.AMDCPU import PRESETS
176176
elif ryzen_family.index(cpu_family) > ryzen_family.index("Matisse"):
177177
if "U" in cpu_model:
178178
loca = "Assets.Presets.AMDAPUPostMatisse_U"
@@ -192,7 +192,34 @@ def get_presets():
192192
elif "GE" in cpu_model:
193193
loca = "Assets.Presets.AMDAPUPostMatisse_GE"
194194
from Assets.Presets.AMDAPUPostMatisse_GE import PRESETS
195+
elif cpu_type == 'Amd_Desktop_Cpu':
196+
if ryzen_family.index(cpu_family) < ryzen_family.index("Raphael"):
197+
if "E" in cpu_model:
198+
loca = "Assets.Presets.AMDCPUPreRaphael_E"
199+
from Assets.Presets.AMDCPUPreRaphael_E import PRESETS
200+
elif "X3D" in cpu_model:
201+
loca = "Assets.Presets.AMDCPUPreRaphael_X3D"
202+
from Assets.Presets.AMDCPUPreRaphael_X3D import PRESETS
203+
elif "X" in cpu_model and "9" in cpu_model:
204+
loca = "Assets.Presets.AMDCPUPreRaphael_X9"
205+
from Assets.Presets.AMDCPUPreRaphael_X9 import PRESETS
206+
elif "X" in cpu_model:
207+
loca = "Assets.Presets.AMDCPUPreRaphael_X"
208+
from Assets.Presets.AMDCPUPreRaphael_X import PRESETS
195209
else:
210+
loca = "Assets.Presets.AMDCPUPreRaphael"
211+
from Assets.Presets.AMDCPUPreRaphael import PRESETS
212+
else:
213+
if "E" in cpu_model:
214+
loca = "Assets.Presets.AMDCPU_E"
215+
from Assets.Presets.AMDCPU_E import PRESETS
216+
elif "X3D" in cpu_model:
217+
loca = "Assets.Presets.AMDCPU_X3D"
218+
from Assets.Presets.AMDCPU_X3D import PRESETS
219+
elif "X" in cpu_model and "9" in cpu_model:
220+
loca = "Assets.Presets.AMDCPU_X9"
221+
from Assets.Presets.AMDCPU_X9 import PRESETS
222+
elif "X" in cpu_model:
196223
loca = "Assets.Presets.AMDCPU"
197224
from Assets.Presets.AMDCPU import PRESETS
198225
cfg.set('User', 'Preset', loca)
@@ -674,9 +701,11 @@ def check_cfg_integrity() -> None:
674701
return
675702
required_keys_user = ['password', 'mode']
676703
required_keys_settings = ['time', 'dynamicmode', 'sip', 'reapply', 'applyonstart', 'softwareupdate', 'debug']
677-
if not cfg.has_section('User') or not cfg.has_section('Settings') or \
704+
required_keys_info = ['cpu', 'signature', 'voltage', 'max speed', 'current speed', 'core count', 'core enabled', 'thread count', 'architecture', 'family', 'type']
705+
if not cfg.has_section('User') or not cfg.has_section('Settings') or not cfg.has_section('Info') or \
678706
any(key not in cfg['User'] for key in required_keys_user) or \
679-
any(key not in cfg['Settings'] for key in required_keys_settings):
707+
any(key not in cfg['Settings'] for key in required_keys_settings) or \
708+
any(key not in cfg['Info'] for key in required_keys_info):
680709
reset()
681710

682711
def get_latest_ver():
@@ -741,54 +770,36 @@ def check_updates():
741770
else:
742771
logging.info("Quitting...")
743772
raise SystemExit
744-
if not skip_update_check and LOCAL_VERSION < latest_version:
745-
updater()
773+
if not skip_update_check:
774+
if LOCAL_VERSION < latest_version:
775+
updater()
776+
elif LOCAL_VERSION > latest_version:
777+
clear()
778+
logging.info("Welcome to the UXTU4Unix Beta Program")
779+
logging.info("This beta build may not work as expected and is only for testing purposes!")
780+
result = input("Do you want to continue (y/n): ").lower().strip()
781+
if result == "y":
782+
pass
783+
else:
784+
logging.info("Quitting...")
785+
raise SystemExit
746786

747-
def l2t():
748-
while True:
749-
clear()
750-
oath = """
751-
----------------------------------------------------------
752-
The Oath Before The Entrance Exam - By GFx
753-
----------------------------------------------------------
754-
In the name of Ly Tu Trong High School,
755-
I pledge to dedicate countless nights to the pursuit of knowledge.
756-
Despite the criticism and disparagement from those around me,
757-
I am prepared to fight relentlessly for a brighter future.
758-
The thought of succeeding,
759-
of feeling a sense of pride,
760-
and of demonstrating to others that I am far from useless,
761-
fuels my motivation to strive harder.
762-
With determination and courage,
763-
I will do my utmost!
764-
"""
765-
logging.info(oath)
766-
player = subprocess.Popen(["afplay", "-q", "1", f"{current_dir}/Assets/TickingAway.mp3"])
767-
logging.info("B. Back")
768-
choice = input("Option: ").strip().lower()
769-
if choice == "b":
770-
player.terminate()
771-
break
772-
else:
773-
logging.info("Invalid option. Please try again.")
774-
player.terminate()
775-
break
776-
777787
def about():
778788
options = {
779789
"1": lambda: webbrowser.open("https://www.github.com/AppleOSX/UXTU4Unix"),
780790
"f": updater,
781791
"b": "break",
782-
"l2t": l2t,
783792
}
784793
while True:
785794
clear()
786795
logging.info("About UXTU4Unix")
787-
logging.info("The L2T Update (2FUTURE)")
796+
logging.info("The Future Stepping Update (3MacL2TDream)")
788797
logging.info("----------------------------")
789798
logging.info("Maintainer: GorouFlex\nCLI: GorouFlex")
790-
logging.info("GUI: NotchApple1703\nAdvisor: NotchApple1703")
791-
logging.info("Command file: CorpNewt\nTester: nlqanh524")
799+
logging.info("GUI: NotchApple1703\nCore: NotchApple1703")
800+
logging.info("Advisor: NotchApple1703")
801+
logging.info("dmidecode for macOS: Acidanthera")
802+
logging.info("Command file for macOS: CorpNewt\nTester: nlqanh524")
792803
logging.info("----------------------------")
793804
try:
794805
logging.info(f"F. Force update to the latest version ({get_latest_ver()})")
@@ -866,6 +877,11 @@ def apply_smu(args, user_mode):
866877
logging.info("Cannot run RyzenAdj because your computer is missing debug=0x144 or required SIP is not SET yet\nPlease run Install UXTU4Unix dependencies under Setting \nand restart after install.")
867878
input("Press Enter to continue...")
868879
return
880+
if cfg.get('Info', 'Type') == "Intel":
881+
clear()
882+
logging.info("Sorry, we currently do not support Intel chipsets. Please consider using CPUFriendFriend by corpnewt.")
883+
input("Press Enter to continue...")
884+
return
869885
sleep_time = cfg.get('Settings', 'Time', fallback='30')
870886
password = cfg.get('User', 'Password', fallback='')
871887
dynamic = cfg.get('Settings', 'dynamicmode', fallback='0')

0 commit comments

Comments
 (0)