Theme NexT works best with JavaScript enabled
安装 npm 以及 asar
解压 GitKraken 的资源文件 1 2 asar extract ./app.asar ./tmp/
修改 static/index.js 文件(注意备份) 下面是 v6.5.1 之后的版本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 @@ -1,6 +1,27 @@ // Warning: You almost certainly do *not* want to edit this code - // instead, you want to edit src/js/main.jsx instead + +function PatchSnapshot() { + const edmLiteD = snapshotResult.customRequire('@axosoft/edm-lite-d/src/d.js'); + snapshotResult.customRequire.cache['@axosoft/edm-lite-d/src/d.js'] = { + exports: function() { + let response = JSON.parse(edmLiteD(...arguments).toString('utf8')); + if ('licenseExpiresAt' in response || 'licensedFeatures' in response) { + response = { + ...response, + availableTrialDays: null, + licenseExpiresAt: 8640000000000000, + licensedFeatures: ['pro'] + }; + } + return Buffer.from(JSON.stringify(response), 'utf8'); + } + }; +} + (function() { + PatchSnapshot(); + const Perf = snapshotResult.customRequire('./src/js/utils/Performance.js'); Perf.timeEnd('loading monaco scripts'); Perf.time('index.js pre-bootstrap');
下面是 v6.5.1 之前的版本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 @@ -1,7 +1,29 @@ // Warning: You almost certainly do *not* want to edit this code - // instead, you want to edit src/js/main.jsx instead +function XhrPromiseReduxProxy() { + const xhrPromiseRedux = snapshotResult.customRequire( + 'xhr-promise-redux/dist/index.js' + ); + xhrPromiseRedux._post = xhrPromiseRedux.post; + xhrPromiseRedux.post = async (url, options) => { + const res = await xhrPromiseRedux._post(url, options); + if (url.match(/https:\/\/.*api.gitkraken.com\/phone-home/)) { + res.body.availableTrialDays = null; + res.body.code = 0; + res.body.features = []; + res.body.individualAccessState = null; + res.body.licenseExpiresAt = 8640000000000000; + res.body.licensedFeatures = ['pro']; + res.body.proAccessState = null; + } + return res; + }; +} + (function() { + XhrPromiseReduxProxy(); + const Perf = snapshotResult.customRequire('./src/js/utils/Performance.js'); Perf.timeEnd('loading monaco scripts'); Perf.time('index.js pre-bootstrap');
重新打包 1 asar pack ./tmp/ app.asar