def _reset(self): if not ui.ask_for_confirmation( common.get_local_string(13007), # 13007=Reset common.get_local_string(30609)): return with common.show_busy_dialog(): # Set WV Sec. Lev. to Disabled self._ensure_wv_btn_check( self.WV_SECLEV_MAP_BTN[WidevineForceSecLev.DISABLED]) self.wv_sec_lev_new = WidevineForceSecLev.DISABLED if self.is_android: # Generate the ESN self.esn_new = generate_android_esn( wv_force_sec_lev=self.wv_sec_lev_new) else: # To retrieve the ESN from the website, # to avoid possible problems we refresh the nf session data to get a new ESN set_website_esn('') common.make_call('refresh_session_data', {'update_profiles': False}) self.esn_new = get_website_esn() if not self.esn_new: raise Exception( 'It was not possible to obtain the ESN, try restarting the add-on' ) self._update_esn_label()
def _apply_changes(self): with common.show_busy_dialog(): set_esn(self.esn_new or self.esn) G.LOCAL_DB.set_value('widevine_force_seclev', self.wv_sec_lev_new or self.wv_force_sec_lev, TABLE_SESSION) # Try apply the changes by performing the MSL key handshake right now try: common.make_call('perform_key_handshake', endpoint=IPC_ENDPOINT_MSL) # When the MSL not raise errors not always means that the device can play the videos # because the MSL manifest/license request may not be granted (you have to play a video to know it). ui.show_ok_dialog(common.get_local_string(30600), common.get_local_string(30606)) except Exception as exc: # pylint: disable=broad-except ui.show_ok_dialog(common.get_local_string(30600), common.get_local_string(30607).format(exc)) self.changes_applied = True