引用:https://blog.csdn.net/MR_ls2/article/details/105072754
<div class="markdown_views prism-atom-one-dark" id="content_views">
<!-- flowchart 箭头图标 勿删 -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<path id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);" stroke-linecap="round" d="M 5 0 L 0 2.5 L 5 5 Z" />
</svg>
<h2><a name="t0"></a><a id="UnityHub_1"></a>UnityHub无法连接证书服务器各种烦的彻底解决方案</h2>
<p><strong>1:</strong><a href="https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.exe" rel="nofollow">下载UnityHub</a></p>
<p><strong>2:</strong><a href="https://cdn.npm.taobao.org/dist/node/v12.16.1/node-v12.16.1-x64.msi" rel="nofollow">下载Node.js</a></p>
<p><strong>3:</strong> Win+R(输入命令) npm install -g asar 直到出来下图<br>
<img alt="" src="https://img-blog.csdnimg.cn/2020032414474984.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01SX2xzMg==,size_16,color_FFFFFF,t_70"><br>
<strong>4:</strong> 下载完UnityHub默认在C盘,<br>
打开 C:\Program Files\Unity Hub\resources。单击resources,按住shift,打开Windows PowerShell。 输入asar extract .\app.asar app。<br>
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/2020032414575457.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01SX2xzMg==,size_16,color_FFFFFF,t_70"><br>
<strong>5:</strong> 如果报了下图错误<br>
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200324145938501.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01SX2xzMg==,size_16,color_FFFFFF,t_70"><br>
用管理员身份重新运行,输入set-ExecutionPolicy RemoteSigned<br>
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200324150554328.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01SX2xzMg==,size_16,color_FFFFFF,t_70"><br>
<strong>6:</strong> 然后cd到UnityHub目录 ,<br>
cd C:\Program Files\Unity Hub\resources<br>
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200324151000340.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01SX2xzMg==,size_16,color_FFFFFF,t_70"><br>
<strong>7:</strong> 删除app.asar。<br>
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200324153357838.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L01SX2xzMg==,size_16,color_FFFFFF,t_70"><br>
<strong>8:</strong> 替换下面的2个文件,在解压出来的app文件夹里面<br>
<strong>C:\Program Files\Unity Hub\resources\app\src\services\licenseService\licenseClient.js</strong></p>
<pre class="prettyprint"><code class="has-numbering" style="position: unset;" onclick="mdcp.copyCode(event)">getLicenseInfo(callback) {
// load license
// get latest data from licenseCore
//licenseInfo.activated = licenseCore.getLicenseToken().length > 0;//注释这行
licenseInfo.activated = true;//新增这行
licenseInfo.flow = licenseCore.getLicenseKind();
licenseInfo.label = licenseCore.getLicenseKind(true);
licenseInfo.offlineDisabled = licenseCore.offlineDisabled;
licenseInfo.transactionId = licenseCore.getTransactionId();
}
<div class="hljs-button {2}" data-title="复制"></div></code><ul class="pre-numbering"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li></ul></pre>
<p><strong>C:\Program Files\Unity Hub\resources\app\src\services\licenseService\licenseCore.js</strong></p>
<pre class="prettyprint"><code class="has-numbering" style="position: unset;" onclick="mdcp.copyCode(event)">verifyLicenseData(xml, newfile = false) {
return new Promise((resolve, reject) => {
resolve(true);//新增这行
if (xml === '') {
this.licenseStatus = LICENSE_STATUS.kLicenseErrorFlag_NoLicense;
reject();
return;
}
}
}
<div class="hljs-button {2}" data-title="复制"></div></code><ul class="pre-numbering"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li></ul></pre>
<p><strong>9:</strong> 如果无法保存,可以复制到桌面改完再替换进去。</p>
</div>