恩山无线论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
小博无线
查看: 707|回复: 3

rush精简固件添加自定义app开机启动方法记录

[复制链接]
发表于 2019-1-14 17:36 | 显示全部楼层 |阅读模式
本帖最后由 拉侧旋 于 2019-1-15 17:30 编辑

T1刷了rush后,烦人的斐X讯启动界面终于没了,但是一些软件不能开机自启了
折腾了一翻,记录一下
①用winscp登陆盒子,ip可以在上级路由器看
用户名 root
密码 rush
端口2223

②命令→打开终端
输入
mount -o remount,rw /system
此条命令用于挂载读写,不然后面修改不能保存

③下载apktool,反编译安装的apk文件,获取完整目录
因为下面要用am start -n打开apk,这里的apk目录要反编译获取
下载到apktool后,解压,把要反编译的apk改名为1.apk,放到apktool目录
在这个目录下cmd(就是windows的命令提示符)执行
aapt dump badging 1.apk >1.txt

这时会生成一个1.txt文件,可以获取到目录
比如我的超级直播1.4.4精简版是这样的
package: name='com.hd.zhibo' versionCode='892' versionName='1.4.4'
uses-permission:'android.permission.INTERNET'
uses-permission:'android.permission.GET_TASKS'
uses-permission:'android.permission.READ_LOGS'
uses-permission:'android.permission.ACCESS_WIFI_STATE'
uses-permission:'android.permission.ACCESS_NETWORK_STATE'
uses-permission:'android.permission.ACCESS_COARSE_LOCATION'
uses-permission:'android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission:'android.permission.MOUNT_UNMOUNT_FILESYSTEMS'
uses-permission:'android.permission.KILL_BACKGROUND_PROCESSES'
sdkVersion:'14'
targetSdkVersion:'18'
application: label='自定义电视' icon='res/drawable-mdpi/ic_launcher.png'
launchable activity name='com.zhibo.media.channel_main'label='' icon=''
uses-feature:'android.hardware.location'
uses-feature:'android.hardware.location.network'
uses-feature:'android.hardware.wifi'
uses-feature:'android.hardware.touchscreen'
main
other-receivers
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--'
densities: '120' '160' '240' '320' '65535'
native-code: 'armeabi-v7a'


获取到两个目录

④winscp定位到/system/bin
打开lazy-start.sh,添加下面的命令
#开机自启
sleep 10
am start -n com.hd.zhibo/com.zhibo.media.channel_main


上面这个sleep10,是我自己试出来 的,如果不加,有时不能打开,开了后试了10多次了正常
下面是我的T1的完整的lazy-start.sh

#!/system/bin/sh
#权限功能
/system/xbin/supolicy --live "permissive init;permissive kernel;permissive shell;permissive toolbox;permissive priv_app;permissive untrusted_app;"

#开启网卡
sleep 2
/system/bin/ip link set eth0 up

#ssh功能
/system/xbin/dropbear &

#nfs-Server
/system/bin/portmap
/system/bin/unfsd

#nfs-client
/system/bin/sh /system/etc/nfs_mounts.sh

#开机自启
sleep 10
am start -n com.hd.zhibo/com.zhibo.media.channel_main

#fail-safe功能
#如果60秒内没有进入桌面,启动有线网卡并设置固定ip
sleep 60
ISBOOTOK=`getprop sys.boot_completed`
if [ $ISBOOTOK -ne 1 ];then
        /system/bin/ip link set eth0 up
        /system/bin/ip addr add 192.168.2.56/24 broadcast 192.168.2.255 dev eth0
        /system/xbin/busybox telnetd -p 2323 -l /system/bin/sh
fi


exit 0




我的恩山、我的无线 The best wifi forum is right here.
发表于 2019-2-3 11:50 | 显示全部楼层
我是通过把一些软件转为系统应用然后开启应用内得自启比如 airpin和adguard
我的恩山、我的无线 The best wifi forum is right here.
发表于 2019-4-15 17:57 | 显示全部楼层
本帖最后由 newswan 于 2019-4-15 18:12 编辑

q201:/system/etc/dropbear # am start -n com.mcu.iVMS/com.mcu.iVMS.ui.control.loading.LoadingActivity
Starting: Intent { cmp=com.mcu.iVMS/.ui.control.loading.LoadingActivity }

在ssh里,命令执行正常,但是app没有启动
am 还需要加什么参数么
我的恩山、我的无线 The best wifi forum is right here.
发表于 2019-4-15 18:10 | 显示全部楼层
aapt 输出:

