一键消失手机相册图片等文件,开发了一个安卓手机脚本执行器
开发了一个安卓 shell 脚本执行器 app 开发工具 android studio 编程语言 java 实现功能可以在里面填入任意语法正确可以运行的脚本然后可以根据这个脚本生成自定义的桌面的快捷方式 点击手机桌面方式就可以执行比如现在点击以下这个保存的脚本生成的桌面快捷方式 手机相册文件全部消失 打开相册没有图片 并且整理到指定目录 以前用的是 mt 管理器执行的 现在搞了一个独立的万能脚本执行器 #!/system/bin/sh
获取当前日期作为目录前缀,格式:YYYYMMDD
today=$(date +%Y%m%d)
定义目标根目录:隐藏主目录 + 固定中文子目录
root_hidden_dir=“/storage/emulated/0/.sjwj/xxxx 手机文件” target_base=”\(root_hidden_dir/\){today}xxxx 手机文件”
创建目标根目录
mkdir -p “$target_base”
1. 处理 Download 根目录下的普通文件
download_src=“/storage/emulated/0/Download” download_dst=”\(target_base/Download 根文件" if find "\)download_src” -maxdepth 1 -type f | grep -q .; then mkdir -p “\(download_dst" find "\)download_src” -maxdepth 1 -type f -exec mv -n {} “$download_dst/” \; fi
1.1 处理 DCIM 根目录下的普通文件
dcim_src=“/storage/emulated/0/DCIM” dcim_dst=”\(target_base/DCIM 根文件" if find "\)dcim_src” -maxdepth 1 -type f | grep -q .; then mkdir -p “\(dcim_dst" find "\)dcim_src” -maxdepth 1 -type f -exec mv -n {} “$dcim_dst/” \; fi
1.2 处理 Movies 根目录下的普通文件
movies_src=“/storage/emulated/0/Movies” movies_dst=”\(target_base/Movies 根文件" if find "\)movies_src” -maxdepth 1 -type f | grep -q .; then mkdir -p “\(movies_dst" find "\)movies_src” -maxdepth 1 -type f -exec mv -n {} “$movies_dst/” \; fi
1.3 处理 Pictures 根目录下的普通文件
pictures_src=“/storage/emulated/0/Pictures” pictures_dst=”\(target_base/Pictures 根文件" if find "\)pictures_src” -maxdepth 1 -type f | grep -q .; then mkdir -p “\(pictures_dst" find "\)pictures_src” -maxdepth 1 -type f -exec mv -n {} “$pictures_dst/” \; fi
2. 统一处理各类子目录,按上级目录归类排序(不含根目录)
for dir in
”/storage/emulated/0/Download/SearchCraft_DownloadedFiles”
”/storage/emulated/0/Download/WeiboMedia”
”/storage/emulated/0/Download/Nagram”
”/storage/emulated/0/Download/Browser”
”/storage/emulated/0/Download/WeiXin”
”/storage/emulated/0/Download/QQ”
”/storage/emulated/0/Download/coverdownload”
”/storage/emulated/0/Download/qrcodex”
”/storage/emulated/0/DCIM/DuiTang”
”/storage/emulated/0/DCIM/Camera”
”/storage/emulated/0/DCIM/Screenshots”
”/storage/emulated/0/DCIM/Screenshots2”
”/storage/emulated/0/DCIM/ScreenRecorder”
”/storage/emulated/0/DCIM/FANVideoRecorder”
”/storage/emulated/0/DCIM/FANPhotoShots”
”/storage/emulated/0/DCIM/FANPhoto”
”/storage/emulated/0/DCIM/QuickVideoRecorder”
”/storage/emulated/0/DCIM/Movies”
”/storage/emulated/0/DCIM/Pictures”
”/storage/emulated/0/DCIM/weibovideo”
”/storage/emulated/0/DCIM/com.cqcsy.ifvod”
”/storage/emulated/0/Pictures/Screenshots”
”/storage/emulated/0/Pictures/weibo”
”/storage/emulated/0/Pictures/news_article”
”/storage/emulated/0/Pictures/Collage”
”/storage/emulated/0/Pictures/baidu/searchbox/downloads”
”/storage/emulated/0/Pictures/JDImage”
”/storage/emulated/0/Pictures/Telegram”
”/storage/emulated/0/Pictures/Nagram”
”/storage/emulated/0/Pictures/bili”
”/storage/emulated/0/Pictures/WeiXin”
”/storage/emulated/0/Pictures/QQ”
”/storage/emulated/0/Pictures/100PINT”
”/storage/emulated/0/Pictures/wv_save_image”
”/storage/emulated/0/Pictures/知乎”
”/storage/emulated/0/Movies/Nagram”
”/storage/emulated/0/Movies/Telegram”
”/storage/emulated/0/Movies/QQ”
”/storage/emulated/0/baidu/searchbox/downloads”
do
if [ -d “\(dir" ] && find "\)dir” -mindepth 1 -type f | grep -q .; then
base=$(basename "$dir")
target="$target_base/$base"
mkdir -p "$target"
mv -n "$dir"/* "$target/" 2>/dev/null
fi done