Browse Source

Get license tool

dongjunhong 2 months ago
parent
commit
48c022e82c
2 changed files with 49 additions and 0 deletions
  1. 26 0
      src/tool/tool_getLicense/main.cpp
  2. 23 0
      src/tool/tool_getLicense/tool_getLicense.pro

+ 26 - 0
src/tool/tool_getLicense/main.cpp

@@ -0,0 +1,26 @@
+#include <QCoreApplication>
+#include "QDebug"
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+        QString str="640d0df56d6g876cc1d0c49c99h4156c";
+        QString decryptedText;
+        for (int i = 0; i < str.length(); ++i) {
+                QChar currentChar = str.at(i);
+                if (currentChar.isLetter()) {
+                    QChar decryptedChar = (currentChar.toLatin1() - 'a' - 2 + 26) % 26 + 'a'; // 反解密操作
+                    if (currentChar.isUpper()) {
+                        decryptedChar = (currentChar.toLatin1() - 'A' - 2 + 26) % 26 + 'A'; // 如果是大写字母
+                    }
+                    decryptedText.append(decryptedChar);
+                } else if (currentChar.isDigit()) {
+                    QChar decryptedChar = (currentChar.toLatin1() - '0' - 4 + 10) % 10 + '0'; // 反解密操作
+                    decryptedText.append(decryptedChar);
+                } else {
+                    decryptedText.append(currentChar); // 如果不是字母或数字,则保持不变
+                }
+            }
+        qDebug()<< decryptedText;
+
+    return a.exec();
+}

+ 23 - 0
src/tool/tool_getLicense/tool_getLicense.pro

@@ -0,0 +1,23 @@
+QT -= gui
+
+CONFIG += c++11 console
+CONFIG -= app_bundle
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+        main.cpp
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target