package: name='com.mcu.iVMS' versionCode='40' versionName='4.7.3'
sdkVersion:'14'
targetSdkVersion:'27'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission: name='android.permission.USE_FINGERPRINT'
uses-permission: name='android.permission.FLASHLIGHT'
uses-permission: name='android.permission.VIBRATE'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.DISABLE_KEYGUARD'
uses-permission: name='android.permission.MOUNT_UNMOUNT_FILESYSTEMS'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.GET_TASKS'
uses-permission: name='android.permission.RECORD_AUDIO'
uses-permission: name='com.google.android.providers.gsf.permission.READ_GSERVICES'
uses-permission: name='android.permission.READ_PHONE_STATE'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.CHANGE_WIFI_STATE'
uses-permission: name='android.permission.CHANGE_WIFI_MULTICAST_STATE'
uses-permission: name='android.permission.GET_ACCOUNTS'
uses-permission: name='android.permission.CHANGE_NETWORK_STATE'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='com.mcu.iVMS.push.sdk.permission.EZVIZ_MESSAGE'
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.BLUETOOTH_ADMIN'
uses-permission: name='android.permission.ACCESS_COARSE_LOCATION'
uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'
uses-permission: name='com.google.android.c2dm.permission.RECEIVE'
uses-permission: name='com.mcu.iVMS.permission.C2D_MESSAGE'
uses-permission: name='android.permission.REQUEST_INSTALL_PACKAGES'
uses-permission: name='android.permission.WRITE_SETTINGS'
uses-permission: name='com.meizu.flyme.push.permission.RECEIVE'
uses-permission: name='com.meizu.c2dm.permission.RECEIVE'
uses-permission: name='com.mcu.iVMS.push.permission.MESSAGE'
uses-permission: name='android.permission.BROADCAST_PACKAGE_ADDED'
uses-permission: name='android.permission.BROADCAST_PACKAGE_CHANGED'
uses-permission: name='android.permission.BROADCAST_PACKAGE_INSTALL'
uses-permission: name='android.permission.BROADCAST_PACKAGE_REPLACED'
uses-permission: name='android.permission.RESTART_PACKAGES'
uses-permission: name='com.mcu.iVMS.permission.MIPUSH_RECEIVE'
uses-permission: name='getui.permission.GetuiService.com.mcu.iVMS'
application-label:'iVMS-4500'
application-label-af:'iVMS-4500'
application-label-am:'iVMS-4500'
application-label-ar:'iVMS-4500'
application-label-az:'iVMS-4500'
application-label-be:'iVMS-4500'
application-label-bg:'iVMS-4500'
application-label-bn:'iVMS-4500'
application-label-bs:'iVMS-4500'
application-label-ca:'iVMS-4500'
application-label-cs:'iVMS-4500'
application-label-da:'iVMS-4500'
application-label-de:'iVMS-4500'
application-label-el:'iVMS-4500'
application-label-en-AU:'iVMS-4500'
application-label-en-GB:'iVMS-4500'
application-label-en-IN:'iVMS-4500'
application-label-es:'iVMS-4500'
application-label-es-US:'iVMS-4500'
application-label-et:'iVMS-4500'
application-label-eu:'iVMS-4500'
application-label-fa:'iVMS-4500'
application-label-fi:'iVMS-4500'
application-label-fr:'iVMS-4500'
application-label-fr-CA:'iVMS-4500'
application-label-gl:'iVMS-4500'
application-label-gu:'iVMS-4500'
application-label-hi:'iVMS-4500'
application-label-hr:'iVMS-4500'
application-label-hu:'iVMS-4500'
application-label-hy:'iVMS-4500'
application-label-in:'iVMS-4500'
application-label-is:'iVMS-4500'
application-label-it:'iVMS-4500'
application-label-iw:'iVMS-4500'
application-label-ja:'iVMS-4500'
application-label-ka:'iVMS-4500'
application-label-kk:'iVMS-4500'
application-label-km:'iVMS-4500'
application-label-kn:'iVMS-4500'
application-label-ko:'iVMS-4500'
application-label-ky:'iVMS-4500'
application-label-lo:'iVMS-4500'
application-label-lt:'iVMS-4500'
application-label-lv:'iVMS-4500'
application-label-mk:'iVMS-4500'
application-label-ml:'iVMS-4500'
application-label-mn:'iVMS-4500'
application-label-mr:'iVMS-4500'
application-label-ms:'iVMS-4500'
application-label-my:'iVMS-4500'
application-label-nb:'iVMS-4500'
application-label-ne:'iVMS-4500'
application-label-nl:'iVMS-4500'
application-label-pa:'iVMS-4500'
application-label-pl:'iVMS-4500'
application-label-pt:'iVMS-4500'
application-label-pt-BR:'iVMS-4500'
application-label-pt-PT:'iVMS-4500'
application-label-ro:'iVMS-4500'
application-label-ru:'iVMS-4500'
application-label-si:'iVMS-4500'
application-label-sk:'iVMS-4500'
application-label-sl:'iVMS-4500'
application-label-sq:'iVMS-4500'
application-label-sr:'iVMS-4500'
application-label-sr-Latn:'iVMS-4500'
application-label-sv:'iVMS-4500'
application-label-sw:'iVMS-4500'
application-label-ta:'iVMS-4500'
application-label-te:'iVMS-4500'
application-label-th:'iVMS-4500'
application-label-tl:'iVMS-4500'
application-label-tr:'iVMS-4500'
application-label-uk:'iVMS-4500'
application-label-ur:'iVMS-4500'
application-label-uz:'iVMS-4500'
application-label-vi:'iVMS-4500'
application-label-zh-CN:'iVMS-4500'
application-label-zh-HK:'iVMS-4500'
application-label-zh-TW:'iVMS-4500'
application-label-zu:'iVMS-4500'
application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml'
application-icon-65535:'res/mipmap-anydpi-v26/ic_launcher.xml'
application: label='iVMS-4500' icon='res/mipmap-anydpi-v26/ic_launcher.xml'
launchable-activity: name='com.mcu.iVMS.ui.control.loading.LoadingActivity'  label='' icon=''
feature-group: label=''
  uses-feature: name='android.hardware.camera'
  uses-feature: name='android.hardware.camera.autofocus'
  uses-feature-not-required: name='android.hardware.telephony'
  uses-feature: name='android.hardware.bluetooth'
  uses-implied-feature: name='android.hardware.bluetooth' reason='requested android.permission.BLUETOOTH permission, requested android.permission.BLUETOOTH_ADMIN permission, and targetSdkVersion > 4'
  uses-feature: name='android.hardware.faketouch'
  uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
  uses-feature: name='android.hardware.location'
  uses-implied-feature: name='android.hardware.location' reason='requested android.permission.ACCESS_COARSE_LOCATION permission, and requested android.permission.ACCESS_FINE_LOCATION permission'
  uses-feature: name='android.hardware.microphone'
  uses-implied-feature: name='android.hardware.microphone' reason='requested android.permission.RECORD_AUDIO permission'
  uses-feature: name='android.hardware.wifi'
  uses-implied-feature: name='android.hardware.wifi' reason='requested android.permission.ACCESS_WIFI_STATE permission, requested android.permission.CHANGE_WIFI_MULTICAST_STATE permission, and requested android.permission.CHANGE_WIFI_STATE permission'
