-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
89 lines (80 loc) · 2.75 KB
/
main.py
File metadata and controls
89 lines (80 loc) · 2.75 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import streamlit as st
import asyncio
# Import functions from the 'functions' folder
from functions import home, device_info, app_manager, ipa_manager, remote_device, quick_scan
from functions.app_explorer import explore_app
from PIL import Image
favicon = Image.open("logo.png")
st.set_page_config(page_title="MobXplore",layout="wide",page_icon=favicon)
st.markdown(
"""
<style>
[data-testid="stExpander"] p {
font-size: 17px;
}
</style>
""",
unsafe_allow_html=True,
)
st.markdown(
"""
<style>
section[data-testid="stSidebar"] {
width: 300px !important; # Set the width to your desired value
}
</style>
""",
unsafe_allow_html=True,
)
rmt_device = None
# Custom CSS to make buttons full-width
st.markdown("""
<style>
.stButton > button {
width: 100%;
margin: 5px 0;
}
</style>
""", unsafe_allow_html=True)
# Initialize session state for page navigation
if 'current_page' not in st.session_state:
st.session_state['current_page'] = 'home' # Default page
def navigate_to(page):
st.session_state['current_page'] = page
def navigation():
st.sidebar.image('logo.png',caption="By The Creators Of Mobexler")
# st.sidebar.title("GiPT Navigation")
# Define buttons for each page, set the state for each page when clicked
if not remote_device.usb_device_connected():
if st.sidebar.button("Connect Remote Device"):
global rmt_device
st.session_state['device'] = remote_device.connect_remote_device()
if st.sidebar.button("Home"):
navigate_to('home')
if st.sidebar.button("Device Info"):
navigate_to('device_info')
if st.sidebar.button("App Explorer"):
navigate_to('app_manager')
if st.sidebar.button("IPA Extractor"):
navigate_to('ipa_manager')
if st.sidebar.button("Quick Security Scan"):
navigate_to('security_scan')
# Check session state for current page
if st.session_state['current_page'] == 'home':
home.home_page()
elif st.session_state['current_page'] == 'device_info':
device_info.get_device_info()
elif st.session_state['current_page'] == 'app_manager':
app_manager.list_installed_apps()
elif st.session_state['current_page'] == 'ipa_manager':
ipa_manager.ipa_manager()
elif st.session_state['current_page'] == 'explore_app':
asyncio.run(explore_app(st.session_state.get('app_identifier', None), st.session_state.get('device')))
elif st.session_state['current_page'] == 'security_scan':
quick_scan.scanner_main(st.session_state.get('device'))
else:
# Default to home page if session state is corrupted
home.home_page()
# Main Entry
if __name__ == "__main__":
navigation()