OpenHarmony ArkTS RK 3568 开机启动server

1 修改gn    系统源码 code/rk3568/applications/standard/hap/BUILD.gn,(参照别的系统app的gn配置修改,如短信)


2 修改系统源码两个list配置清单   code/rk3568/vendor/hihope/rk3568/preinstall-config/install_list.json --- /install_list_capability.json
    参考网址    https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md#/openharmony/docs/blob/master/zh-cn/application-dev/security/app-provision-structure.md
    签名工具    https://gitee.com/openharmony/developtools_hapsigner  也可用编译器自带证书,然后提取编译器自带证书的.cer文件的第一个证书指纹


3 修改hap源码 config入口module的ServerAbility   


4,打入hap包到系统源码  code/rk3568/applications/standard/hap/

以上涉及到系统源码的都是要编译在OpenHarmony镜像里,至于目录,每个人编译镜像的服务器目录不一样,如果不知道自己的目录,大可直接用find命令 搜 这个系统源码相关文件的位置


install_list.json代码追加示例:

        {
            "app_dir" : "/system/app/com.demo.demo",
            "removable" : false
        }
        
install_list_capability.json代码追加示例:

        {
             "bundleName": "com.demo.demo",
            "singleton": true,     
            "keepAlive": true,
            "associatedWakeUp": true,
            "allowAppDesktopIconHide": true,
            "allowAbilityExcludeFromMissions": true,
            "app_signature" : ["C1A5CFEB63DDE3A6987BC97DDDC3B8F701A1E7E8FC3959A6FC9DD9A5CD2CB789"],//注意此指纹要和hap指纹一样
            "allowCommonEvent": ["usual.event.BOOT_COMPLETED"]
        }

config示例: (重点是:1,"mainAbility": "com.demo.demo.ServiceAbility", 2,"singleton": true,  )
{
  "app": {
    "bundleName": "com.demo.demo",
    "vendor": "example",
    "singleton": true,
    "version": {
      "code": 1000000,
      "name": "1.0.0"
    }
  },
  "deviceConfig": {
    "default": {
      "keepAlive": true
    }
  },
  "module": {
    "package": "com.demo.demo",
    "name": ".MyApplication",
    "mainAbility": "com.demo.demo.ServiceAbility",
    "deviceType": [
      "default",
      "tablet"
    ],
    "distro": {
      "deliveryWithInstall": true,
      "moduleName": "entry",
      "moduleType": "entry",
      "installationFree": false
    },
    "abilities": [
      {
        "skills": [
          {
            "entities": [
              "entity.system.home"
            ],
            "actions": [
              "action.system.home"
            ]
          }
        ],
        "orientation": "unspecified",
        "formsEnabled": false,
        "name": ".MainAbility",
        "srcLanguage": "ets",
        "srcPath": "MainAbility",
        "icon": "$media:icon",
        "description": "$string:MainAbility_desc",
        "label": "$string:MainAbility_label",
        "type": "page",
        "visible": true,
        "launchType": "singleton"
      },
      {
        "name": ".ServiceAbility",
        "srcLanguage": "ets",
        "srcPath": "ServiceAbility",
        "icon": "$media:icon",
        "description": "$string:ServiceAbility_desc",
        "type": "service",
        "visible": true
      }
    ],
    "js": [
      {
        "mode": {
          "syntax": "ets",
          "type": "pageAbility"
        },
        "pages": [
          "pages/index"
        ],
        "name": ".MainAbility",
        "window": {
          "designWidth": 720,
          "autoDesignWidth": false
        }
      }
    ],
    "reqPermissions": [
      {
        "name": "ohos.permission.XXX"
      }
    ]
  }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

零九

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值