├── .github
└── workflows
│ └── codeql-analysis.yml
├── .gitignore
├── AdbWinApi.dll
├── AdbWinUsbApi.dll
├── README.md
├── adb.exe
├── images
└── scr.png
├── main.py
└── main.spec
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ main ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ main ]
20 | schedule:
21 | - cron: '40 14 * * 3'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ubuntu-latest
27 | permissions:
28 | actions: read
29 | contents: read
30 | security-events: write
31 |
32 | strategy:
33 | fail-fast: false
34 | matrix:
35 | language: [ 'python' ]
36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support
38 |
39 | steps:
40 | - name: Checkout repository
41 | uses: actions/checkout@v2
42 |
43 | # Initializes the CodeQL tools for scanning.
44 | - name: Initialize CodeQL
45 | uses: github/codeql-action/init@v1
46 | with:
47 | languages: ${{ matrix.language }}
48 | # If you wish to specify custom queries, you can do so here or in a config file.
49 | # By default, queries listed here will override any specified in a config file.
50 | # Prefix the list here with "+" to use these queries and those in the config file.
51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
52 |
53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54 | # If this step fails, then you should remove it and run the build manually (see below)
55 | - name: Autobuild
56 | uses: github/codeql-action/autobuild@v1
57 |
58 | # ℹ️ Command-line programs to run using the OS shell.
59 | # 📚 https://git.io/JvXDl
60 |
61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62 | # and modify them (or add more) to build your code if your project
63 | # uses a compiled language
64 |
65 | #- run: |
66 | # make bootstrap
67 | # make release
68 |
69 | - name: Perform CodeQL Analysis
70 | uses: github/codeql-action/analyze@v1
71 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.apk
2 | *.msixbundle
3 | dist
4 | build
5 | __pycache__
6 | venv
--------------------------------------------------------------------------------
/AdbWinApi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sleepntsheep/wsa-toolbox/db4962979181e0beb73db127a46d52d6afd9a985/AdbWinApi.dll
--------------------------------------------------------------------------------
/AdbWinUsbApi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sleepntsheep/wsa-toolbox/db4962979181e0beb73db127a46d52d6afd9a985/AdbWinUsbApi.dll
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
WSA Toolbox
3 |
4 |
5 | #### usage:
6 | download and run main.exe in releases, it might take a while to start
7 |
8 | #### note:
9 | while this work on all branch of windows 11, wsa require windows 11 ui component to work so you can't install wsa on windows 10
10 |
11 | ****
12 |
13 | 
14 |
15 | # TODO:
16 |
17 | - [x] install wsa button for windows 11 stable-dev
18 | - [ ] install gapp
19 | - [ ] file management
20 |
21 | # Contributions:
22 | feel free to fork and make a pull request or open an issue!
23 |
--------------------------------------------------------------------------------
/adb.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sleepntsheep/wsa-toolbox/db4962979181e0beb73db127a46d52d6afd9a985/adb.exe
--------------------------------------------------------------------------------
/images/scr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sleepntsheep/wsa-toolbox/db4962979181e0beb73db127a46d52d6afd9a985/images/scr.png
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import tkinter as tk
2 | import shutil
3 | from tkinter import filedialog as fd
4 | from tkinter import messagebox as mb
5 | import os
6 | import urllib3
7 | import subprocess
8 | import requests
9 | import re
10 | import sys
11 |
12 | class Btn(tk.Button):
13 | def __init__(self, *args, **kwargs):
14 | tk.Button.__init__(self, *args, **kwargs)
15 | self['bg'] = '#191919'
16 | self['fg'] = '#cacaca'
17 | self['width'] = 50
18 | self['height'] = 2
19 | self.draw()
20 |
21 | def draw(self):
22 | self.pack(pady=8, anchor='center')
23 |
24 | class App(tk.Frame):
25 | def __init__(self, parent, *args, **kwargs):
26 | tk.Frame.__init__(self, parent, *args, **kwargs)
27 | self.parent = parent
28 |
29 | b1 = Btn(
30 | self.parent,
31 | command=self.installAPK,
32 | text='Install APK',
33 | )
34 |
35 | b2 = Btn(
36 | self.parent,
37 | text='Open ADB Shell',
38 | command=self.adbShell
39 | )
40 |
41 | b3 = Btn(
42 | self.parent,
43 | text='Install aurora store (play store alternative)',
44 | command=lambda: self.installURL('https://files.auroraoss.com/AuroraStore/Stable/AuroraStore_4.0.7.apk', name='AuroraStore')
45 | )
46 |
47 | b4 = Btn(
48 | self.parent,
49 | text='Installing F-Droid store',
50 | command=lambda: self.installURL('https://f-droid.org/F-Droid.apk', name='FDroid')
51 | )
52 |
53 |
54 | b5 = Btn(
55 | self.parent,
56 | text='Download+install WSA (Windows 11 stable/beta/dev) [need admin]',
57 | command=self.installWSL
58 | )
59 |
60 |
61 | self.status = tk.StringVar()
62 | self.status.set('Choose an action')
63 |
64 | tk.Label(
65 | self.parent,
66 | textvariable=self.status,
67 | bg='red',
68 | fg='white',
69 | width=60,
70 | height=2,
71 | ).pack(side='bottom')
72 |
73 | def installAPK(self):
74 | global adbpath
75 | path = fd.askopenfilename(
76 | title='Choose apk file',
77 | initialdir='HOME',
78 | filetypes=[('Android Package', '*.apk')]
79 | )
80 | self.updatestatus('Installing APK')
81 | self.apk(path)
82 | self.updatestatus('Finished Installing APK')
83 |
84 | def adbShell(self):
85 | global adbpath
86 | subprocess.call((f'{adbpath} disconnect'), shell=True)
87 | subprocess.call((f'{adbpath} connect 127.0.0.1:58526'), shell=True)
88 | os.system(f'start cmd /k {adbpath} shell')
89 | self.updatestatus('Opened adb shell')
90 |
91 | def installURL(self, link, name='app'):
92 | global adbpath
93 | if os.path.exists(f'./{name}.apk'):
94 | os.remove(f'./{name}.apk')
95 | self.updatestatus('Downloading apk')
96 | download(link, name+'.apk')
97 | self.updatestatus('Downloaded apk, installing')
98 | self.apk(name+'.apk')
99 | self.updatestatus('Finished installing '+name)
100 |
101 | def apk(self, path):
102 | global adbpath
103 | subprocess.call((f'{adbpath} disconnect'), shell=True)
104 | c = subprocess.getoutput(f'{adbpath} connect 127.0.0.1:58526')
105 | if 'unable to connect' in c:
106 | mb.showerror('OK', 'Unable to connect, enable developer mode and run WSA if you haven\'t')
107 | return self.updatestatus('Failed: make sure you opened WSA')
108 | p = subprocess.getoutput(f'{adbpath} install "'+path+'"')
109 | if 'Package com.aurora.store signatures do not match previously installed version; ignoring!]' in p:
110 | mb.showwarning('OK', 'Error: signatures do not match previously installed version, try again!')
111 | elif 'Success' in p:
112 | mb.showinfo('OK', 'Successfully installed ' + path)
113 | else:
114 | mb.showwarning('OK', p)
115 |
116 | def installWSL(self):
117 | answer = tk.messagebox.askokcancel(
118 | title = 'Confirmation',
119 | message = 'Make sure you ran this application as adminastrator',
120 | )
121 | if not answer:
122 | return
123 | purl = 'https://www.microsoft.com/store/productId/9P3395VX91NR'
124 | apiurl = 'https://store.rg-adguard.net/api/GetFiles'
125 | r = requests.post(apiurl, data={
126 | 'type': 'url',
127 | 'url': purl,
128 | 'ring': 'WIS',
129 | 'lang': 'en-US'
130 | })
131 | regex = re.search('\)\">(.*\.msixbundle) | ', str(r.content))
132 | url = regex.group(1)
133 | text = regex.group(2)
134 | if text.endswith('.msixbundle'):
135 | url = url.split('"')[-1]
136 | self.updatestatus('Downloading, windows not responding is normal. Please wait')
137 | download(url, 'wsa.msixbundle')
138 | self.updatestatus('Successfully Downloaded , installing')
139 | os.system('start cmd /k powershell Add-AppxPackage -Path '+ os.path.abspath('wsa.msixbundle'))
140 | self.updatestatus('Installed WSA')
141 | tk.messagebox.info('You need to enable Virtualization in bios to use WSA!')
142 |
143 | def updatestatus(self, text):
144 | self.status.set(text)
145 | self.parent.update()
146 |
147 | def download(url, filename):
148 | with requests.get(url, stream=True) as r:
149 | with open(os.path.abspath(filename), 'wb') as f:
150 | shutil.copyfileobj(r.raw, f)
151 |
152 |
153 | def resource_path(relative_path):
154 | if hasattr(sys, '_MEIPASS'):
155 | return os.path.join(sys._MEIPASS, relative_path)
156 | else:
157 | return os.path.join(os.path.abspath("."), relative_path)
158 |
159 |
160 | if __name__ == '__main__':
161 | WIDTH = 400
162 | HEIGHT = 500
163 | try:
164 | adbpath = resource_path('./adb.exe')
165 | except :
166 | adbpath = resource_path('adb.exe')
167 |
168 | adbpath = os.path.abspath(adbpath)
169 |
170 | root = tk.Tk()
171 | root.geometry(f'{WIDTH}x{HEIGHT}')
172 | root.resizable(False, False)
173 | root.title('WSA toolbox')
174 |
175 | HOME = os.path.expanduser('~')
176 |
177 | app = App(root)
178 | app.pack(side='top', fill='both', expand=True)
179 | root.mainloop()
180 |
--------------------------------------------------------------------------------
/main.spec:
--------------------------------------------------------------------------------
1 | # -*- mode: python ; coding: utf-8 -*-
2 |
3 |
4 | block_cipher = None
5 |
6 |
7 | a = Analysis(
8 | ['main.py'],
9 | pathex=[],
10 | binaries=[],
11 | datas=[('adb.exe', '.'), ('AdbWinApi.dll', '.'), ('AdbWinUsbApi.dll', '.')],
12 | hiddenimports=[],
13 | hookspath=[],
14 | hooksconfig={},
15 | runtime_hooks=[],
16 | excludes=[],
17 | win_no_prefer_redirects=False,
18 | win_private_assemblies=False,
19 | cipher=block_cipher,
20 | noarchive=False,
21 | )
22 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
23 |
24 | exe = EXE(
25 | pyz,
26 | a.scripts,
27 | a.binaries,
28 | a.zipfiles,
29 | a.datas,
30 | [],
31 | name='main',
32 | debug=False,
33 | bootloader_ignore_signals=False,
34 | strip=False,
35 | upx=True,
36 | upx_exclude=[],
37 | runtime_tmpdir=None,
38 | console=True,
39 | disable_windowed_traceback=False,
40 | argv_emulation=False,
41 | target_arch=None,
42 | codesign_identity=None,
43 | entitlements_file=None,
44 | )
45 |
--------------------------------------------------------------------------------