当前位置:   article > 正文

自制小米手机工具箱,分享一下源代码_settings put secure speed_mode_enable 1

settings put secure speed_mode_enable 1
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <stdlib.h>
  4. #include <conio.h>
  5. #include <string.h>
  6. void s1() {
  7. system("adb devices");
  8. }
  9. void s101() {
  10. system("adb kill-server");
  11. printf("ADB服务已停止,程序即将关闭,可重新打开程序\n\n");
  12. Sleep(2800);
  13. exit(0);
  14. }
  15. void s2() {
  16. printf("ADB执行重启");
  17. printf("\n");
  18. system("adb shell reboot \\\"dm-verity enforcing\\\"");
  19. system("adb reboot \"dm-verity enforcing\"");
  20. system("adb reboot");
  21. }
  22. void s102() {
  23. printf("FASTBOOT执行重启");
  24. printf("\n");
  25. system("fastboot reboot");
  26. }
  27. void s3() {
  28. system("adb shell pm enable com.miui.powerkeeper");
  29. system("adb shell pm install-existing --user 0 com.xiaomi.joyose");
  30. system("adb shell pm enable com.xiaomi.joyose");
  31. }
  32. void s103() {
  33. system("adb shell pm disable-user com.miui.powerkeeper");
  34. system("adb shell pm disable-user com.xiaomi.joyose");//关闭joyose
  35. system("adb shell pm uninstall --user 0 com.xiaomi.joyose");//卸载joyose
  36. }
  37. void s4() {
  38. system("adb shell pm disable-user com.xiaomi.joyose");
  39. system("adb shell pm uninstall --user 0 com.xiaomi.joyose");
  40. system("adb shell pm enable com.miui.powerkeeper");
  41. }
  42. void s104() {
  43. system("adb shell pm install-existing --user 0 com.xiaomi.joyose");
  44. system("adb shell pm enable com.xiaomi.joyose");
  45. system("adb shell pm disable-user com.miui.powerkeeper");
  46. }
  47. void s5() {
  48. system("adb shell pm uninstall --user 0 com.miui.systemAdSolution");
  49. system("adb shell pm uninstall --user 0 com.miui.hybrid");
  50. printf("\n如果提示FAILURE可能本身不存在或者已卸载\n\n");
  51. }
  52. void s105() {
  53. system("adb shell pm install-existing --user 0 com.miui.systemAdSolution");
  54. system("adb shell pm install-existing --user 0 com.miui.hybrid");
  55. system("adb shell pm enable com.miui.systemAdSolution");
  56. system("adb shell pm enable com.miui.hybrid");
  57. }
  58. void s6() {
  59. system("fastboot reboot fastboot");
  60. system("fastboot gsi wipe");
  61. system("fastboot reboot");
  62. }
  63. void s106() {
  64. system("cls");
  65. system("adb shell appops get com.miui.securitycenter");
  66. }
  67. void s7() {
  68. printf("若想解决骁龙平台DSU英文问题,复制以下这段话,然后按回车\n\n");
  69. printf("reboot \"dm-verity enforcing\"\n\n");
  70. system("adb shell");
  71. }
  72. void s107() {
  73. system("color ef");
  74. system("adb shell pm pm uninstall --user 0 com.android.dynsystem");
  75. system("cls");
  76. system("adb shell pm uninstall --user 0 com.android.emergency");
  77. system("adb shell appops set com.miui.securitycenter WRITE_SMS deny");
  78. system("adb shell appops set com.miui.securitycenter SEND_SMS deny");
  79. system("cls");
  80. system("color 0a");
  81. system("adb shell appops get com.miui.securitycenter");
  82. }
  83. void s8() {
  84. system("fastboot oem cdms");
  85. system("fastboot reboot");
  86. }
  87. void s9() {
  88. system("adb reboot bootloader");
  89. }
  90. void s109() {
  91. system("adb reboot fastboot");
  92. }
  93. void s10() {
  94. system("adb reboot recovery");
  95. }
  96. void s110() {
  97. printf("若想退出,请不要长按电源键,拔下数据线(也可充电)稍等片刻自动重启\n\n");
  98. system("adb reboot sideload");
  99. }
  100. void s11() {
  101. system("adb shell dumpsys battery set level 100");
  102. system("adb shell dumpsys battery set status 1");
  103. }
  104. void s111() {
  105. system("adb shell dumpsys battery reset");
  106. }
  107. void s12() {
  108. s103();
  109. s5();
  110. system("pause");
  111. s107();
  112. printf("优化成功,5秒后重启\n");
  113. Sleep(5000);
  114. s2();
  115. system("adb shell settings put Secure speed_mode_enable 1");
  116. }
  117. void s112() {
  118. system("cls");
  119. s3();
  120. s105();
  121. printf("恢复成功,5秒后重启\n");
  122. Sleep(5000);
  123. s2();
  124. system("adb shell settings put Secure speed_mode_enable 0");
  125. }
  126. void s13() {
  127. system("fastboot oem enable-charger-screen");
  128. system("fastboot oem off-mode-charge 1");
  129. system("fastboot oem poweroff");
  130. }
  131. void s113() {
  132. system("fastboot oem disable-charger-screen");
  133. system("fastboot oem off-mode-charge 0");
  134. system("fastboot oem poweroff");
  135. }
  136. void s14() {
  137. system("fastboot set_active other");
  138. printf("如果无限重启请再次进入FASTBOOT运行此选项\n\n");
  139. }
  140. void s114() {
  141. system("cls");
  142. printf("请复制这段网址,然后打开\n\n");
  143. printf("https://www.bilibili.com/read/cv27279331/\n\n");
  144. }
  145. void s15() {
  146. system("adb shell settings put Secure speed_mode_enable 1");
  147. }
  148. void s115() {
  149. system("adb shell settings put Secure speed_mode_enable 0");
  150. }
  151. void s16() {
  152. char a16[20];
  153. printf("只有澎湃系统才能卸载电量与性能,MIUI卸了会卡米!输入XiaomiHyperOS后方可确认\n");
  154. scanf("%s", &a16);
  155. if (strcmp(a16, "XiaomiHyperOS") == 0) {
  156. system("adb shell pm uninstall --user 0 com.miui.powerkeeper");
  157. } else {
  158. printf("输入错误\n\n");
  159. }
  160. }
  161. void s116() {
  162. system("adb shell pm install-existing --user 0 com.miui.powerkeeper");
  163. system("adb shell pm enable com.miui.powerkeeper");
  164. }
  165. int main(void) {
  166. printf("正在启动ADB服务...\n\n");
  167. system("adb start-server");
  168. system("cls");
  169. system("color 0a");
  170. while (1) {
  171. printf("<小米工具箱>\n\n");
  172. printf("1-检测ADB设备,101-停止服务并关闭程序\t");
  173. printf("2-ADB重启设备,102-FASTBOOT重启设备\n\n");
  174. printf("3-恢复默认设置(电量与性能和joyose全部解冻,最省电)\t");
  175. printf(" 103-电量与性能和joyose全部冻结(耗电快)\n");
  176. printf("4-只冻结joyose,但不冻结电量与性能\t");
  177. printf(" 104-只冻结电量与性能,不冻结joyose(全局高刷)\n");
  178. printf("5-卸载广告程序和快应用,105-重装\n\n");
  179. printf("6-清除DATA分区中的DSU安装程序(需要进FASTBOOT,无需解锁),其他品牌通用,常用于使用DSU Sideloader安第三方装损坏zip包导致卡\n logo且长按重启无效\t");
  180. printf(" 106-查看手机管家权限\n");
  181. printf("7-解决小米13,K60Pro不解锁安装DSU导致开机上方英文(按电源键进系统,使用USB调试)\n");
  182. printf(" 如果你想进入手动命令行也可以选择此项,107-禁用危险组件\n");
  183. printf("8-解决联发科(天玑1200之前会出现)不解锁安装DSU导致开机左侧英文(进FASTBOOT)\n\n");
  184. printf("9-进入FASTBOOT,109-进入FASTBOOTD\t");
  185. printf("10-进入Recovery,110-进入小米助手模式\n");
  186. printf("11-把电量改到满格,111-恢复电量\n");
  187. printf("12-系统极致优化并重启(一流的体验,耗电),112-全部恢复原样并重启(省电,不启用危险组件)\n");
  188. printf("13-启用关机充电(默认),113-禁用关机充电(插上自动开机)-需要进FASTBOOT,该项仅对小米MTK机型有效\n");
  189. printf("14-FASTBOOT切换AB分区(高通需解锁,MTK不用解锁),114-了解不同小米机型不解锁安装DSU的后果\n");
  190. printf("15-显示极致模式选项,115-隐藏极致模式选项(不一定有效,需打开USB调试-安全设置)\n");
  191. printf("16-澎湃系统卸载电量与性能(不卡米),116-重装电量与性能\n");
  192. int a = 0;
  193. printf("\n");
  194. printf("输入你想要的操作:");
  195. scanf("%d", &a);
  196. switch (a) {
  197. default:
  198. printf("输入有误\n\n");
  199. break;
  200. case 1:
  201. s1();
  202. break;
  203. case 101:
  204. s101();
  205. break;
  206. case 2:
  207. s2();
  208. break;
  209. case 102:
  210. s102();
  211. break;
  212. case 3:
  213. s3();
  214. break;
  215. case 103:
  216. s103();
  217. break;
  218. case 4:
  219. s4();
  220. break;
  221. case 104:
  222. s104();
  223. break;
  224. case 5:
  225. s5();
  226. break;
  227. case 105:
  228. s105();
  229. break;
  230. case 6:
  231. s6();
  232. break;
  233. case 106:
  234. s106();
  235. break;
  236. case 7:
  237. s7();
  238. break;
  239. case 107:
  240. s107();
  241. break;
  242. case 8:
  243. s8();
  244. break;
  245. case 9:
  246. s9();
  247. break;
  248. case 109:
  249. s109();
  250. break;
  251. case 10:
  252. s10();
  253. break;
  254. case 110:
  255. s110();
  256. break;
  257. case 11:
  258. s11();
  259. break;
  260. case 111:
  261. s111();
  262. break;
  263. case 12:
  264. s12();
  265. break;
  266. case 112:
  267. s112();
  268. break;
  269. case 13:
  270. s13();
  271. break;
  272. case 113:
  273. s113();
  274. break;
  275. case 14:
  276. s14();
  277. break;
  278. case 114:
  279. s114();
  280. break;
  281. case 15:
  282. s15();
  283. break;
  284. case 115:
  285. s115();
  286. break;
  287. case 16:
  288. s16();
  289. break;
  290. case 116:
  291. s116();
  292. break;
  293. }
  294. system("pause");
  295. system("cls");
  296. }
  297. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/466449
推荐阅读
相关标签
  

闽ICP备14008679号