HBuilder X packages web addresses into app s

Keywords: app

Step 1: create a new 5+APP project

Step 2: configure web address

After opening the App home page, jump to the website

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>
    <script type="text/javascript">
   		document.addEventListener('plusready', function(){
			//Change the font color of the status bar at the top of the phone
			//black, light, white
			plus.navigator.setStatusBarStyle('light');
			//Change status bar background color
			plus.navigator.setStatusBarBackground('#000000');
   			//console.log("all plus api should be called after this event occurs, otherwise plus is undefined will appear.").
   			// alert("1");
			window.location.href="http://jym.50cms.com/4g/Default.aspx?pid=27f214a253171f92";
   		});
    </script>
</head>
<body>
	
</body>
</html>

Step 3: configure App information

Step 4: debugging (can be omitted)

This step can be adjusted or not adjusted according to your own situation

Debugging mode: connect computer and mobile phone with data cable

*Attention

  • Do not select charge only, etc
  • According to the prompt, turn on the allow debugging, allow installation through USB and other switches

Part V: cloud packaging

  • Certificate alias: the certificate alias set with the - alias parameter when generating a certificate;
  • Private key password: the keystore password used to generate the certificate;
  • Certificate file: the certificate saving path set with the - keystore parameter when generating a certificate;

1: Packaging with public test certificates

Select public test certificate to package, and then click package directly

2: Package with own certificate

Android platform signing certificate required

Android platform signing certificate generation method

According to how to generate the certificate, just follow the steps (see the key part)

be careful:

1: d: it can be written or not. This is the storage path of the generated certificate file

2: Select 8 for jdk, otherwise an error will be reported when packaging after generation: the certificate file is not a valid keystore file

3: cmd is opened as an administrator. Otherwise, if the permission is insufficient, an error will be reported: keytool error: java.io.FileNotFoundException: test.keystore (access denied.)

4: cmd prompt: Warning:JKS keystore uses private format. It is recommended to use "keytool -importkeystore -srckeystore hyj.keystore -destkeystore hyj.keystore -deststoretype pkcs12" to migrate to the industry standard format PKCS12., Never mind him, otherwise an error will be reported when packing: the Google developer certificate information is incorrect, please fill in the relevant information and certificate file again, which is not a valid keystore file. If the format has been migrated according to the prompt, change it to JKS through the command again. The command is as follows

keytool -importkeystore -srckeystore hyj.keystore -destkeystore hyj.keystore -deststoretype JKS

explain:

Generate Android signature certificate, and use Keytool, a tool provided by JRE to create and manage digital certificates.

Use the following command to generate a certificate:

//Generate key
keytool -genkey -alias ship.keystore -keyalg RSA -validity 1000 -keystore ship.keystore
 
explain: keytool -genkey -alias alias.keystore -keyalg RSA -validity Term of validity(Days) -keystore alias.keystore
 
For example: keytool -genkey -alias hello.keystore -keyalg RSA -validity 1000 -keystore hello.keystore
 
 
//autograph
jarsigner -verbose -keystore ship.keystore -signedjar ship.apk android-release-unsigned.apk ship.keystore
 
explain: jarsigner -verbose -keystore alias.keystore(Keystore location) -signedjar Document generated after signature.apk File to sign.apk alias.keystore(Keystore)
 
For example:
jarsigner -verbose -keystore hello.keystore -signedjar hello.apk android-release-unsigned.apk hello.keystore

  • Keystore: helloworld.keystore represents the generated certificate, and the path can be added (it is in the user's home directory by default);
  • Alias: helloworld indicates that the alias of the certificate is helloworld;
  • keyalg: RSA indicates the RSA algorithm adopted;
  • Validity: 10000 indicates that the validity period of the certificate is 10000 days

Channel package:

Channel package refers to that in the list file of apk packages published in major application markets, the value configured under a meta data tag is different. The function of this tag is to distinguish which market, for example, you publish to 360. This value is that you can configure 360 and pea pod can configure wandoujia. What is the function of such configuration? Very simple, it is used for statistics. For example, Youmeng statistics is used in our project. It can count which platform users downloaded your app from, so as to better master users' operation habits. Therefore, if the app doesn't have the demand for statistical function, you just need to make the same package and publish it directly to various platforms, and don't care about any channels at all.

Posted by pointsplat on Mon, 22 Nov 2021 13:42:00 -0800