def packages_clear_userdata_callback(sender, data) -> NoReturn:
    global table_selection
    for package in table_selection:
        adb_fw.clear_userdata_of_package(package)
        log_info(f"cleared user-data for '{package}'", logger="debuglog")
    adb_fw.backup_device_package_list()
    adb_fw.update_package_data()
    update_table()
def packages_uninstall_callback(sender, data) -> NoReturn:
    global table_selection
    for package in table_selection:
        adb_fw.disable_package(package, with_uninstall=True)
        log_info(f"uninstalled '{package}'", logger="debuglog")
    adb_fw.backup_device_package_list()
    adb_fw.update_package_data()
    update_table()
def connect_button_callback(sender, data) -> NoReturn:
    if adb_fw.device_is_connected:
        adb_fw.disconnect_device()
    else:
        adb_fw.connect_device_usb()
        if adb_fw.device is None:
            log_error(f"not able to connect to any device", logger="debuglog")
            return
        adb_fw.update_package_data()
    update_table()
    update_buttons()
def update_button_callback(sender, data) -> NoReturn:
    adb_fw.update_package_data()
    update_table()
Beispiel #5
0
import framework_adb as adb_fw
import configuration as cfg
import framework_debloat as uad_fw
import framework_misc as misc

# TODO: initial, unfinished (and now most likely incompatible) cmd line interface
# TODO: try https://github.com/tiangolo/typer to put together a proper CLI

# ###############################################################################
#                                Program                                        #
# ###############################################################################

# This code just pulls package overview from device and saves it as csv
if __name__ == '__main__':
    adb_fw.connect_device_usb()
    adb_fw.update_device_properties()
    uad_fw.parse_debloat_lists()
    adb_fw.update_package_data()
    misc.save_dataframe(adb_fw.device_packages, cfg.local_package_file_path)
    adb_fw.disconnect_device()