diff options
Diffstat (limited to 'dev-util/mtools/files')
4 files changed, 177 insertions, 0 deletions
diff --git a/dev-util/mtools/files/mtools-fix-glade-file-path.patch b/dev-util/mtools/files/mtools-fix-glade-file-path.patch new file mode 100644 index 0000000..fe8a00b --- /dev/null +++ b/dev-util/mtools/files/mtools-fix-glade-file-path.patch @@ -0,0 +1,11 @@ +--- src/gtk/Mtools.cpp (revision 24) ++++ src/gtk/Mtools.cpp (working copy) +@@ -10,7 +10,7 @@ + #include "gtk/Mtools.h" + #include "gtk/Application.h" + +-const std::string Mtools::MTOOLS_UI = "mtools.glade"; ++const std::string Mtools::MTOOLS_UI = "/usr/share/mifare-tools/mtools.glade"; + + Mtools::Mtools() { + } diff --git a/dev-util/mtools/files/mtools-new-libfreefare-version.patch b/dev-util/mtools/files/mtools-new-libfreefare-version.patch new file mode 100644 index 0000000..f7f6c4e --- /dev/null +++ b/dev-util/mtools/files/mtools-new-libfreefare-version.patch @@ -0,0 +1,21 @@ +--- src/Nfc.cpp (revision 24) ++++ src/Nfc.cpp (working copy) +@@ -154,15 +156,9 @@ + + std::string Nfc::Tag::getUid() { + std::string uid = ""; +- if(isClassic()) { +- char* pUid = mifare_classic_get_uid (tag); +- uid = pUid; +- free(pUid); +- } else if(isUltralight()) { +- char* pUid = mifare_ultralight_get_uid (tag); +- uid = pUid; +- free(pUid); +- } ++ char* pUid = freefare_get_tag_uid (tag); ++ uid = pUid; ++ free(pUid); + + return uid; + } diff --git a/dev-util/mtools/files/mtools-new-libnfc-version.patch b/dev-util/mtools/files/mtools-new-libnfc-version.patch new file mode 100644 index 0000000..3a44984 --- /dev/null +++ b/dev-util/mtools/files/mtools-new-libnfc-version.patch @@ -0,0 +1,62 @@ +--- configure.ac (revision 24) ++++ configure.ac (working copy) +@@ -30,7 +30,7 @@ + fi + + # Checks for libraries. +-AC_CHECK_LIB(nfc, nfc_connect,,AC_MSG_ERROR(Install libnfc)) ++AC_CHECK_LIB(nfc, nfc_version,,AC_MSG_ERROR(Install libnfc)) + AC_CHECK_LIB(freefare, mifare_classic_connect,,AC_MSG_ERROR(Install libfreefare)) + AC_CHECK_LIB(gthread-2.0, g_thread_init) + +--- src/Nfc.cpp (revision 24) ++++ src/Nfc.cpp (working copy) +@@ -31,22 +31,24 @@ + }; + + Nfc::Nfc() : dev(NULL), tags(NULL) { ++ nfc_init(NULL); + selectedTag = -1; + connect(); + } + + Nfc::~Nfc() { + disconnect(); ++ nfc_exit(NULL); + } + + void Nfc::connect() { + if(dev) return; +- dev = nfc_connect(NULL); ++ dev = nfc_open(NULL, NULL); + } + + void Nfc::disconnect() { + if (!dev) return; +- nfc_disconnect(dev); ++ nfc_close(dev); + dev = NULL; + } + +--- src/Nfc.h (revision 24) ++++ src/Nfc.h (working copy) +@@ -83,7 +80,7 @@ + + Nfc::Tag* findTag(); + protected: +- nfc_device_t* dev; ++ nfc_device* dev; + + int selectedTag; + MifareTag* tags; +--- src/Utils.h (revision 24) ++++ src/Utils.h (working copy) +@@ -30,7 +30,7 @@ + return ss.str().c_str(); + } + +- static std::string pByteToStrHex(byte_t* bytes, unsigned int len) { ++ static std::string pByteToStrHex(uint8_t* bytes, unsigned int len) { + std::stringstream ss; + for(unsigned int i = 0; i < len; i++) + ss << std::hex << (unsigned int)bytes[i]; diff --git a/dev-util/mtools/files/mtools-remove-not-working-stuff.patch b/dev-util/mtools/files/mtools-remove-not-working-stuff.patch new file mode 100644 index 0000000..bc69132 --- /dev/null +++ b/dev-util/mtools/files/mtools-remove-not-working-stuff.patch @@ -0,0 +1,83 @@ +--- src/Makefile.am (revision 24) ++++ src/Makefile.am (working copy) +@@ -19,10 +19,7 @@ + Nfc.cpp Nfc.h Utils.h \ + gtk/Consts.cpp gtk/Consts.h \ + gtk/GtkUtil.h gtk/GtkUtil.cpp \ +- gtk/dialogs/ErrorDialog.cpp gtk/dialogs/ErrorDialog.h \ +- gtk/dialogs/KeysChooserDialog.cpp gtk/dialogs/KeysChooserDialog.h \ +- gtk/dialogs/KeysStoreDialog.cpp gtk/dialogs/KeysStoreDialog.h \ +- gtk/dialogs/InputDialog.cpp gtk/dialogs/InputDialog.h ++ gtk/dialogs/ErrorDialog.cpp gtk/dialogs/ErrorDialog.h + + + mtools_LDFLAGS = -lboost_regex-mt -lboost_thread-mt +--- src/Nfc.h (revision 24) ++++ src/Nfc.h (working copy) +@@ -16,9 +16,6 @@ + + #include <glibmm/i18n.h> + +-#include <thread/Runnable.h> +-#include <thread/AsyncCallback.h> +- + /** + * This class is c++ wrapper for libfreefare library. + */ +--- src/gtk/Callbacks.cpp (revision 24) ++++ src/gtk/Callbacks.cpp (working copy) +@@ -66,10 +66,6 @@ + app->getBuilder()->get_widget("miSearch", pMiSearch); + pMiSearch->signal_activate().connect(sigc::mem_fun(*this, &Callbacks::onBtnSearchClicked)); + +- Gtk::ImageMenuItem* pMiOpenKeys; +- app->getBuilder()->get_widget("miOpenKeys", pMiOpenKeys); +- pMiOpenKeys->signal_activate().connect(sigc::mem_fun(*this, &Callbacks::onMiOpenKeys)); +- + Gtk::ImageMenuItem* pMiAbout; + app->getBuilder()->get_widget("miAbout", pMiAbout); + pMiAbout->signal_activate().connect(sigc::mem_fun(*this, &Callbacks::about)); +@@ -78,8 +74,6 @@ + app->getBuilder()->get_widget("dlgAbout", pDlgAbout); + pDlgAbout->signal_response().connect(sigc::mem_fun(*this, &Callbacks::onDlgAboutResponse)); + +- dlgKeysStore.signal_changed.connect(sigc::mem_fun(*this, &Callbacks::onKeysStoreChange)); +- + nfc = new Nfc(); + } + +@@ -260,10 +254,6 @@ + Gtk::Main::quit(); + } + +-void Callbacks::onMiOpenKeys() { +- dlgKeysStore.run(); +-} +- + void Callbacks::authenticate(int sector) { + unsigned char key[6] = {0}; + +--- src/gtk/Callbacks.h (revision 24) ++++ src/gtk/Callbacks.h (working copy) +@@ -13,13 +13,10 @@ + #include "gtk/DataAccessConditions.h" + #include "gtk/TrailerAccessConditions.h" + +-#include "gtk/dialogs/KeysStoreDialog.h" + #include <gtk/dialogs/ErrorDialog.h> + #include "gtk/ComboBoxText.h" + + +-#include <thread/AsyncCallback.h> +- + class Callbacks { + public: + Callbacks(); +@@ -59,7 +56,6 @@ + DataAccessConditions dataAC; + TrailerAccessConditions trailerAC; + +- KeysStoreDialog dlgKeysStore; + void onKeysStoreChange(std::vector<std::string> v); + + void onBtnSearchClicked(); |