Mac App破解之路九 vscode插件破解

时间:2021-01-27 09:54:09

破解对象: luaide

破解目的:学习如何破解vscode插件

破解背景:

vsscode用了这么多年,安装了很多插件,其中luaide插件是收费的.  说实话,100块并不贵, 我本来准备买的.

结果我想加入luaide群,问几个插件相关问题,结果需要回答验证码.太扯了.  既然有7天试用,为何还要入群权限?真搞不懂

一般群我也懒得加,反正加入群,基本上是划水,没什么软用.

刚好之前没有破解vscode插件经验, 那就拿这个练手好了. 纯属破解学习用, 不做非法用途.

我破解的过程中,发现luaide作者还是很用心的, 对防破解用心了,对lua调试插件用心了,对文档用心了, 代码质量不错.  这个插件不贵, 建议lua开发同学购买.

有一个用户系统, 在线统计等功能, 这个肯定得需要一台服务器.  这些都是成本.

这个破解花了我好几个晚上,其中有几个晚上,由于对VScode工具的实现不熟悉,vscode插件开发流程不熟悉, 所以一直在探索,一直在走弯路.

这是我当时想问的:

插件有不完美的地方, 想调试要在main.lua中新增几行代码

这样会污染源文件main.lua.可不可以不污染?

当然我本人是可以解决的这个问题的, 就是不知道luaide作者是如何想的.

方案是新增一个文件, 名字叫debug2.lua.      把需要新增的几行代码写在 debug2中,  然后在require "main"

修改AppDelegate文件, 如果是DEBUG模式,就 执行 debug2文件  否则就是 main文件.

发布的时候肯定都是release模式, 所以没有任何影响.

当然还有一个方案, 修改引擎,让config.json 使其在 mac平台或者win平台生效.    直接修改entry字段的内容就OK

终极方案:

我觉得这个事情应该可以完全插件处理的, 包括端口啥的可以自动分配处理. 不需要使用者额外再加任何代码.

这个得luaide插件作者来做吧, 我做的话就严重违法了. 即使做了,也顶多自己使用, 浪费时间,没有啥意义.

加的几行代码也仅仅是拷贝, 时间上无伤大雅.

插件安装目录:

~/.vscode/extensions/kangping.luaide-1.1.3

当我用vscode打开这个目录的时候, 找到了.node文件, 我以为是node项目, 用node各种版本去尝试调试它, 一直报错.

没有一个nodejs版本是支持x64_69版本的.  这个就让我很郁闷了.    只能换个思路, 直接调试vscode 编辑器.  因为插件是寄生在编辑器上的.

Mac App破解之路九 vscode插件破解

code 仅仅是一个shell脚本, 实质上真正调用的是 Electron可执行程序.   查了一下资料,  它是跨平台的应用框架.

和nodejs很像, 都是在v8上实现的,  所有逻辑都是js 或者 .node文件.

查找了一下Electron调试方法,发现可以调试,那太完美.     初始化的数据是 luaide.info 这个数据是加密,  在.node文件中进行解密.

Mac App破解之路九 vscode插件破解

Mac App破解之路九 vscode插件破解

从这个.node的文件逻辑中可以看到luaide原来的逻辑是啥样的:

class Persisten_1{

getScriptValue()

initWarp()

static createNew()

}

js 层面有3个方法:[

init,

getScriptValue,

luaIdecreate

]

createNew的实现

Mac App破解之路九 vscode插件破解

很明显这个是一个单例, 没什么好说的.

其实关键还是在于init函数, 和getScriptValue

init 函数功能加载luaide.info文件,  然后按照换行符切割,  保存到scriptmap中

getScriptValue函数的功能是根据key值获取脚本值,  这里有一个解密的过程,  本人懒得分析怎么解密了,  这里直接获取结果就好.

Mac App破解之路九 vscode插件破解

通过断点调试发现确实可以拿到数据.  接下来就好办了.

在readFileSync函数包装一层,先保存到文件. 文件名为 ${key}.js

    fs.readFileSync = function (path, options) {

       var newPath = path.replace(/\\/g, "/");
var lastIndex = newPath.lastIndexOf("/")
if(lastIndex > -1){
newPath = newPath.substring(lastIndex+1)
newPath = newPath.replace(".js","")
} var value = luaideIde.getScriptValue(newPath)
if (!!value) {
fs.writeFile(`${tempPath}/${newPath}.js`, value, { 'flag': 'w' }, function(err) {
if (err) {
throw err;
} console.log('OK:',newPath);
});
return value;
}else
{
return readFileSync(path, options);
}
};

