Commit 659c4e39 authored by rockyl's avatar rockyl

兼容混淆版本的引擎

parent 5dc859bf
...@@ -174,6 +174,11 @@ export function findProcess(rootMetas, builtinMetas, filter) { ...@@ -174,6 +174,11 @@ export function findProcess(rootMetas, builtinMetas, filter) {
return result; return result;
function findOnce(metas, parentPath) { function findOnce(metas, parentPath) {
/*if (parentPath) {
//let pathStr = parentPath.map(item=>item.name || item.metaName).join('>');
let pathStr = parentPath.map(item => item.name || item.process.uuid.substr(0, 8)).join('>');
console.log('findProcess', pathStr);
}*/
for (let meta of metas) { for (let meta of metas) {
let path = parentPath ? parentPath : []; let path = parentPath ? parentPath : [];
if (!parentPath) { if (!parentPath) {
...@@ -181,6 +186,9 @@ export function findProcess(rootMetas, builtinMetas, filter) { ...@@ -181,6 +186,9 @@ export function findProcess(rootMetas, builtinMetas, filter) {
} }
for (let key in meta.sub) { for (let key in meta.sub) {
let subProcess = meta.sub[key]; let subProcess = meta.sub[key];
if (path.find(item => item.process && item.process.uuid === subProcess.uuid)) {
break;
}
let subMeta = meta.metas ? meta.metas.find(item => item.id === subProcess.meta) : null; let subMeta = meta.metas ? meta.metas.find(item => item.id === subProcess.meta) : null;
if (!subMeta) { if (!subMeta) {
subMeta = rootMetas.find(item => item.id === subProcess.meta); subMeta = rootMetas.find(item => item.id === subProcess.meta);
...@@ -486,7 +494,7 @@ export function dataURLtoBlob(dataUrl) { ...@@ -486,7 +494,7 @@ export function dataURLtoBlob(dataUrl) {
return new Blob([u8arr], {type: mime}); return new Blob([u8arr], {type: mime});
} }
export async function zipViewFile(file){ export async function zipViewFile(file) {
let dataString = await readTextFile(file); let dataString = await readTextFile(file);
let buf = new Buffer(dataString); let buf = new Buffer(dataString);
......
...@@ -141,7 +141,8 @@ export async function packImages(assets, options = {}) { ...@@ -141,7 +141,8 @@ export async function packImages(assets, options = {}) {
} }
async function deal(assets, urls, getSheetUrlByUUID, name, blob, frames) { async function deal(assets, urls, getSheetUrlByUUID, name, blob, frames) {
const sheetUUID = sha256(urls.sort().join()).toString(); //const sheetUUID = sha256(urls.sort().join()).toString();
const sheetUUID = sha256(Object.keys(frames).sort().join()).toString();
let url; let url;
if (getSheetUrlByUUID) { if (getSheetUrlByUUID) {
......
...@@ -53,7 +53,7 @@ export async function preprocess(project, packages) { ...@@ -53,7 +53,7 @@ export async function preprocess(project, packages) {
const dataUrl = URL.createObjectURL(new Blob([JSON.stringify(data)])); const dataUrl = URL.createObjectURL(new Blob([JSON.stringify(data)]));
const {libraryScriptElMap, analyseResult} = await generateLibraryScriptEl(tpl, dependencies, getPackages(packages), '//yun.duiba.com.cn/editor/zeroing/libs/'); const {libraryScriptElMap, analyseResult} = await generateLibraryScriptEl(tpl, dependencies, getPackages(packages), '//yun.duiba.com.cn/editor/zeroing/libs/', true);
tpl = fillTemplate(tpl, { tpl = fillTemplate(tpl, {
pageTitle, pageTitle,
...@@ -64,7 +64,7 @@ export async function preprocess(project, packages) { ...@@ -64,7 +64,7 @@ export async function preprocess(project, packages) {
tpl = tpl.replace('//yun.duiba.com.cn/aurora/$VERSION$-data.json', dataUrl); tpl = tpl.replace('//yun.duiba.com.cn/aurora/$VERSION$-data.json', dataUrl);
console.log("塞入数据",storeName,data) console.log("塞入数据",storeName,data)
db.set(storeName, { db.set(storeName, {
id: project.id, id: project.id,
data, data,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment