小程序反编译报错:ReferenceError: __vd_version_info__ is not defined

屏聚源码
屏聚源码
屏聚源码
3392
文章
24
评论
2020年5月24日13:39:57
评论
6,313

错误ReferenceError: __vd_version_info__ is not defined

错误提示代码:

ReferenceError: $gwx is not defined
    at vm.js:3:3
    at Script.runInContext (vm.js:107:20)
    at VM.run (D:\wxappUnpacker-master\node_modules\vm2\lib\main.js:208:72)
    at runVM (D:\wxappUnpacker-master\wuWxss.js:69:6)
    at runOnce (D:\wxappUnpacker-master\wuWxss.js:97:27)
    at Array.preRun (D:\wxappUnpacker-master\wuWxss.js:177:5)
    at CntEvent.decount (D:\wxappUnpacker-master\wuLib.js:17:43)
    at ioLimit.runWithCb.err (D:\wxappUnpacker-master\wuLib.js:73:11)
    at agent (D:\wxappUnpacker-master\wuLib.js:54:14)
    at FSReqWrap.oncomplete (fs.js:141:20)

解决方法:

修改反编译脚本wuWxss.js代码
将原代码:

function runVM(name,code){
    let wxAppCode={},handle={cssFile:name};
    let vm=new VM({sandbox:Object.assign(new GwxCfg(),{__wxAppCode__:wxAppCode,setCssToHead:cssRebuild.bind(handle)})});
    vm.run(code);
    for(let name in wxAppCode)if(name.endsWith(".wxss")){
        handle.cssFile=path.resolve(frameName,"..",name);
        wxAppCode[name]();
    }
}

修改为:

function runVM(name,code){
    let wxAppCode={},handle={cssFile:name};
    let gg = new GwxCfg();
    let tsandbox ={$gwx:GwxCfg.prototype["$gwx"],__mainPageFrameReady__:GwxCfg.prototype["$gwx"],__wxAppCode__:wxAppCode,setCssToHead:cssRebuild.bind(handle)};
    let vm = new VM({sandbox:tsandbox});
    vm.run(code);
    for(let name in wxAppCode)if(name.endsWith(".wxss")){
        handle.cssFile=path.resolve(frameName,"..",name);
        wxAppCode[name]();
    }
}

或者修改这个
将原代码:

function runOnce(){
	for(let name in runList)runVM(name,runList[name]);
  }

修改为:

function runOnce() {
	for (let name in runList) {
		// console.log(name, runList[name]);
		var start = `var window = window || {}; var __pageFrameStartTime__ = Date.now(); 	var __webviewId__; 	var __wxAppCode__={}; 	var __mainPageFrameReady__ = function(){}; 	var __WXML_GLOBAL__={entrys:{},defines:{},modules:{},ops:[],wxs_nf_init:undefined,total_ops:0}; 	var __vd_version_info__=__vd_version_info__||{};
		$gwx=function(path,global){
			if(typeof global === 'undefined') global={};if(typeof __WXML_GLOBAL__ === 'undefined') {__WXML_GLOBAL__={};
			}__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};
		}`;
		runVM(name, start + " \r\n" + runList[name]);
	}
}

 

屏聚源码
Hyper-V 虚拟机无法上网的解决方法 屏聚学院

Hyper-V 虚拟机无法上网的解决方法

Windows  8中内置的Hyper-V管理器可以说给许多人带来了惊喜!在Hyper-V管理器强大的同时,也同样面临着设置中一些不可避免的麻烦。有人说,Hyper-V虚拟机联网麻烦,其实,只要掌握了...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: