jh5_app_build 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/build_std.js +17 -1
  2. package/package.json +1 -1
package/lib/build_std.js CHANGED
@@ -162,7 +162,7 @@ module.exports = async (cmd, buildCfg) => {
162
162
  child_process.execFileSync("C:\\jdev_develop\\jre\\bin\\java.exe", [
163
163
  "-jar", "C:\\jdev_develop\\h5_bin\\apktool.jar",
164
164
  "d", custumApk,
165
- "-r", "-s",
165
+ "-r", "-s", "-f",
166
166
  "-o", stdBinDir
167
167
  ], {
168
168
  cwd: jreCwd
@@ -345,6 +345,22 @@ module.exports = async (cmd, buildCfg) => {
345
345
  }
346
346
  }
347
347
 
348
+ // 修改版本名
349
+ if (apkinfoObj.useAppVer) {
350
+ let tmpName = Buffer.from("12.34.56.7890", 'utf16le');
351
+ let nameIndex = anfData.indexOf(tmpName);
352
+ if (nameIndex > 0) {
353
+ let tmpVerStr = buildCfg.dateStr;
354
+ let toVerStr = `${tmpVerStr.substr(0, 2)}.${tmpVerStr.substr(2, 2)}.${tmpVerStr.substr(4, 2)}.${tmpVerStr.substr(7, 4)}`
355
+ console.log("versionName=" + toVerStr);
356
+ let toName = Buffer.from(toVerStr, 'utf16le');
357
+ // 写入名
358
+ for (let index = 0; index < toName.length; index++) {
359
+ anfData[nameIndex + index] = toName[index];
360
+ }
361
+ }
362
+ }
363
+
348
364
  // 写入
349
365
  fs.writeFileSync(AndroidManifestPath, anfData);
350
366
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jh5_app_build",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "jaskle jh5_app_build",
5
5
  "main": "./bin/jh5_app_build.js",
6
6
  "registry": true,