标题: [其他] 安卓魔盒1.0版 [打印本页]
作者: happy886rr 时间: 2016-11-7 12:36 标题: 安卓魔盒1.0版
本帖最后由 happy886rr 于 2016-11-27 20:57 编辑
ANDROID魔盒
下载地址:点击进入下载
-----------------------------------------------------------------------------
这是一款cmd应用,完全用cmd脚本写就,但是却拥有应用软件的特性。采用
cmd胶水语言无缝拼接java语言、C语言、sh脚本、批处理脚本。 多语种协同
作业,性能优异,功能齐全,同时内置JAVA运行时。 支持ROM解打包、apk
反编译、回编译、odex、手机root 固件提取、apk安装、开机动画、 ROM优
化...等70多项分支功能。
由于我只有安卓4.0的手机,因此在涉及到安卓5.0、6.0的版本时, 通过视窗
模拟安卓高版本系统,结合谷歌提供的源码研发出了可行的作业方案。
针对不同手机型号,如有不兼容,请自行结合魔盒脚本以及android源码适配。
同时,该工具具备在windows系统下解打包linux磁盘文件系统, 签名UNIX
时间戳等功能。
-----------------------------------------------------------------------------
---------------------------------------------------
>>>细项优化
---------------------------------------------------
1.照相优化 2.录像优化 3.电量优化
4.触摸优化 5.滑动优化 6.定位加速
7.开启虚拟按键
8.去除虚拟按键
9.开启 GPU渲染
0.优化 jpg显示
-----------------------------------------------------------------------------
---------------------------------------------------
>>>ROM信息
---------------------------------------------------
ro.build.id (产品ID
ro.build.version.sdk (SDK版本 :)
ro.build.version.release (安卓版本 :)
ro.build.date (创建日期 :)
ro.product.model (产品型号 :)
ro.product.brand (品牌 :)
ro.product.name (设备名称 :)
ro.product.cpu.abi (CPU指令集 :)
ro.product.locale.language (语言 :)
ro.hardware (硬件 :)
ro.mediatek.platform (芯片型号 :)
dalvik.vm.heapstartsize (虚拟机初始:)
dalvik.vm.heapgrowthlimit (虚拟机增长:)
dalvik.vm.heapsize (虚拟机大小:)
ro.config.notification_sound (短信铃声 :)
ro.config.alarm_alert (闹钟铃声 :)
ro.config.ringtone (来电铃声 :)
ro.sf.lcd_density (屏幕DPI :)
ro.wifi.channels (WIFI信道 :)
ro.sf.gsensorposition (重力感应系:)
-----------------------------------------------------------------------------
---------------------------------------------------
ADB SHELL
---------------------------------------------------
01-设备列表 06-模拟终端 11-bug报告
02-进程列表 07-CPU参数 12-电量信息
03-磁盘分区 08-内存信息 13-电池信息
04-进程监视 09-手机串号 14-重启设备
05-分区信息 10-分区参数 15-recovery模式
-----------------------------------------------------------------------------
==================================
### XDA--odex化手机工具 ###
==================================
1-优化data 2-优化system
3-优化framework 4-优化bootstrap
5-全部优化 6-帮助
-----------------------------------------------------------------------------
==================================
### 打包ROM目录为 ###
==================================
1-标准zip格式(推荐)
2-img格式(ext4压缩)
3-dat格式
4-tar格式
5-sin格式
-----------------------------------------------------------------------------
==================================
### 集成工具 ###
==================================
1-ROM集成Root
2-ROM集成busybox
3-ROM集成init.d支持
4-ROM集成data支持
5-手机获取Root
6-手机安装busybox
7-手机添加init.d
8-手机添加V6优化脚本
-----------------------------------------------------------------------------
==================================
### 刷机脚本编写 ###
==================================
1-创建刷机脚本
2-在刷机脚本中添加busybox
3-在刷机脚本中添加su
4-在刷机脚本中添加boot.img
5-在刷机脚本中添加recovery.img
6-在刷机脚本中添加data
7-从recovery文件获取挂载路径
-----------------------------------------------------------------------------
┌──────—─———───—┐
丨 *Apk急速安装器* 丨
└────────———───—┘
-->正在安装
-----------------------------------------------------------------------------
┌───────────────┐
丨 Apktool使用说明 丨
└───────────────┘
=============Readme===============
1.需要Java环境;
2.路径不应含特殊符号;
3.系统级apk需framework-res.apk
-----------------------------------------------------------------------------
┌───────────────┐
丨SignApk使用说明 (需Java环境)丨
└───────────────┘
=============签名密钥=============
1 普通-testkey
2 系统-platform
3 shared
4 media
5 superuser
-----------------------------------------------------------------------------
┌───────────────┐
丨Boot.img,Recovery.img 解包工具丨
└───────────────┘
==================================
全机型内核解包(兼容MTK解包)
直接拖入批处理自动运行
智能判断操作类型:解包或打包
-----------------------------------------------------------------------------
┌───────────────┐
丨### Ultimate旗舰功能 ###丨(自动脚本)
├───────────────┤
丨 A. 7#─2#─51# 丨解包─合并odex─打包
丨 B. 7#─91#─92#─51# 丨解包─签名优化─打包
丨 C. 7#─3#─51# 丨解包─odex化─打包
└───────────────┘
-----------------------------------------------------------------------------
11/07/2016
核心代码:- @echo off&title
- ::开启变量延迟
- setlocal enabledelayedexpansion
- ::设置颜色
- color 0f
- ::安全保护
- if not exist "%~dp0Tools\" (exit)
- ::设置ROM路径
- set "ROMr=!CD!\ROM"
- ::设置工作路径
- PUSHD "%~dp0Tools"
- ::APK安装器
- if "%~x1"==".apk" (
- mode con cols=45 lines=11
- echo ┌──────—─————┐
- echo 丨 ^* Apk急速安装器 ^* 丨
- echo └────────————┘
- echo ---^>正在安装%~nx1
- adb install %1 >NUL && echo ---^>安装成功 || echo ---^>安装失败
- ping -n 2 127.0.0.1>NUL
- exit
- )
- ::设置窗体
- mode con cols=58 lines=38
- ::设置java环境变量
- :head
- if exist .\jre\EnableJre\ (
- set "JAVA_HOME=!CD!"
- set "PATH=!PATH!;!JAVA_HOME!\jre\bin"
- set "dif=内置"
- ) else (set "dif=系统")
- ::创建重要目录
- if not exist .\temp\ (md .\temp 1>NUL 2>NUL)
- if not exist !ROMr!\ (md !ROMr!)
- if not exist !ROMr!\ (md !ROMr!)
- ::操作标示
- for /l %%i in (0,1,9) do (
- set "be%%i= "
- set "ie%%i= "
- if %%i geq 2 if %%i leq 6 (set "ue%%i= ")
- )
-
-
- :main
- ::关闭自动脚本
- set NX=0
- cls
- echo ^>^>^>-----------------------------------------------------
- echo COPYRIGHT@2016~2018 BY HAPPY, VERSION 1.0
- echo --------------------------------------------------------
- echo ANDROID魔盒
- echo ┌────────┬────────┬────────┐
- echo 丨反编译工具 丨模拟终端 丨内核编辑 (K)丨
- echo 丨 ┌ApkTool2.0.3丨 A# Adb Shell 丨 K# Kernel 丨
- echo 丨1#丨ApkTool1.5 丨 丨 丨
- echo 丨 └ShakaApk 丨备份还原 丨签名工具 (S)丨
- echo 丨 丨 B# BackUp 丨 S# SignApk 丨
- echo 丨优化工具 丨 丨 丨
- echo 丨 2# 合并odex 丨清空目录 丨旗舰功能 (U)丨
- echo 丨 3# OdexROM 丨 C# Clean 丨 U# Ultimate 丨
- echo 丨 4# Odex手机 丨 ├────────┘
- echo 丨 丨集成工具 丨
- echo 丨ROM工具 丨 I# Integrate 丨
- echo 丨 5# ROM 打包 丨 丨
- echo 丨 6# ROM 提取 丨JAVA切换 丨
- echo 丨 7# ROM 解包 丨 J# Jre^(!dif!^) 丨
- echo 丨 8# 无损解包 ├────────┘
- echo 丨 9# ROM 优化 丨
- echo 丨 0# ROM 信息 丨
- echo 丨 00 刷机脚本 丨
- echo └────────┘
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- goto BOX!cho:#=!
- exit
-
-
- :BOX00
- cls
- echo.
- echo ====================================
- echo ### 刷机脚本编写 ###
- echo ====================================
- echo 1-创建刷机脚本
- echo 2-在刷机脚本中添加busybox !ue2!
- echo 3-在刷机脚本中添加su !ue3!
- echo 4-在刷机脚本中添加boot.img !ue4!
- echo 5-在刷机脚本中添加recovery.img !ue5!
- echo 6-在刷机脚本中添加data !ue6!
- echo 7-从recovery文件获取挂载路径
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- if "!cho!"=="1" (
- if "!ue1!"=="√" (goto BOX00)
- if exist !ROMr!\META-INF\com\google\android\updater-script (
- set /p choos=是否覆盖现有脚本,^(y,n^)?:
- if /i "!choos!"=="n" (goto BOX00)
- )
- 7z x .\META-INF.zip -o!ROMr!\
- notepad !ROMr!\META-INF\com\google\android\updater-script
- set "ue1=√"
- goto BOX00
- )
- if "!cho!"=="2" (
- if "!ue6!"=="√" (goto BOX00)
- if exist !ROMr!\data\ (
- echo 已经含有DATA目录
- pause>nul
- goto BOX00
- ) else (
- md !ROMr!\data\
- if exist !ROMr!\META-INF\com\google\android\updater-script (
- echo.>>!ROMr!\META-INF\com\google\android\updater-script
- echo ^#ROM集成data支持,请依照自己机型修改 >>!ROMr!\META-INF\com\google\android\updater-script
- echo format^("ext4或yaffs2或ubifs", "EMMC或MTD或UBI", "挂载路径", "0"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo mount^("ext4或yaffs2或ubifs", "EMMC或MTD或UBI", "挂载路径", "/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo package_extract_dir^("data", "/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo unmount^("/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo 请按照自己机型修改
- notepad !ROMr!\META-INF\com\google\android\updater-script
- set "ue6=√"
- ) else (
- echo ROM目录无刷机脚本
- pause>nul
- goto BOX00
- )
- )
- goto BOX00
- )
- if "!cho!"=="3" (
- 7z x .\META-INF.zip -o!ROMr!\
- notepad !ROMr!\META-INF\com\google\android\updater-script
- goto BOX00
- )
- if "!cho!"=="4" (
- if "!ue4!"=="√" (goto BOX00)
- if not exist !ROMr!\boot.img (
- echo ROM目录没有boot.img
- pause>nul
- goto BOX00
- )
- if exist !ROMr!\META-INF\com\google\android\updater-script (
- echo.>>!ROMr!\META-INF\com\google\android\updater-script
- ) else (
- echo.>!ROMr!\META-INF\com\google\android\updater-script
- )
- echo ^#添加刷写boot.img,请依照自己机型修改 >>!ROMr!\META-INF\com\google\android\updater-script
- echo write_raw_image^(package_extract_file^("boot.img"^), "boot"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- notepad !ROMr!\META-INF\com\google\android\updater-script
- set "ue4=√"
- goto BOX00
- )
- if "!cho!"=="5" (
- if "!ue5!"=="√" (goto BOX00)
- if not exist !ROMr!\recovery.img (
- echo ROM目录没有recovery.img
- pause>nul
- goto BOX00
- )
- if exist !ROMr!\META-INF\com\google\android\updater-script (
- echo.>>!ROMr!\META-INF\com\google\android\updater-script
- ) else (
- echo.>!ROMr!\META-INF\com\google\android\updater-script
- )
- echo ^#添加刷写recovery,请依照自己机型修改 >>!ROMr!\META-INF\com\google\android\updater-script
- echo write_raw_image^(package_extract_file^("recovery.img"^), "recovery"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- notepad !ROMr!\META-INF\com\google\android\updater-script
- set "ue5=√"
- goto BOX00
- )
- if "!cho!"=="6" (
- if "!ue6!"=="√" (goto BOX00)
- if exist !ROMr!\data\ (
- echo 已经含有DATA目录
- pause>nul
- goto BOX00
- ) else (
- md !ROMr!\data\
- if exist !ROMr!\META-INF\com\google\android\updater-script (
- echo.>>!ROMr!\META-INF\com\google\android\updater-script
- echo ^#ROM集成data支持,请依照自己机型修改 >>!ROMr!\META-INF\com\google\android\updater-script
- echo format^("ext4或yaffs2或ubifs", "EMMC或MTD或UBI", "挂载路径", "0"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo mount^("ext4或yaffs2或ubifs", "EMMC或MTD或UBI", "挂载路径", "/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo package_extract_dir^("data", "/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo unmount^("/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo 请按照自己机型修改
- notepad !ROMr!\META-INF\com\google\android\updater-script
- set "ue6=√"
- ) else (
- echo ROM目录无刷机脚本
- pause>nul
- goto BOX00
- )
- )
- goto BOX00
- )
- if "!cho!"=="7" (
- 7z x .\META-INF.zip -o!ROMr!\
- notepad !ROMr!\META-INF\com\google\android\updater-script
- goto BOX00
- )
- goto BOX00!cho!
- exit
- pause>nul
- goto main
-
-
- :BOX0
- cls
- if not exist "!ROMr!\system\build.prop" (
- if exist "!ROMr!\*.zip" (
- 7z e !ROMr!\*.zip -r system\build.prop -o!ROMr!\ -y 1>NUL 2>NUL
- set BP="!ROMr!\build.prop"
- )
- if not exist "!ROMr!\build.prop" (
- echo 没有发现build.prop文件
- pause>nul
- goto main
- )
- ) else (
- set BP="!ROMr!\system\build.prop"
- )
- echo --------------ROM信息---------------
- for /f "tokens=1,2 delims==" %%a in ('find /v "#" ^<!BP!') do (
- if "%%a"=="ro.build.id" (echo 产品ID^:%%b)
- if "%%a"=="ro.build.version.sdk" (echo SDK版本^:%%b)
- if "%%a"=="ro.build.version.release" (echo 安卓版本^:%%b)
- if "%%a"=="ro.build.date" (echo 创建日期^:%%b)
- if "%%a"=="ro.product.model" (echo 产品型号^:%%b)
- if "%%a"=="ro.product.brand" (echo 品牌^:%%b)
- if "%%a"=="ro.product.name" (echo 设备名称^:%%b)
- if "%%a"=="ro.product.cpu.abi" (echo CPU指令集^:%%b)
- if "%%a"=="ro.product.locale.language" (echo 语言^:%%b)
- if "%%a"=="ro.hardware" (echo 硬件^:%%b)
- if "%%a"=="ro.mediatek.platform" (echo 芯片型号^:%%b)
- if "%%a"=="dalvik.vm.heapstartsize" (echo 虚拟机初始^:%%b)
- if "%%a"=="dalvik.vm.heapgrowthlimit" (echo 虚拟机增长^:%%b)
- if "%%a"=="dalvik.vm.heapsize" (echo 虚拟机大小^:%%b)
- if "%%a"=="ro.config.notification_sound" (echo 短信铃声^:%%b)
- if "%%a"=="ro.config.alarm_alert" (echo 闹钟铃声^:%%b)
- if "%%a"=="ro.config.ringtone" (echo 来电铃声^:%%b)
- if "%%a"=="ro.sf.lcd_density" (echo 屏幕DPI^:%%b)
- if "%%a"=="ro.wifi.channels" (echo WIFI信道^:%%b)
- if "%%a"=="ro.sf.gsensorposition" (echo 重力感应系^:%%b)
- )
- echo ------------------------------------
- echo 返回
- del /f /q !ROMr!\build.prop 1>NUL 2>NUL
- pause>nul
- goto main
-
-
- :BOX1
- start .\Apktool\
- goto main
-
-
- :BOX2
- cls
- if not exist !ROMr!\system\ (
- md !ROMr! 1>NUL 2>NUL
- echo.
- echo ====================================
- echo 没有找到system文件夹
- echo.
- echo 请将system文件夹复制到ROM目录
- echo ====================================
- pause>NUL
- exit
- )
- if not exist !ROMr!\system\framework\*.jar (
- echo.
- echo ====================================
- echo 没有系统framework框架
- echo ====================================
- pause>NUL
- goto main
- )
- rd .\temp\out /q /s 1>NUL 2>NUL
- del .\temp\classes.dex /q 1>NUL 2>NUL
- cls
- echo.
- echo ====================================
- echo ### odex合并工具 ###
- echo ====================================
- ::设置framework目录
- set FR=!ROMr!\system\framework
- ::设置app目录
- set APP=!ROMr!\system\app
- ::判断架构arm、arm64、x86
- if exist !FR!\arm\boot.oat (
- set CPUF=arm
- if exist "!FR!\oat\" (goto BOX2a) else (goto BOX2b)
- )
- if exist !FR!\arm64\boot.oat (
- set CPUF=arm64
- if exist "!FR!\oat\" (goto BOX2a) else (goto BOX2b)
- )
- if exist !FR!\x86\boot.oat (
- set CPUF=x86
- if exist "!FR!\oat\" (goto BOX2a) else (goto BOX2b)
- )
- echo ----------正在合并系统apk-----------
- for %%a in ("!APP!\*.odex") do (
- set er=0
- echo 合并%%~nxa
- java -jar baksmali.jar -d !FR! -o .\temp\out -x %%a >NUL || set er=1
- java -Xmx512M -jar smali.jar .\temp\out -o .\temp\classes.dex >NUL || set er=1
- rd .\temp\out /q /s
- 7z a !APP!\%%~na.apk .\temp\classes.dex >NUL || set er=1
- del .\temp\classes.dex /q
- if !er! equ 0 (del %%a /q & echo ----- 成功 -----) else (echo ----- 失败 -----)
- echo.
- )
- echo ----------正在合并系统框架----------
- for %%a in ("!FR!\*.odex") do (
- set er=0
- echo 合并%%~nxa
- java -jar baksmali.jar -d !FR! -o .\temp\out -x %%a >NUL || set er=1
- java -Xmx512M -jar smali.jar .\temp\out -o .\temp\classes.dex>NUL || set er=1
- rd .\temp\out /q /s
- 7z a !FR!\%%~na.jar .\temp\classes.dex>NUL || set er=1
- del .\temp\classes.dex /q
- if !er! equ 0 (del %%a /q & echo ----- 成功 -----) else (echo ----- 失败 -----)
- echo.
- )
- echo ------------合并odex结束------------
- if !NX! equ 1 (goto :EOF)
- pause>NUL
- goto main
- ::
- BOX2a
- ::设置boot-class目录
- set BC=!FR!\!CPUF!\odex
- echo ===================================
- echo 正在分解boot.oat
- echo ===================================
- echo 请稍等...
- java -Xmx512M -jar oat2dex.jar -o !FR!\ boot !FR!\!CPUF!\boot.oat 1>nul 2>nul
- echo ----------正在合并app目录----------
- for /f %%a in ('dir /b !APP!') do (
- echo 合并app下%%~na
- if exist "!APP!\%%a\oat\!CPUF!\%%~na.odex" (
- java -Xmx512M -jar oat2dex.jar -o !APP!\%%a\ !APP!\%%a\oat\!CPUF!\%%~na.odex !BC!\ 1>nul 2>nul
- ren !APP!\%%a\%%~na.dex classes.dex
- 7z a !APP!\%%a\%%~na.apk !APP!\%%a\classes.dex 1>nul 2>nul
- del /f /q !APP!\%%a\classes.dex 1>nul 2>nul
- rd /q /s !APP!\%%a\oat 1>nul 2>nul
- )
- )
- ::设置priv-app目录
- set APP=!ROM!\system\priv-app
- echo -------正在合并priv-app目录--------
- for /f %%a in ('dir /b !APP!') do (
- echo 合并priv-app下%%~na
- if exist "!APP!\%%a\oat\!CPUF!\%%~na.odex" (
- java -Xmx512M -jar oat2dex.jar -o !APP!\%%a\ !APP!\%%a\oat\!CPUF!\%%~na.odex !BC!\ 1>nul 2>nul
- ren !APP!\%%a\%%~na.dex classes.dex
- 7z a !APP!\%%a\%%~na.apk !APP!\%%a\classes.dex 1>nul 2>nul
- del /f /q !APP!\%%a\classes.dex 1>nul 2>nul
- rd /q /s !APP!\%%a\oat 1>nul 2>nul
- )
- )
- echo ---------正在合并次要框架----------
- for %%a in ("!FR!\oat\!CPUF!\*.odex") do (
- echo 合并%%~nxa
- java -Xmx512M -jar oat2dex.jar -o !FR!\ %%a !BC!\ 1>nul 2>nul
- rename !FR!\%%~na.dex classes.dex
- 7z a !FR!\%%~na.jar !FR!\classes.dex 1>nul 2>nul
- del /f /q !FR!\classes.dex
- )
- echo ---------正在合并核心框架----------
- for %%a in ("!FR!\*.dex") do (
- echo 合并%%~nxa
- if not "%%~nxa"=="framework-classes2.dex" (
- ren %%a classes.dex
- 7z a !FR!\%%~na.jar !FR!\classes.dex 1>nul 2>nul
- del /f /q !FR!\classes.dex
- ) else (
- ren %%a classes2.dex
- 7z a !FR!\framework.jar !FR!\classes2.dex 1>nul 2>nul
- del !FR!\classes2.dex
- )
- )
- echo ===================================
- echo 正在清理oat目录
- echo ===================================
- echo 请稍等...
- rd /q /s !FR!\oat
- rd /q /s !FR!\!CPUF!
- pause>NUL
- goto main
- ::
- BOX2b
- echo ----------正在合并app目录----------
- for /f %%a in ('dir /b !APP!') do (
- echo 合并app下%%~na
- if exist "!APP!\%%a\!CPUF!\%%~na.odex" (
- java -Xmx512M -jar oat2dex.jar -o !APP!\%%a\ !APP!\%%a\!CPUF!\%%~na.odex !BC!\ 1>nul 2>nul
- ren !APP!\%%a\%%~na.dex classes.dex
- 7z a !APP!\%%a\%%~na.apk !APP!\%%a\classes.dex 1>nul 2>nul
- del /f /q !APP!\%%a\classes.dex 1>nul 2>nul
- rd /q /s !APP!\%%a\!CPUF! 1>nul 2>nul
- )
- )
- ::设置priv-app目录
- set APP=!ROM!\system\priv-app
- echo -------正在合并priv-app目录--------
- for /f %%a in ('dir /b !APP!') do (
- echo 合并priv-app下%%~na
- if exist "!APP!\%%a\!CPUF!\%%~na.odex" (
- java -Xmx512M -jar oat2dex.jar -o !APP!\%%a\ !APP!\%%a\!CPUF!\%%~na.odex !BC!\ 1>nul 2>nul
- ren !APP!\%%a\%%~na.dex classes.dex
- 7z a !APP!\%%a\%%~na.apk !APP!\%%a\classes.dex 1>nul 2>nul
- del /f /q !APP!\%%a\classes.dex 1>nul 2>nul
- rd /q /s !APP!\%%a\!CPUF! 1>nul 2>nul
- )
- )
- echo ---------正在合并次要框架----------
- for %%a in ("!FR!\!CPUF!\*.odex") do (
- echo 合并%%~nxa
- java -Xmx512M -jar oat2dex.jar -o !FR!\ %%a !BC!\ 1>nul 2>nul
- ren !FR!\%%~na.dex classes.dex
- 7z a !FR!\%%~na.jar !FR!\classes.dex 1>nul 2>nul
- del /f /q !FR!\classes.dex
- )
- echo ---------正在合并核心框架----------
- for %%a in ("!FR!\*.dex") do (
- echo 合并%%~nxa
- ren %%a classes.dex
- 7z a !FR!\%%~na.jar !FR!\classes.dex 1>nul 2>nul
- del !FR!\classes.dex
- )
- echo ===================================
- echo 正在清理oat目录
- echo ===================================
- echo 请稍等...
- rd /q /s !FR!\!CPUF!
- pause>NUL
- goto main
-
-
- :BOX3
- cls
- if not exist !ROMr!\system\ (
- md !ROMr! 1>NUL 2>NUL
- echo.
- echo ====================================
- echo 没有找到system文件夹
- echo.
- echo 请将system文件夹复制到ROM目录
- echo ====================================
- pause>NUL
- exit
- )
- if exist !ROMr!\system\app\*.odex (
- echo.
- echo ====================================
- echo 似乎有被odex优化的迹象
- echo.
- echo ====================================
- pause>NUL
- goto main
- )
- echo ====================================
- echo 1.开启USB调试模式;
- echo.
- echo 2.手机须root且允许adb连接
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device && echo 成功连接设备|| echo 无法连接设备 && pause>NUL && goto main
- adb push .\dexopt-wrapper /data/local/tmp/dexopt-wrapper 1>NUL 2>NUL
- adb shell chmod 0755 /data/local/tmp/dexopt-wrapper 1>NUL 2>NUL
- cls
- echo.
- echo ====================================
- echo ### odex化ROM工具 ###
- echo ====================================
- echo ----------正在优化系统apk-----------
- rd "!ROMr!\system\framework" /q /s 1>NUL 2>NUL
- for %%a in ("!ROMr!\system\app\*.apk") do (
- echo.
- echo odex化%%~nxa
- if exist !ROMr!\system\app\%%~na.odex (echo 已odex化,跳过) else (
- set er=0
- adb push %%a /data/local/tmp/ 1>NUL 2>NUL
- adb shell /data/local/tmp/dexopt-wrapper /data/local/tmp/%%~nxa /data/local/tmp/%%~na.odex 1>NUL 2>NUL
- adb shell rm /data/local/tmp/%%~nxa 1>NUL 2>NUL
- adb pull /data/local/tmp/%%~na.odex !ROMr!\system\app 1>NUL 2>NUL || set er=1
- adb shell rm /data/local/tmp/%%~na.odex 1>NUL 2>NUL
- if !er! equ 0 (7z d %%a classes.dex -r >nul & echo ----- 成功 -----) else (echo ----- 失败 -----)
- )
- )
- echo ----------正在提取系统框架-----------
- md "!ROMr!\system\framework"
- adb pull /system/framework !ROMr!\system\framework 1>NUL 2>NUL || echo 提取framework失败 && pause>NUL
- adb shell rm /data/local/tmp/dexopt-wrapper 1>NUL 2>NUL
- adb shell exit
- echo ------------odex化ROM结束------------
- if !NX! equ 1 (goto :EOF)
- pause>NUL
- goto main
-
-
- :BOX4
- cls
- echo ====================================
- echo 1.开启USB调试模式;
- echo.
- echo 2.手机须root且允许adb连接;
- echo.
- echo 3.暂不支持安卓4.4以上.
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device && echo 成功连接设备|| echo 无法连接设备 && pause>NUL && goto main
- echo 安装dexo到设备...
- adb push .\tools.zip /data/local/tmp/
- adb push .\busybox /data/local/tmp/
- adb shell "su -c 'chmod 0755 /data/local/tmp/tools.zip'"
- adb shell "su -c 'chmod 0755 /data/local/tmp/busybox'"
- adb shell "su -c 'mount -o remount -o rw /system'"
- adb shell "su -c '/data/local/tmp/busybox cp /data/local/tmp/tools.zip /system/bin/tools.zip'"
- adb shell "su -c '/data/local/tmp/busybox unzip -o /data/local/tmp/tools.zip -d /system/'"
- echo 正在设置权限...
- adb shell "su -c 'chmod 0777 /system/bin/dexo'"
- adb shell "su -c 'chmod 0777 /system/bin/dexopt-wrapper'"
- adb shell "su -c 'chmod 0777 /system/xbin/zip'"
- adb shell "su -c 'chmod 0777 /system/xbin/zipalign'"
- :BOX4main
- cls
- echo.
- echo ====================================
- echo ### XDA--odex化手机工具 ###
- echo ====================================
- echo 1-优化data 2-优化system
- echo 3-优化framework 4-优化bootstrap
- echo 5-全部优化 6-帮助
- echo.
- set "cho="
- set /p cho=请选择:
- cls
- if "!cho!"=="" (goto main)
- if /i "!cho!"=="1" (set cm=dat & goto BOX4main1)
- if /i "!cho!"=="2" (set cm=sys & goto BOX4main1)
- if /i "!cho!"=="3" (set cm=fr & goto BOX4main1)
- if /i "!cho!"=="4" (set cm=bs & goto BOX4main1)
- if /i "!cho!"=="5" (set cm=all & goto BOX4main1)
- if /i "!cho!"=="6" (set cm=h & goto BOX4main1)
- echo 选择错误,请重新选择
- pause>NUL
- goto BOX4main
- :BOX4main1
- adb shell "su -c 'dexo -!cm!'" && if !cho! lss 6 (echo 正在重启设备... & adb reboot & goto BOX4main)
- pause>NUL
- goto BOX4main
-
-
- :BOX5
- cls
- echo.
- echo ====================================
- echo ### 打包ROM目录为 ###
- echo ====================================
- echo 1-标准zip格式^(推荐^)
- echo 2-img格式^(ext4压缩^)
- echo 3-dat格式
- echo 4-tar格式
- echo 5-sin格式
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- goto BOX5!cho!
- exit
- ::
- :BOX51
- cls
- if exist .\temp\temp.zip (del .\temp\temp.zip)
- if not exist !ROMr!\META-INF\com\google\android\updater-script (
- echo.
- echo ------------------------------------
- echo ROM目录无刷机脚本,采取通用脚本?
- echo ------------------------------------
- echo 1.采取通用脚本
- echo 2.退出
- echo.
- set "cho="
- set /p cho=请选择:
- if /i "!cho!"=="1" (
- 7z x .\META-INF.zip -o!ROMr!\
- notepad !ROMr!\META-INF\com\google\android\updater-script
- goto BOX51
- )
- exit
- )
- echo.
- echo ------------------------------------
- echo ^* 打包为zip格式 ^*
- echo ------------------------------------
- 7z a -tzip .\temp\temp.zip !ROMr!\*
- echo.
- echo 签名中...
- java -jar signapk.jar -w -v testkey.x509.pem testkey.pk8 .\temp\temp.zip !ROMr!.zip 2>NUL && del .\temp\temp.zip && echo ------------打包ROM成功------------- || echo ------------打包ROM失败-------------
- if !NX! equ 1 (goto :EOF)
- pause>NUL
- goto main
- ::
- :BOX52
- cls
- if exist !ROMr!\system\ (
- echo.
- echo ------------------------------------
- echo ^* 打包为img格式^(ext4压缩^) ^*
- echo ------------------------------------
- echo 备注:安卓4.3以上需file_contexts
- echo.
- if exist !ROMr!\extra.inf (
- for /f "tokens=1,2 delims=:" %%a in ('find ":" ^<!ROMr!\extra.inf') do (
- if "%%a"=="Block count" (set /a blc=%%b)
- if "%%a"=="Block size" (set /a blz=%%b)
- )
- set /a size=!blc!*!blz!
- del /f /q !ROMr!\extra.inf 1>NUL 2>NUL
- ) else (
- echo EXT4分区大小M^(单位: 兆^)
- echo EXT4分区大小 ^(单位:字节^)
- set /p size=请输入:
- )
- if "!size!"=="" (
- echo EXT4分区大小不能为空
- pause>nul
- exit
- )
- if exist !ROMr!\file_contexts (set "FCS=-S !ROMr!\file_contexts") else (set "FCS=")
- make_ext4fs -a system -l !size! !FCS! -s !ROMr!\system.img !ROMr!\system\
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- echo 完毕!
- pause>NUL
- )
- goto main
- ::
- :BOX53
- cls
- if exist !ROMr!\system\ (
- echo.
- echo ------------------------------------
- echo ^* 打包为dat格式 ^*
- echo ------------------------------------
- echo 备注:安卓4.3以上需file_contexts
- echo.
- if exist !ROMr!\extra.inf (
- for /f "tokens=1,2 delims=:" %%a in ('find ":" ^<!ROMr!\extra.inf') do (
- if "%%a"=="Block count" (set /a blc=%%b)
- if "%%a"=="Block size" (set /a blz=%%b)
- )
- set /a size=!blc!*!blz!
- del /f /q !ROMr!\extra.inf 1>NUL 2>NUL
- ) else (
- echo EXT4分区大小M^(单位: 兆^)
- echo EXT4分区大小 ^(单位:字节^)
- set /p size=请输入:
- )
- if "!size!"=="" (
- echo EXT4分区大小不能为空
- pause>nul
- exit
- )
- if exist !ROMr!\file_contexts (set "FCS=-S !ROMr!\file_contexts") else (set "FCS=" & echo 警告:没有file_contexts文件)
- make_ext4fs -a system -l !size! !FCS! !ROMr!\system.new.img !ROMr!\system\
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- CD !ROMr!\
- %~dp0tools\rimg2sdat.exe .\system.new.img
- del .\system.new.img /f /q 1>NUL 2>NUL
- echo.>.\system.patch.dat
- echo 完毕!
- CD %~dp0tools\
- pause>NUL
- )
- goto main
- ::
- :BOX54
- cls
- if exist !ROMr!\system\ (
- echo.
- echo ------------------------------------
- echo ^* 打包为tar格式 ^*
- echo ------------------------------------
- echo 备注:该功能不予提供!
- pause>NUL
- )
- goto main
- ::
- :BOX55
- cls
- if exist !ROMr!\system\ (
- echo.
- echo ------------------------------------
- echo ^* 打包为sin格式 ^*
- echo ------------------------------------
- echo 备注:该功能不予提供!
- pause>NUL
- )
- goto main
-
-
- :BOX6
- cls
- if exist !ROMr!\system\ (
- echo 请先清空ROM目录
- pause>NUL
- goto main
- )
- echo.
- echo ====================================
- echo 请连接手机USB调试模式;
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device && echo 成功连接设备|| echo 无法连接设备 && pause>NUL && goto main
- cls
- echo.
- echo ====================================
- echo 正在从手机提取ROM...
- echo ====================================
- md !ROMr!\system
- adb pull /system/ !ROMr!\system || echo 提取ROM失败 && pause>NUL
- if !NX! equ 1 (goto :EOF)
- goto main
-
-
- :BOX7
- cls
- echo.
- echo ====================================
- echo Imgextra快速解包
- echo ====================================
- echo 部分软链文件打包为zip包时会失效
- echo.
- for %%a in ("!ROMr!\*.*") do (
- if "%%~xa"==".zip" (
- cls
- echo ------------正在解包ROM-------------
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- 7z x %%a -o!ROMr!\ -y 1>NUL 2>NUL
- echo 解包完毕
- del /f /q %%a 1>NUL 2>NUL
- )
- if %%~za gtr 13000000 (
- if "%%~xa"==".img" (
- cls
- echo ------------正在解包img-------------
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- Imgextractor %%a !ROMr!\system 1>NUL 2>NUL
- if exist !ROMr!\system\app\*.apk (
- Imgextractor %%a -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q %%a 1>NUL 2>NUL
- ) else (echo 无法解包)
- )
- )
- if "%%~xa"==".sin" (
- cls
- echo ------------正在解包sin-------------
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- Imgextractor %%a !ROMr!\system 1>NUL 2>NUL
- if exist !ROMr!\system\app\*.apk (
- Imgextractor %%a -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q %%a 1>NUL 2>NUL
- ) else (echo 无法解包)
- )
- )
- if exist "!ROMr!\system.new.dat" (
- cls
- echo ------------正在解包dat-------------
- if not exist "!ROMr!\system.transfer.list" (echo 没有 system.transfer.list)
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- sdat2img !ROMr!\system.transfer.list !ROMr!\system.new.dat .\temp\system.new.img 1>NUL 2>NUL
- Imgextractor .\temp\system.new.img !ROMr!\system
- if exist !ROMr!\system\app\*.apk (
- Imgextractor .\temp\system.new.img -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q !ROMr!\system.new.dat 1>NUL 2>NUL
- del /f /q !ROMr!\system.transfer.list 1>NUL 2>NUL
- ) else (echo 无法解包)
- del /f /q .\temp\system.new.img 1>NUL 2>NUL
- )
- if !NX! equ 1 (goto :EOF)
- if not exist "!ROMr!\system\app\*.apk" (
- echo 发成错误!!!
- pause>nul
- goto main
- )
- goto BOX0
-
-
- :BOX8
- cls
- echo.
- echo ====================================
- echo True无损解包
- echo ====================================
- echo 能无损解包软链文件,但解包时间漫长
- echo.
- for %%a in ("!ROMr!\*.*") do (
- if "%%~xa"==".zip" (
- cls
- echo ------------正在解包zip-------------
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- 7z x %%a -o!ROMr!\ -y 1>NUL 2>NUL
- del /f /q %%a 1>NUL 2>NUL
- )
- if %%~za gtr 13000000 (
- if "%%~xa"==".img" (
- cls
- echo ------------正在解包img-------------
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- 7z x %%a -o!ROMr!\system 1>NUL 2>NUL
- if exist !ROMr!\system\app\*.apk (
- Imgextractor %%a -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q %%a 1>NUL 2>NUL
- ) else (
- Imgextractor %%a .\temp\system.ext4 -conv 1>NUL 2>NUL
- 7z x .\temp\system.ext4 -o!ROMr!\system 1>NUL 2>NUL
- if exist !ROMr!\system\app\*.apk (
- Imgextractor %%a -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q %%a 1>NUL 2>NUL
- ) else (echo 无法解包)
- del /f /q .\temp\system.ext4 1>NUL 2>NUL
- )
- rd /q /s !ROMr!\system\[SYS] 1>NUL 2>NUL
- )
- )
- if "%%~xa"==".sin" (
- cls
- echo ------------正在解包sin-------------
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- Imgextractor %%a .\temp\system.ext4 -conv 1>NUL 2>NUL
- 7z x .\temp\system.ext4 -o!ROMr!\system 1>NUL 2>NUL
- if exist !ROMr!\system\app\*.apk (
- Imgextractor %%a -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q %%a 1>NUL 2>NUL
- ) else (echo 无法解包)
- del /f /q .\temp\system.ext4 1>NUL 2>NUL
- rd /q /s !ROMr!\system\[SYS] 1>NUL 2>NUL
- )
- )
- if exist "!ROMr!\system.new.dat" (
- cls
- echo ------------正在解包dat-------------
- if not exist "!ROMr!\system.transfer.list" (echo 没有 system.transfer.list)
- rd !ROMr!\system /q /s 1>NUL 2>NUL
- sdat2img !ROMr!\system.transfer.list !ROMr!\system.new.dat .\temp\system.new.img 1>NUL 2>NUL
- 7z x .\temp\system.new.img -o!ROMr!\system\ 1>NUL 2>NUL
- if exist !ROMr!\system\app\*.apk (
- Imgextractor .\temp\system.new.img -s >!ROMr!\extra.inf
- echo 解包成功
- del /f /q !ROMr!\system.new.dat 1>NUL 2>NUL
- del /f /q !ROMr!\system.transfer.list 1>NUL 2>NUL
- ) else (echo 无法解包)
- del /f /q .\temp\system.new.img 1>NUL 2>NUL
- rd /q /s !ROMr!\system\[SYS] 1>NUL 2>NUL
- )
- if !NX! equ 1 (goto :EOF)
- if not exist "!ROMr!\system\app\*.apk" (
- echo 发成错误!!!
- pause>nul
- goto main
- )
- goto BOX0
-
-
- :BOX9
- if not exist "!ROMr!\system\build.prop" (
- echo ROM目录残缺
- pause>nul
- exit
- )
- cls
- echo.
- echo ====================================
- echo ### ROM优化工具 ###
- echo ====================================
- echo 1-签名ROM目录app
- echo 2-zipalign化ROM目录
- echo 3-更换字体
- echo 4-更换开机动画
- echo 5-细项优化
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- goto BOX9!cho!
- exit
- ::
- :BOX91
- cls
- if exist "!ROMr!\data\app\" (
- echo.
- echo ------------------------------------
- echo ^>^>^>遍签data\app目录
- echo ------------------------------------
- for %%a in ("!ROMr!\data\app\*.apk") do (
- ren %%a pre_%%~nxa
- java -jar signapk.jar -w -v testkey.x509.pem testkey.pk8 "!ROMr!\data\app\pre_%%~nxa" "!ROMr!\data\app\%%~nxa" 1>NUL 2>NUL && echo -成功- %%~nxa || echo -失败- %%~nxa
- del "!ROMr!\data\app\pre_%%~nxa"
- )
- )
- if exist !ROMr!\system\app\ (
- echo.
- echo ------------------------------------
- echo ^>^>^>遍签system\app目录
- echo ------------------------------------
- for %%a in ("!ROMr!\system\app\*.apk") do (
- ren %%a pre_%%~nxa
- java -jar signapk.jar -w -v platform.x509.pem platform.pk8 "!ROMr!\system\app\pre_%%~nxa" "!ROMr!\system\app\%%~nxa" 1>NUL 2>NUL && echo -成功- %%~nxa || echo -失败- %%~nxa
- del "!ROMr!\system\app\pre_%%~nxa"
- )
- )
- echo.
- echo 签名完毕!
- echo ------------------------------------
- if !NX! equ 1 (goto :EOF)
- pause>nul
- goto BOX9
- ::
- :BOX92
- cls
- if exist "!ROMr!\data\app\" (
- echo.
- echo ------------------------------------
- echo ^>^>^>zipalign化data\app目录
- echo ------------------------------------
- for %%a in ("!ROMr!\data\app\*.apk") do (
- ren %%a pre_%%~nxa
- zipalign -v 4 "!ROMr!\data\app\pre_%%~nxa" "!ROMr!\data\app\%%~nxa" 1>NUL 2>NUL && echo -成功- %%~nxa || echo -失败- %%~nxa
- del "!ROMr!\data\app\pre_%%~nxa"
- )
- )
- if exist !ROMr!\system\app\ (
- echo.
- echo ------------------------------------
- echo ^>^>^>zipalign化system\app目录
- echo ------------------------------------
- for %%a in ("!ROMr!\system\app\*.apk") do (
- ren %%a pre_%%~nxa
- zipalign -v 4 "!ROMr!\system\app\pre_%%~nxa" "!ROMr!\system\app\%%~nxa" 1>NUL 2>NUL && echo -成功- %%~nxa || echo -失败- %%~nxa
- del "!ROMr!\system\app\pre_%%~nxa"
- )
- )
- if exist !ROMr!\system\framework\ (
- echo.
- echo ------------------------------------
- echo ^>^>^>zipalign化system\framework目录
- echo ------------------------------------
- for %%a in ("!ROMr!\system\framework\*.apk") do (
- ren %%a pre_%%~nxa
- zipalign -v 4 "!ROMr!\system\framework\pre_%%~nxa" "!ROMr!\system\framework\%%~nxa" 1>NUL 2>NUL && echo -成功- %%~nxa || echo -失败- %%~nxa
- del "!ROMr!\system\framework\pre_%%~nxa"
- )
- )
- echo.
- echo zipalign优化结束!
- echo ------------------------------------
- if !NX! equ 1 (goto :EOF)
- pause>nul
- goto BOX9
- ::
- :BOX93
- cls
- if not exist "!ROMr!\system\fonts\" (
- echo ROM目录残缺
- pause>nul
- exit
- )
- echo.
- echo ------------------------------------
- echo ^>^>^>替换ROM字体^(仅支持ttf格式^)
- echo ------------------------------------
- set /p Cttf=拖入中文字体:
- if "!Cttf!"=="" (goto BOX9) else (copy !Cttf! !ROMr!\system\fonts\DroidSansFallback.ttf)
- set /p Ettf=拖入英文字体:
- if "!Ettf!"=="" (goto BOX9) else (copy !Ettf! !ROMr!\system\fonts\Roboto-Regular.ttf)
- echo 完成!
- pause>nul
- goto BOX9
-
-
- ::
- :BOX94
- cls
- if not exist "!ROMr!\system\media\" (
- echo ROM目录残缺
- pause>nul
- exit
- )
- echo.
- echo ------------------------------------
- echo ^>^>^>更换开机动画^(仅支持zip格式^)
- echo ------------------------------------
- echo 1.使用框架动画 2.使用彩色Android
- echo 3.自定义 4.禁用开机动画
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto BOX9)
- if "!cho!"=="1" (del /f /q !ROMr!\system\media\bootanimation.zip)
- if "!cho!"=="2" (copy .\bootanimation.zip !ROMr!\system\media\)
- if "!cho!"=="3" (
- md .\temp\bootanimation 1>NUL 2>NUL
- md .\temp\bootanimation\part0 1>NUL 2>NUL
- md .\temp\bootanimation\part1 1>NUL 2>NUL
- start .\temp\bootanimation\
- echo ------------------------------------
- echo 说明:^(将图片复制到对应目录^)
- echo part0目录循环播放;
- echo part1目录播放一次
- echo ------------------------------------
- set /p witha=动画宽度:
- set /p heiga=动画高度:
- set /p fps=播放帧率:
- echo !witha! !heiga! !fps!>.\temp\bootanimation\desc.txt
- echo p 1 0 part1>>.\temp\bootanimation\desc.txt
- echo p 0 0 part0>>.\temp\bootanimation\desc.txt
- echo 正在压制...
- 7z a -mx0 -tzip .\temp\bootanimation.zip .\temp\bootanimation\* 1>NUL 2>NUL
- echo 正在替换...
- move .\temp\bootanimation.zip !ROMr!\system\media\
- rd .\temp\bootanimation /q /s 1>NUL 2>NUL
- )
- if "!cho!"=="4" (echo debug.sf.nobootanimation=1 >>!ROMr!\system\build.prop)
- echo 完成!
- pause>nul
- goto BOX9
-
-
- ::
- :BOX95
- cls
- echo.
- echo ------------------------------------
- echo ^>^>^>细项优化
- echo ------------------------------------
- echo 1.照相优化!be1! 2.录像优化!be2! 3.电量优化!be3!
- echo 4.触摸优化!be4! 5.滑动优化!be5! 6.定位加速!be6!
- echo 7.开启虚拟按键!be7!
- echo 8.去除虚拟按键!be8!
- echo 9.开启 GPU渲染!be9!
- echo 0.优化 jpg显示!be0!
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto BOX9)
- if "!cho!"=="1" (
- if "!be1!"=="√" (goto BOX95)
- echo ro.media.dec.jpeg.memcap=8000000 >>!ROMr!\system\build.prop
- echo ro.media.enc.hprof.vid.bps=8000000 >>!ROMr!\system\build.prop
- set "be1=√"
- )
- if "!cho!"=="2" (
- if "!be2!"=="√" (goto BOX95)
- echo ro.media.capture.maxres=8m >>!ROMr!\system\build.prop
- echo ro.media.capture.fast.fps=4 >>!ROMr!\system\build.prop
- echo ro.media.capture.slow.fps=120 >>!ROMr!\system\build.prop
- echo ro.media.panorama.defres=3264x1840 >>!ROMr!\system\build.prop
- echo ro.media.panorama.frameres=1280x720 >>!ROMr!\system\build.prop
- echo ro.camcorder.videoModes=true >>!ROMr!\system\build.prop
- set "be2=√"
- )
- if "!cho!"=="3" (
- if "!be3!"=="√" (goto BOX95)
- echo wifi.supplicant_scan_interval=180 >>!ROMr!\system\build.prop
- echo pm.sleep_mode=1 >>!ROMr!\system\build.prop
- echo ro.ril.disable.power.collapse=0 >>!ROMr!\system\build.prop
- set "be3=√"
- )
- if "!cho!"=="4" (
- if "!be4!"=="√" (goto BOX95)
- echo debug.performance.tuning=1 >>!ROMr!\system\build.prop
- echo video.accelerate.hw=1 >>!ROMr!\system\build.prop
- set "be4=√"
- )
- if "!cho!"=="5" (
- if "!be5!"=="√" (goto BOX95)
- echo windowsmgr.max_events_per_sec=150 >>!ROMr!\system\build.prop
- set "be5=√"
- )
- if "!cho!"=="6" (
- if "!be6!"=="√" (goto BOX95)
- copy .\gps.conf !ROMr!\system\etc\
- set "be6=√"
- )
- if "!cho!"=="7" (
- if "!be7!"=="√" (goto BOX95)
- echo qemu.hw.mainkeys=0 >>!ROMr!\system\build.prop
- set "be7=√"
- )
- if "!cho!"=="8" (
- if "!be8!"=="√" (goto BOX95)
- echo qemu.hw.mainkeys=1 >>!ROMr!\system\build.prop
- set "be8=√"
- )
- if "!cho!"=="9" (
- if "!be9!"=="√" (goto BOX95)
- echo debug.sf.hw=1 >>!ROMr!\system\build.prop
- set "be9=√"
- )
- if "!cho!"=="0" (
- if "!be0!"=="√" (goto BOX95)
- echo ro.media.enc.jpeg.quality=100 >>!ROMr!\system\build.prop
- set "be0=√"
- )
- goto BOX95
-
-
- :BOXA
- cls
- echo.
- echo ====================================
- echo 请连接手机USB调试模式;
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device 1>NUL 2>NUL
- :ADB
- cls
- echo ADB常用命令
- echo ___________________________________________________
- echo 01-设备列表 06-模拟终端 11-bug报告
- echo 02-进程列表 07-CPU参数 12-电量信息
- echo 03-磁盘分区 08-内存信息 13^*电池信息
- echo 04^*进程监视 09-手机串号 14-重启设备
- echo 05-分区信息 10-分区参数 15-recovery模式
- echo ___________________________________________________
- echo.
- set "choadb="
- set /p choadb=-^>选择:
- cls
- if "!choadb!"=="" (goto main)
- if "!choadb:0=!"=="1" (adb devices)
- if "!choadb:0=!"=="2" (adb shell ps)
- if "!choadb:0=!"=="3" (adb shell df)
- if "!choadb:0=!"=="4" (start cmd /k adb shell top -m 10)
- if "!choadb:0=!"=="5" (adb shell "su -c 'cat /proc/partitions'")
- if "!choadb:0=!"=="6" (start cmd /k adb shell)
- if "!choadb:0=!"=="7" (adb shell cat /proc/cpuinfo)
- if "!choadb:0=!"=="8" (adb shell dumpsys meminfo)
- if "!choadb:0=!"=="9" (adb shell dumpsys iphonesubinfo)
- if "!choadb!"=="10" (adb shell "su -c 'cat /proc/dumchar_info'")
- if "!choadb!"=="11" (adb bugreport)
- if "!choadb!"=="12" (adb shell dumpsys battery)
- if "!choadb!"=="13" (start cmd /k adb shell "su -c 'cat /proc/kmsg|/data/local/tmp/busybox grep "batt"'")
- if "!choadb!"=="14" (adb reboot)
- if "!choadb!"=="15" (adb reboot recovery)
- echo 返回
- pause>NUL
- goto ADB
-
-
- :BOXB
- cls
- echo.
- echo ====================================
- echo 请连接手机USB调试模式;
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device 1>NUL 2>NUL
- :BOXBT
- cls
- echo.
- echo ====================================
- echo ### 备份还原手机数据 ###
- echo ====================================
- echo 1.备份数据 2.备份设置
- echo *.拖入还原
- echo.
- set "cho="
- set /p cho=-^>:
- if "!cho!"=="" (goto main)
- if "!cho:~-3!"==".ab" (
- cls
- echo.
- echo ====================================
- echo 1.请关注你的手机屏幕
- echo.
- echo 2.触摸“相应位置”
- echo ====================================
- adb restore !cho! 1>NUL 2>NUL
- goto BOXBT
- )
- del .\temp\backup.ab 1>NUL 2>NUL
- if "!cho!"=="1" (
- set dat=!date:~0,10!
- set dat=!dat:/=-!
- set timeh=!time:~0,2!
- set timem=!time:~3,2!
- set times=!time:~6,2!
- set dtm=Date!dat!Time!timeh!°!timem!′!times!″
- cls
- echo.
- echo ====================================
- echo 1.请关注你的手机屏幕
- echo.
- echo 2.触摸“相应位置”
- echo.
- echo ^(仅限备份allowbackup="true"的应用^)
- echo ====================================
- adb backup -apk -noshared -nosystem -all -f ".\temp\backup.ab" 1>NUL 2>NUL
- move .\temp\backup.ab ..\App!dtm!.ab 1>NUL 2>NUL && echo 备份成功 || echo 备份失败
- del .\temp\backup.ab 1>NUL 2>NUL
- pause>nul
- goto BOXBT
- )
- if "!cho!"=="2" (
- set dat=!date:~0,10!
- set dat=!dat:/=-!
- set timeh=!time:~0,2!
- set timem=!time:~3,2!
- set times=!time:~6,2!
- set dtm=Date!dat!Time!timeh!°!timem!′!times!″
- cls
- echo.
- echo ====================================
- echo 1.请关注你的手机屏幕
- echo.
- echo 2.触摸“相应位置”
- echo ====================================
- adb backup -noapk -noshared -nosystem -all -f backup.ab 1>NUL 2>NUL
- move .\temp\backup.ab ..\Settings!dtm!.ab 1>NUL 2>NUL && echo 备份成功 || echo 备份失败
- del .\temp\backup.ab 1>NUL 2>NUL
- pause>nul
- goto BOXBT
- )
- goto BOXBT
-
-
- :BOXC
- echo 正在清空目录请稍等...
- rd .\Apktool /q /s
- rd .\Kernel /q /s
- rd .\SignApk /q /s
- rd .\temp /q /s
- 7z x .\Shadow.zip -o.\ 1>NUL 2>NUL
- rd !ROMr! /q /s
- md !ROMr!
- goto main
-
-
- :BOXI
- cls
- echo.
- echo ====================================
- echo ### 集成工具 ###
- echo ====================================
- echo 1-ROM集成Root !ie1!
- echo 2-ROM集成busybox !ie2!
- echo 3-ROM集成init.d支持 !ie3!
- echo 4-ROM集成data支持 !ie4!
- echo 5-手机获取Root
- echo 6-手机安装busybox
- echo 7-手机添加init.d
- echo 8-手机添加V6优化脚本
- echo.
- set "cho="
- set /p cho=请选择:
- echo.
- if "!cho!"=="" (goto main)
- goto BOXI!cho!
- exit
- ::
- :BOXI1
- if "!ie1!"=="√" (goto BOXI)
- if exist !ROMr!\system\bin\ (
- copy .\su !ROMr!\system\bin\su
- copy .\SuperSU.apk !ROMr!\system\app\SuperSU.apk
- del !ROMr!\system\app\SuperSU.odex 1>nul 2>nul
- set "ie1=√"
- ) else (
- echo ROM目录残缺
- pause>nul
- )
- if !NX! equ 1 (goto :EOF)
- goto BOXI
- ::
- :BOXI2
- if "!ie2!"=="√" (goto BOXI)
- if exist !ROMr!\system\xbin\ (
- copy .\busybox !ROMr!\system\xbin\busybox
- set "ie2=√"
- ) else (
- echo ROM目录残缺
- pause>nul
- )
- if !NX! equ 1 (goto :EOF)
- goto BOXI
- ::
- :BOXI3
- if "!ie3!"=="√" (goto BOXI)
- if exist !ROMr!\system\etc\ (
- if exist !ROMr!\system\etc\init.d (
- echo 已经含有INIT.D目录
- pause>nul
- goto BOXI
- ) else (
- if exist !ROMr!\system\etc\install-recovery.sh (
- echo #^^!/system/bin/sh>>!ROMr!\system\etc\install-recovery.sh
- ) else (
- echo #^^!/system/bin/sh>!ROMr!\system\etc\install-recovery.sh
- )
- echo # init.d support>>!ROMr!\system\etc\install-recovery.sh
- echo busybox run-parts /system/etc/init.d>>!ROMr!\system\etc\install-recovery.sh
- md !ROMr!\system\etc\init.d
- copy .\busybox !ROMr!\system\xbin\busybox
- set "ie3=√"
- )
- ) else (
- echo ROM目录残缺
- pause>nul
- )
- if !NX! equ 1 (goto :EOF)
- goto BOXI
- ::
- :BOXI4
- if "!ie4!"=="√" (goto BOXI)
- if exist !ROMr!\data\ (
- echo 已经含有DATA目录
- pause>nul
- goto BOXI
- ) else (
- md !ROMr!\data\
- if exist !ROMr!\META-INF\com\google\android\updater-script (
- echo.>>!ROMr!\META-INF\com\google\android\updater-script
- echo ^#ROM集成data支持,请依照自己机型修改 >>!ROMr!\META-INF\com\google\android\updater-script
- echo format^("ext4或yaffs2或ubifs", "EMMC或MTD或UBI", "挂载路径", "0"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo mount^("ext4或yaffs2或ubifs", "EMMC或MTD或UBI", "挂载路径", "/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo package_extract_dir^("data", "/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo unmount^("/data"^)^; >>!ROMr!\META-INF\com\google\android\updater-script
- echo 请按照自己机型修改
- notepad !ROMr!\META-INF\com\google\android\updater-script
- set "ie4=√"
- ) else (
- echo ROM目录无刷机脚本
- pause>nul
- goto BOXI
- )
- )
- if !NX! equ 1 (goto :EOF)
- goto BOXI
- ::
- :BOXI5
- cls
- echo.
- echo ====================================
- echo 手机开启USB调试自动连接;
- echo ====================================
- echo 正在连接设备...
- adb kill-server
- adb wait-for-device
- adb push su /data/local/tmp/.
- adb restore fakebackup.ab
- cls
- echo.
- echo ====================================
- echo 1.请关注你的手机屏幕
- echo.
- echo 2.点击“恢复我的数据”
- echo ====================================
- setlocal disabledelayedexpansion
- adb shell "while ! ln -s /data/local.prop /data/data/com.android.settings/a/file99; do :; done" > NUL
- setlocal enabledelayedexpansion
- echo 重新启动...
- adb reboot
- ping -n 50 127.0.0.1>NUL
- echo 写入su ...
- adb shell "mount -o remount,rw /system"
- adb shell "dd if=/data/local/tmp/su of=/system/bin/su"
- adb shell "chmod 06755 /system/bin/su"
- adb install -r SuperSU.apk
- adb shell "rm /data/local.prop"
- adb shell "rm -r /data/data/com.android.settings/a"
- adb shell "sync;sync;sync;"
- echo 再次重启...
- adb reboot
- echo 请查看Root权限
- pause>NUL
- goto BOXI
- ::
- :BOXI6
- cls
- echo.
- echo ====================================
- echo 1.开启USB调试模式;
- echo.
- echo 2.手机须root且允许adb连接
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device 1>NUL 2>NUL
- adb push .\busybox /mnt/sdcard/busybox
- adb shell "su -c 'mount -o remount,rw /system'"
- adb shell "su -c 'dd if=/mnt/sdcard/busybox of=/system/xbin/busybox'"
- adb shell "su -c 'chmod 0755 /system/xbin/busybox'"
- adb shell "su -c 'busybox --install -s /system/xbin'"
- echo 命令执行完毕.
- pause>NUL
- goto BOXI
- ::
- :BOXI7
- cls
- echo.
- echo ====================================
- echo 1.开启USB调试模式;
- echo.
- echo 2.手机须root且允许adb连接;
- echo.
- echo 3.手机须有busybox
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device 1>NUL 2>NUL
- adb push .\term-init.sh /sdcard/term-init.sh
- adb shell "su -c 'sh /sdcard/term-init.sh'"
- pause>NUL
- goto BOXI
- ::
- :BOXI8
- cls
- echo.
- echo ====================================
- echo 1.开启USB调试模式;
- echo.
- echo 2.手机须root且允许adb连接;
- echo.
- echo 3.手机须busybox和init.d支持
- echo ====================================
- echo 正在连接设备...
- adb kill-server 1>NUL 2>NUL
- adb wait-for-device 1>NUL 2>NUL
- adb push .\V6_SuperCharger.sh /sdcard/V6_SuperCharger.sh
- adb shell "su -c 'sh /sdcard/V6_SuperCharger.sh'"
- echo 命令执行完毕.
- pause>NUL
- goto BOXI
-
-
- :BOXJ
- cls
- echo.
- echo ====================================
- echo ### Java运行时设置 ###
- echo ====================================
- echo 1.启用内置Jre 2.启用系统Jre
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- if "!cho!"=="1" (
- if exist .\jre\ (
- if exist .\jre\EnableJre\ (goto main)
- md .\jre\EnableJre 1>NUL 2>NUL
- ) else (
- echo 没有内置JRE
- pause>NUL
- )
- )
- if "!cho!"=="2" (rd .\jre\EnableJre 1>NUL 2>NUL)
- goto head
-
-
- :BOXK
- cls
- echo.
- echo ====================================
- echo ### Kernel内核编辑工具 ###
- echo ====================================
- echo 1-编辑boot.img
- echo 2-编辑recovery.img
- echo 3-快捷编辑
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- if "!cho!"=="1" (
- if exist !ROMr!\boot.img (
- echo ------------------------------------
- echo 正在解包boot.img...
- CALL .\Kernel\Edit_Krenel.bat !ROMr!\boot.img 1>NUL 2>NUL
- pushd "%~dp0tools"
- if exist .\Kernel\boot\rmdisk\default.prop (
- start .\Kernel\boot\
- notepad .\Kernel\boot\rmdisk\default.prop
- echo 正在打包boot.img...
- CALL .\Kernel\Edit_Krenel.bat boot 1>NUL 2>NUL
- pushd "%~dp0tools"
- if exist .\Kernel\new_boot.img (
- move .\Kernel\new_boot.img !ROMr!\boot.img
- )
- rd .\Kernel\boot /q /s 1>NUL 2>NUL
- ) else (echo 无法正确解包!)
- echo ------------------------------------
- ) else (
- echo ROM目录没有boot.img
- )
- echo 请返回
- pause>nul
- goto BOXK
- )
- if "!cho!"=="2" (
- if exist !ROMr!\recovery.img (
- echo ------------------------------------
- echo 正在解包recovery.img...
- CALL .\Kernel\Edit_Krenel.bat !ROMr!\recovery.img 1>NUL 2>NUL
- pushd "%~dp0tools"
- if exist .\Kernel\recovery\rmdisk\init.rc (
- start .\Kernel\recovery\
- notepad .\Kernel\recovery\rmdisk\init.rc
- echo 正在打包recovery.img...
- CALL .\Kernel\Edit_Krenel.bat recovery 1>NUL 2>NUL
- pushd "%~dp0tools"
- if exist .\Kernel\new_recovery.img (
- move .\Kernel\new_recovery.img !ROMr!\recovery.img
- )
- rd .\Kernel\recovery /q /s 1>NUL 2>NUL
- ) else (echo 无法正确解包!)
- echo ------------------------------------
- ) else (
- echo ROM目录没有recovery.img
- )
- echo 请返回
- pause>nul
- goto BOXK
- )
- if "!cho!"=="3" (start .\Kernel\)
- goto BOXK
-
-
- :BOXS
- start .\SignApk\
- goto main
-
-
- :BOXU
- ::打开自动脚本
- set NX=1
- cls
- echo.
- echo ┌───────────────┐
- echo 丨### Ultimate旗舰功能 ###丨^(全自动脚本^)
- echo ├───────────────┤
- echo 丨 A. 7#─2#─51# 丨解包─合并odex─打包
- echo 丨 B. 7#─91#─92#─51# 丨解包─签名优化─打包
- echo 丨 C. 7#─3#─51# 丨解包─odex化─打包
- echo └───────────────┘
- echo.
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="" (goto main)
- goto BOXU!cho!
- exit
- ::
- :BOXUA
- cls
- echo ┌───────────────┐
- echo 丨 AutoScript 7#─2#─51# 丨
- echo └───────────────┘
- CALL :BOX7
- CALL :BOX2
- CALL :BOX51
- pause>nul
- goto main
- ::
- :BOXUB
- cls
- echo ┌───────────────┐
- echo 丨 AutoScript 7#─91#─92#─51#丨
- echo └───────────────┘
- CALL :BOX7
- CALL :BOX91
- CALL :BOX92
- CALL :BOX51
- pause>nul
- goto main
- ::
- :BOXUC
- cls
- echo ┌───────────────┐
- echo 丨 AutoScript 7#─3#─51# 丨
- echo └───────────────┘
- CALL :BOX7
- CALL :BOX3
- CALL :BOX51
- pause>nul
- goto main
复制代码
作者: codegay 时间: 2016-11-7 17:42
视窗模拟。。作业方案。。。你是台湾的啊?
作者: 523066680 时间: 2016-11-7 18:03
回复 2# codegay
如果台湾估计会统一用繁体吧
作者: happy886rr 时间: 2016-11-7 18:43
本帖最后由 happy886rr 于 2016-11-7 19:03 编辑
回复 2# codegay
视窗代指微软的图形操作系统,话说微软和苹果也是抄袭施乐的图形界面。比尔盖茨只有命令行的思维,乔布斯也不是搞编程的,所以今天的窗体界面都有一个共同的祖师爷施乐。要知道那是上世纪70年代,真正的dos时代,我也很遗憾没能出生在那个时代,直接被视窗和谐了。
这些窗体思维都基于整学的运算。比如:
1+3+5=9
1+3+5+7=16
1+3+5+7+9=25
这是计算机快速画圆的基石,也是批处理快速计算一个数的平方根的基石,同时也是其他图形变换的数学本质。
最后你会发现,操作系统、应用程序、脚本其实只在做一件事,那就是在算数。
作者: SJDB-BayMAX 时间: 2016-11-12 11:53
佩服!希望继续努力
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |