camunda.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="generator" content="Asciidoctor 2.0.15">
  8. <title>Camunda</title>
  9. <link rel="stylesheet" href="css/site.css">
  10. <link href="css/custom.css" rel="stylesheet">
  11. <script src="js/setup.js"></script><script defer src="js/site.js"></script>
  12. </head>
  13. <body class="article toc2 toc-left"><div id="banner-container" class="container" role="banner">
  14. <div id="banner" class="contained" role="banner">
  15. <div id="switch-theme">
  16. <input type="checkbox" id="switch-theme-checkbox" />
  17. <label for="switch-theme-checkbox">Dark Theme</label>
  18. </div>
  19. </div>
  20. </div>
  21. <div id="tocbar-container" class="container" role="navigation">
  22. <div id="tocbar" class="contained" role="navigation">
  23. <button id="toggle-toc"></button>
  24. </div>
  25. </div>
  26. <div id="main-container" class="container">
  27. <div id="main" class="contained">
  28. <div id="doc" class="doc">
  29. <div id="header">
  30. <h1>Camunda</h1>
  31. <div id="toc" class="toc2">
  32. <div id="toctitle">Table of Contents</div>
  33. <span id="back-to-index"><a href="index.html">Back to index</a></span><ul class="sectlevel1">
  34. <li><a href="#_企业版破解方法">1. 企业版破解方法</a></li>
  35. </ul>
  36. </div>
  37. </div>
  38. <div id="content">
  39. <div id="preamble">
  40. <div class="sectionbody">
  41. <div class="paragraph">
  42. <p>Camunda是通用的流程编排引擎</p>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="sect1">
  47. <h2 id="_企业版破解方法"><a class="anchor" href="#_企业版破解方法"></a>1. 企业版破解方法</h2>
  48. <div class="sectionbody">
  49. <div class="paragraph">
  50. <p>Camunda Platform企业版功能比社区版更完善,不过企业版默认仅能试用30天,按照如下方法可以突破此限制长期使用。</p>
  51. </div>
  52. <div class="paragraph">
  53. <p>首先在 <a href="https://camunda.com/download/">Camunda下载页面</a>选择 <code>30-Day Trial Enterprise Edition</code> 填写相关信息后下载企业版,
  54. 注意邮箱必须填写真实邮箱,因为Camunda会向邮箱发送一个试用账号和License,只有使用此账号才能下载。</p>
  55. </div>
  56. <div class="paragraph">
  57. <p>下载并解压后的Camunda目录结构如下所示,在internal/webapps目录下有一个名称为 <code>camunda-license-check</code> 的jar包,
  58. 这个jar包就负责校验license,后续步骤会替换jar包根目录下的公钥 <code>unified_public_key.der</code></p>
  59. </div>
  60. <div class="literalblock">
  61. <div class="content">
  62. <pre>configuration/
  63. internal/
  64. --example/
  65. --rest/
  66. --swaggerui/
  67. --webapps/</pre>
  68. </div>
  69. </div>
  70. <div class="paragraph">
  71. <p>下一步执行如下如下Java类生成密钥对和签名,注意修改main方法中的 <code>privateKeyPath</code> 和 <code>publicKeyPath</code> 两个参数为电脑上存在的目录。
  72. 这个类运行后会打印一个无限期使用的license字符串,保存下来在下一步使用。</p>
  73. </div>
  74. <div class="listingblock">
  75. <div class="content">
  76. <pre class="highlight"><code class="language-java" data-lang="java"><span class="fold-block hide-when-folded">import org.apache.commons.codec.binary.Base64;
  77. import org.springframework.util.FileCopyUtils;
  78. import java.io.File;
  79. import java.io.FileOutputStream;
  80. import java.io.IOException;
  81. import java.security.*;
  82. import java.security.spec.InvalidKeySpecException;
  83. import java.security.spec.PKCS8EncodedKeySpec;
  84. </span><span class="fold-block">public class Camunda {
  85. private static final Base64 BASE64 = new Base64(0);
  86. /**
  87. * 生成密钥对
  88. * @param privateKeyPath 私钥文件
  89. * @param publicKeyPath 公钥文件
  90. * @throws NoSuchAlgorithmException
  91. * @throws IOException
  92. */
  93. private static void generateKeyPair(String privateKeyPath, String publicKeyPath) throws NoSuchAlgorithmException, IOException {
  94. KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
  95. keyPairGenerator.initialize(4096);
  96. KeyPair keyPair = keyPairGenerator.generateKeyPair();
  97. PrivateKey aPrivate = keyPair.getPrivate();
  98. PublicKey aPublic = keyPair.getPublic();
  99. byte[] publicEncoded = aPublic.getEncoded();
  100. byte[] privateEncoded = aPrivate.getEncoded();
  101. FileCopyUtils.copy(publicEncoded, new FileOutputStream(publicKeyPath));
  102. FileCopyUtils.copy(privateEncoded, new FileOutputStream(privateKeyPath));
  103. }
  104. private static String sign(String privateKeyPath) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException {
  105. KeyFactory keyFactory = KeyFactory.getInstance("RSA");
  106. PKCS8EncodedKeySpec keySpec1 = new PKCS8EncodedKeySpec(FileCopyUtils.copyToByteArray(new File(privateKeyPath)));
  107. PrivateKey privateKey = keyFactory.generatePrivate(keySpec1);
  108. Signature signature = Signature.getInstance("SHA256withRSA");
  109. signature.initSign(privateKey);
  110. String licenseBody = "customer = jd;expiryDate = unlimited;cawemo = true;optimize = true;camundaBPM = true;";
  111. signature.update(licenseBody.getBytes());
  112. byte[] sign = signature.sign();
  113. String encodedSign = BASE64.encodeToString(sign);
  114. encodedSign = encodedSign + ";\n" + "customer = jd;\nexpiryDate = unlimited;\ncawemo = true;\noptimize = true;\ncamundaBPM = true;";
  115. return encodedSign;
  116. }
  117. public static void main(String[] args) throws NoSuchAlgorithmException, IOException, InvalidKeySpecException, SignatureException, InvalidKeyException {
  118. String privateKeyPath = "C:/Users/pxzxj1/Desktop/private_key.pem";
  119. String publicKeyPath = "C:/Users/pxzxj1/Desktop/unified_public_key.der";
  120. generateKeyPair(privateKeyPath, publicKeyPath);
  121. String signature = sign(privateKeyPath);
  122. System.out.println(signature);
  123. }
  124. }
  125. </span></code></pre>
  126. </div>
  127. </div>
  128. <div class="paragraph">
  129. <p>使用上一步生成的unified_public_key.der公钥替换 <code>camunda-license-check</code> jar包中的对应公钥后就可以启动服务。启动后在License Key菜单中输入上一步生成的
  130. License字符串,保存后会提示 <span class="green">Your license key has unlimited validity. It will not expire.</span> 表示已经破解成功。</p>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <div id="footer">
  136. <div id="footer-text">
  137. Last updated 2024-03-18 05:44:42 UTC
  138. </div>
  139. </div>
  140. <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
  141. <script>
  142. if (!hljs.initHighlighting.called) {
  143. hljs.initHighlighting.called = true
  144. ;[].slice.call(document.querySelectorAll('pre.highlight > code')).forEach(function (el) { hljs.highlightBlock(el) })
  145. }
  146. </script>
  147. <script src="https://utteranc.es/client.js"
  148. repo="pxzxj/articles"
  149. issue-term="title"
  150. label="utteranc"
  151. theme="github-light"
  152. crossorigin="anonymous"
  153. async>
  154. </script>
  155. </div>
  156. </div>
  157. </div>
  158. </body>
  159. </html>