MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / menu

Function menu

Scripts/Developer Base/Mobile Developer Setup.py:772–808  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

770 if update:
771 args.append("--upgrade")
772 args.append(package)
773
774 result = run_cmd(args, check=False)
775 if result.returncode == 0 and shutil.which(command):
776 action = "Updated" if update else "Installed"
777 SUMMARY.success(f"{action} Python developer tool {package}")
778 else:
779 SUMMARY.failure(f"Required Python developer tool failed: {package}")
780 all_ok = False
781 return all_ok
782
783# -----------------------------------------------------------------------------
784# Legacy DedSec Bash environment cleanup
785# -----------------------------------------------------------------------------
786
787
788def _looks_like_dedsec_ps1(line: str) -> bool:
789 stripped = line.lstrip()
790 return (
791 stripped.startswith("PS1=")
792 and r"\D{%d/%m/%Y}" in line
793 and r"\A" in line
794 and r"\W" in line
795 )
796
797
798
799def extract_dedsec_prompt_name(text: str) -> str:
800 """Extract the visible username from the DedSec Settings.py PS1, if present."""
801 for line in text.splitlines():
802 if not _looks_like_dedsec_ps1(line):
803 continue
804 match = re.search(r"1;34m\\\]([^\\'\n]+?)\\\[\\e\[0m", line)
805 if match:
806 return sanitize_prompt_name(match.group(1))
807 return ""
808
809
810def clean_dedsec_bash_environment() -> bool:
811 """Remove only shell hooks created by DedSec Settings.py.

Callers 1

mainFunction · 0.70

Calls 11

printFunction · 0.85
inputFunction · 0.85
ensure_dirsFunction · 0.70
headerFunction · 0.70
cFunction · 0.70
install_setupFunction · 0.70
run_updateFunction · 0.70
backup_onlyFunction · 0.70
restore_and_removeFunction · 0.70
uninstall_files_onlyFunction · 0.70
show_infoFunction · 0.70

Tested by

no test coverage detected