欢迎加入 iFLYTEK-BOOM群聊:766720774
此教程针对科大讯飞学习机X1 Pro,X2 Pro,X3 Pro,T10等机型(零售版本)
使用本脚本前请打开学习机USB调试功能
已编译版本请划至页面底部下载
首先引入os,init两个模块
import os
from colorama import init
init(autoreset=True)
第二步,调用cmd获取"adb devices"的返回值,并将设备连接状态赋值为0
adb_devices=os.popen('adb devices').read()
adb_devices=adb_devices.strip("List of devices attached")
devices="device"
status=0
第三步,通过if语句判断设备是否连接,若设备未连接,则通过pnputil添加adb驱动;若设备已连接,则对设备连接状态重新赋值
if devices not in adb_devices:
print('\033[37;41m未连接\033[0m')
print("请检查USB调试是否开启以及电脑驱动")
mks2=input("是否继续安装驱动?Y/N(默认Y):")
if mks2!="N" and mks2!="n":
adbserverstatus=os.popen('cd ./adbdriver&&pnputil -i -a *.inf').read()
if "已成功添加驱动程序程序包" in adbserverstatus:
print('\033[30;42m驱动安装成功,请重启本应用\033[0m')
else:
print(adbserverstatus)
print('\033[37;41m安装失败,请检查后重试\033[0m')
else:
pass
else:
print('\033[30;42m已连接\033[0m')
status=1
第四步,通过if语句判断设备连接状态,若设备已连接,则调用adb命令安装冰箱与安装狮
if status == 1:
mks=input("设备已连接,是否继续安装应用?Y/N(默认Y):")
if mks!="N" and mks!="n":
result1=os.popen('adb install ./icebox.apk').read()
result2=os.popen('adb install ./alion.apk').read()
if "Success" in result1 and "Success" in result2:
print('\033[30;42m安装成功\033[0m')
elif "Success" not in result1 and "Success" in result2:
print(result1)
print('\033[37;41m冰箱(icebox.apk)安装失败,请检查后重试\033[0m')
elif "Success" in result1 and "Success" not in result2:
print(result2)
print('\033[37;41m安装狮(alion.apk)安装失败,请检查后重试\033[0m')
else:
print(result1,result2)
print('\033[37;41m安装失败,请检查后重试\033[0m')
第五步,通过if语句判断应用是否安装成功,若安装成功,则调用adb shell激活冰箱管理员权限,若多次激活失败,则调用官方激活程序(请选择激活设备管理员模式)
if "Success" in result1 and "Success" in result2:
print('\033[30;42m安装成功\033[0m')
mks1=input("是否激活冰箱管理员?Y/N(默认Y):")
if mks1!="N" and mks1!="n":
result3=os.popen('adb shell dpm set-device-owner com.catchingnow.icebox/.receiver.DPMReceiver').read()
if "Success" in result3:
print(result3)
print('\033[30;42m激活成功\033[0m')
else:
print(result3)
print('\033[37;41m激活失败,请检查后重试\033[0m')
mks3=input("若多次激活失败,可尝试使用冰箱激活器(请使用激活设备管理员模式),是否继续?Y/N(默认Y):")
if mks3!="N" and mks3!="n":
os.system('ice-open')
else:
pass
最后,通过pause指令使窗口常驻,以显示运行结果
os.system('pause')
完整代码如下
import os
from colorama import init
init(autoreset=True)
adb_devices=os.popen('adb devices').read()
adb_devices=adb_devices.strip("List of devices attached")
devices="device"
status=0
if devices not in a:
print('\033[37;41m未连接\033[0m')
print("请检查USB调试是否开启以及电脑驱动")
mks2=input("是否继续安装驱动?Y/N(默认Y):")
if mks2!="N" and mks2!="n":
adbserverstatus=os.popen('cd ./adbdriver&&pnputil -i -a *.inf').read()
if "已成功添加驱动程序程序包" in adbserverstatus:
print('\033[30;42m驱动安装成功,请重启本应用\033[0m')
else:
print(adbserverstatus)
print('\033[37;41m安装失败,请检查后重试\033[0m')
else:
pass
else:
print('\033[30;42m已连接\033[0m')
status=1
if status == 1:
mks=input("设备已连接,是否继续安装应用?Y/N(默认Y):")
if mks!="N" and mks!="n":
result1=os.popen('adb install ./icebox.apk').read()
result2=os.popen('adb install ./alion.apk').read()
if "Success" in result1 and "Success" in result2:
print('\033[30;42m安装成功\033[0m')
mks1=input("是否激活冰箱管理员?Y/N(默认Y):")
if mks1!="N" and mks1!="n":
result3=os.popen('adb shell dpm set-device-owner com.catchingnow.icebox/.receiver.DPMReceiver').read()
if "Success" in result3:
print(result3)
print('\033[30;42m激活成功\033[0m')
else:
print(result3)
print('\033[37;41m激活失败,请检查后重试\033[0m')
mks3=input("若多次激活失败,可尝试使用冰箱激活器(请使用激活设备管理员模式),是否继续?Y/N(默认Y):")
if mks3!="N" and mks3!="n":
os.system('ice-open')
else:
pass
elif "Success" not in result1 and "Success" in result2:
print(result1)
print('\033[37;41m冰箱(icebox.apk)安装失败,请检查后重试\033[0m')
elif "Success" in result1 and "Success" not in result2:
print(result2)
print('\033[37;41m安装狮(alion.apk)安装失败,请检查后重试\033[0m')
else:
print(result1,result2)
print('\033[37;41m安装失败,请检查后重试\033[0m')
print("感谢你的使用,脚本作者:whhhhh,欢迎访问我的blog:https://whhhh.top")
os.system('start https://whhhh.top')
os.system('pause')
已编译版本如下,可使用“点我运行.exe”运行脚本(使用前请全部解压)
auto-break破解py脚本 下载
文章评论