-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.py
49 lines (35 loc) · 1.66 KB
/
installer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from git import Repo
import os
import shutil
from tkinter import filedialog
def select_files(extension):
file_paths = filedialog.askopenfilenames(filetypes=[(f"{extension.upper()} Files", f"*.{extension}")])
return file_paths
folder_name = "flipperc"
os.mkdir(folder_name)
firmware_choice = input("firmware selection: \n1- official firmware --> https://github.com/flipperdevices/flipperzero-firmware\n2- roguemaster --> https://github.com/RogueMaster/flipperzero-firmware-wPlugins\n3- unleashed --> https://github.com/DarkFlippers/unleashed-firmware\n4- xtreme --> https://github.com/Flipper-XFW/Xtreme-Firmware\npick one: ")
if firmware_choice == '1':
repo_url = "https://github.com/flipperdevices/flipperzero-firmware.git"
Repo.clone_from(repo_url, folder_name)
if firmware_choice == '2':
repo_url = "https://github.com/RogueMaster/flipperzero-firmware-wPlugins.git"
Repo.clone_from(repo_url, folder_name)
if firmware_choice == '3':
repo_url = "https://github.com/DarkFlippers/unleashed-firmware.git"
Repo.clone_from(repo_url, folder_name)
if firmware_choice == '4':
repo_url = "https://github.com/Flipper-XFW/Xtreme-Firmware.git"
Repo.clone_from(repo_url, folder_name)
fam_files = select_files("fam")
c_files = select_files("c")
app_name = input("Enter the name of the application: ")
app_user_folder = os.path.join(folder_name, "applications_user", app_name)
os.makedirs(app_user_folder)
for fam_file in fam_files:
shutil.copy(fam_file, app_user_folder)
for c_file in c_files:
shutil.copy(c_file, app_user_folder)
os.chdir(folder_name)
os.system(f"./fbt fap_{app_name}")
os.system(f"./fbt launch_app APPSRC={app_name}")
print("enjoy !!!")