Skip to content

Commit

Permalink
Remove Apktool framework on new version
Browse files Browse the repository at this point in the history
  • Loading branch information
kefir500 committed Mar 31, 2015
1 parent 4e567df commit 471080b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/dialogs/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -463,6 +464,10 @@ void MainWindow::restoreSettings()

// Restore settings:

if (sVersion != VER) {
resetApktool();
}

devices->setCurrentGroup(sProfile);

if (!sRecent.isEmpty()) {
Expand Down Expand Up @@ -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?"))
Expand Down Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 471080b

Please sign in to comment.