Skip to content

Commit 03f9a8c

Browse files
committed
- Added Pixel 8a (akita) support.
- Updated Pixel device end of life dates based on [Google's published data](https://support.google.com/pixelphone/answer/4457705). - Added an option to refresh Google Images download links, useful on release days when you want an immediate refresh. - Memory improvements when building Google Images list. - Added additional troubleshooting debug messages when a device is not detected. - Minor bug fixes and improvements.
1 parent 0ea3b64 commit 03f9a8c

File tree

9 files changed

+109
-58
lines changed

9 files changed

+109
-58
lines changed

Main.py

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,13 @@ def download_completed(destination_path):
322322
download_thread.start()
323323

324324
def on_refresh_google_images(self, event):
325+
print("Refreshing Google Images Menu ...")
326+
self.parent._on_spin('start')
325327
self.parent.config.google_images_last_checked = False
326328
# Refresh the Google Images menu
327329
self.parent.update_google_images_menu()
330+
print("Completed refreshing Google Images Menu.")
331+
self.parent._on_spin('stop')
328332

329333
# ============================================================================
330334
# Class GoogleImagesMenu
@@ -410,9 +414,9 @@ def __init__(self, parent):
410414
phone_menu_item.SetBitmap(phone_icon)
411415
watches_menu_item = self.AppendSubMenu(self.watches_menu, "Watches")
412416
watches_menu_item.SetBitmap(watch_icon)
413-
# self.AppendSeparator()
414-
# refresh_images_menu_item = self.Append(wx.ID_ANY, "Refresh images list")
415-
# self.Bind(wx.EVT_MENU, self.on_refresh_google_images, refresh_images_menu_item)
417+
self.AppendSeparator()
418+
refresh_images_menu_item = self.Append(wx.ID_ANY, "Refresh images list")
419+
self.Bind(wx.EVT_MENU, self.on_refresh_google_images, refresh_images_menu_item)
416420

417421
if download_available:
418422
self.parent.toast("Updates are available", f"There are updates available for your device.\nCheck Google Images menu.")
@@ -751,7 +755,7 @@ def initialize(self):
751755

752756
# select configured device
753757
debug("select configured device")
754-
self._select_configured_device()
758+
self._select_configured_device(is_init=True)
755759
self._refresh_ui()
756760
except Exception as e:
757761
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error while checking for connected devices during initialization.")
@@ -2392,7 +2396,7 @@ def _update_custom_flash_options(self):
23922396
# -----------------------------------------------
23932397
# _select_configured_device
23942398
# -----------------------------------------------
2395-
def _select_configured_device(self):
2399+
def _select_configured_device(self, is_init=False):
23962400
try:
23972401
if self.config.device:
23982402
count = 0
@@ -2402,7 +2406,7 @@ def _select_configured_device(self):
24022406
set_phone_id(device.id)
24032407
puml(f":Select Device;\n", True)
24042408
self._print_device_details(device)
2405-
self.update_google_images_menu()
2409+
self.update_google_images_menu(update_icons_only=not is_init)
24062410
count += 1
24072411
elif self.device_choice.StringSelection:
24082412
device = self.device_choice.StringSelection
@@ -2416,7 +2420,7 @@ def _select_configured_device(self):
24162420
set_phone_id(device.id)
24172421
puml(f":Select Device;\n", True)
24182422
self._print_device_details(device)
2419-
self.update_google_images_menu()
2423+
self.update_google_images_menu(update_icons_only=not is_init)
24202424
else:
24212425
set_phone_id(None)
24222426
self.device_label.Label = "ADB Connected Devices"
@@ -2439,19 +2443,23 @@ def refresh_device(self, look_for_device=None):
24392443
print("Updating connected devices ...")
24402444
if look_for_device:
24412445
selected_device_id = look_for_device
2446+
debug(f"Looking for requested device: {look_for_device}")
24422447
else:
24432448
selected_device = self.device_choice.StringSelection
2449+
debug(f"Checking a previous device choice: [{selected_device}]")
24442450
selected_device_id = None
24452451
if selected_device:
24462452
# selected_device_id = selected_device.split()[2]
24472453
selected_device_id = self.config.device
2454+
debug(f"Looking for previously selected device: {selected_device_id}")
24482455
self.device_choice.Clear()
24492456
phones = get_phones()
24502457
for device in phones:
24512458
if device:
24522459
device_details = device.get_device_details()
24532460
self.device_choice.Append(device_details)
24542461
if selected_device_id and device.id == selected_device_id:
2462+
debug(f"Found device: {selected_device_id}, selecting it ...")
24552463
self.device_choice.SetStringSelection(device_details) # Select the matching device ID
24562464
self._select_configured_device()
24572465
self._reflect_slots()
@@ -2778,8 +2786,9 @@ def _on_select_device(self, event):
27782786
wx.YieldIfNeeded()
27792787
if device.id == d_id:
27802788
set_phone_id(device.id)
2789+
self.config.device = device.id
27812790
self._print_device_details(device)
2782-
self.update_google_images_menu()
2791+
self.update_google_images_menu(update_icons_only=True)
27832792
self._reflect_slots()
27842793
self.update_widget_states()
27852794
except Exception as e:
@@ -2829,6 +2838,9 @@ def _on_scan(self, event):
28292838
# -----------------------------------------------
28302839
def _on_select_platform_tools(self, event):
28312840
try:
2841+
print("\n==============================================================================")
2842+
print(f" {datetime.now():%Y-%m-%d %H:%M:%S} User initiated select platform tools")
2843+
print("==============================================================================")
28322844
self._on_spin('start')
28332845
self.config.platform_tools_path = event.GetPath().replace("'", "")
28342846
check_platform_tools(self)
@@ -2847,6 +2859,9 @@ def _on_select_platform_tools(self, event):
28472859
# -----------------------------------------------
28482860
def update_firmware_selection(self, path):
28492861
try:
2862+
print("\n==============================================================================")
2863+
print(f" {datetime.now():%Y-%m-%d %H:%M:%S} User initiated update firmware selection")
2864+
print("==============================================================================")
28502865
if not os.path.exists(path):
28512866
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: file {path} does not exist")
28522867
return -1
@@ -4863,14 +4878,37 @@ def _add_mode_radio_button(sizer, index, flash_mode, label, tooltip):
48634878
# -----------------------------------------------
48644879
# update_google_images_menu
48654880
# -----------------------------------------------
4866-
def update_google_images_menu(self):
4867-
self.google_images_menu.reset_menu_id()
4868-
menu_index = self.menuBar.FindMenu("Google Images")
4869-
self.menuBar.Remove(menu_index)
4870-
self.google_images_menu = GoogleImagesMenu(self)
4871-
self.menuBar.Insert(menu_index, self.google_images_menu, "Google Images")
4872-
self.Refresh()
4873-
self.Update()
4881+
def update_google_images_menu(self, update_icons_only=False):
4882+
try:
4883+
if update_icons_only:
4884+
device = get_phone()
4885+
device_icon = images.star_green_24.GetBitmap()
4886+
empty_bitmap =wx.NullBitmap
4887+
4888+
if device:
4889+
current_device = device.hardware
4890+
else:
4891+
current_device = "UNKNOWN_DEVICE"
4892+
4893+
for menu in [self.google_images_menu.phones_menu, self.google_images_menu.watches_menu]:
4894+
for item in menu.GetMenuItems():
4895+
# Clear the icon
4896+
item.SetBitmap(empty_bitmap)
4897+
4898+
# If the item's label matches the current device, set the icon
4899+
if current_device in item.GetItemLabelText():
4900+
item.SetBitmap(device_icon)
4901+
else:
4902+
self.google_images_menu.reset_menu_id()
4903+
menu_index = self.menuBar.FindMenu("Google Images")
4904+
self.menuBar.Remove(menu_index)
4905+
self.google_images_menu = GoogleImagesMenu(self)
4906+
self.menuBar.Insert(menu_index, self.google_images_menu, "Google Images")
4907+
self.Refresh()
4908+
self.Update()
4909+
except Exception as e:
4910+
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error while updating Google Images Menu")
4911+
traceback.print_exc()
48744912

48754913

48764914
# ============================================================================

android_devices.json

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
{
2+
"akita": {
3+
"device": "Google Pixel 8a",
4+
"android_version_end_date": "May 2031",
5+
"security_update_end_date": "May 2031",
6+
"first_api_level": "34"
7+
},
28
"eos": {
39
"device": "Google Pixel Watch 2 (LTE)",
410
"android_version_end_date": "October 2026",
5-
"security_update_end_date": "October 2027",
11+
"security_update_end_date": "October 2028",
612
"first_api_level": "33"
713
},
814
"aurora": {
915
"device": "Google Pixel Watch 2 (Bluetooth/Wi-Fi)",
1016
"android_version_end_date": "October 2026",
11-
"security_update_end_date": "October 2027",
17+
"security_update_end_date": "October 2028",
1218
"first_api_level": "33"
1319
},
1420
"husky": {
1521
"device": "Pixel 8 Pro",
16-
"android_version_end_date": "October 2026",
22+
"android_version_end_date": "October 2030",
1723
"security_update_end_date": "October 2030",
1824
"first_api_level": "34"
1925
},
2026
"shiba": {
2127
"device": "Pixel 8",
22-
"android_version_end_date": "October 2026",
23-
"security_update_end_date": "October 2027",
28+
"android_version_end_date": "October 2030",
29+
"security_update_end_date": "October 2030",
2430
"first_api_level": "34"
2531
},
2632
"felix": {
2733
"device": "Pixel Fold",
2834
"android_version_end_date": "June 2026",
29-
"security_update_end_date": "June 2027",
35+
"security_update_end_date": "June 2028",
3036
"first_api_level": "33"
3137
},
3238
"tangorpro": {
3339
"device": "Pixel Tablet",
3440
"android_version_end_date": "June 2026",
35-
"security_update_end_date": "June 2027",
41+
"security_update_end_date": "June 2028",
3642
"first_api_level": "33"
3743
},
3844
"lynx": {
3945
"device": "Pixel 7a",
4046
"android_version_end_date": "May 2026",
41-
"security_update_end_date": "May 2027",
47+
"security_update_end_date": "May 2028",
4248
"first_api_level": "33"
4349
},
4450
"r11": {
@@ -56,67 +62,67 @@
5662
"cheetah": {
5763
"device": "Pixel 7 Pro",
5864
"android_version_end_date": "October 2025",
59-
"security_update_end_date": "October 2026",
65+
"security_update_end_date": "October 2027",
6066
"first_api_level": "33"
6167
},
6268
"panther": {
6369
"device": "Pixel 7",
6470
"android_version_end_date": "October 2025",
65-
"security_update_end_date": "October 2026",
71+
"security_update_end_date": "October 2027",
6672
"first_api_level": "33"
6773
},
6874
"bluejay": {
6975
"device": "Pixel 6a",
7076
"android_version_end_date": "June 2025",
71-
"security_update_end_date": "June 2026",
77+
"security_update_end_date": "June 2027",
7278
"first_api_level": "32"
7379
},
7480
"oriole": {
7581
"device": "Pixel 6",
7682
"android_version_end_date": "October 2024",
77-
"security_update_end_date": "October 2025",
83+
"security_update_end_date": "October 2026",
7884
"first_api_level": "31"
7985
},
8086
"raven": {
8187
"device": "Pixel 6 Pro",
8288
"android_version_end_date": "October 2024",
83-
"security_update_end_date": "October 2025",
89+
"security_update_end_date": "October 2026",
8490
"first_api_level": "31"
8591
},
8692
"barbet": {
8793
"device": "Pixel 5a",
8894
"android_version_end_date": "August 2024",
89-
"security_update_end_date": "August 2025",
95+
"security_update_end_date": "August 2024",
9096
"first_api_level": "30"
9197
},
9298
"redfin": {
9399
"device": "Pixel 5",
94100
"android_version_end_date": "October 2023",
95-
"security_update_end_date": "October 2024",
101+
"security_update_end_date": "October 2023",
96102
"first_api_level": "30"
97103
},
98104
"bramble": {
99105
"device": "Pixel 4a (5G)",
100-
"android_version_end_date": "October 2023",
101-
"security_update_end_date": "October 2024",
106+
"android_version_end_date": "November 2023",
107+
"security_update_end_date": "November 2023",
102108
"first_api_level": "30"
103109
},
104110
"sunfish": {
105111
"device": "Pixel 4a",
106112
"android_version_end_date": "August 2023",
107-
"security_update_end_date": "August 2024",
113+
"security_update_end_date": "August 2023",
108114
"first_api_level": "29"
109115
},
110116
"coral": {
111117
"device": "Pixel 4 XL",
112118
"android_version_end_date": "October 2022",
113-
"security_update_end_date": "October 2023",
119+
"security_update_end_date": "October 2022",
114120
"first_api_level": "29"
115121
},
116122
"flame": {
117123
"device": "Pixel 4",
118124
"android_version_end_date": "October 2022",
119-
"security_update_end_date": "October 2023",
125+
"security_update_end_date": "October 2022",
120126
"first_api_level": "29"
121127
},
122128
"bonito": {
@@ -128,55 +134,55 @@
128134
"sargo": {
129135
"device": "Pixel 3a",
130136
"android_version_end_date": "May 2022",
131-
"security_update_end_date": "May 2023",
137+
"security_update_end_date": "May 2022",
132138
"first_api_level": "28"
133139
},
134140
"crosshatch": {
135141
"device": "Pixel 3 XL",
136142
"android_version_end_date": "October 2021",
137-
"security_update_end_date": "October 2023",
143+
"security_update_end_date": "October 2021",
138144
"first_api_level": "28"
139145
},
140146
"blueline": {
141147
"device": "Pixel 3",
142148
"android_version_end_date": "October 2021",
143-
"security_update_end_date": "October 2023",
149+
"security_update_end_date": "October 2021",
144150
"first_api_level": "28"
145151
},
146152
"taimen": {
147153
"device": "Pixel 2 XL",
148154
"android_version_end_date": "October 2020",
149-
"security_update_end_date": "October 2022",
155+
"security_update_end_date": "October 2020",
150156
"first_api_level": "26"
151157
},
152158
"walleye": {
153159
"device": "Pixel 2",
154160
"android_version_end_date": "October 2020",
155-
"security_update_end_date": "October 2022",
161+
"security_update_end_date": "October 2020",
156162
"first_api_level": "26"
157163
},
158164
"marlin": {
159165
"device": "Pixel XL",
160166
"android_version_end_date": "October 2018",
161-
"security_update_end_date": "October 2019",
167+
"security_update_end_date": "October 2018",
162168
"first_api_level": "25"
163169
},
164170
"sailfish": {
165171
"device": "Pixel",
166172
"android_version_end_date": "October 2019",
167-
"security_update_end_date": "October 2020",
173+
"security_update_end_date": "October 2019",
168174
"first_api_level": "25"
169175
},
170176
"ryu": {
171177
"device": "Pixel C",
172178
"android_version_end_date": "October 2018",
173-
"security_update_end_date": "October 2019",
179+
"security_update_end_date": "October 2018",
174180
"first_api_level": "23"
175181
},
176182
"angler": {
177183
"device": "Nexus 6P",
178184
"android_version_end_date": "September 2018",
179-
"security_update_end_date": "September 2019",
185+
"security_update_end_date": "September 2018",
180186
"first_api_level": "23"
181187
}
182188
}

build-on-mac.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ exe = EXE(pyz,
2828
icon='images/icon-dark-256.icns')
2929
app = BUNDLE(exe,
3030
name='PixelFlasher.app',
31-
version='6.9.4.0',
31+
version='6.9.5.0',
3232
icon='./images/icon-dark-256.icns',
3333
bundle_identifier='com.badabing.pixelflasher')

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
rm -rf build dist
3-
VERSION=6.9.4.0
3+
VERSION=6.9.5.0
44
NAME="PixelFlasher"
55
DIST_NAME="PixelFlasher"
66

0 commit comments

Comments
 (0)