diff --git a/src/dialogs/mainwindow.cpp b/src/dialogs/mainwindow.cpp index 944f67d..5eb11b5 100644 --- a/src/dialogs/mainwindow.cpp +++ b/src/dialogs/mainwindow.cpp @@ -419,6 +419,7 @@ void MainWindow::restoreSettings() const QString KEYS_DIR = APPDIR + "/signer/"; // Read settings: + QString sVersion = settings->value("Version", "").toString(); QString sProfile = settings->value("Profile", "").toString(); QString sLanguage = settings->value("Language", LOCALE).toString(); QString sLastDir = settings->value("Directory", "").toString(); @@ -463,6 +464,10 @@ void MainWindow::restoreSettings() // Restore settings: + if (sVersion != VER) { + resetApktool(); + } + devices->setCurrentGroup(sProfile); if (!sRecent.isEmpty()) { @@ -511,6 +516,14 @@ void MainWindow::restoreSettings() } } +void MainWindow::resetApktool() +{ + QDir apktool; + QFile::remove(QDir::homePath() + "/apktool/framework/1.apk"); + apktool.rmdir(QDir::homePath() + "/apktool/framework"); + apktool.rmdir(QDir::homePath() + "/apktool"); +} + void MainWindow::resetSettings() { if (QMessageBox::question(this, tr("Reset?"), tr("Reset settings to default?")) @@ -1430,6 +1443,7 @@ void MainWindow::closeEvent(QCloseEvent *event) } // Save settings: + settings->setValue("Version", VER); settings->setValue("Profile", devices->currentGroupText()); settings->setValue("Language", currentLang); settings->setValue("Update", actAutoUpdate->isChecked()); diff --git a/src/dialogs/mainwindow.h b/src/dialogs/mainwindow.h index 3eb9771..c334a03 100644 --- a/src/dialogs/mainwindow.h +++ b/src/dialogs/mainwindow.h @@ -113,6 +113,7 @@ class MainWindow : public QMainWindow { void addToRecent(QString filename); ///< Add \c filename to recent list. void refreshRecent(); ///< Refresh recent list. void restoreSettings(); ///< Restore settings from INI. + void resetApktool(); ///< Remove Apktool "1.apk" framework bool confirmExit(); ///< Ask user to confim exit. void invalidDpi(); ///< Show "Invalid DPI" message. void connectRepaintSignals(); ///< Create signal-slot connections to repaint windows.