mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2025-02-16 22:21:30 +08:00
New project structure
Load translation file in the executable.
This commit is contained in:
parent
b319f9fbe1
commit
f86cba8d56
73
.gitignore
vendored
73
.gitignore
vendored
@ -1,72 +1 @@
|
|||||||
# This file is used to ignore files which are generated
|
/build*
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
*~
|
|
||||||
*.autosave
|
|
||||||
*.a
|
|
||||||
*.core
|
|
||||||
*.moc
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
*.orig
|
|
||||||
*.rej
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
*_pch.h.cpp
|
|
||||||
*_resource.rc
|
|
||||||
.#*
|
|
||||||
*.*#
|
|
||||||
core
|
|
||||||
!core/
|
|
||||||
tags
|
|
||||||
.DS_Store
|
|
||||||
.directory
|
|
||||||
*.debug
|
|
||||||
Makefile*
|
|
||||||
*.prl
|
|
||||||
*.app
|
|
||||||
moc_*.cpp
|
|
||||||
ui_*.h
|
|
||||||
qrc_*.cpp
|
|
||||||
Thumbs.db
|
|
||||||
*.res
|
|
||||||
*.rc
|
|
||||||
/.qmake.cache
|
|
||||||
/.qmake.stash
|
|
||||||
|
|
||||||
# qtcreator generated files
|
|
||||||
*.pro.user*
|
|
||||||
|
|
||||||
# xemacs temporary files
|
|
||||||
*.flc
|
|
||||||
|
|
||||||
# Vim temporary files
|
|
||||||
.*.swp
|
|
||||||
|
|
||||||
# Visual Studio generated files
|
|
||||||
*.ib_pdb_index
|
|
||||||
*.idb
|
|
||||||
*.ilk
|
|
||||||
*.pdb
|
|
||||||
*.sln
|
|
||||||
*.suo
|
|
||||||
*.vcproj
|
|
||||||
*vcproj.*.*.user
|
|
||||||
*.ncb
|
|
||||||
*.sdf
|
|
||||||
*.opensdf
|
|
||||||
*.vcxproj
|
|
||||||
*vcxproj.*
|
|
||||||
|
|
||||||
# MinGW generated files
|
|
||||||
*.Debug
|
|
||||||
*.Release
|
|
||||||
|
|
||||||
# Python byte code
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# Binaries
|
|
||||||
# --------
|
|
||||||
*.dll
|
|
||||||
*.exe
|
|
||||||
|
|
@ -55,12 +55,9 @@ Great thanks to him.
|
|||||||
sudo apt-get install qt5-default libqt5serialport5 libqt5serialport5-dev
|
sudo apt-get install qt5-default libqt5serialport5 libqt5serialport5-dev
|
||||||
git clone https://github.com/wh201906/Proxmark3GUI.git --depth=1
|
git clone https://github.com/wh201906/Proxmark3GUI.git --depth=1
|
||||||
cd Proxmark3GUI
|
cd Proxmark3GUI
|
||||||
mkdir build
|
mkdir build && cd build
|
||||||
cd build
|
qmake ../src
|
||||||
qmake ../
|
make -j4 && make clean
|
||||||
make
|
|
||||||
make clean
|
|
||||||
cp -r ../lang ./
|
|
||||||
cp -r ../config ./
|
cp -r ../config ./
|
||||||
./Proxmark3GUI
|
./Proxmark3GUI
|
||||||
|
|
||||||
|
@ -54,12 +54,9 @@ release页面中有含客户端的GUI。这个GUI也可以搭配你自己的客
|
|||||||
sudo apt-get install qt5-default libqt5serialport5 libqt5serialport5-dev
|
sudo apt-get install qt5-default libqt5serialport5 libqt5serialport5-dev
|
||||||
git clone https://github.com/wh201906/Proxmark3GUI.git --depth=1
|
git clone https://github.com/wh201906/Proxmark3GUI.git --depth=1
|
||||||
cd Proxmark3GUI
|
cd Proxmark3GUI
|
||||||
mkdir build
|
mkdir build && cd build
|
||||||
cd build
|
qmake ../src
|
||||||
qmake ../
|
make -j4 && make clean
|
||||||
make
|
|
||||||
make clean
|
|
||||||
cp -r ../lang ./
|
|
||||||
cp -r ../config ./
|
cp -r ../config ./
|
||||||
./Proxmark3GUI
|
./Proxmark3GUI
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
[Languages]
|
|
||||||
en_US=English
|
|
||||||
zh_CN=简体中文
|
|
72
src/.gitignore
vendored
Normal file
72
src/.gitignore
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# This file is used to ignore files which are generated
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
*~
|
||||||
|
*.autosave
|
||||||
|
*.a
|
||||||
|
*.core
|
||||||
|
*.moc
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*_pch.h.cpp
|
||||||
|
*_resource.rc
|
||||||
|
.#*
|
||||||
|
*.*#
|
||||||
|
core
|
||||||
|
!core/
|
||||||
|
tags
|
||||||
|
.DS_Store
|
||||||
|
.directory
|
||||||
|
*.debug
|
||||||
|
Makefile*
|
||||||
|
*.prl
|
||||||
|
*.app
|
||||||
|
moc_*.cpp
|
||||||
|
ui_*.h
|
||||||
|
qrc_*.cpp
|
||||||
|
Thumbs.db
|
||||||
|
*.res
|
||||||
|
*.rc
|
||||||
|
/.qmake.cache
|
||||||
|
/.qmake.stash
|
||||||
|
|
||||||
|
# qtcreator generated files
|
||||||
|
*.pro.user*
|
||||||
|
|
||||||
|
# xemacs temporary files
|
||||||
|
*.flc
|
||||||
|
|
||||||
|
# Vim temporary files
|
||||||
|
.*.swp
|
||||||
|
|
||||||
|
# Visual Studio generated files
|
||||||
|
*.ib_pdb_index
|
||||||
|
*.idb
|
||||||
|
*.ilk
|
||||||
|
*.pdb
|
||||||
|
*.sln
|
||||||
|
*.suo
|
||||||
|
*.vcproj
|
||||||
|
*vcproj.*.*.user
|
||||||
|
*.ncb
|
||||||
|
*.sdf
|
||||||
|
*.opensdf
|
||||||
|
*.vcxproj
|
||||||
|
*vcxproj.*
|
||||||
|
|
||||||
|
# MinGW generated files
|
||||||
|
*.Debug
|
||||||
|
*.Release
|
||||||
|
|
||||||
|
# Python byte code
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Binaries
|
||||||
|
# --------
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
|
@ -22,6 +22,7 @@ SOURCES += \
|
|||||||
common/util.cpp \
|
common/util.cpp \
|
||||||
module/lf.cpp \
|
module/lf.cpp \
|
||||||
module/mifare.cpp \
|
module/mifare.cpp \
|
||||||
|
module/t55xxtab.cpp \
|
||||||
ui/mf_trailerdecoderdialog.cpp \
|
ui/mf_trailerdecoderdialog.cpp \
|
||||||
ui/mf_sim_simdialog.cpp \
|
ui/mf_sim_simdialog.cpp \
|
||||||
ui/mf_uid_parameterdialog.cpp \
|
ui/mf_uid_parameterdialog.cpp \
|
||||||
@ -34,6 +35,7 @@ HEADERS += \
|
|||||||
common/util.h \
|
common/util.h \
|
||||||
module/lf.h \
|
module/lf.h \
|
||||||
module/mifare.h \
|
module/mifare.h \
|
||||||
|
module/t55xxtab.h \
|
||||||
ui/mf_trailerdecoderdialog.h \
|
ui/mf_trailerdecoderdialog.h \
|
||||||
ui/mf_sim_simdialog.h \
|
ui/mf_sim_simdialog.h \
|
||||||
ui/mf_uid_parameterdialog.h \
|
ui/mf_uid_parameterdialog.h \
|
||||||
@ -41,6 +43,7 @@ HEADERS += \
|
|||||||
ui/mf_attack_hardnesteddialog.h \
|
ui/mf_attack_hardnesteddialog.h \
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
ui/t55xxtab.ui \
|
||||||
ui/mf_trailerdecoderdialog.ui \
|
ui/mf_trailerdecoderdialog.ui \
|
||||||
ui/mf_sim_simdialog.ui \
|
ui/mf_sim_simdialog.ui \
|
||||||
ui/mf_uid_parameterdialog.ui \
|
ui/mf_uid_parameterdialog.ui \
|
||||||
@ -48,8 +51,8 @@ FORMS += \
|
|||||||
ui/mf_attack_hardnesteddialog.ui
|
ui/mf_attack_hardnesteddialog.ui
|
||||||
|
|
||||||
TRANSLATIONS += \
|
TRANSLATIONS += \
|
||||||
lang/zh_CN.ts \
|
i18n/zh_CN.ts \
|
||||||
lang/en_US.ts
|
i18n/en_US.ts
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
@ -60,3 +63,6 @@ VERSION = 0.2.3
|
|||||||
QMAKE_TARGET_PRODUCT = "Proxmark3GUI"
|
QMAKE_TARGET_PRODUCT = "Proxmark3GUI"
|
||||||
QMAKE_TARGET_DESCRIPTION = "Proxmark3GUI"
|
QMAKE_TARGET_DESCRIPTION = "Proxmark3GUI"
|
||||||
QMAKE_TARGET_COMPANY = "wh201906"
|
QMAKE_TARGET_COMPANY = "wh201906"
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
i18n/language.qrc
|
@ -106,7 +106,7 @@ void Util::setRunningState(bool st)
|
|||||||
bool Util::chooseLanguage(QSettings* guiSettings, QMainWindow* window)
|
bool Util::chooseLanguage(QSettings* guiSettings, QMainWindow* window)
|
||||||
{
|
{
|
||||||
// make sure the GUISettings is not in any group
|
// make sure the GUISettings is not in any group
|
||||||
QSettings* langSettings = new QSettings("lang/languages.ini", QSettings::IniFormat);
|
QSettings* langSettings = new QSettings(":/i18n/languages.ini", QSettings::IniFormat);
|
||||||
QMap<QString, QString> langMap;
|
QMap<QString, QString> langMap;
|
||||||
langSettings->setIniCodec("UTF-8");
|
langSettings->setIniCodec("UTF-8");
|
||||||
langSettings->beginGroup("Languages");
|
langSettings->beginGroup("Languages");
|
7
src/i18n/language.qrc
Normal file
7
src/i18n/language.qrc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/i18n">
|
||||||
|
<file>en_US.qm</file>
|
||||||
|
<file>languages.ini</file>
|
||||||
|
<file>zh_CN.qm</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
4
src/i18n/languages.ini
Normal file
4
src/i18n/languages.ini
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[Languages]
|
||||||
|
en_US=English
|
||||||
|
zh_CN=简体中文
|
||||||
|
ext=Load from external file
|
@ -694,7 +694,7 @@ Use this to get raw data from a tag.</source>
|
|||||||
If the antenna voltage has a obvious drop after putting card on the antenna, it is likely that the tag is a LF tag.
|
If the antenna voltage has a obvious drop after putting card on the antenna, it is likely that the tag is a LF tag.
|
||||||
On Iceman/RRG repo, press the button on PM3 to stop measuring</source>
|
On Iceman/RRG repo, press the button on PM3 to stop measuring</source>
|
||||||
<translation>测量低频天线谐振频率。
|
<translation>测量低频天线谐振频率。
|
||||||
如果天线电压在放置卡片后出现明显下降,则该卡片很可能是低频卡。
|
如果天线电压在放置卡片后明显下降,则该卡片很可能是低频卡。
|
||||||
在冰人版固件下,如果需要停止测量,请按下PM3侧面的按钮</translation>
|
在冰人版固件下,如果需要停止测量,请按下PM3侧面的按钮</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
@ -22,7 +22,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
|
||||||
QDir *langPath = new QDir();
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
|
||||||
@ -42,10 +41,12 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
currLang = "en_US";
|
currLang = "en_US";
|
||||||
}
|
}
|
||||||
currLang += ".qm";
|
if(currLang == "ext")
|
||||||
langPath->cd("lang");
|
currLang = QFileDialog::getOpenFileName(nullptr, "Select the translation file:");
|
||||||
|
else
|
||||||
|
currLang = ":/i18n/" + currLang + ".qm";
|
||||||
QTranslator* translator = new QTranslator(&w);
|
QTranslator* translator = new QTranslator(&w);
|
||||||
if(translator->load(currLang, langPath->absolutePath()))
|
if(translator->load(currLang))
|
||||||
{
|
{
|
||||||
a.installTranslator(translator);
|
a.installTranslator(translator);
|
||||||
}
|
}
|
||||||
@ -54,7 +55,6 @@ int main(int argc, char *argv[])
|
|||||||
QMessageBox::information(&w, "Error", "Can't load " + currLang + " as translation file.");
|
QMessageBox::information(&w, "Error", "Can't load " + currLang + " as translation file.");
|
||||||
}
|
}
|
||||||
delete settings;
|
delete settings;
|
||||||
delete langPath;
|
|
||||||
w.initUI();
|
w.initUI();
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
14
src/module/t55xxtab.cpp
Normal file
14
src/module/t55xxtab.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "t55xxtab.h"
|
||||||
|
#include "ui_t55xxtab.h"
|
||||||
|
|
||||||
|
T55xxTab::T55xxTab(QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
ui(new Ui::T55xxTab)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
T55xxTab::~T55xxTab()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
22
src/module/t55xxtab.h
Normal file
22
src/module/t55xxtab.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef T55XXTAB_H
|
||||||
|
#define T55XXTAB_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class T55xxTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
class T55xxTab : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit T55xxTab(QWidget *parent = nullptr);
|
||||||
|
~T55xxTab();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::T55xxTab *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // T55XXTAB_H
|
@ -136,7 +136,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="mifareTab">
|
<widget class="QWidget" name="mifareTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
21
src/ui/t55xxtab.ui
Normal file
21
src/ui/t55xxtab.ui
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<ui version="4.0">
|
||||||
|
<author/>
|
||||||
|
<comment/>
|
||||||
|
<exportmacro/>
|
||||||
|
<class>T55xxTab</class>
|
||||||
|
<widget class="QWidget" name="T55xxTab">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<pixmapfunction/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
x
Reference in New Issue
Block a user