网络技术

使用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. 本文至此结束,提示:密钥和私钥是一回事,期间穿插着说的。其实一样的。

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

  1. What i don’t understood is in truth how you’re now not really much more neatly-liked than you might be
    right now. You’re very intelligent. You already know thus considerably in relation to this matter, made me personally consider it from
    numerous various angles. Its like men and women are not
    involved until it is one thing to do with Woman gaga! Your
    own stuffs nice. Always take care of it up!

  2. I was curious if you ever considered changing the page layout of
    your site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of text for only
    having 1 or two pictures. Maybe you could space it out better?

  3. Does your site have a contact page? I’m having a tough time locating it but, I’d like
    to shoot you an e-mail. I’ve got some creative ideas for your blog you might be interested in hearing.
    Either way, great website and I look forward to seeing it
    expand over time.

  4. Hi, Neat post. There’s an issue with your site in web explorer,
    may test this? IE still is the market chief and a
    good component to folks will miss your wonderful writing due to this problem.

  5. I’m really enjoying the theme/design of your
    web site. Do you ever run into any browser compatibility issues?
    A small number of my blog audience have complained about my website not working correctly in Explorer but looks great in Firefox.
    Do you have any recommendations to help fix this problem?

  6. This design is steller! You obviously know how to keep a reader entertained.
    Between your wit and your videos, I was almost
    moved to start my own blog (well, almost…HaHa!) Wonderful job.
    I really loved what you had to say, and more than that, how you
    presented it. Too cool!

  7. Great weblog here! Additionally your site rather a lot
    up very fast! What host are you the usage of? Can I get your associate hyperlink for your host?
    I wish my web site loaded up as quickly as yours lol

  8. After I initially left a comment I seem to have
    clicked the -Notify me when new comments are added- checkbox and now every
    time a comment is added I get four emails with the same comment.
    Is there a means you can remove me from that service?
    Many thanks!

  9. You’re so interesting! I don’t believe I’ve truly read anything like that before.
    So wonderful to discover another person with some original thoughts on this subject.
    Seriously.. thank you for starting this up. This site is something that is required on the
    internet, someone with some originality!

  10. hey there and thank you for your information – I’ve certainly picked up anything new from
    right here. I did however expertise a few technical issues using
    this website, as I experienced to reload the web site a lot of
    times previous to I could get it to load correctly.
    I had been wondering if your hosting is OK? Not that I am complaining, but slow loading instances times will sometimes affect your placement in google and
    could damage your high quality score if advertising and
    marketing with Adwords. Anyway I’m adding this RSS to my
    e-mail and can look out for a lot more of your respective interesting content.
    Ensure that you update this again very soon.

  11. I don’t even know how I ended up here, but I thought this post was great.
    I do not know who you are but definitely
    you are going to a famous blogger if you are
    not already 😉 Cheers!

  12. Wow that was unusual. I just wrote an really long comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again. Anyways, just wanted to say excellent blog!

  13. Thanks , I have just been looking for info approximately this topic for ages and yours is the greatest I’ve found out so far.
    However, what concerning the bottom line? Are you sure in regards to the source?

  14. Thank you for some other informative website. The place else may just I get that
    type of information written in such an ideal manner? I have a venture that I am simply now working on,
    and I’ve been at the look out for such information.

发表评论

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

答案 : *
4 + 16 =


返回顶部