From 99bc99bf41214cfe8ee31c8abba7b1248e94758d Mon Sep 17 00:00:00 2001 From: Huang Minzhi Date: Wed, 9 Mar 2022 13:17:13 +0800 Subject: [PATCH] fix cconb file --- package.json | 2 +- source/merge.ts | 17 ++++++++--------- static/download-hook.js | 16 ++++++++++++++++ static/wrapper.js | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a7463bb..940a812 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "playable-build-tool", "title": "Playable build tool", "package_version": 2, - "version": "1.0.0", + "version": "1.0.1", "author": "minzhi", "description": "i18n:playable-build-tool.description", "contributions": { diff --git a/source/merge.ts b/source/merge.ts index 2d67245..7885565 100644 --- a/source/merge.ts +++ b/source/merge.ts @@ -41,12 +41,12 @@ const import_map_match_key = ""; const dapi_match_key = ""; const google_match_key = ""; const start_match_key = ""; -const fileByteList = [".png", ".bin", ".mp3"]; const excludeList = ["/index.js"]; const base64PreList = new Map([ [".png", "data:image/png;base64,"], [".bin", "data:application/octet-stream;base64,"], [".mp3", "data:audio/mpeg;base64,"], + [".cconb", "data:application/octet-stream;base64,"], [".ttf", ""], ]); export class MergeBuilder { @@ -208,9 +208,7 @@ export class MergeBuilder { switch (adNetwork) { case "mintegral": const mintegral_str = - "\n"; + "\n"; html_str = html_str.replace(start_match_key, mintegral_str); break; case "ironsource": @@ -219,7 +217,8 @@ export class MergeBuilder { html_str = html_str.replace(start_match_key, dapi_body_str); break; case "unity": - const unity_path = "\n"; + const unity_path = + "\n"; html_str = html_str.replace(start_match_key, unity_path); break; case "applovin": @@ -235,16 +234,16 @@ export class MergeBuilder { //bundle const bundle_str = - "\n"; + "\n}\n\n"; html_str = this.simpleReplace(html_str, bundle_match_key, bundle_str); //engine const engine_str = "\n"; + "\n}\n\n"; html_str = this.simpleReplace(html_str, engine_match_key, engine_str); // resmap @@ -252,7 +251,7 @@ export class MergeBuilder { const cc_index_str = "\n"; + "\n}\n\n"; const setting_str = "