1 Star 0 Fork 0

sandaohaizi / flutter_flutter_av

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Flutter SDK 仓库

原始仓来源:https://github.com/flutter/flutter

仓库说明:

本仓库是基于flutter sdk对于OpenHarmony的兼容拓展,可支持使用flutter tools指令编译和构建OpenHarmony应用程序。

构建说明:

  • 构建环境: 目前flutter tools指令仅支持linux下使用

  • 构建依赖: 依赖flutter engine构建产物,请在flutter tools指令运行参数中添加:--local-engine=<engine产物目录>

  • 构建步骤:

  1. 请先下载Command Line Tools for OpenHarmony

  2. 在Command Line Tools下载目录中,找到sdkmanager, 参考ohsdkmgr使用指导 下载OpenHarmony sdk。 (PS:api 10需要从每日构建下载ohos-full-sdk) 配置OpenHarmony sdk路径到环境变量OHOS_SDK_HOME,例如:~/.bashrc新增配置export OHOS_SDK_HOME=<sdk路径>(路径的根目录下,包含9或者10命名api文件夹);

  3. 在Command Line Tools下载目录中,ohpm文件夹路径配置成环境变量OHPM_HOME,例如:export OHPM_HOME=<父路径>/oh-command-line-tools/ohpm,参照指导文档:ohpm使用指导,执行ohpm/bin/init命令安装ohpm;

  4. 配置签名工具环境变量SIGN_TOOL_HOME,例如:export SIGN_TOOL_HOME=<developtools_hapsigner目录>/autosign,下载地址:https://gitee.com/openharmony/developtools_hapsigner

签名工具还需进行下列配置:

  • 参照developtools_hapsigner的readme,编译得到 hap-sign-tool.jar ,确保其在目录下:./hapsigntool/hap_sign_tool/build/libs/hap-sign-tool.jar
  • 进入autosign文件夹,执行命令chmod 777 *.sh,并且新增profile_tmp_template.json文件,编辑如下:
{
  "version-name": "2.0.0",
  "version-code": 2,
  "app-distribution-type": "os_integration",
  "uuid": "5027b99e-5f9e-465d-9508-a9e0134ffe18",
  "validity": {
      "not-before": 1594865258,
      "not-after": 1689473258
  },
  "type": "release",
  "bundle-info": {
      "developer-id": "OpenHarmony",
      "distribution-certificate": "-----BEGIN CERTIFICATE-----\nMIICSTCCAc+gAwIBAgIFAJV7uNUwCgYIKoZIzj0EAwIwYzELMAkGA1UEBhMCQ04x\nFDASBgNVBAoMC09wZW5IYXJtb255MRkwFwYDVQQLDBBPcGVuSGFybW9ueSBUZWFt\nMSMwIQYDVQQDDBpPcGVuSGFybW9ueSBBcHBsaWNhdGlvbiBDQTAeFw0yMjAxMjkw\nNTU0MTRaFw0yMzAxMjkwNTU0MTRaMGgxCzAJBgNVBAYTAkNOMRQwEgYDVQQKDAtP\ncGVuSGFybW9ueTEZMBcGA1UECwwQT3Blbkhhcm1vbnkgVGVhbTEoMCYGA1UEAwwf\nT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUmVsZWFzZTBZMBMGByqGSM49AgEGCCqG\nSM49AwEHA0IABAW8pFu7tHGUuWtddD5wvazc1qN8ts9UPZH4pecbb/bSFWKh7X7R\n/eTVaRrCTSSdovI1dhoV5GjuFsKW+jT2TwSjazBpMB0GA1UdDgQWBBScyywAaAMj\nI7HcuIS42lvZx0Lj+zAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUE\nDDAKBggrBgEFBQcDAzAYBgwrBgEEAY9bAoJ4AQMECDAGAgEBCgEAMAoGCCqGSM49\nBAMCA2gAMGUCMFfNidGo6uK6KGT9zT1T5bY1NCHTH3P3muy5X1xudOgxWoOqIbnk\ntmQYB78dxWEHLQIxANfApAlXAD/0hnyNC8RDzfLOPEeay6jU9FXJj3AoR90rwZpR\noN9sYD6Oks4VGRw6yQ==\n-----END CERTIFICATE-----\n",
      "bundle-name": "{{ohosId}}",
      "apl": "normal",
      "app-feature": "hos_normal_app"
  },
  "acls": {
      "allowed-acls": [
          ""
      ]
  },
  "permissions": {
      "restricted-permissions": []
  },
  "issuer": "pki_internal"
}
  • 编辑autosign.config和createAppCertAndProfile.config,修改值:sign.profile.inFile=profile_tmp.json
  1. 配置<当前项目目录>/bin,到环境变量PATH,确保which flutter能找到<flutter sdk>/bin/flutter位置;

  2. 运行flutter docker,检查环境变量配置是否都正确;

  3. 打开vscode,安装好flutter插件,如果flutter sdk配置正确,可发现OpenHarmony连接设备,可在vscode上运行和调试应用。

已兼容OpenHarmony开发的指令列表:

指令名称 指令描述 使用说明
doctor 环境检测 flutter doctor
config 环境配置 flutter config --<key> <value>
create 创建新项目 flutter create --platforms ohos,android --org <org> <appName>
devices 已连接设备查找 flutter devices
install 应用安装 flutter install
assemble 资源打包 flutter assemble
build 应用构建 flutter build hap --target-platform ohos-arm --debug true --local-engine=<兼容ohos的engine产物路径>
run 应用运行 flutter run --local-engine=<兼容ohos的engine产物路径>
attach 调试模式 flutter attach
Copyright 2014 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

致敬:https://gitee.com/getmoon/flutter_flutter http://ci.openharmony.cn/ 展开 收起
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/sandaohaizi/flutter_flutter_av.git
git@gitee.com:sandaohaizi/flutter_flutter_av.git
sandaohaizi
flutter_flutter_av
flutter_flutter_av
master

搜索帮助