网络技术

使用Hbuilder封装APP(含配置证书)

前言:

不想说什么应用市场,产品趋势。不想说什么小程序、公众号。

就想说一下怎么把网站封装成app,本次使用的是Hbuilder。

网站封装成APP所需软件:

工具:Hbuilder(用于封装)

环境:Java(用于签名)

本机的环境是:Windows10,、Jdk1.8,Hbuilder1.5.4

 

网站封装成APP步骤:

 

  1. 首先要去hbuilder官网下载app开发版。是绿色版免安装的,建议把根目录的HBuilderX.exe发送到桌面快捷方式,方便使用。
  2. 安装java环境,配置环境变量。这个应该没问题吧。保证jdk可以正常工作,因为要用到keytool,安装完配置完环境变量之后分别运行java和javac确保没问题
    java
    

    javac
    

     

  3. 打开hbuilder,创建一个wap2app项目
  4. 主要需要进行配置的就是manifest.json文件,需手动设置一些默认的样式。
  5. 还是在manifest.json里面配置app的图标和启动图

  6. 打包发行
  7. 建议的打包配置
  8. 最关键的一步:配置证书。要用到jdk
    1. 打开cmd命令行,定位到jdk的安装目录的bin目录
    2. 输入命令(有下划线是可以更改的参数,其他的请保持原文语法)
      keytool -genkey -alias sjar -keyalg RSA -sigalg SHA1WithRSA -validity 40000 -keysize 1024 -keystore sjar.keystore
      

      解释:

      keytool:java工具。管理私钥仓库(keystore)。-genkey:生成公钥。-alias sjar:别名sjar。-keyalg RSA -sigalg SHA1WithRSA:加密算法是rsa和sha1的验证。-validity 40000:有效期40000天。-keysize 1024:私钥长度是1024位。-keystore sjar.keystore:生成私钥,私钥名为sjar.keystore。
      完成之后输入这些信息:

    3. 这里有建议使用的语法,复制重新输入keytool -importkeystore -srckeystore sjar.keystore -destkeystore sjar.keystore -deststoretype pkcs12
      并验证源密钥库口令
    4. 打开jdk的bin目录找到sjar.keystore
  9. 回到hbuilder里,证书别名就是-alils后面的,我这里是sjar,证书密码按前面输入的填写,选择jdk/bin目录下的sjar.keystore文件。
  10. 正在打包了,等待完成。
  11. 在控制台可以看到打包进程
  12. 完成
  13. 本文至此结束,提示:密钥和私钥是一回事,期间穿插着说的。其实一样的。

50 thoughts on “使用Hbuilder封装APP(含配置证书)

  1. What i do not understood is in fact how you’re not actually a lot more neatly-liked than you may be right now.
    You are so intelligent. You know thus significantly when it comes
    to this topic, made me in my opinion consider it from numerous numerous angles.
    Its like men and women are not interested except it is something to
    do with Girl gaga! Your own stuffs great. All the time maintain it up!

  2. Fantastic items from you, man. I’ve take into account your stuff previous
    to and you are just extremely magnificent.
    I really like what you’ve bought right here, certainly like what you’re stating and the way
    through which you are saying it. You’re making it entertaining and you continue to care for to keep it sensible.
    I cant wait to read much more from you. That is actually
    a tremendous site.

  3. I’m curious to find out what blog system you’re using?
    I’m experiencing some small security problems
    with my latest site and I’d like to find something more
    safe. Do you have any recommendations?

  4. Thank you for every other magnificent post. Where else may anybody get that kind
    of information in such a perfect approach of writing?

    I have a presentation next week, and I am on the search
    for such information.

  5. Simply wish to say your article is as amazing. The clarity for your put
    up is simply great and i could suppose you’re knowledgeable in this subject.

    Well along with your permission allow me to seize your feed to stay up to
    date with impending post. Thank you 1,000,000 and please continue
    the gratifying work.

  6. A fascinating discussion is definitely worth comment.

    There’s no doubt that that you need to write more about this subject matter, it may not be a taboo subject
    but usually people do not discuss these subjects.
    To the next! Kind regards!!

  7. We are a group of volunteers and opening a new scheme in our community.
    Your website provided us with valuable information to work on. You have done an impressive job and our entire
    community will be thankful to you.

  8. I have been exploring for a little bit for any high-quality articles or blog posts in this kind
    of house . Exploring in Yahoo I at last stumbled upon this web
    site. Reading this information So i am happy to show that I have an incredibly excellent uncanny feeling I came
    upon exactly what I needed. I such a lot undoubtedly will make sure to do not forget this web site
    and give it a look regularly.

  9. After I originally left a comment I seem to
    have clicked the -Notify me when new comments are
    added- checkbox and from now on whenever a comment is added I get four emails
    with the exact same comment. Is there an easy method you can remove me from that service?
    Kudos!

  10. I do not even know how I finished up here, but I believed this
    put up used to be great. I don’t recognize who you’re however definitely you are going to a famous blogger if you are not already.
    Cheers!

  11. We’re a group of volunteers and opening a
    new scheme in our community. Your website provided us with
    valuable info to work on. You have done a formidable job
    and our whole community will be thankful to you.

  12. I’m more than happy to uncover this web site.
    I wanted to thank you for ones time for this particularly fantastic read!!
    I definitely enjoyed every part of it and I have you saved to fav to check out new stuff in your website.

  13. Howdy! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very
    good gains. If you know of any please share. Appreciate it!

  14. Write more, thats all I have to say. Literally,
    it seems as though you relied on the video to make
    your point. You obviously know what youre talking about, why throw away your intelligence on just posting videos to your site when you could be giving us something enlightening to read?

  15. First of all I want to say wonderful blog! I had a quick question which I’d like to ask if you do not mind.
    I was curious to know how you center yourself and clear your head prior to writing.
    I have had a hard time clearing my thoughts
    in getting my ideas out there. I truly do enjoy writing however it just seems like the first 10 to
    15 minutes are usually wasted just trying to figure out how to begin. Any recommendations or tips?

    Thanks!

  16. Greetings! I know this is kinda off topic however , I’d figured I’d ask.

    Would you be interested in trading links or maybe guest writing a blog post or
    vice-versa? My site covers a lot of the same subjects as yours and I believe we could greatly
    benefit from each other. If you’re interested feel free to send
    me an email. I look forward to hearing from you! Fantastic
    blog by the way!

  17. My developer is trying to persuade me to move to
    .net from PHP. I have always disliked the idea because of the costs.

    But he’s tryiong none the less. I’ve been using WordPress on various websites for
    about a year and am concerned about switching to another platform.
    I have heard good things about blogengine.net.
    Is there a way I can transfer all my wordpress posts into it?
    Any help would be greatly appreciated!

  18. We are a group of volunteers and starting a new scheme
    in our community. Your website provided us with valuable information to work
    on. You’ve done a formidable job and our entire community
    will be grateful to you.

  19. 嗯。就是这样不容易上架到应用商城,如果能用原生的java写会更流畅。这样就相当于给软件内置了一个浏览器,打开了一个网站,无非就是多加个启动图和图标。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

答案 : *
8 + 11 =


返回顶部