最后所有代码都已经拿到了,效果如图:

Mac App破解之路九 vscode插件破解

有了代码,接下来想怎么玩耍就怎么玩耍了.

我发现作者真是煞费苦心啊,  防破解方面是花了大功夫了,  发现部分代码, 是走的网络.    aes解密后,动态执行代码.

Mac App破解之路九 vscode插件破解

看了一下代码, 代码量很多,并且质量不错,  花100块还是很划算的.

声明: 本人破解的软件, 破解的代码, 百分百不会放到网上,全部仅供个人娱乐. 学习使用.

launch.json
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/test/suite/index"
]
}
]
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
function activate(context) {
var fss = fs.readFileSync;
fs.readFileSync = function(path, op) {
return fss(path, op);
};
const vscode = require("vscode");
var path = require("path");
var fileName =
process.platform +
"_" +
process.arch +
"_" +
process.versions.modules +
".node";
var extensionPath = vscode.extensions.getExtension("kangping.luaide")
.extensionPath;
var libpath = path.join(extensionPath, "runtime", fileName);
var hotlib = require(libpath);
// new Function("require", "context", "hotlib", "luaIdeStart(require,context,hotlib);")(require, context,hotlib)
luaIdeStart(require, context, hotlib);
} function saveFiles(extensionPath, luaideIde) {
let list = [
"ApiInit",
"ApiUtils",
"AutoLuaComment",
"Base64",
"BaseChildProcess",
"BreakPointData",
"CacheCompletionInfo",
"ChangeCaseExtension",
"CheckDebug",
"CheckLuaDebugFile",
"CommentLuaCompletionManager",
"Common",
"ConstInfo",
"CreateFunction",
"CreateMoudleFunction",
"CreateNewTemplate",
"CreateTemplateFile",
"DCommon",
"DebugCommon",
"DebugReLoadFile",
"DownLoad",
"ExInit",
"ExtensionManager",
"FileCompletionItemManager",
"FunctionCall",
"FunctionParameter",
"GVarRefNameInfo",
"HttpClient",
"LoadLuaScript",
"LoadScriptResponse",
"LoadStringTest",
"LuaCheckDoEnd",
"LuaCheckLuaInfos",
"LuaCheckRepeat",
"LuaCheckReturn",
"LuaCheckUnary",
"LuaChuckInfo",
"LuaComment",
"LuaCompletionItemControler",
"LuaCompletionItemFunControler",
"LuaCompletionItemGolbalControler",
"LuaCompletionItemProvider",
"LuaCompletionItemProviderUtils",
"LuaDebug",
"LuaDefinitionProvider",
"LuaDocumentProvider",
"LuaDocumentSymbolProvider",
"LuaFileCompletionItems",
"LuaFiledCompletionInfo",
"LuaForLogic",
"LuaFormatChildProcess",
"LuaFormatParseTool",
"LuaFormattingEditProvider",
"LuaFuncitonCheck",
"LuaFunctionParse",
"LuaGolbalCompletionManager",
"LuaHighlight",
"LuaIdeClient",
"LuaIdeConfigManager",
"LuaIfLogic",
"LuaInfoManager",
"LuaLeftCheck",
"LuaMode",
"LuaParse",
"LuaParseTool",
"LuaParseTool1",
"LuaProcess",
"LuaProviderUtils",
"LuaProvoderUtil",
"LuaReferenceProvider",
"LuaSetValue",
"LuaSignatureHelpProvider",
"LuaSymbolInformation",
"LuaTableParse",
"LuaToDoProvider",
"LuaValidateBracket_G",
"LuaValidateBracket_M",
"LuaValidateConstValue",
"LuaValidateOperator",
"LuaVmTool",
"LuaWhileLogic",
"LuacCheck",
"LuaideConsole",
"LualOutlineProvider",
"OpenHelper",
"PBLuaCompleteManager",
"PBLuaCompletionInfo",
"ScopesManager",
"SynchronizationCode",
"TemplateManager",
"TokenInfo",
"TokenInfoCache",
"UserInfoManager",
"UserLoginCount",
"UserUtils",
"Utils",
"extension1",
"luaVmCheck",
"luacheck",
"luaideDebugInit",
"luaideInit1",
"luavm1",
"nodeMachine"
]; let srcPath = extensionPath + "/out/src/";
list.forEach(fileName => {
var value = luaideIde.getScriptValue(fileName);
if (!!value) {
fs.writeFile(`${srcPath}/${fileName}.js`, value, { 'flag': 'w' }, function(err) {
if (err) {
console.error("luaideIde.writeScriptValue faild:",err);
}
});
}
else{
console.error("luaideIde.getScriptValue faild:", fileName);
}
});
} global.luaideLoad = null; function luaIdeStart(re, con, lib) {
global.require = re;
global.context = con;
var vscode = re("vscode");
var fs = re("fs");
var extensionPath = vscode.extensions.getExtension("kangping.luaide")
.extensionPath;
var path = re("path");
var nodePath = path.join(extensionPath, "runtime", "luaide.info");
var tempPath = path.join(extensionPath, "runtime", "temp");
if (!fs.existsSync(tempPath)) {
fs.mkdirSync(tempPath, "0755");
}
var luaideIde = lib.luaIdecreate(); luaideIde.init(fs.readFileSync(nodePath)); // 保存文件
// setTimeout(function(){
// saveFiles(extensionPath,luaideIde);
// },3000); var fs = require("fs");
var readFileSync = fs.readFileSync;
fs.readFileSync = function(path, options) {
var newPath = path.replace(/\\/g, "/");
var lastIndex = newPath.lastIndexOf("/");
if (lastIndex > -1) {
newPath = newPath.substring(lastIndex + 1);
newPath = newPath.replace(".js", "");
} var value = luaideIde.getScriptValue(newPath);
if (value != "") {
return value;
} else {
return readFileSync(path, options);
}
};
luaideLoad("./extension1");
}
var requireStrs1 = [
"/signatureHelp/",
"/format/",
"/documentSymbol/",
"/definition/",
"/definition/",
"/completion/",
"/provider/",
"/manager/",
"/activitybar/",
"/helper/",
"/Template/",
"/ex/",
"/luatool/"
];
var requireStrs = [
"../../../../../",
"../../../../",
"../../../",
"../../",
"../"
];
luaideLoad = function(path) {
for (let index = 0; index < requireStrs1.length; index++) {
const element = requireStrs1[index]; while (true) {
if (path.indexOf(element) > -1) {
path = path.replace(element, "/");
} else {
break;
}
}
}
for (let index = 0; index < requireStrs.length; index++) {
const element = requireStrs[index];
while (true) {
if (path.indexOf(element) > -1) {
path = path.replace(element, '"./');
} else {
break;
}
}
} return require(path);
}; exports.activate = activate;
var vscode = luaideLoad("vscode");
var ConstInfo_1 = luaideLoad("./ConstInfo");
var LuaIdeClient_1 = luaideLoad("./LuaIdeClient");
var UserUtils_1 = luaideLoad("./UserUtils");
var LuaDocumentProvider_1 = luaideLoad("./LuaDocumentProvider");
var path = luaideLoad("path");
var fs = luaideLoad("fs");
var LuaToDoProvider_1 = luaideLoad("./LuaToDoProvider");
var DebugReLoadFile_1 = luaideLoad("./DebugReLoadFile");
ConstInfo_1.ConstInfo.exPath = vscode.extensions.getExtension(ConstInfo_1.ConstInfo.extensionConfig).extensionPath;
ConstInfo_1.ConstInfo.toDoManager = new LuaToDoProvider_1.ToDoManager();
vscode.commands.executeCommand('setContext', 'luaIdeDebugState', true);
vscode.debug.onDidReceiveDebugSessionCustomEvent(e => {
if (e.event == "LuaideReLoadFileEvent") {
}
else if (e.event == "LuaIdeDebugStart") {
ConstInfo_1.ConstInfo.debugState = true;
ConstInfo_1.ConstInfo.autoDebugReLoadFile = e.body.isAutoReLoadFile;
ConstInfo_1.ConstInfo.luaDebugExtNames = e.body.fileExtnames;
vscode.commands.executeCommand('setContext', 'luaIdeDebugState', true);
}
else if (e.event == "LuaIdeDebugEnd") {
vscode.commands.executeCommand('setContext', 'luaIdeDebugState', false);
ConstInfo_1.ConstInfo.debugState = false;
}
else if (e.event == "LuaideReLoadFileCompleteEvent") {
}
else if (e.event == "LuaDebugVersionErrorEvent") {
vscode.window.showErrorMessage("调试文件版本应该为:" + e.body.curVersion + ",请替换的的调试文件!", {
title: "打开最新调试文件目录",
isCloseAffordance: true,
id: 1
}).then(v => {
if (v && v.id == 1) {
vscode.commands.executeCommand('revealFileInOS', vscode.Uri.file(path.join(ConstInfo_1.ConstInfo.exPath, "luadebug", "test")));
}
});
}
});
vscode.commands.registerCommand("luaide.reLoadFile", (e) => {
DebugReLoadFile_1.DebugReLoadFile.sendMsg();
});
vscode.commands.registerCommand("luaide.runScript", (e) => {
var editor = vscode.window.activeTextEditor;
var script = editor.document.getText(editor.selection);
vscode.debug.activeDebugSession.customRequest("luaide_loadstript", {
script: script,
frameId: 0
}).then(function (e1) {
});
});
vscode.commands.registerCommand('luaide.searchText', (e) => {
var document = vscode.window.activeTextEditor.document;
var selection = vscode.window.activeTextEditor.selection;
var text = document.getText(new vscode.Range(selection.start, selection.end));
var luaideConfig = vscode.workspace.getConfiguration("luaide");
var macroListConfig = luaideConfig.get("openUriConfig");
var showConfig = new Array();
macroListConfig.forEach(c => {
var url = c.url;
url = url.replace("{selection}", text);
var showName = c.name + "->" + url;
showConfig.push(showName);
});
vscode.window.showQuickPick(showConfig).then(function (selection) {
if (!selection) {
return;
}
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(selection.split("->")[1]));
});
});
var debugTip = function (e) {
if (e.type == "lua") {
var showInfo = ["谢谢,我不使用调试功能!", "购买Luaide!(如果无法自动打开连接,可加QQ:3567349380)!",];
vscode.window.showQuickPick(showInfo, { placeHolder: "请支持正版,谢谢!" }).then(e => {
if (showInfo[1] == e) {
var previewUri = vscode.Uri.parse("https://www.showdoc.cc/luaide?page_id=711205379167780");
vscode.commands.executeCommand('vscode.open', previewUri);
}
});
}
};
var mdPath = path.join(ConstInfo_1.ConstInfo.exPath, 'doc', 'luaTemplatesDir.md');
var jsonPath = path.join(ConstInfo_1.ConstInfo.exPath, 'doc', 'doc.json');
this.json = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
vscode.window.registerTreeDataProvider('luaide_setting', new LuaDocumentProvider_1.LuaDocumentProvider(this.json.doc));
vscode.window.registerTreeDataProvider('luaide_user', new LuaDocumentProvider_1.LuaDocumentProvider(this.json.user));
vscode.window.registerTreeDataProvider('luaide_faq', new LuaDocumentProvider_1.LuaDocumentProvider(this.json.FAQ));
var luaToDoProvider = new LuaToDoProvider_1.LuaToDoProvider();
ConstInfo_1.ConstInfo.toDoManager.lualToDoProvider = luaToDoProvider;
vscode.window.registerTreeDataProvider('luaide_todo', luaToDoProvider);
vscode.commands.registerCommand('extension.openLuaIdeDoc', url => { vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(url)); });
ConstInfo_1.ConstInfo.userBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
ConstInfo_1.ConstInfo.userBarItem.show();
ConstInfo_1.ConstInfo.barItem = vscode.window.createStatusBarItem();
ConstInfo_1.ConstInfo.barItem.show();
ConstInfo_1.ConstInfo.barItem.text = "LuaIde 启动中...";
vscode.commands.registerCommand('luaide.delUser', (e) => {
new UserUtils_1.UserUtils().delUserInfo();
});
// new LuaIdeClient_1.LuaIdeClient(context);
// dzq
function LuaIdeClient2(context){
const ChangeCaseExtension_1 = luaideLoad("./luatool/ex/ChangeCaseExtension");
const cmf = luaideLoad("./luatool/ex/CreateMoudleFunction");
const CreateFunction = luaideLoad("./luatool/ex/CreateFunction");
const CreateTemplateFile_1 = luaideLoad("./luatool/ex/Template/CreateTemplateFile");
const util_1 = luaideLoad("util");
const vscode = luaideLoad("vscode");
const net = luaideLoad("net");
const LuaCompletionItemProvider_1 = luaideLoad("./luatool/provider/completion/LuaCompletionItemProvider");
const LuaDefinitionProvider_1 = luaideLoad("./luatool/provider/definition/LuaDefinitionProvider");
const LuaDocumentSymbolProvider_1 = luaideLoad("./luatool/provider/documentSymbol/LuaDocumentSymbolProvider");
const LuaMode_1 = luaideLoad("./luatool/provider/LuaMode");
const LuaSignatureHelpProvider_1 = luaideLoad("./luatool/provider/signatureHelp/LuaSignatureHelpProvider");
const LuaFormattingEditProvider_1 = luaideLoad("./luatool/provider/format/LuaFormattingEditProvider");
const LuaParse_1 = luaideLoad("./luatool/LuaParse");
const ExtensionManager_1 = luaideLoad("./luatool/ex/ExtensionManager")
const ExInit_1 = luaideLoad("./ExInit"); var em = new ExtensionManager_1.ExtensionManager();
var LuaParseEndFun866 = function() {
var tokens = new Array();
while (true) { var token = this.lpt.lex();
if (token.error != null) {
this.setError(token, token.error.msg);
return;
}
if (token.type == TokenInfo_1.TokenTypes.EOF) {
break;
}
token.index = tokens.length;
tokens.push(token);
}
this.tokens = tokens;
this.luaInfoManager.init(this, this.currentUri, this.tempUri);
this.tokenIndex = 0;
this.tokensLength = tokens.length;
var isReturn = false;
// try {
if (this.checkSemicolons(true))
this.tokenIndex++;
isReturn = this.setLuaInfo(this.rootLuaInfo, null, null);
// } catch (error) {
// console.log(error)
// }
var returnValueToken = null;
if (isReturn) {
// console.log("isReturn:"+isReturn)
if (this.tokenIndex < this.tokensLength) {
this.setError(this.getLastToken(), "return 的多余字符");
}
}
if (this.isError == false) {
for (var i = 0; i < this.errorFilePaths.length; i++) {
if (this.tempUri.path == this.errorFilePaths[i].path) {
this.errorFilePaths.splice(i, 1);
break;
}
}
//正确了删除错误提示
if (this.diagnosticCollection && this.diagnosticCollection.has(this.tempUri)) {
this.diagnosticCollection.delete(this.tempUri);
}
var fcim = this.luaInfoManager.currentFcim;
fcim.currentFunctionNames = null;
if (this.isSaveCompletion || (this.isSaveCompletion == false && this.isError == false)) {
var oldFcim = this.luaInfoManager.getFcimByPathStr(this.tempUri.path);
// if(oldFcim != null){
// LuaGolbalCompletionManager.clearGolbalCompletion(oldFcim.luaGolbalCompletionInfo)
// LuaGolbalCompletionManager.clearGolbalCompletion(oldFcim.luaFunCompletionInfo)
// }
if (isReturn) {
if (this.tokensLength - 2 >= 0) {
var endIndex = this.tokensLength - 1;
while (endIndex > 0) {
if (this.consume(';', tokens[endIndex], TokenInfo_1.TokenTypes.Punctuator)) {
endIndex--;
}
else {
break;
}
}
var returnToken = tokens[endIndex - 1];
if (this.consume('return', returnToken, TokenInfo_1.TokenTypes.Keyword)) {
if (tokens[endIndex].type == TokenInfo_1.TokenTypes.Identifier) {
returnValueToken = tokens[endIndex];
fcim.setRootCompletionInfo(returnValueToken.value);
}
}
}
}
this.luaInfoManager.fileCompletionItemManagers.set(this.tempUri.path, fcim);
LuaFileCompletionItems_1.LuaFileCompletionItems.getLuaFileCompletionItems().checkCompletion(fcim, this.isApi);
// LuaGolbalCompletionManager.setGolbalCompletion(fcim.luaGolbalCompletionInfo)
// LuaGolbalCompletionManager.setGolbalCompletion(fcim.luaFunCompletionInfo)
this.luaInfoManager.currentFcim = null;
fcim.tokens = null;
this.tokenInfoCache.gc(this.tokens);
this.tokens = null;
this.tokenInfoCache.gcLuaInfo();
this.tokenInfoCache.gcLuaComment();
this.tokenInfoCache.gcLuaRange();
this.tokenInfoCache.clearLuaFiledCompletionInfo();
}
this.luaInfoManager.fileCompletionItemManagers.delete(this.currentUri.path);
}
else {
var fcim = this.luaInfoManager.fileCompletionItemManagers.get(this.currentUri.path);
fcim.clear();
}
} var COMMAND_LABELS = {
toUpperCase: 'toUpperCase',
toLowerCase: 'toLowerCase',
createModuleFunction: 'createModuleFunction',
CreateFunction: "CreateFunction",
createTemplateFile: "createTemplateFile",
LoadLuaScript: "LoadLuaScript",
chatShow: "chatShow",
donate: "donate",
helper:"helper",
resetPwd:"resetPwd",
delUser:"delUser"
};
new LuaParse_1.LuaParse();
var COMMAND_DEFINITIONS = [
{ label: COMMAND_LABELS.toUpperCase, description: '转换为大写', func: ChangeCaseExtension_1.toUpperCase },
{ label: COMMAND_LABELS.toLowerCase, description: '转换为小写', func: ChangeCaseExtension_1.toLowerCase },
{ label: COMMAND_LABELS.createModuleFunction, description: '创建模块方法', func: cmf.createModuleFunction },
{ label: COMMAND_LABELS.CreateFunction, description: '创建方法', func: CreateFunction.createFunction },
{ label: COMMAND_LABELS.createTemplateFile, description: '创建模板文件', func: CreateTemplateFile_1.CreateTemplateFile.run }, ];
vscode.commands.registerCommand('luaide.changecase.toLowerCase', (e) => { RunCommand(COMMAND_DEFINITIONS, COMMAND_LABELS.toLowerCase, e); });
vscode.commands.registerCommand('luaide.changecase.toUpperCase', (e) => { RunCommand(COMMAND_DEFINITIONS, COMMAND_LABELS.toUpperCase, e); });
vscode.commands.registerCommand('luaide.utils.createModuleFunction', (e) => { RunCommand(COMMAND_DEFINITIONS, COMMAND_LABELS.createModuleFunction, e); });
vscode.commands.registerCommand('luaide.utils.createFunction1', (e) => { RunCommand(COMMAND_DEFINITIONS, COMMAND_LABELS.CreateFunction, e); });
vscode.commands.registerCommand('luaide.utils.createTemplateFile', (e) => { RunCommand(COMMAND_DEFINITIONS, COMMAND_LABELS.createTemplateFile, e); }); vscode.commands.registerCommand('luaide.reConn', (e) => {
ConstInfo_1.ConstInfo.barItem.text = "LuaIde 需要重连--dzq";
// if(isCloseConn) {
// vscode.commands.executeCommand('workbench.action.reloadWindow');
// return
// }
// if(reCount482 >= 5){
// reCount482 = 0
// reConnServer();
// } });
LuaParse_1.LuaParse.lp.end = LuaParseEndFun866;
var luaCompletionItemProvider = new LuaCompletionItemProvider_1.LuaCompletionItemProvider();
var luaSignatureHelpProvider = new LuaSignatureHelpProvider_1.LuaSignatureHelpProvider();
var luaFormattingEditProvider = new LuaFormattingEditProvider_1.LuaFormattingEditProvider();
var rangeluaFormattingEditProvider = new LuaFormattingEditProvider_1.LuaFormattingEditProvider();
var luaDefinitionProvider = new LuaDefinitionProvider_1.LuaDefinitionProvider()
var luaDocumentSymbolProvider = new LuaDocumentSymbolProvider_1.LuaDocumentSymbolProvider()
global.luaideProvider = {
luaCompletionItemProvider : luaCompletionItemProvider,
luaDefinitionProvider : luaDefinitionProvider
}
global.luaFunCache = {
provideCompletionItems : luaideProvider.luaCompletionItemProvider.provideCompletionItems,
luaDefinitionProvider : luaideProvider.luaDefinitionProvider.provideDefinition
} ExInit_1.initLuaIdeEx(context,function(){ context.subscriptions.push(vscode.languages.registerCompletionItemProvider(LuaMode_1.LUA_MODE, luaCompletionItemProvider,
'.', ":", '"', "'", "[", "@",",","="));
context.subscriptions.push(vscode.languages.registerDefinitionProvider(LuaMode_1.LUA_MODE, luaDefinitionProvider));
context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(LuaMode_1.LUA_MODE, luaDocumentSymbolProvider));
context.subscriptions.push(vscode.languages.registerSignatureHelpProvider(LuaMode_1.LUA_MODE, luaSignatureHelpProvider, '(', ','));
context.subscriptions.push(vscode.languages.registerDocumentFormattingEditProvider(LuaMode_1.LUA_MODE, luaFormattingEditProvider));
context.subscriptions.push(vscode.languages.registerDocumentRangeFormattingEditProvider(LuaMode_1.LUA_MODE, rangeluaFormattingEditProvider)); });
} try {
global.ConstInfo_1 = luaideLoad("./ConstInfo");
global.userBarItem = ConstInfo_1.ConstInfo.userBarItem
LuaIdeClient2(context);
} catch (error) {
console.log("error === ",error);
} function downLoadFile(downinfo, callBack) {
var md5url = downinfo.md5url;
var downLoadUrl = downinfo.downLoadUrl;
var filePath = downinfo.filePath;
var http = luaideLoad("http");
http.get(md5url, function (req, res) {
var html = '';
req.on('data', function (data) {
html += data;
});
req.on('end', function () {
var isDown = false;
if (!fs.existsSync(filePath)) {
isDown = true;
}
else {
var crypto = require('crypto');
var contentText = fs.readFileSync(filePath, 'utf-8');
var hash = crypto.createHash('md5');
hash.update(contentText);
var packagemd5 = hash.digest('hex');
if (packagemd5 != html) {
isDown = true;
}
}
if (!isDown) {
console.log("相同不需要修改!");
callBack();
}
else {
console.log("不相同" + filePath);
var req = http.get(downLoadUrl, function (res) {
var imgData = "";
res.setEncoding("binary");
res.on("data", function (chunk) {
imgData += chunk;
});
res.on("end", function () {
fs.writeFile(filePath, imgData, "binary", function (err) {
if (err) {
return;
}
});
callBack();
});
res.on("error", function (err) {
console.log(err);
});
});
}
});
req.on('error', function (err) {
});
});
}
setTimeout(function () {
function deleteall(path) {
var files = [];
if (fs.existsSync(path)) {
files = fs.readdirSync(path);
files.forEach(function (file, index) {
var curPath = path + "/" + file;
if (fs.statSync(curPath).isDirectory()) {
deleteall(curPath);
}
else {
fs.unlinkSync(curPath);
}
});
}
}
var extensionPath = vscode.extensions.getExtension("kangping.luaide").extensionPath;
try {
var tempPath = path.join(extensionPath, "runtime", "temp");
deleteall(tempPath);
if (!fs.existsSync(tempPath)) {
fs.mkdirSync(tempPath, '0755');
}
}
catch (error) {
console.log(error.trace);
}
}, 30 * 100000);

破解成功效果图:

Mac App破解之路九 vscode插件破解

希望永远不要再破这样的插件,真是浪费好多时间, 不得不佩服作者防破能力.

Mac App破解之路九 vscode插件破解的更多相关文章

  1. 【APP设计利器】Sketch 41 Mac中文破解版&lpar;含汉化插件&rpar;

    Sketch是一款拥有美观界面和强大功能适用于所有设计师的专业矢量绘图工具.它旨在为美术设计师创造出一款更优秀的作品,不是复制品,而是提升品.Sketch简约的设计是基于无限的规模和层次的绘图空间,免 ...

  2. 2019&period;1&period;7 Mac的Vscode插件总结

    Vscode插件 通用插件 Chinese 配置中文界面 HTML Snippets H5代码片段以及提示 HTML CSS Support 让 html 标签上写class 智能提示当前项目所支持的 ...

  3. VSCODE 插件初探

    写在前面 分享一个vscode插件background(用于改变背景).点击直接跳到vscode插件开发步骤 做vscode的插件,很久就有这个想法了,但是一直因为这样,那样的事情耽误,放弃了N次.不 ...

  4. 用VSCode插件来一键填满Github的绿色格子吧-AutoCommit

    autoCommit 一个用于Git自动commit的VSCode插件,它可以用来补充之前忘记提交commit,帮助你把首页的绿色格子填满. 使用效果 使用本插件来控制commit次数. 如下图,你甚 ...

  5. 干货:用好这13款VSCode插件,工作效率提升10倍

    文章每周持续更新,原创不易,「三连」让更多人看到是对我最大的肯定.可以微信搜索公众号「 后端技术学堂 」第一时间阅读(一般比博客早更新一到两篇) 大家好我是lemon, 马上进入我们今天的主题吧. 又 ...

  6. Mac上的欧路词典单词本迁移到有道词典 &num;node&period;js

    摘要 有道词典提供了柯林斯和朗文辞典,加上最近在背单词且Mac版的屏幕取词也够用了,为了云单词本的同步,决定抛弃Mac上的欧路词典.单词欧路上的单词本也存了一百多个单词.怎样迁移到有道呢? 关键词:n ...

  7. mac app icon 设置

    mac app icon 设置 1:目前 mac app 所需要的icon 图标尺寸 icon_16x16.png 16px icon_16x16@2x.png 32px icon_32x32.png ...

  8. &lbrack;转&rsqb;Mac App distribution in App Store

    Mac程序的大包上传和iOS的有些许不同,因为Mac app既可以上传到store,也可以不通过store供人下载.因此,code sign和provision要根据情况(开发,release< ...

  9. iOS中 CocoaPods Mac App的安装和使用 韩俊强的博客

    CocoaPods Mac App的安装和使用 CocoaPods桌面应用版下载地址:https://cocoapods.org/app打开应用会提示你是否安装命令行工具,选择install就也可以在 ...

随机推荐

  1. &lbrack;MVC4&rsqb;初识&period;NET MVC4

    最近一个月都在专心做unity3d的斗地主游戏,从早到晚,最后总算是搞出来了,其中的心酸只有自己知道.最近才有功夫闲下来,还是学习学习之前的老本行——asp.net,现在用.net做项目流行MVC,而 ...

  2. android native crash 分析

    工具: addr2line arm-linux-androideabi-addr2line -aCfe libart.so 0x63006d 当libart.so包含符号表的情况下,可以查询到他的地址 ...

  3. tweenmax&period;js 文档

    TweenMax 参考http://bbs.9ria.com/thread-214959-1-1.html TweenMax 可能是很多人都用的,包括我 但 是最近发现大量的运用就总会产生这样或那样的 ...

  4. 老王Python培训视频教程(价值500元)【基础进阶项目篇 &ndash&semi; 完整版】

    老王Python培训视频教程(价值500元)[基础进阶项目篇 – 完整版] 教学大纲python基础篇1-25课时1.虚拟机安装ubuntu开发环境,第一个程序:hello python! (配置开发 ...

  5. HDU 4417 Super Mario&lpar;划分树&plus;二分&rpar;

    题目链接 #include <cstdio> #include <cstring> #include <algorithm> using namespace std ...

  6. Echarts个人实例

    1.deviceOperateTrendIndex.jsp <%@ page language="java" contentType="text/html; cha ...

  7. PPTP模式跟L2TP模式有什么不同

    使用VPN的时候经常会看到商家说支持PPTP模式和L2TP模式,但是许多朋友都不知道有什么区别,该用哪一个,下面给你们讲讲: 1).PPTP协议是点对点隧道协议:其将控制包与数据包分开,控制包采用TC ...

  8. Linq 合并数据并相加

    有几条数据是这样的 Person      123    456      789 Person      321    654      987 想合并成 Person      444     1 ...

  9. March of the Penguins

    poj3498:http://poj.org/problem?id=3498 题意:某个冰块上有a只企鹅,总共可以跳出去b只,问是否可能所有的企鹅都跳到某一块冰块上,输出所有的可能的冰块的编号. 由于 ...

  10. python抓取zabbix图形&comma;并发送邮件

    最近十九大非常烦,作为*网站维护人员,简直是夜不能寐.各种局子看着你,内保局,*部,360,天融信,华胜天成,*工委,政治委员会... 360人员很傻X,作为安全公司,竟然不能抓到XX网站流量, ...