@@ -148,7 +148,7 @@ def build(self):
148148 "Download TWRP recovery" ,
149149 icon = icons .DOWNLOAD_OUTLINED ,
150150 on_click = lambda _ : webbrowser .open (
151- f"https://dl.twrp.me/{ self .state .config .metadata . get ( 'devicecode' ) } "
151+ f"https://dl.twrp.me/{ self .state .config .device_code } "
152152 ),
153153 expand = True ,
154154 ),
@@ -164,7 +164,7 @@ def build(self):
164164 Text ("Select an OS image:" , style = "titleSmall" ),
165165 Markdown (
166166 f"""
167- The image file should look something like `lineage-19.1-20221101-nightly-{ self .state .config .metadata . get ( 'devicecode' ) } -signed.zip`."""
167+ The image file should look something like `lineage-19.1-20221101-nightly-{ self .state .config .device_code } -signed.zip`."""
168168 ),
169169 Row (
170170 [
@@ -185,7 +185,7 @@ def build(self):
185185 Text ("Select a TWRP recovery image:" , style = "titleSmall" ),
186186 Markdown (
187187 f"""
188- The recovery image should look something like `twrp-3.6.2_9 -0-{ self .state .config .metadata . get ( 'devicecode' ) } .img`.
188+ The recovery image should look something like `twrp-3.7.0_12 -0-{ self .state .config .device_code } .img`.
189189
190190**Note:** This tool **only supports TWRP recoveries**.""" ,
191191 extension_set = "gitHubFlavored" ,
@@ -237,9 +237,11 @@ def pick_image_result(self, e: FilePickerResultEvent):
237237 logger .info ("No image selected." )
238238 # check if the image works with the device and show the filename in different colors accordingly
239239 if e .files :
240- device_code = self .state .config .metadata . get ( "devicecode" )
240+ device_code = self .state .config .device_code
241241 if image_works_with_device (
242- device_code = device_code , image_path = self .state .image_path
242+ device_code = device_code ,
243+ alternative_device_code = self .state .config .alternative_device_code ,
244+ image_path = self .state .image_path ,
243245 ):
244246 self .selected_image .color = colors .GREEN
245247 else :
@@ -261,7 +263,7 @@ def pick_recovery_result(self, e: FilePickerResultEvent):
261263 logger .info ("No image selected." )
262264 # check if the recovery works with the device and show the filename in different colors accordingly
263265 if e .files :
264- device_code = self .state .config .metadata . get ( "devicecode" )
266+ device_code = self .state .config .device_code
265267 if recovery_works_with_device (
266268 device_code = device_code , recovery_path = self .state .recovery_path
267269 ):
@@ -276,10 +278,12 @@ def enable_button_if_ready(self, e):
276278 if (".zip" in self .selected_image .value ) and (
277279 ".img" in self .selected_recovery .value
278280 ):
279- device_code = self .state .config .metadata . get ( "devicecode" )
281+ device_code = self .state .config .device_code
280282 if not (
281283 image_works_with_device (
282- device_code = device_code , image_path = self .state .image_path
284+ device_code = device_code ,
285+ alternative_device_code = self .state .config .alternative_device_code ,
286+ image_path = self .state .image_path ,
283287 )
284288 and recovery_works_with_device (
285289 device_code = device_code , recovery_path = self .state .recovery_path
0 commit comments