main
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--' 'af' 'am' 'ar' 'az' 'be' 'bg' 'bn' 'bs' 'ca' 'cs' 'da' 'de' 'el' 'en-AU' 'en-GB' 'en-IN' 'es' 'es-US' 'et' 'eu' 'fa' 'fi' 'fr' 'fr-CA' 'gl' 'gu' 'hi' 'hr' 'hu' 'hy' 'in' 'is' 'it' 'iw' 'ja' 'ka' 'kk' 'km' 'kn' 'ko' 'ky' 'lo' 'lt' 'lv' 'mk' 'ml' 'mn' 'mr' 'ms' 'my' 'nb' 'ne' 'nl' 'pa' 'pl' 'pt' 'pt-BR' 'pt-PT' 'ro' 'ru' 'si' 'sk' 'sl' 'sq' 'sr' 'sr-Latn' 'sv' 'sw' 'ta' 'te' 'th' 'tl' 'tr' 'uk' 'ur' 'uz' 'vi' 'zh-CN' 'zh-HK' 'zh-TW' 'zu'
densities: '120' '160' '240' '320' '480' '640' '65534' '65535'
native-code: 'armeabi-v7a'
我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|Archiver|恩山无线论坛 ( 苏ICP备05084872号-1 )

GMT+8, 2019-4-25 06:32

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表