Removes all DedSec-related blocks and aliases from bash.bashrc.
()
| 2007 | parts.append(part_arc) |
| 2008 | os.remove(temp_part) |
| 2009 | split_records.append({"target": entry["arc"], "mode": entry.get("mode", 0o600), "part_dir": part_dir, "parts": parts}) |
| 2010 | finally: |
| 2011 | if current is not None: |
| 2012 | current.close() |
| 2013 | return archive_names, split_records |
| 2014 | |
| 2015 | |
| 2016 | def _transfer_package_list(): |
| 2017 | try: |
| 2018 | result = subprocess.run(["dpkg-query", "-W", "-f=${binary:Package}\\t${Version}\\n"], capture_output=True, text=True, timeout=60, check=False) |
| 2019 | if result.returncode == 0: |
| 2020 | return result.stdout |
| 2021 | except Exception: |
| 2022 | pass |
| 2023 | return "" |
| 2024 | |
| 2025 | |
| 2026 | def _transfer_write_core(entries, split_records, excluded): |
| 2027 | core_path = os.path.join(TERMUX_TRANSFER_DIR, TERMUX_TRANSFER_CORE_NAME) |
| 2028 | metadata = { |
| 2029 | "schema": 1, |
| 2030 | "created_at": time.strftime("%Y-%m-%dT%H:%M:%S%z"), |
| 2031 | "source_arch": os.uname().machine, |
| 2032 | "source_prefix": TERMUX_TRANSFER_PREFIX, |
| 2033 | "source_home": HOME_DIR, |
| 2034 | "android_sdk": run_command_silent("getprop ro.build.version.sdk")[0], |
| 2035 | "privacy": { |
| 2036 | "private_paths_excluded": int(excluded.get("private", 0)), |
| 2037 | "secret_content_excluded": int(excluded.get("secret_content", 0)), |
| 2038 | "volatile_or_unsupported_excluded": int(excluded.get("volatile", 0)) + int(excluded.get("unsupported", 0)), |
| 2039 | }, |
| 2040 | } |
| 2041 | split_lines = [] |
| 2042 | for record in split_records: |
| 2043 | split_lines.append(f"{record['target']}\t{int(record['mode']):o}\t{record['part_dir']}") |
| 2044 | with zipfile.ZipFile(core_path, "w", compression=zipfile.ZIP_STORED, allowZip64=True) as zf: |
| 2045 | for entry in entries: |
| 2046 | if entry.get("core"): |
no test coverage detected