首页 » 技术分享 » 改手机为自动开机的车载导航仪

改手机为自动开机的车载导航仪

 

无意在外网发现一篇文章,具体发源地不可考。是说让手机通电自动开机的。正好有辆N年前的车子,没有导航。可怜啊!想换个吧~木有小钱钱,存钱买大房子重要!谁说汽车销量下滑和房价疯涨没关系的!
原文是这样的:
Auto boot (start or power on) android on charge
After some research and I don`t remember how many google pages and searches I found that you can achieve this function using:

  1. Enter Fastboot Mode (adb reboot bootloader)
  2. Enter Command: fastboot oem off-mode charge 0
  3. Enter Command: fastboot reboot
    if that is not working for you maybe this one will work:
  4. search in /system/bin/ for playlpm, ipod, lpm, kpoc_charger or any other file that have inside some reference to battery animation.
  5. edit that file, delete all content inside and add
    #!/system/bin/sh
    /system/bin/reboot
    if that is not working you can try this:
  6. Unpack boot.img and edit init.rc.
  7. Add following to the end of file:
    #Check if chargermode and start autoreboot service.
    on property:ro.bootmode=charger
    start autoreboot
    #autoreboot service which command reboot
    service autoreboot /su/bin/su /system/bin/reboot -c reboot now
    user root
    oneshot
  8. re-pack boot.img
    None of that worked for me but I had an idea. Why not just create that damn file inside /bin ???
  9. unpack boot.img
  10. edit > ramdisk > init.target.rc
  11. add start kpoc_charger to “on charger” line *** “kpoc_charger” can have any name be free to name it ***
  12. add after:
    service kpoc_charger /system/bin/kpoc_charger
    class charge
  13. create kpoc_charger file on root/system/bin/ with 755 permissions using any root file managers
  14. edit file and add:
    #!/system/bin/sh
    /system/bin/reboot
    Have fun and enjoy this.

For NEXUS and MOTOROLA PHONES

  1. enter FASTBOOT mode
  2. Connect phone to computer via USB
  3. Go to adb folder and then press SHIFT+RIGHT CLICK
  4. Select command prompt
  5. Enter “fastboot oem off-mode-charge 0”

To reverse it type “fastboot oem off-mode-charge 1”

Another method for ASUS:

  1. Unpack the kernel
  2. Open the init.qcom.rc file in the Notepad ++ ramdisk
  3. Look for and delete the lines:
service charger / charger 
class charger 
group log 
seclabel u: r: healthd: s0
  1. Instead of deleted lines we write the following lines:
on property: ro.bootmode = charger 
class_start sec-charger 
service playlpm / system / bin / reboot 
class sec-charger 
critical
  1. We pack the kernel.
  2. Install the kernel.

大概意思是说了四个方法:
1、在FASTBOOT里输入命令即可,我没测试。
2、把手机充电的动画删了,改成SHELL命令REBOOT。本人用了三星S3实际试了一把,可行!
3、是针对NEXUS和MOTOROLA的,和方法一类似,不过是模式0和1的区别。
4、是针对ASUS的。解压包,改造后打包刷入。

解决了手机的通电开机问题,剩下的就简单了,大致思路如下:

  1. 安装TASKER,安卓自动执行神器
  2. 安装横屏软件 ,一键关机软件, 安装导航软件
    3.做个脚本,在机子启动后事件SYSTEM START,启动横屏软件,启动导航软件。在USB断电 事件后,启动一键关机。启动关机前可以有个倒计时,比如五分钟。如果没有操作就关机,可以手动取消关机(TASKER可以添加按钮的,设置一个立即关机,一个取消关机),在USB通电事件后也能自动取消这个关机任务。这样就可以防止短时间熄火又要重启手机了。实测有个小毛病,关机任务被取消后,导航会切换到后台运行。懒得改了!
    从此我过上了有自动开关机导航的幸福生活~

转载自原文链接, 如需删除请联系管理员。

原文链接:改手机为自动开机的车载导航仪,转载请注明来源!

0