commit b653f85c3c0f41f73b7aa151fce49a3291ed3c38 Author: Lappland Date: Mon Jul 4 13:05:58 2022 +0800 beta-v0.2 diff --git a/QtAdb/QtAdb.pro b/QtAdb/QtAdb.pro new file mode 100644 index 0000000..5c2e73e --- /dev/null +++ b/QtAdb/QtAdb.pro @@ -0,0 +1,85 @@ +QT += core gui +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + about.cpp \ + adbprocess.cpp \ + basepage.cpp \ + indexlistitem.cpp \ + main.cpp \ + mainwindow.cpp \ + pagelistitem.cpp \ + pagemaker.cpp \ + sonPages/activator/sp_activator.cpp \ + sonPages/apps/sp_installer.cpp \ + sonPages/devControl/btnemulator.cpp \ + sonPages/devControl/sp_devcontrol_power.cpp \ + sonPages/devInfo/sp_dpichanger.cpp \ + sonPages/pay.cpp \ + sonPages/recovery/sp_recovery.cpp \ + sonPages/sonpagebase.cpp \ + sonPages/sonpagemanager.cpp \ + sonPages/standardoutputpage.cpp \ + textexplainer.cpp \ + threads/thread_createpage.cpp \ + welcomepage.cpp + +HEADERS += \ + about.h \ + adbprocess.h \ + basepage.h \ + indexlistitem.h \ + mainwindow.h \ + pagelistitem.h \ + pagemaker.h \ + sonPages/activator/sp_activator.h \ + sonPages/apps/sp_installer.h \ + sonPages/devControl/btnemulator.h \ + sonPages/devControl/sp_devcontrol_power.h \ + sonPages/devInfo/sp_dpichanger.h \ + sonPages/pay.h \ + sonPages/recovery/sp_recovery.h \ + sonPages/sonpagebase.h \ + sonPages/sonpagemanager.h \ + sonPages/standardoutputpage.h \ + textexplainer.h \ + threads/thread_createpage.h \ + welcomepage.h + +FORMS += \ + about.ui \ + basepage.ui \ + indexlistitem.ui \ + mainwindow.ui \ + pagelistitem.ui \ + sonPages/activator/sp_activator.ui \ + sonPages/apps/sp_installer.ui \ + sonPages/devControl/btnemulator.ui \ + sonPages/devControl/sp_devcontrol_power.ui \ + sonPages/devInfo/sp_dpichanger.ui \ + sonPages/pay.ui \ + sonPages/recovery/sp_recovery.ui \ + sonPages/sonpagebase.ui \ + sonPages/standardoutputpage.ui \ + welcomepage.ui + +TRANSLATIONS += \ + QtAdb_zh_CN.ts +CONFIG += lrelease +CONFIG += embed_translations + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + ico.qrc + +RC_FILE += logo.rc diff --git a/QtAdb/QtAdb_zh_CN.ts b/QtAdb/QtAdb_zh_CN.ts new file mode 100644 index 0000000..630fd35 --- /dev/null +++ b/QtAdb/QtAdb_zh_CN.ts @@ -0,0 +1,3 @@ + + + diff --git a/QtAdb/about.cpp b/QtAdb/about.cpp new file mode 100644 index 0000000..e0fdbb6 --- /dev/null +++ b/QtAdb/about.cpp @@ -0,0 +1,92 @@ +#include "about.h" +#include "ui_about.h" + +about::about(QWidget *parent) : + QWidget(parent), + ui(new Ui::about) +{ + ui->setupUi(this); + + QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect(); + shadowEffect_btn_website->setOffset(0,0); + shadowEffect_btn_website->setColor(Qt::gray); + shadowEffect_btn_website->setBlurRadius(5); + ui->btn_website->setGraphicsEffect(shadowEffect_btn_website); + + QGraphicsDropShadowEffect *shadowEffect_btn_coolapk = new QGraphicsDropShadowEffect(); + shadowEffect_btn_coolapk->setOffset(0,0); + shadowEffect_btn_coolapk->setColor(Qt::gray); + shadowEffect_btn_coolapk->setBlurRadius(5); + ui->btn_coolapk->setGraphicsEffect(shadowEffect_btn_coolapk); + + QGraphicsDropShadowEffect *shadowEffect_btn_github = new QGraphicsDropShadowEffect(); + shadowEffect_btn_github->setOffset(0,0); + shadowEffect_btn_github->setColor(Qt::gray); + shadowEffect_btn_github->setBlurRadius(5); + ui->btn_github->setGraphicsEffect(shadowEffect_btn_github); + + QGraphicsDropShadowEffect *shadowEffect_btn_money = new QGraphicsDropShadowEffect(); + shadowEffect_btn_money->setOffset(0,0); + shadowEffect_btn_money->setColor(Qt::gray); + shadowEffect_btn_money->setBlurRadius(5); + ui->btn_money->setGraphicsEffect(shadowEffect_btn_money); + QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(); + shadowEffect_btn_money2->setOffset(0,0); + shadowEffect_btn_money2->setColor(Qt::gray); + shadowEffect_btn_money2->setBlurRadius(5); + ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2); + QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(); + shadowEffect_btn_money3->setOffset(0,0); + shadowEffect_btn_money3->setColor(Qt::gray); + shadowEffect_btn_money3->setBlurRadius(5); + ui->btn_money_3->setGraphicsEffect(shadowEffect_btn_money3); + QGraphicsDropShadowEffect *shadowEffect_btn_money4 = new QGraphicsDropShadowEffect(); + shadowEffect_btn_money4->setOffset(0,0); + shadowEffect_btn_money4->setColor(Qt::gray); + shadowEffect_btn_money4->setBlurRadius(5); + ui->btn_money_4->setGraphicsEffect(shadowEffect_btn_money4); + + QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(); + shadowEffect_btn_version->setOffset(0,0); + shadowEffect_btn_version->setColor(Qt::gray); + shadowEffect_btn_version->setBlurRadius(5); + ui->btn_version->setGraphicsEffect(shadowEffect_btn_version); + + ui->btn_money->hide(); + ui->btn_money_3->hide(); + ui->btn_money_4->hide(); +} + +about::~about() +{ + delete ui; +} + +void about::on_btn_website_clicked() +{ + QDesktopServices::openUrl(QUrl("https://lapplandsp.github.io/QtAdb-pages/", QUrl::TolerantMode)); +} + + +void about::on_btn_coolapk_clicked() +{ + QDesktopServices::openUrl(QUrl("http://www.coolapk.com/u/692559", QUrl::TolerantMode)); +} + + +void about::on_btn_github_clicked() +{ + QDesktopServices::openUrl(QUrl("https://github.com/LapplandSP", QUrl::TolerantMode)); +} + + +void about::on_btn_money_2_clicked() +{ + pay * payPage = new pay(); + payPage->setStyleSheet("background-color:rgba(255,255,255,1);"); + payPage->setWindowIcon(QIcon(":/ico/image/ico/about/cola.svg")); + payPage->setBaseSize(300,500); + payPage->setWindowTitle("请我喝可乐"); + payPage->show(); +} + diff --git a/QtAdb/about.h b/QtAdb/about.h new file mode 100644 index 0000000..3e0c7c4 --- /dev/null +++ b/QtAdb/about.h @@ -0,0 +1,34 @@ +#ifndef ABOUT_H +#define ABOUT_H + +#include +#include +#include +#include "sonPages/pay.h" + +namespace Ui { +class about; +} + +class about : public QWidget +{ + Q_OBJECT + +public: + explicit about(QWidget *parent = nullptr); + ~about(); + +private slots: + void on_btn_website_clicked(); + + void on_btn_coolapk_clicked(); + + void on_btn_github_clicked(); + + void on_btn_money_2_clicked(); + +private: + Ui::about *ui; +}; + +#endif // ABOUT_H diff --git a/QtAdb/about.ui b/QtAdb/about.ui new file mode 100644 index 0000000..da645f9 --- /dev/null +++ b/QtAdb/about.ui @@ -0,0 +1,492 @@ + + + about + + + + 0 + 0 + 644 + 496 + + + + Form + + + + 0 + + + 0 + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 11 + + + + + 14 + + + 11 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 版本号 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/information-line.svg:/ico/image/ico/about/information-line.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 测试版本:beta-v0.2 + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 网址 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/firefox-line.svg:/ico/image/ico/btnEmulator/firefox-line.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 网站:https://lapplandsp.github.io/QtAdb-pages/ + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 酷安 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/coolapklogo-b.png:/ico/image/ico/about/coolapklogo-b.png + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 酷安:@霍星 + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + Github + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/github-fill.svg:/ico/image/ico/about/github-fill.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + Github :LapplandSP + + + + + + + + + + + false + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 请我吃东西 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/heart-line.svg:/ico/image/ico/about/heart-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 请我吃可乐(3元) + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/cola.svg:/ico/image/ico/about/cola.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 请我吃鸡腿(5元) + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/chiken.svg:/ico/image/ico/about/chiken.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + 请我吃面条(10元) + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/about/noodles.svg:/ico/image/ico/about/noodles.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 捐赠:请我喝快乐水 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/adbprocess.cpp b/QtAdb/adbprocess.cpp new file mode 100644 index 0000000..af58758 --- /dev/null +++ b/QtAdb/adbprocess.cpp @@ -0,0 +1,365 @@ +#include "adbprocess.h" + +adbProcess::adbProcess() +{ + explainer = new textExplainer; + connect(this , SIGNAL(readyReadStandardError()) , this , SLOT(on_readerror())); +} + +QString adbProcess::run(QString command) //Adb 命令解析 - 单条命令 +{ + QStringList args_0; + QStringList args_1; + + args_0 = command.split(" "); + args_0.append("*"); + + QString shell_command; + for(int i = 0, tag = 1; args_0[i] != "*" ; i++) + { + if(args_0[i] != "'" && tag == 1) + { + args_1.append(args_0[i]); + //qDebug() << "append0" << shell_command; + } + /* + if(tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command = shell_command + args_0[i] + " "; + //q.enqueue(args_0[i]); + //qDebug() << shell_command; + }*/ + + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command.remove(QRegularExpression("\\s* +$")); + args_1.append(shell_command); + tag = 1; + shell_command.clear(); + } + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + args_1.append(shell_command); + tag = 1; + } + + if(args_0[i] == "'" && tag == 1) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + tag = 0; + shell_command = shell_command + args_0[i] + " "; + //qDebug() << q << "\n"; + } + + } + args_1.removeAt(0); + qDebug() << "'run' running with arguments" << args_1 ; + this->start("adb", args_1); + + //qDebug() << readAllStandardOutput(); + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + waitForReadyRead(); + waitForFinished(); + + QString output; + output = readAllStandardOutput(); + standardOutput.append(output); + explainer->explainOutput(output); + return output; +} + +QString adbProcess::run(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令 +{ + QStringList args_0; + QStringList args_1; + + args_1.append("-s"); + args_1.append(dev.addr); + + //qDebug() << "'run' running with arguments" << args_1 ; + + args_0 = command.split(" "); + args_0.append("*"); + + QString shell_command; + for(int i = 0, tag = 1; args_0[i] != "*" ; i++) + { + if(args_0[i] != "'" && tag == 1) + { + args_1.append(args_0[i]); + //qDebug() << "append0" << shell_command; + } + /* + if(tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command = shell_command + args_0[i] + " "; + //q.enqueue(args_0[i]); + //qDebug() << shell_command; + }*/ + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command.remove(QRegularExpression("\\s* +$")); + args_1.append(shell_command); + tag = 1; + shell_command.clear(); + } + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + args_1.append(shell_command); + tag = 1; + } + + if(args_0[i] == "'" && tag == 1) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + tag = 0; + shell_command = shell_command + args_0[i] + " "; + //qDebug() << q << "\n"; + } + } + + args_1.removeAt(2); + + qDebug() << "'run' running with arguments" << args_1 ; + //qDebug() << "calling this->start('adb', args_1);"; + this->start("adb", args_1); + //qDebug() << "this->start('adb', args_1); ended"; + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + waitForReadyRead(); + waitForFinished(); + + QString output; + output = readAllStandardOutput(); + //qDebug() << "run output:" << output << "\n"; + explainer->explainOutput(output); + return output; +} + +QString adbProcess::run_contains_empty(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令(可能包含空格) +{ + QStringList args_0; + QStringList args_1; + + args_1.append("-s"); + args_1.append(dev.addr); + + //qDebug() << "'run' running with arguments" << args_1 ; + + args_0 = command.split(" "); + args_0.append("*"); + + QString shell_command; + for(int i = 0, tag = 1; args_0[i] != "*" ; i++) + { + if(args_0[i] != "~" && tag == 1) + { + args_1.append(args_0[i]); + //qDebug() << "常规添加" << shell_command << "\n"; + } + + if(args_0[i] != "~" &&tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command = shell_command + args_0[i] + " "; + //qDebug() << "里面添加" << shell_command << "\n"; + //q.enqueue(args_0[i]); + //qDebug() << shell_command; + } + + if(args_0[i] == "~" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command.remove(QRegularExpression("\\s* +$")); + args_1.append(shell_command); + tag = 1; + shell_command.clear(); + } + + if(args_0[i] == "~" && tag == 1) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + tag = 0; + //shell_command = shell_command + args_0[i] + " "; + //qDebug() << q << "\n"; + } + } + + args_1.removeAt(2); + + qDebug() << "'run' running with arguments" << args_1 ; + this->start("adb", args_1); + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + waitForReadyRead(); + waitForFinished(); + + QString output; + output = readAllStandardOutput(); + //qDebug() << "run output:" << output << "\n"; + explainer->explainOutput(output); + return output; +} + +QString adbProcess::run(QString command, QString write_command) //Adb 命令解析 - 发送单条命令并向控制台输入内容 +{ + QStringList args_0; + QStringList args_1; + + args_0 = command.split(" "); + args_0.append("*"); + + QString shell_command; + for(int i = 0, tag = 1; args_0[i] != "*" ; i++) + { + if(args_0[i] != "'" && tag == 1) + { + args_1.append(args_0[i]); + //qDebug() << "append0" << shell_command; + } + /* + if(tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command = shell_command + args_0[i] + " "; + //q.enqueue(args_0[i]); + //qDebug() << shell_command; + }*/ + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command.remove(QRegularExpression("\\s* +$")); + args_1.append(shell_command); + tag = 1; + shell_command.clear(); + } + + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + args_1.append(shell_command); + tag = 1; + } + + if(args_0[i] == "'" && tag == 1) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + tag = 0; + shell_command = shell_command + args_0[i] + " "; + //qDebug() << q << "\n"; + } + + } + args_1.removeAt(0); + qDebug() << "'run' running with arguments" << args_1 ; + this->start("adb", args_1); + + //qDebug() << "write 0"; + //qDebug() << "write 1"; + this->write(write_command.toLocal8Bit()); + //qDebug() << "write 2"; + waitForReadyRead(); + //qDebug() << "write 3"; + waitForFinished(); + //qDebug() << "write 4"; + + QString output; + output = readAllStandardOutput(); + standardOutput.append(output); + + //qDebug() << "output:" << output; + + explainer->explainOutput(output); + return output; +} + +QString adbProcess::run(QString command, device dev, QString write_command) //Adb 命令解析 - 对指定设备发送单条命令并向控制台输入内容 +{ + QStringList args_0; + QStringList args_1; + + args_1.append("-s"); + args_1.append(dev.addr); + + //qDebug() << "'run' running with arguments" << args_1 ; + + args_0 = command.split(" "); + args_0.append("*"); + + QString shell_command; + for(int i = 0, tag = 1; args_0[i] != "*" ; i++) + { + if(args_0[i] != "'" && tag == 1) + { + args_1.append(args_0[i]); + //qDebug() << "append0" << shell_command; + } + + /* + if(tag == 0) + { + qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command = shell_command + args_0[i] + " "; + //q.enqueue(args_0[i]); + qDebug() << shell_command; + }*/ + + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + shell_command.remove(QRegularExpression("\\s* +$")); + args_1.append(shell_command); + tag = 1; + shell_command.clear(); + } + + if(args_0[i] == "'" && tag == 0) + { + //qDebug() << "!!!!!!!!!!!!!!!!!!!!!No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + args_1.append(shell_command); + tag = 1; + } + + if(args_0[i] == "'" && tag == 1) + { + //qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n"; + tag = 0; + shell_command = shell_command + args_0[i] + " "; + } + } + + args_1.removeAt(2); + + qDebug() << "'run' running with arguments" << args_1 ; + this->start("adb", args_1); + this->write(write_command.toLocal8Bit()); + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + waitForReadyRead(); + waitForFinished(); + + QString output; + output = readAllStandardOutput(); + //qDebug() << "run output:" << output << "\n"; + + explainer->explainOutput(output); + return output; +} + +adbProcess::~adbProcess() +{ + run("adb kill-server"); + terminate(); + waitForFinished(); +} + +void adbProcess::on_readerror() +{ + QString text = this->readAllStandardError().data(); + explainer->explainError(text); + //if(text.contains("")) + //QMessageBox::information(0, "Error", this->readAllStandardError().data()); +} diff --git a/QtAdb/adbprocess.h b/QtAdb/adbprocess.h new file mode 100644 index 0000000..32030d6 --- /dev/null +++ b/QtAdb/adbprocess.h @@ -0,0 +1,38 @@ +#ifndef ADBPROCESS_H +#define ADBPROCESS_H +#include +#include +#include +#include +#include "textexplainer.h" +#include +#include +#include +#include + +#include + + +class adbProcess : public QProcess +{ + Q_OBJECT +public: + adbProcess(); + ~adbProcess(); + + QString run(QString command); + QString run(QString command, device dev); + QString run(QString command, device dev, QString write_command); + QString run(QString command, QString write_command); + QString run_contains_empty(QString command, device dev); + + QString standardOutput; + + textExplainer *explainer; + +private slots: + //void onReadData(); + void on_readerror(); +}; + +#endif // ADBPROCESS_H diff --git a/QtAdb/basepage.cpp b/QtAdb/basepage.cpp new file mode 100644 index 0000000..55a202a --- /dev/null +++ b/QtAdb/basepage.cpp @@ -0,0 +1,163 @@ +#include "basepage.h" +#include "ui_basepage.h" + +basePage::basePage(QWidget *parent) : + QWidget(parent), + ui(new Ui::basePage) +{ + ui->setupUi(this); + SPManager = new sonPageManager; + parents = parent; + + lastPage = NULL; + sonPage = NULL; + + QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(); + shadowEffect->setOffset(0,0); + shadowEffect->setColor(Qt::gray); + shadowEffect->setBlurRadius(10); + + //ui->listWidget->setGraphicsEffect(shadowEffect); +/*******原来的 + ui->listWidget->setStyleSheet("QListWidget{background-color:rgba(255,255,255,0);border-width:1px;border-radius:4px;outline:0px;}" + "QListView::item:hover {" + "background-color: rgba(250, 250, 250, 0.9);" + "padding: 0px;" + "border: 1px solid #BDBDBD;" + "}" + "QListView::item:selected {" + "background-color: rgba(245, 245, 245, 0.9);" + "color: black;" + "padding: 0px;" + "border: 2px solid #BDBDBD;" + "}" + "QListView::item{height:70px;border: 1px solid #BDBDBD;border-radius:4px;margin:6px 0px 0px 6px;}" + );*/ + ui->listWidget->setStyleSheet("QListWidget{background-color:rgba(255,255,255,0);border:0px;border-radius:4px;outline:0px;}" + "QListView::item:hover {" + "background-color: #EEEEEE;" + "padding: 0px;" + "border: 0px solid #E0E0E0;" + "}" + "QListView::item:selected {" + "background-color: #EEEEEE;" + "color: black;" + "padding: 0px;" + "border: 0px solid #BDBDBD;" + "}" + "QListView::item{height:70px;border: 0px solid #BDBDBD;border-radius:4px;margin:6px 0px 0px 6px;}" + ); + /* + * + "QListWidget::item{background-color:rgba(255,255,255,0.9);border-color:rgba(255,255,255,0.9);border-width:0px;border-radius:4px;margin:4px 0px 0px 0px;}" + "QListWidget::item:hover{background-color:rgba(255,255,255,0.7);}" + "QListWidget::item::selected{background-color:rgba(255,255,255,0.5);color:black;}" + * */ + ui->listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + connect(ui->listWidget,SIGNAL(currentRowChanged(int)),this,SLOT(slot_createSonPage(int))); + /*透明度动画 + exitOpacity = new QGraphicsOpacityEffect (this);//创建QGraphicsOpacityEffect对象关联控件ui.widgetProcess + exitOpacity->setOpacity(1);//设置透明度为0,隐藏控件 + this->setGraphicsEffect(exitOpacity);//控件添加绘图效果*/ +} + +basePage::~basePage() +{ + //qDebug() << "~basePage" << "\n"; +/* + if(sonPage != NULL) + sonPage->~basePage();*/ + + //qDebug() << "~basePage deleted" << "\n"; + delete ui; +} + +void basePage::playExitAnimation() +{/* + QPropertyAnimation* pWidgetProcessOpacity = new QPropertyAnimation(exitOpacity, "opacity", this); + + pWidgetProcessOpacity->setDuration(300); + + pWidgetProcessOpacity->setStartValue(1); + + pWidgetProcessOpacity->setEndValue(0); + + pWidgetProcessOpacity->setEasingCurve(QEasingCurve::Linear); + + pWidgetProcessOpacity->start(QAbstractAnimation::DeleteWhenStopped);//执行动画,结束后删除对象。*/ +} + +void basePage::addItemsToList(pageListItem *itemWidget) +{ + QListWidgetItem *tmpItem = new QListWidgetItem(); + ui->listWidget->addItem(tmpItem); + ui->listWidget->setItemWidget(tmpItem, itemWidget); +} + +void basePage::setFather(QWidget *parent) +{ + father = parent; +} + +void basePage::slot_createSonPage(int key) +{ + emit creatingSonPage(); + if(isEnable(key)) + { + ui->listWidget->setCurrentRow(-1); + qDebug() << "dev of basePage = " << dev.addr; + sonPage = SPManager->selector(this,whoAmI(),key,dev); + if(sonPage != NULL) + { + ui->listWidget->setVisible(false); + ui->mainLayout->addWidget(sonPage); + } + } + //qDebug() << "is not"; +} + +void basePage::slot_destroySonPage() +{ + if(sonPage == NULL) + throw "trying to destroy sonPage, but sonPage == NULL;"; + + sonPage->~QWidget(); + sonPage = NULL; + ui->listWidget->setVisible(true); +} + +QString basePage::whoAmI() +{ + return myName; +} + +void basePage::whoYouAre(QString name) +{ + myName = name; +} + +void basePage::setEnableValue(int *val) +{ + for(int i = 0; i < 20 ; i++) + { + enableVal[i] = val[i]; + } +} + +bool basePage::isEnable(int k) +{ + //qDebug() << "k=" << k; + for(int i = 0; i < 20; i++) + { + if(enableVal[i] == k + 1) + return true; + } + return false; +} + +void basePage::setDev(device device) +{ + dev = device; +} diff --git a/QtAdb/basepage.h b/QtAdb/basepage.h new file mode 100644 index 0000000..6ffba7e --- /dev/null +++ b/QtAdb/basepage.h @@ -0,0 +1,59 @@ +#ifndef BASEPAGE_H +#define BASEPAGE_H + +#include +#include +#include +#include +#include "pagelistitem.h" +#include "sonPages/sonpagemanager.h" + +namespace Ui { +class basePage; +} + +class basePage : public QWidget +{ + Q_OBJECT +signals: + void creatingSonPage(); + +public: + explicit basePage(QWidget *parent = nullptr); + ~basePage(); + + QWidget *parents; + + basePage *lastPage; + QWidget *sonPage; + QWidget *father; + QString myName; + sonPageManager *SPManager; + int enableVal[20]; + //pageMaker *maker; + device dev; + + + void addItemsToList(pageListItem *itemWidget); + void setFather(QWidget *parent); + QString whoAmI(); + void whoYouAre(QString name); + void setEnableValue(int val[20]); + void setDev(device dev); + +private: + Ui::basePage *ui; + + bool isEnable(int k); + + //QGraphicsOpacityEffect* exitOpacity; + +public slots: + void playExitAnimation(); + +private slots: + void slot_createSonPage(int key); + void slot_destroySonPage(); +}; + +#endif // BASEPAGE_H diff --git a/QtAdb/basepage.ui b/QtAdb/basepage.ui new file mode 100644 index 0000000..a51b42f --- /dev/null +++ b/QtAdb/basepage.ui @@ -0,0 +1,44 @@ + + + basePage + + + + 0 + 0 + 690 + 550 + + + + Form + + + + 0 + + + 11 + + + 0 + + + 11 + + + + + + + + + + + + + + + + + diff --git a/QtAdb/fonts/MiSans-Bold.ttf b/QtAdb/fonts/MiSans-Bold.ttf new file mode 100644 index 0000000..13b6185 Binary files /dev/null and b/QtAdb/fonts/MiSans-Bold.ttf differ diff --git a/QtAdb/fonts/MiSans-Light.ttf b/QtAdb/fonts/MiSans-Light.ttf new file mode 100644 index 0000000..bf1af84 Binary files /dev/null and b/QtAdb/fonts/MiSans-Light.ttf differ diff --git a/QtAdb/fonts/MiSans-Normal.ttf b/QtAdb/fonts/MiSans-Normal.ttf new file mode 100644 index 0000000..3199d46 Binary files /dev/null and b/QtAdb/fonts/MiSans-Normal.ttf differ diff --git a/QtAdb/ico.qrc b/QtAdb/ico.qrc new file mode 100644 index 0000000..34f0231 --- /dev/null +++ b/QtAdb/ico.qrc @@ -0,0 +1,90 @@ + + + image/ico/android-line.svg + image/ico/arrow-left-line.svg + image/ico/barcode-line.svg + image/ico/check-line.svg + image/ico/close-circle-line.svg + image/ico/cpu-line.svg + image/ico/device-recover-line.svg + image/ico/drag-move-line.svg + image/ico/dvd-line.svg + image/ico/file-copy-line.svg + image/ico/fullscreen-line.svg + image/ico/google-play-line.svg + image/ico/grid-line.svg + image/ico/install-line.svg + image/ico/link.svg + image/ico/play-line.svg + image/ico/profile-line.svg + image/ico/pulse-line.svg + image/ico/refresh-line.svg + image/ico/refund-line.svg + image/ico/registered-line.svg + image/ico/remote-control-2-line.svg + image/ico/restart-line.svg + image/ico/shut-down-line.svg + image/ico/signal-wifi-3-fill.svg + image/ico/smartphone-line.svg + image/ico/spam-line.svg + image/ico/terminal-box-line.svg + image/ico/tools-line.svg + image/ico/video-line.svg + image/ico/btnEmulator/arrow-left-right-line.svg + image/ico/btnEmulator/arrow-left-s-line.svg + image/ico/btnEmulator/calculator-line.svg + image/ico/btnEmulator/calendar-event-line.svg + image/ico/btnEmulator/camera-3-line.svg + image/ico/btnEmulator/contacts-book-line.svg + image/ico/btnEmulator/disc-line.svg + image/ico/btnEmulator/firefox-line.svg + image/ico/btnEmulator/haze-line.svg + image/ico/btnEmulator/home-2-line.svg + image/ico/btnEmulator/lightbulb-line.svg + image/ico/btnEmulator/menu-line.svg + image/ico/btnEmulator/pause-line.svg + image/ico/btnEmulator/phone-line.svg + image/ico/btnEmulator/phone-off.svg + image/ico/btnEmulator/psychotherapy-line.svg + image/ico/btnEmulator/rest-time-line.svg + image/ico/btnEmulator/settings-line.svg + image/ico/btnEmulator/skip-back-line.svg + image/ico/btnEmulator/skip-forward-line.svg + image/ico/btnEmulator/stop-fill.svg + image/ico/btnEmulator/sun-line.svg + image/ico/btnEmulator/volume-down-line.svg + image/ico/btnEmulator/volume-mute-line.svg + image/ico/btnEmulator/volume-up-line.svg + image/ico/btnEmulator/zzz-line.svg + image/ico/connect.svg + image/ico/about/alipay-line.svg + image/ico/about/github-fill.svg + image/ico/about/heart-line.svg + image/ico/about/information-line.svg + image/ico/about/wechat-pay-line.svg + image/ico/about/chiken.svg + image/ico/about/cola.svg + image/ico/about/noodles.svg + image/ico/about/header-logo.png + image/ico/about/coolapklogo-b.png + image/ico/about/alipay.svg + image/ico/about/wechat.svg + image/ico/logo.svg + + + image/test/back.png + image/test/Lappland.png + + + image/gif/final.gif + + + image/activatorApps/blackhole.png + image/activatorApps/blackroom.png + image/activatorApps/brevent.png + image/activatorApps/icebox.png + image/activatorApps/island.png + image/activatorApps/shizuku.png + image/activatorApps/taichi.png + + diff --git a/QtAdb/image/activatorApps/blackhole.png b/QtAdb/image/activatorApps/blackhole.png new file mode 100644 index 0000000..2dee3d3 Binary files /dev/null and b/QtAdb/image/activatorApps/blackhole.png differ diff --git a/QtAdb/image/activatorApps/blackroom.png b/QtAdb/image/activatorApps/blackroom.png new file mode 100644 index 0000000..505521d Binary files /dev/null and b/QtAdb/image/activatorApps/blackroom.png differ diff --git a/QtAdb/image/activatorApps/brevent.png b/QtAdb/image/activatorApps/brevent.png new file mode 100644 index 0000000..6b46470 Binary files /dev/null and b/QtAdb/image/activatorApps/brevent.png differ diff --git a/QtAdb/image/activatorApps/icebox.png b/QtAdb/image/activatorApps/icebox.png new file mode 100644 index 0000000..493d9a7 Binary files /dev/null and b/QtAdb/image/activatorApps/icebox.png differ diff --git a/QtAdb/image/activatorApps/island.png b/QtAdb/image/activatorApps/island.png new file mode 100644 index 0000000..b3debe2 Binary files /dev/null and b/QtAdb/image/activatorApps/island.png differ diff --git a/QtAdb/image/activatorApps/shizuku.png b/QtAdb/image/activatorApps/shizuku.png new file mode 100644 index 0000000..41a2ed8 Binary files /dev/null and b/QtAdb/image/activatorApps/shizuku.png differ diff --git a/QtAdb/image/activatorApps/taichi.png b/QtAdb/image/activatorApps/taichi.png new file mode 100644 index 0000000..8eb3585 Binary files /dev/null and b/QtAdb/image/activatorApps/taichi.png differ diff --git a/QtAdb/image/gif/final.gif b/QtAdb/image/gif/final.gif new file mode 100644 index 0000000..8ec4d89 Binary files /dev/null and b/QtAdb/image/gif/final.gif differ diff --git a/QtAdb/image/ico/about/alipay-line.svg b/QtAdb/image/ico/about/alipay-line.svg new file mode 100644 index 0000000..edd6f1c --- /dev/null +++ b/QtAdb/image/ico/about/alipay-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/alipay.svg b/QtAdb/image/ico/about/alipay.svg new file mode 100644 index 0000000..f3c7a55 --- /dev/null +++ b/QtAdb/image/ico/about/alipay.svg @@ -0,0 +1,1095 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/QtAdb/image/ico/about/chiken.svg b/QtAdb/image/ico/about/chiken.svg new file mode 100644 index 0000000..d9d00ff --- /dev/null +++ b/QtAdb/image/ico/about/chiken.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/cola.svg b/QtAdb/image/ico/about/cola.svg new file mode 100644 index 0000000..bdd7c77 --- /dev/null +++ b/QtAdb/image/ico/about/cola.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/coolapklogo-b.png b/QtAdb/image/ico/about/coolapklogo-b.png new file mode 100644 index 0000000..6d9ef53 Binary files /dev/null and b/QtAdb/image/ico/about/coolapklogo-b.png differ diff --git a/QtAdb/image/ico/about/github-fill.svg b/QtAdb/image/ico/about/github-fill.svg new file mode 100644 index 0000000..a3582de --- /dev/null +++ b/QtAdb/image/ico/about/github-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/header-logo.png b/QtAdb/image/ico/about/header-logo.png new file mode 100644 index 0000000..17d173d Binary files /dev/null and b/QtAdb/image/ico/about/header-logo.png differ diff --git a/QtAdb/image/ico/about/heart-line.svg b/QtAdb/image/ico/about/heart-line.svg new file mode 100644 index 0000000..627882b --- /dev/null +++ b/QtAdb/image/ico/about/heart-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/information-line.svg b/QtAdb/image/ico/about/information-line.svg new file mode 100644 index 0000000..f614384 --- /dev/null +++ b/QtAdb/image/ico/about/information-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/noodles.svg b/QtAdb/image/ico/about/noodles.svg new file mode 100644 index 0000000..1451bcd --- /dev/null +++ b/QtAdb/image/ico/about/noodles.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/wechat-pay-line.svg b/QtAdb/image/ico/about/wechat-pay-line.svg new file mode 100644 index 0000000..8e2e654 --- /dev/null +++ b/QtAdb/image/ico/about/wechat-pay-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/about/wechat.svg b/QtAdb/image/ico/about/wechat.svg new file mode 100644 index 0000000..d8be456 --- /dev/null +++ b/QtAdb/image/ico/about/wechat.svg @@ -0,0 +1,1375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/QtAdb/image/ico/android-line.svg b/QtAdb/image/ico/android-line.svg new file mode 100644 index 0000000..1a5036f --- /dev/null +++ b/QtAdb/image/ico/android-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/arrow-left-line.svg b/QtAdb/image/ico/arrow-left-line.svg new file mode 100644 index 0000000..97a8f83 --- /dev/null +++ b/QtAdb/image/ico/arrow-left-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/barcode-line.svg b/QtAdb/image/ico/barcode-line.svg new file mode 100644 index 0000000..c2ca1e3 --- /dev/null +++ b/QtAdb/image/ico/barcode-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/arrow-left-right-line.svg b/QtAdb/image/ico/btnEmulator/arrow-left-right-line.svg new file mode 100644 index 0000000..fb88a6a --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/arrow-left-right-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/arrow-left-s-line.svg b/QtAdb/image/ico/btnEmulator/arrow-left-s-line.svg new file mode 100644 index 0000000..87faa57 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/arrow-left-s-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/calculator-line.svg b/QtAdb/image/ico/btnEmulator/calculator-line.svg new file mode 100644 index 0000000..affd5dd --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/calculator-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/calendar-event-line.svg b/QtAdb/image/ico/btnEmulator/calendar-event-line.svg new file mode 100644 index 0000000..66e817f --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/calendar-event-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/camera-3-line.svg b/QtAdb/image/ico/btnEmulator/camera-3-line.svg new file mode 100644 index 0000000..c9dde7b --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/camera-3-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/contacts-book-line.svg b/QtAdb/image/ico/btnEmulator/contacts-book-line.svg new file mode 100644 index 0000000..cfe5a5a --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/contacts-book-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/disc-line.svg b/QtAdb/image/ico/btnEmulator/disc-line.svg new file mode 100644 index 0000000..e2b5c4c --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/disc-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/firefox-line.svg b/QtAdb/image/ico/btnEmulator/firefox-line.svg new file mode 100644 index 0000000..dbd4f9d --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/firefox-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/haze-line.svg b/QtAdb/image/ico/btnEmulator/haze-line.svg new file mode 100644 index 0000000..b5e6ca6 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/haze-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/home-2-line.svg b/QtAdb/image/ico/btnEmulator/home-2-line.svg new file mode 100644 index 0000000..66d8884 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/home-2-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/lightbulb-line.svg b/QtAdb/image/ico/btnEmulator/lightbulb-line.svg new file mode 100644 index 0000000..96f6da2 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/lightbulb-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/menu-line.svg b/QtAdb/image/ico/btnEmulator/menu-line.svg new file mode 100644 index 0000000..37604e6 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/menu-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/pause-line.svg b/QtAdb/image/ico/btnEmulator/pause-line.svg new file mode 100644 index 0000000..b452210 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/pause-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/phone-line.svg b/QtAdb/image/ico/btnEmulator/phone-line.svg new file mode 100644 index 0000000..eddd572 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/phone-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/phone-off.svg b/QtAdb/image/ico/btnEmulator/phone-off.svg new file mode 100644 index 0000000..285426a --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/phone-off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/psychotherapy-line.svg b/QtAdb/image/ico/btnEmulator/psychotherapy-line.svg new file mode 100644 index 0000000..fce9205 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/psychotherapy-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/rest-time-line.svg b/QtAdb/image/ico/btnEmulator/rest-time-line.svg new file mode 100644 index 0000000..67507e8 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/rest-time-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/settings-line.svg b/QtAdb/image/ico/btnEmulator/settings-line.svg new file mode 100644 index 0000000..ab58bbf --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/settings-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/skip-back-line.svg b/QtAdb/image/ico/btnEmulator/skip-back-line.svg new file mode 100644 index 0000000..5101fb6 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/skip-back-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/skip-forward-line.svg b/QtAdb/image/ico/btnEmulator/skip-forward-line.svg new file mode 100644 index 0000000..75990ca --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/skip-forward-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/stop-fill.svg b/QtAdb/image/ico/btnEmulator/stop-fill.svg new file mode 100644 index 0000000..0884998 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/stop-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/sun-line.svg b/QtAdb/image/ico/btnEmulator/sun-line.svg new file mode 100644 index 0000000..af7d536 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/sun-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/volume-down-line.svg b/QtAdb/image/ico/btnEmulator/volume-down-line.svg new file mode 100644 index 0000000..604a16a --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/volume-down-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/volume-mute-line.svg b/QtAdb/image/ico/btnEmulator/volume-mute-line.svg new file mode 100644 index 0000000..aecd7ba --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/volume-mute-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/volume-up-line.svg b/QtAdb/image/ico/btnEmulator/volume-up-line.svg new file mode 100644 index 0000000..1aee5a6 --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/volume-up-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/btnEmulator/zzz-line.svg b/QtAdb/image/ico/btnEmulator/zzz-line.svg new file mode 100644 index 0000000..99a062f --- /dev/null +++ b/QtAdb/image/ico/btnEmulator/zzz-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/check-line.svg b/QtAdb/image/ico/check-line.svg new file mode 100644 index 0000000..4a987a6 --- /dev/null +++ b/QtAdb/image/ico/check-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/close-circle-line.svg b/QtAdb/image/ico/close-circle-line.svg new file mode 100644 index 0000000..f344960 --- /dev/null +++ b/QtAdb/image/ico/close-circle-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/connect.svg b/QtAdb/image/ico/connect.svg new file mode 100644 index 0000000..0ea916d --- /dev/null +++ b/QtAdb/image/ico/connect.svg @@ -0,0 +1 @@ +画板 1 \ No newline at end of file diff --git a/QtAdb/image/ico/cpu-line.svg b/QtAdb/image/ico/cpu-line.svg new file mode 100644 index 0000000..72ba0cf --- /dev/null +++ b/QtAdb/image/ico/cpu-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/device-recover-line.svg b/QtAdb/image/ico/device-recover-line.svg new file mode 100644 index 0000000..916618e --- /dev/null +++ b/QtAdb/image/ico/device-recover-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/drag-move-line.svg b/QtAdb/image/ico/drag-move-line.svg new file mode 100644 index 0000000..86c75be --- /dev/null +++ b/QtAdb/image/ico/drag-move-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/dvd-line.svg b/QtAdb/image/ico/dvd-line.svg new file mode 100644 index 0000000..b2e93d2 --- /dev/null +++ b/QtAdb/image/ico/dvd-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/file-copy-line.svg b/QtAdb/image/ico/file-copy-line.svg new file mode 100644 index 0000000..eb32d14 --- /dev/null +++ b/QtAdb/image/ico/file-copy-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/fullscreen-line.svg b/QtAdb/image/ico/fullscreen-line.svg new file mode 100644 index 0000000..560ab2c --- /dev/null +++ b/QtAdb/image/ico/fullscreen-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/google-play-line.svg b/QtAdb/image/ico/google-play-line.svg new file mode 100644 index 0000000..8bb0a08 --- /dev/null +++ b/QtAdb/image/ico/google-play-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/grid-line.svg b/QtAdb/image/ico/grid-line.svg new file mode 100644 index 0000000..99a45fa --- /dev/null +++ b/QtAdb/image/ico/grid-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/install-line.svg b/QtAdb/image/ico/install-line.svg new file mode 100644 index 0000000..f56ef7e --- /dev/null +++ b/QtAdb/image/ico/install-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/link.svg b/QtAdb/image/ico/link.svg new file mode 100644 index 0000000..8c949a0 --- /dev/null +++ b/QtAdb/image/ico/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/logo.svg b/QtAdb/image/ico/logo.svg new file mode 100644 index 0000000..9231981 --- /dev/null +++ b/QtAdb/image/ico/logo.svg @@ -0,0 +1 @@ +画板 1 \ No newline at end of file diff --git a/QtAdb/image/ico/play-line.svg b/QtAdb/image/ico/play-line.svg new file mode 100644 index 0000000..628d84b --- /dev/null +++ b/QtAdb/image/ico/play-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/profile-line.svg b/QtAdb/image/ico/profile-line.svg new file mode 100644 index 0000000..73999b9 --- /dev/null +++ b/QtAdb/image/ico/profile-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/pulse-line.svg b/QtAdb/image/ico/pulse-line.svg new file mode 100644 index 0000000..b815e66 --- /dev/null +++ b/QtAdb/image/ico/pulse-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/refresh-line.svg b/QtAdb/image/ico/refresh-line.svg new file mode 100644 index 0000000..97182dc --- /dev/null +++ b/QtAdb/image/ico/refresh-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/refund-line.svg b/QtAdb/image/ico/refund-line.svg new file mode 100644 index 0000000..6fdb65d --- /dev/null +++ b/QtAdb/image/ico/refund-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/registered-line.svg b/QtAdb/image/ico/registered-line.svg new file mode 100644 index 0000000..63087f1 --- /dev/null +++ b/QtAdb/image/ico/registered-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/remote-control-2-line.svg b/QtAdb/image/ico/remote-control-2-line.svg new file mode 100644 index 0000000..5a5e540 --- /dev/null +++ b/QtAdb/image/ico/remote-control-2-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/restart-line.svg b/QtAdb/image/ico/restart-line.svg new file mode 100644 index 0000000..a12a250 --- /dev/null +++ b/QtAdb/image/ico/restart-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/shut-down-line.svg b/QtAdb/image/ico/shut-down-line.svg new file mode 100644 index 0000000..48958ee --- /dev/null +++ b/QtAdb/image/ico/shut-down-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/signal-wifi-3-fill.svg b/QtAdb/image/ico/signal-wifi-3-fill.svg new file mode 100644 index 0000000..73c696b --- /dev/null +++ b/QtAdb/image/ico/signal-wifi-3-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/smartphone-line.svg b/QtAdb/image/ico/smartphone-line.svg new file mode 100644 index 0000000..ef0b0b8 --- /dev/null +++ b/QtAdb/image/ico/smartphone-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/spam-line.svg b/QtAdb/image/ico/spam-line.svg new file mode 100644 index 0000000..f90788c --- /dev/null +++ b/QtAdb/image/ico/spam-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/terminal-box-line.svg b/QtAdb/image/ico/terminal-box-line.svg new file mode 100644 index 0000000..5ad3284 --- /dev/null +++ b/QtAdb/image/ico/terminal-box-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/tools-line.svg b/QtAdb/image/ico/tools-line.svg new file mode 100644 index 0000000..fe5211a --- /dev/null +++ b/QtAdb/image/ico/tools-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/video-line.svg b/QtAdb/image/ico/video-line.svg new file mode 100644 index 0000000..c0b4217 --- /dev/null +++ b/QtAdb/image/ico/video-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/test/Lappland.png b/QtAdb/image/test/Lappland.png new file mode 100644 index 0000000..dc79fb6 Binary files /dev/null and b/QtAdb/image/test/Lappland.png differ diff --git a/QtAdb/image/test/back.png b/QtAdb/image/test/back.png new file mode 100644 index 0000000..1b4bdcc Binary files /dev/null and b/QtAdb/image/test/back.png differ diff --git a/QtAdb/indexlistitem.cpp b/QtAdb/indexlistitem.cpp new file mode 100644 index 0000000..77edd42 --- /dev/null +++ b/QtAdb/indexlistitem.cpp @@ -0,0 +1,24 @@ +#include "indexlistitem.h" +#include "ui_indexlistitem.h" + +indexListItem::indexListItem(QWidget *parent) : + QWidget(parent), + ui(new Ui::indexListItem) +{ + ui->setupUi(this); +} + +indexListItem::~indexListItem() +{ + delete ui; +} + +void indexListItem::setText(QString text) +{ + ui->text->setText(text); +} + +void indexListItem::setPic(QString qss) +{ + ui->pic->setStyleSheet(qss); +} diff --git a/QtAdb/indexlistitem.h b/QtAdb/indexlistitem.h new file mode 100644 index 0000000..5cbedcc --- /dev/null +++ b/QtAdb/indexlistitem.h @@ -0,0 +1,25 @@ +#ifndef INDEXLISTITEM_H +#define INDEXLISTITEM_H + +#include + +namespace Ui { +class indexListItem; +} + +class indexListItem : public QWidget +{ + Q_OBJECT + +public: + explicit indexListItem(QWidget *parent = nullptr); + ~indexListItem(); + + void setText(QString text); + void setPic(QString qss); + +private: + Ui::indexListItem *ui; +}; + +#endif // INDEXLISTITEM_H diff --git a/QtAdb/indexlistitem.ui b/QtAdb/indexlistitem.ui new file mode 100644 index 0000000..750c103 --- /dev/null +++ b/QtAdb/indexlistitem.ui @@ -0,0 +1,135 @@ + + + indexListItem + + + + 0 + 0 + 234 + 35 + + + + + 0 + 35 + + + + + 16777215 + 35 + + + + Form + + + false + + + /*background-color: rgba(255, 255, 255, 0);*/ +border-width:2px; +border-color: rgb(152, 152, 152); + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 5 + 20 + + + + + 5 + 25 + + + + false + + + background-color:rgb(165, 165, 165); +border-radius:2px; + + + + + + + + + + + 20 + 20 + + + + + 20 + 20 + + + + false + + + /*background-color:rgb(0, 0, 0); +border-radius:4px;*/ + + + + + + Qt::AlignCenter + + + + + + + + 0 + 16 + + + + + 16777215 + 16 + + + + + MiSans Normal + + + + background-color: rgba(255, 255, 255, 0); + + + TextLabel + + + + + + + + diff --git a/QtAdb/logo.ico b/QtAdb/logo.ico new file mode 100644 index 0000000..d0757e7 Binary files /dev/null and b/QtAdb/logo.ico differ diff --git a/QtAdb/logo.rc b/QtAdb/logo.rc new file mode 100644 index 0000000..4e6f23f --- /dev/null +++ b/QtAdb/logo.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "logo.ico" \ No newline at end of file diff --git a/QtAdb/logo.svg b/QtAdb/logo.svg new file mode 100644 index 0000000..9231981 --- /dev/null +++ b/QtAdb/logo.svg @@ -0,0 +1 @@ +画板 1 \ No newline at end of file diff --git a/QtAdb/main.cpp b/QtAdb/main.cpp new file mode 100644 index 0000000..ab834f3 --- /dev/null +++ b/QtAdb/main.cpp @@ -0,0 +1,55 @@ +#include "mainwindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + + QFont font; + int index = QFontDatabase::addApplicationFont(":/fonts/fonts/MiSans-Normal.ttf"); + if (index != -1) + { + QStringList fontList(QFontDatabase::applicationFontFamilies(index)); + if (fontList.count() > 0) + { + font.setFamily(fontList.at(0)); + font.setBold(false); + } + } + a.setFont(font); + a.setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}"); + + QTranslator translator; + const QStringList uiLanguages = QLocale::system().uiLanguages(); + for (const QString &locale : uiLanguages) { + const QString baseName = "QtAdb_" + QLocale(locale).name(); + if (translator.load(":/i18n/" + baseName)) { + a.installTranslator(&translator); + break; + } + } + + QPixmap pix(":/ico/image/ico/logo.svg"); + QSplashScreen splash(pix); + splash.setBaseSize(100,100); + splash.setMaximumSize(100,100); + splash.show(); + a.processEvents(); + + MainWindow w; + w.show(); + + splash.finish(&w); + + + return a.exec(); +} diff --git a/QtAdb/mainwindow.cpp b/QtAdb/mainwindow.cpp new file mode 100644 index 0000000..0c20a6f --- /dev/null +++ b/QtAdb/mainwindow.cpp @@ -0,0 +1,459 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +/* + * 待实现: + * ******************************adbProcess 的read std output不应与主页面位于同一个线程 + * 显示输出 + * 代码规范化,提升封装程度 + * 写注释 + */ + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); + initEnvironmentPATH(); + + /*加载动画GIF*/ + movie = new QMovie(":/gif/image/gif/final.gif"); + //sub = new QThread; + + /*页面内容更新线程*/ + //thread_BPCreator = new thread_createPage; + //thread_BPCreator->moveToThread(sub); + //sub->start(); + + /*currentPage指针*/ + currentPage = NULL; + WCMPage = NULL; + + /*devList 中的当前设备索引*/ + current_device = 0; + ui->comboBox->setPlaceholderText("请先选择设备"); + + /*连接信号与槽*/ + connect(this->ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setCurrentDevice(int))); //更改当前设备 + //connect(this->ui->indexList,SIGNAL(currentRowChanged(int)),this,SLOT(playLoadingGif())); //播放加载动画 + connect(this->ui->indexList,SIGNAL(currentRowChanged(int)),this,SLOT(initBasePage(int))); //创建并更改当前页面 + + /*设置界面*/ + addIndexItems(); //设置左侧目录 + setStyles(); //设置样式 + + /*初始化对象*/ + process = new adbProcess(); + explainer = new textExplainer(); + maker = new pageMaker(); + + /*启动ADB,将延长页面创建时间,在此期间显示启动界面*/ + process->run("adb server"); + refreshDevList(); + + /*用户未选择设备前,锁定界面*/ + lock(); + qDebug() << "1"; + displayWelcomePage(); + qDebug() << "2"; +} + +MainWindow::~MainWindow() +{ + delete process; + delete explainer; + delete ui; +} + +void MainWindow::initEnvironmentPATH() //方法:设置环境变量 +{ + QString envPath = qgetenv("PATH"); //获取当前环境变量 + QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置 + QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境 + envPath += QDir::toNativeSeparators(userPath).prepend(';'); + qputenv("PATH",envPath.toStdString().c_str()); //更改环境变量 + //qDebug() << envPath.toStdString().c_str(); +} + +void MainWindow::refreshDevList() //方法:刷新设备列表 +{ + ui->comboBox->clear(); //清空combobox + devList.clear(); //清空设备列表 + + devList = explainer->getDevList_windows(process->run("adb devices -l")); //重新赋值 + + /*将设备信息传入 List l ,并将l的值显示在combobox中*/ + QStringList l; + l.clear(); + for (int i = 0 ; i < devList.size() ; i++ ) + { + QString devItem =devList[i].state + " " + explainer->get_words_after(devList[i].device_product, ":") + " " + explainer->get_words_after(devList[i].model, ":"); + l.append(devItem); + } + ui->comboBox->addItems(l); + + current_device = 0; //重设当前设备 +} + +void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 +{ + refreshDevList(); + lock(); + if(currentPage != NULL) + { + currentPage->~QWidget(); + currentPage = NULL; + } + displayWelcomePage(); +} + +void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 +{ + current_device = index; + unlock(); +} + +void MainWindow::initBasePage(int key) //槽:生成basePages +{ + if(WCMPage != NULL) //销毁欢迎页面 + { + //currentPage->setDisabled(true); + //delete currentPage; + WCMPage->~welcomePage(); + WCMPage = NULL; + } + + if(currentPage != NULL) //销毁上一个basePage + { + //currentPage->setDisabled(true); + //delete currentPage; + currentPage->~QWidget(); + currentPage = NULL; + } + + currentPage = new QWidget(this); + currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); //究极开销 + qDebug() << "currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); ended"; + ui->verticalLayout_2->addWidget(currentPage); +} + +void MainWindow::addItemToIndex(indexListItem *itemWidget) //方法:向indexist中添加单个item +{ + QListWidgetItem * tmpItem = new QListWidgetItem(); + ui->indexList->addItem(tmpItem); + ui->indexList->setItemWidget(tmpItem, itemWidget); +} + +void MainWindow::addIndexItems() //方法:初始化向indexList中添加的item,完成indexList创建。 +{ +/* + basePage *wgt = new basePage(this); + currentPage = wgt;*/ + + indexListItem *devInfo = new indexListItem(this->ui->indexList); + devInfo->setText("设备信息"); + devInfo->setPic("image:url(:/ico/image/ico/smartphone-line.svg);background-color:rgba(255,255,255,0);"); + addItemToIndex(devInfo); + /* + QListWidgetItem * tmpItem = new QListWidgetItem(); + ui->indexList->addItem(tmpItem); + ui->indexList->setItemWidget(tmpItem, devInfo);*/ + + indexListItem *activator = new indexListItem(this->ui->indexList); + activator->setText("激活"); + activator->setPic("image:url(:/ico/image/ico/pulse-line.svg);background-color:rgba(255,255,255,0);"); + addItemToIndex(activator); + + indexListItem *apps = new indexListItem(this->ui->indexList); + apps->setText("应用"); + apps->setPic("image:url(:/ico/image/ico/google-play-line.svg);background-color:rgba(255,255,255,0);"); + addItemToIndex(apps); + + indexListItem *devControl = new indexListItem(this->ui->indexList); + devControl->setText("设备控制"); + devControl->setPic("image:url(:/ico/image/ico/remote-control-2-line.svg);background-color:rgba(255,255,255,0);"); + addItemToIndex(devControl); + + indexListItem *recovery = new indexListItem(this->ui->indexList); + recovery->setText("Recovery"); + recovery->setPic("image:url(:/ico/image/ico/registered-line.svg);background-color:rgba(255,255,255,0);"); + addItemToIndex(recovery); + + indexListItem *about = new indexListItem(this->ui->indexList); + about->setText("关于"); + about->setPic("image:url(:/ico/image/ico/about/information-line.svg);background-color:rgba(255,255,255,0);"); + addItemToIndex(about); + + ui->indexList->setResizeMode(QListView::Adjust); +} + +void MainWindow::lock() //方法:锁定mainwindow中控件 +{ + ui->indexList->setEnabled(false); + //currentPage->setEnabled(false); + ui->page->setEnabled(false); +} + +void MainWindow::unlock() //方法:解锁mainwindow中的控件 +{ + ui->indexList->setEnabled(true); + //currentPage->setEnabled(true); + ui->page->setEnabled(true); +} + +void MainWindow::setStyles() //方法:设置样式 +{ + setWindowTitle("QtAdb"); + setWindowIcon(QIcon(":/ico/image/ico/logo.svg")); + + this->setWindowOpacity(0.99); + + ui->horizontalLayout_3->setAlignment(Qt::AlignLeft); + ui->verticalLayout_2->setAlignment(Qt::AlignTop); + + ui->indexList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + ui->indexList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + ui->indexList->setStyleSheet("QListWidget{background-color:rgba(255,255,255,0);border-width:0px;border-radius:4px;outline:0px;}" + "QListWidget::item{background-color:rgba(255,255,255,0.9);border-width:0px;border-radius:4px;margin:4px 0px 0px 0px;}" + "QListWidget::item:hover{background-color:#f5f6f9;padding:5px;}" + "QListWidget::item::selected{background-color:#f5f6f9;color:black;padding:10px;}" + "QListView::item{height:35px;}" + ); + + ui->comboBox->setStyleSheet("QComboBox{color:black;border-bottom:1px solid #BDBDBD;border-radius:0px;background-color:transparent;}" + "QComboBox::drop-down{border: 0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);border-bottom-right-radius: 0px;}" + "QComboBox QAbstractItemView{border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;outline: 0px;}" + "QComboBox QAbstractItemView::item{height:30px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;}" + "QComboBox QAbstractItemView::item:hover{height:30px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black}" + "QComboBox QAbstractItemView::item:selected{height:30px;border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black}" + ); + + ui->refreshButton->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;}" + "QPushButton:hover{background-color:rgba(255,255,255,0.7);}" + "QPushButton:pressed{background-color:rgba(255,255,255,0.6);}"); + ui->iconLabel->setStyleSheet("background-color:transparent;"); + ui->fakeSpacer->setStyleSheet("background-color:transparent;"); + + QGraphicsDropShadowEffect *shadowEffect_refreshButton = new QGraphicsDropShadowEffect(); + shadowEffect_refreshButton->setOffset(0,0); + shadowEffect_refreshButton->setColor(Qt::gray); + shadowEffect_refreshButton->setBlurRadius(5); + + QGraphicsDropShadowEffect *shadowEffect_killAdbBtn = new QGraphicsDropShadowEffect(); + shadowEffect_killAdbBtn->setOffset(0,0); + shadowEffect_killAdbBtn->setColor(Qt::gray); + shadowEffect_killAdbBtn->setBlurRadius(5); + + QGraphicsDropShadowEffect *shadowEffect_testBtn = new QGraphicsDropShadowEffect(); + shadowEffect_testBtn->setOffset(0,0); + shadowEffect_testBtn->setColor(Qt::gray); + shadowEffect_testBtn->setBlurRadius(5); + + QGraphicsDropShadowEffect *shadowEffect_WSABtn = new QGraphicsDropShadowEffect(); + shadowEffect_WSABtn->setOffset(0,0); + shadowEffect_WSABtn->setColor(Qt::gray); + shadowEffect_WSABtn->setBlurRadius(5); + + ui->refreshButton->setGraphicsEffect(shadowEffect_refreshButton); + ui->adbKillerBtn->setGraphicsEffect(shadowEffect_killAdbBtn); + ui->WIFIBtn->setGraphicsEffect(shadowEffect_testBtn); + ui->WSABtn->setGraphicsEffect(shadowEffect_WSABtn); +} + +/* +void MainWindow::hideCurrentPage() //方法:隐藏当前basePage +{ + currentPage->hide(); +}*/ + +void MainWindow::initSonPage(int key) //槽:生成子页面 +{ + maker->createPageWithKey(key,currentPage,devList[current_device]); +} + +void MainWindow::on_adbKillerBtn_clicked() //槽:杀死ADB +{ + QMessageBox * msgBox = new QMessageBox; + msgBox->setWindowIcon(QIcon(":/ico/image/ico/close-circle-line.svg")); + msgBox->setStyleSheet("background-color:rgba(255,255,255,1);border:0px; border-radius:0px;"); + msgBox->setWindowTitle("杀死ADB"); + msgBox->setText("· 已尝试杀死ADB进程\n· 请勿连续执行!!!"); + msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); + msgBox->show(); + + process->run("adb kill-server"); +} + +void MainWindow::playLoadingGif() //槽:播放加载动画 +{ + qDebug() << "playLoadingGif"; + ui->loadingLabel->setMovie(movie); + movie->start(); + ui->loadingLabel->show(); +} + +void MainWindow::stopLoadingGif() //槽:隐藏加载动画 + 设置currentpage参数,并发出完成basepage创建的信号 +{ + ui->loadingLabel->setVisible(false); +} + +void MainWindow::on_WIFIBtn_clicked() //槽:获取无线调试参数 +{ + getInfo = new QWidget(); + getInfo->setWindowTitle("无线调试"); + getInfo->setStyleSheet("background-color:rgba(255,255,255,1);"); + getInfo->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); + getInfo->setWindowIconText("test"); + + QLabel * title = new QLabel(); + title->setText("通过WI-FI连接设备"); + + QWidget *outWgt = new QWidget(); + outWgt->setStyleSheet("border-radius: 4px;border:1px solid #BDBDBD;"); + QVBoxLayout * outLayout = new QVBoxLayout(); + QLabel * step1 = new QLabel(); + step1->setText("第一步:打开 [开发者选项 -> 无线调试]"); + step1->setStyleSheet("border-radius: 4px;border-bottom:1px solid #BDBDBD;"); + QLabel * lb_outIp = new QLabel(); + lb_outIp->setText("无线调试IP地址:"); + lb_outIp->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); + QLabel * lb_outPort = new QLabel(); + lb_outPort->setText("无线调试端口:"); + lb_outPort->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); + + le_outIp = new QLineEdit(); + //le_outIp->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); + le_outPort = new QLineEdit(); + //le_outPort->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); + + + QWidget *inWgt = new QWidget(); + inWgt->setStyleSheet("border-radius: 4px;border:1px solid #BDBDBD;"); + QVBoxLayout * inLayout = new QVBoxLayout(); + QLabel * step2 = new QLabel(); + step2->setText("第二步:点击 [使用配对码配对设备]"); + step2->setStyleSheet("border-radius: 4px;border-bottom:1px solid #BDBDBD;"); + QLabel * lb_ipAddr = new QLabel(); + lb_ipAddr->setText("配对IP地址:"); + lb_ipAddr->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;border-bottom:2px"); + QLabel * lb_port = new QLabel(); + lb_port->setText("配对端口:"); + lb_port->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); + QLabel * lb_code = new QLabel(); + lb_code->setText("配对码:"); + lb_code->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); + + le_ipAddr = new QLineEdit(); + //le_ipAddr->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); + le_port = new QLineEdit(); + //le_port->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); + le_code = new QLineEdit(); + //le_code->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); + + QHBoxLayout * lo_outIp = new QHBoxLayout(); + lo_outIp->addWidget(lb_outIp); + lo_outIp->addWidget(le_outIp); + QHBoxLayout * lo_outPort = new QHBoxLayout(); + lo_outPort->addWidget(lb_outPort); + lo_outPort->addWidget(le_outPort); + + QHBoxLayout * lo_ipAddr = new QHBoxLayout(); + lo_ipAddr->addWidget(lb_ipAddr); + lo_ipAddr->addWidget(le_ipAddr); + QHBoxLayout * lo_port = new QHBoxLayout(); + lo_port->addWidget(lb_port); + lo_port->addWidget(le_port); + QHBoxLayout * lo_code = new QHBoxLayout(); + lo_code->addWidget(lb_code); + lo_code->addWidget(le_code); + + QPushButton * getInfoBtn = new QPushButton(getInfo); + getInfoBtn->setText("连接"); + getInfoBtn->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}QPushButton:hover{background-color:rgba(255,255,255,0.7);}QPushButton:pressed{background-color:rgba(255,255,255,0.6);}"); + QVBoxLayout * mainLayout = new QVBoxLayout(); + + QGraphicsDropShadowEffect *shadowEffect_getInfoBtn = new QGraphicsDropShadowEffect(); + shadowEffect_getInfoBtn->setOffset(0,0); + shadowEffect_getInfoBtn->setColor(Qt::gray); + shadowEffect_getInfoBtn->setBlurRadius(5); + + getInfoBtn->setGraphicsEffect(shadowEffect_getInfoBtn); + + getInfo->setLayout(mainLayout); + mainLayout->addWidget(title); + + mainLayout->addWidget(outWgt); + + outWgt->setLayout(outLayout); + outLayout->addWidget(step1); + outLayout->addLayout(lo_outIp); + outLayout->addLayout(lo_outPort); + + mainLayout->addWidget(inWgt); + + inWgt->setLayout(inLayout); + inLayout->addWidget(step2); + inLayout->addLayout(lo_ipAddr); + inLayout->addLayout(lo_port); + inLayout->addLayout(lo_code); + + mainLayout->addWidget(getInfoBtn); + + connect(getInfoBtn,SIGNAL(clicked()),this,SLOT(connectWIFIDev())); + getInfo->show(); +} + +void MainWindow::connectWIFIDev() //槽:连接无线调试设备 +{ + QString ip = le_ipAddr->text().simplified(); + QString port = le_port->text().simplified(); + QString outIp = le_outIp->text().simplified(); + QString outPort = le_outPort->text().simplified(); + QString code = le_code->text().simplified(); + QString command_connect_to_WIFI_dev = "adb pair " + ip + ":" + port; + + process->run(command_connect_to_WIFI_dev, code + "\n"); + process->run("adb connect " + outIp + ":" + outPort); + + le_ipAddr->clear(); + le_port->clear(); + le_code->clear(); + le_outIp->clear(); + le_outPort->clear(); + getInfo->deleteLater(); +} + +void MainWindow::on_WSABtn_clicked() //槽:连接WSA +{ + process->run("adb connect 127.0.0.1:58526"); + + QMessageBox * msgBox = new QMessageBox; + msgBox->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); + msgBox->setStyleSheet("background-color:rgba(255,255,255,1);border:0px; border-radius:0px;"); + msgBox->setWindowTitle("无线调试"); + msgBox->setText("· 已尝试连接,请刷新设备列表并选择WSA"); + msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); + msgBox->show(); +} + +/* +void MainWindow::emit_signal_createBasePage(int key) +{ + emit createBasePage(key, ui->widget, devList[current_device], currentPage); +} +*/ + +void MainWindow::displayWelcomePage() +{ + if(WCMPage != NULL) //销毁上一个basePage + { + //currentPage->setDisabled(true); + //delete currentPage; + WCMPage->~welcomePage(); + WCMPage = NULL; + } + + WCMPage = new welcomePage(); + ui->verticalLayout_2->addWidget(WCMPage); +} diff --git a/QtAdb/mainwindow.h b/QtAdb/mainwindow.h new file mode 100644 index 0000000..bd60ac3 --- /dev/null +++ b/QtAdb/mainwindow.h @@ -0,0 +1,94 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include "adbprocess.h" +#include "textexplainer.h" +#include "indexlistitem.h" +#include "basepage.h" +#include "pagemaker.h" +#include "threads/thread_createpage.h" +#include "welcomepage.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT +signals: + //void createBasePage(int, QWidget*, device, basePage*); + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + + adbProcess *process; + textExplainer *explainer; + pageMaker *maker; + QMovie *movie; + + QWidget * getInfo; + QLineEdit * le_outIp; + QLineEdit * le_outPort; + QLineEdit * le_ipAddr; + QLineEdit * le_port; + QLineEdit * le_code; + + //QThread* sub; + //thread_createPage * thread_BPCreator; + + int current_device; + QList devList; + indexListItem listItems[10]; + void refreshDevList(); + void addItemToIndex(indexListItem *itemWidget); + void lock(); + void unlock(); + void hideCurrentPage(); + +private slots: + void on_refreshButton_clicked(); + void setCurrentDevice(int index); + void initBasePage(int key); + void initSonPage(int key); + void playLoadingGif(); + void stopLoadingGif(); + + void on_adbKillerBtn_clicked(); + + void on_WIFIBtn_clicked(); + void connectWIFIDev(); + + + //void emit_signal_createBasePage(int key); + /*(int key, QWidget *parent, device dev)*/ + + void on_WSABtn_clicked(); + +private: + Ui::MainWindow *ui; + + void initEnvironmentPATH(); + void addIndexItems(); + void setStyles(); + void displayWelcomePage(); + + QWidget * currentPage; + QWidget * tmpPage; + welcomePage * WCMPage; +}; +#endif // MAINWINDOW_H diff --git a/QtAdb/mainwindow.ui b/QtAdb/mainwindow.ui new file mode 100644 index 0000000..8779a82 --- /dev/null +++ b/QtAdb/mainwindow.ui @@ -0,0 +1,368 @@ + + + MainWindow + + + + 0 + 0 + 954 + 567 + + + + MainWindow + + + background-color: rgb(255, 255, 255); +/*background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(238, 154, 229, 255), stop:1 rgba(89, 97, 249, 255));*/ + + + + + 0 + + + + + + 0 + + + + + + + + 250 + 100 + + + + + 250 + 100 + + + + + MiSans Normal + + + + <html><head/><body><p><span style=" font-size:36pt; color:#41cd52;">Qt</span><span style=" font-size:36pt;">ADB</span></p></body></html> + + + Qt::AlignCenter + + + + + + + + + + 210 + 30 + + + + + 210 + 30 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + <html><head/><body><p>刷新设备列表</p></body></html> + + + + + + + + + + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + + + 250 + 0 + + + + + 250 + 16777215 + + + + true + + + + + + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + + + + + + + + + + 11 + + + 16 + + + 16 + + + 16 + + + + + + 64 + 64 + + + + + 64 + 64 + + + + 无线调试 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/signal-wifi-3-fill.svg:/ico/image/ico/signal-wifi-3-fill.svg + + + + 25 + 25 + + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + + + + 杀死ADB进程 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/close-circle-line.svg:/ico/image/ico/close-circle-line.svg + + + + 25 + 25 + + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + + 64 + 64 + + + + + MiSans Normal + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + 连接 +WSA + + + + 25 + 25 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 0 + + + + + + + + + 0 + 0 + + + + background-color:rgb(85, 255, 127) + + + + + + + + + + + + + + + + diff --git a/QtAdb/pagelistitem.cpp b/QtAdb/pagelistitem.cpp new file mode 100644 index 0000000..409490e --- /dev/null +++ b/QtAdb/pagelistitem.cpp @@ -0,0 +1,60 @@ +#include "pagelistitem.h" +#include "ui_pagelistitem.h" + +pageListItem::pageListItem(QWidget *parent) : + QWidget(parent), + ui(new Ui::pageListItem) +{ + ui->setupUi(this); + ui->enableLight->setVisible(false); + + ui->widget->setStyleSheet("background-color:transparent; border-radius:4px; border-color:gray;border:0px;"); + + QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(); + shadowEffect->setOffset(0,0); + shadowEffect->setColor(Qt::gray); + shadowEffect->setBlurRadius(5); + ui->enableLight->setGraphicsEffect(shadowEffect); + + QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect(); + shadowEffect_icon->setOffset(0,0); + shadowEffect_icon->setColor(Qt::gray); + shadowEffect_icon->setBlurRadius(5); + ui->pic->setGraphicsEffect(shadowEffect_icon); + //this->setGraphicsEffect(shadowEffect); +} + +pageListItem::~pageListItem() +{ + delete ui; +} + +void pageListItem::setText(QString title, QString profile) +{ + ui->title->setText(title); + ui->profile->setText(profile); +} + +void pageListItem::setPic(QString ico) +{ + ui->pic->setIcon(QIcon(ico)); +} + +void pageListItem::on_copyButton_clicked() +{ + QClipboard *clip = QApplication::clipboard(); + clip->setText(ui->profile->text()); + + QMessageBox *msgBox = new QMessageBox; + msgBox->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); + msgBox->setStyleSheet("background-color:rgba(255,255,255,1);border:0px; border-radius:0px;"); + msgBox->setWindowTitle("复制到剪贴板"); + msgBox->setText("·已将文本\n" + ui->profile->text() + "\n复制到剪贴板"); + msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); + msgBox->show(); +} + +void pageListItem::setSelectable() +{ + ui->enableLight->setVisible(true); +} diff --git a/QtAdb/pagelistitem.h b/QtAdb/pagelistitem.h new file mode 100644 index 0000000..4d8ecb9 --- /dev/null +++ b/QtAdb/pagelistitem.h @@ -0,0 +1,37 @@ +#ifndef PAGELISTITEM_H +#define PAGELISTITEM_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace Ui { +class pageListItem; +} + +class pageListItem : public QWidget +{ + Q_OBJECT + +public: + explicit pageListItem(QWidget *parent = nullptr); + ~pageListItem(); + + void setText(QString title, QString profile); + void setPic(QString qss); + void setSelectable(); + +private slots: + void on_copyButton_clicked(); + +private: + Ui::pageListItem *ui; +}; + +#endif // PAGELISTITEM_H diff --git a/QtAdb/pagelistitem.ui b/QtAdb/pagelistitem.ui new file mode 100644 index 0000000..29e453b --- /dev/null +++ b/QtAdb/pagelistitem.ui @@ -0,0 +1,241 @@ + + + pageListItem + + + + 0 + 0 + 868 + 76 + + + + + 16777215 + 76 + + + + Form + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 16777215 + 70 + + + + border-color: rgb(0, 255, 0); +border-width:1px; + + + + 20 + + + 5 + + + 0 + + + 7 + + + 0 + + + + + false + + + + 50 + 50 + + + + + 50 + 50 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + 27 + 27 + + + + + + + + 0 + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Normal + + + + background-color: rgba(255, 255, 255, 0); + + + TextLabel + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + 3 + + + + + + 20 + 20 + + + + <html><head/><body><p>复制到剪贴板</p></body></html> + + + -1 + + + QPushButton{background-color:rgba(255,255,255,0);border-radius:4px;} +QPushButton:hover{background-color:rgba(255,255,255,0);} +QPushButton:pressed{background-color:rgba(255,255,255,1);} +QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9); font-size:12px;border-radius:2px;} + + + + + + + :/ico/image/ico/file-copy-line.svg:/ico/image/ico/file-copy-line.svg + + + + 15 + 15 + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Normal + + + + background-color: rgba(255, 255, 255, 0); +color: rgba(117, 117, 117, 0.9); + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 12 + 12 + + + + + 12 + 12 + + + + background-color:rgba(255,255,255,0.7); +border-radius:6px; + + + <html><head/><body><p><br/></p></body></html> + + + + + + + + + + + + + diff --git a/QtAdb/pagemaker.cpp b/QtAdb/pagemaker.cpp new file mode 100644 index 0000000..e655bb8 --- /dev/null +++ b/QtAdb/pagemaker.cpp @@ -0,0 +1,299 @@ +#include "pagemaker.h" +/* +pageMaker::pageMaker() +{ + +}*/ + +pageMaker::pageMaker() +{ + process = new adbProcess(); + explainer = new textExplainer(); +} + +QWidget* pageMaker::createPageWithKey(int key, QWidget *parent, device dev) +{ + int k = key; + switch(k) + { + case 0: + if(dev.state == "[开机]") + { + return createPage_devInfo(parent , dev); + break; + } + else + { + return createPage_devInfo_powerdown(parent, dev); + } + + case 1: + return createPage_acvitator(parent, dev); + break; + case 2: + return createPage_apps(parent, dev); + break; + case 3: + return createPage_devControl(parent, dev); + break; + case 4: + return createPage_recovery(parent, dev); + break; + case 5: + return createPage_about(parent); + break; + } + return NULL; +} + +basePage* pageMaker::createPage_devInfo(QWidget *parent, device dev) +{ + /* + CItemWidget* pItemWidget = new CItemWidget(this); + QListWidgetItem* pItem = new QListWidgetItem(); + pItem->setSizeHint(QSize(350, 40)); + ui->listWidget->addItem(pItem); + ui->listWidget->setItemWidget(pItem, pItemWidget);*/ + + basePage *devInfo = new basePage(parent); + devInfo->whoYouAre("devInfo"); + int val[20] = {3}; + //qDebug() << "!!!!!!!!!!!!!!!!!!!" << *val; + devInfo->setEnableValue(val); + devInfo->setDev(dev); + /**/ + + pageListItem *productModel = new pageListItem(devInfo); + //qDebug() << "dev of pageMaker" << dev.addr; + productModel->setText("设备型号 | DeviceModel",process->run("adb shell getprop ro.product.model", dev).simplified()); + productModel->setPic(":/ico/image/ico/profile-line.svg"); + devInfo->addItemsToList(productModel); + + pageListItem *screen_resolution = new pageListItem(devInfo); + screen_resolution->setText("屏幕分辨率",explainer->get_words_after(process->run("adb shell wm size", dev), ": ")); + screen_resolution->setPic(":/ico/image/ico/fullscreen-line.svg"); + devInfo->addItemsToList(screen_resolution); + + //adb shell wm density ***************** + pageListItem *dpi = new pageListItem(devInfo); + dpi->setText("屏幕密度 | DPI",process->run("adb shell wm density", dev).replace("Physical density", "默认").replace("Override density","当前").simplified()); + dpi->setPic(":/ico/image/ico/grid-line.svg"); + dpi->setSelectable(); + devInfo->addItemsToList(dpi); + + //adb shell settings get secure android_id + pageListItem *android_id = new pageListItem(devInfo); + android_id->setText("Android Id",process->run("adb shell settings get secure android_id", dev).simplified()); + android_id->setPic(":/ico/image/ico/barcode-line.svg"); + devInfo->addItemsToList(android_id); + + //adb shell getprop ro.build.version.release + pageListItem *android_version = new pageListItem(devInfo); + android_version->setText("安卓版本",process->run("adb shell getprop ro.build.version.release", dev).simplified()); + android_version->setPic(":/ico/image/ico/android-line.svg"); + devInfo->addItemsToList(android_version); + + pageListItem *cpu = new pageListItem(devInfo); + cpu->setText("处理器 | CPU",explainer->explain_cpu_output(process->run("adb shell cat /proc/cpuinfo", dev))); + cpu->setPic(":/ico/image/ico/cpu-line.svg"); + devInfo->addItemsToList(cpu); + /**/ + return devInfo; +} + +basePage* pageMaker::createPage_devInfo_powerdown(QWidget *parent, device dev) +{ + /* + CItemWidget* pItemWidget = new CItemWidget(this); + QListWidgetItem* pItem = new QListWidgetItem(); + pItem->setSizeHint(QSize(350, 40)); + ui->listWidget->addItem(pItem); + ui->listWidget->setItemWidget(pItem, pItemWidget);*/ + + basePage *devInfo = new basePage(parent); + devInfo->whoYouAre("devInfo"); + int val[20] = {}; + //qDebug() << "!!!!!!!!!!!!!!!!!!!" << *val; + devInfo->setEnableValue(val); + devInfo->setDev(dev); + /**/ + + pageListItem *productModel = new pageListItem(devInfo); + //qDebug() << "dev of pageMaker" << dev.addr; + productModel->setText("设备型号 | DeviceModel",process->run("adb shell getprop ro.product.model", dev).simplified()); + productModel->setPic(":/ico/image/ico/profile-line.svg"); + devInfo->addItemsToList(productModel); + + + pageListItem *screen_resolution = new pageListItem(devInfo); + screen_resolution->setText("屏幕分辨率","当前状态无法获取"); + screen_resolution->setPic(":/ico/image/ico/fullscreen-line.svg"); + devInfo->addItemsToList(screen_resolution); + + + //adb shell wm density ***************** + pageListItem *dpi = new pageListItem(devInfo); + dpi->setText("屏幕密度 | DPI","当前状态无法获取"); + dpi->setPic(":/ico/image/ico/grid-line.svg"); + //dpi->setSelectable(); + devInfo->addItemsToList(dpi); + + //adb shell settings get secure android_id + + pageListItem *android_id = new pageListItem(devInfo); + android_id->setText("Android Id","当前状态无法获取"); + android_id->setPic(":/ico/image/ico/barcode-line.svg"); + devInfo->addItemsToList(android_id); + + //adb shell getprop ro.build.version.release + pageListItem *android_version = new pageListItem(devInfo); + android_version->setText("Recovery 版本",process->run("adb shell getprop ro.build.version.release", dev).simplified()); + android_version->setPic(":/ico/image/ico/android-line.svg"); + devInfo->addItemsToList(android_version); + + pageListItem *cpu = new pageListItem(devInfo); + cpu->setText("处理器 | CPU",explainer->explain_cpu_output(process->run("adb shell cat /proc/cpuinfo", dev))); + cpu->setPic(":/ico/image/ico/cpu-line.svg"); + devInfo->addItemsToList(cpu); + /**/ + return devInfo; +} + +basePage* pageMaker::createPage_acvitator(QWidget *parent, device dev) +{ + basePage *activator = new basePage(parent); + //activatorPage *activator = new activatorPage(parent); + activator->whoYouAre("activator"); + int val[20] = {1,2,3,4,5,6,7,8,9}; + activator->setEnableValue(val); + activator->setDev(dev); + + pageListItem *Brevent = new pageListItem(activator); + Brevent->setText("黑阈","adb -d shell sh /data/data/me.piebridge.brevent/brevent.sh"); + Brevent->setPic(":/activatorApps/image/activatorApps/brevent.png"); + Brevent->setSelectable(); + activator->addItemsToList(Brevent); + + pageListItem *IceBox_dpm = new pageListItem(activator); + IceBox_dpm->setText("冰箱 - 设备管理员","adb shell dpm set-device-owner com.catchingnow.icebox/.receiver.DPMReceiver"); + IceBox_dpm->setPic(":/activatorApps/image/activatorApps/icebox.png"); + IceBox_dpm->setSelectable(); + activator->addItemsToList(IceBox_dpm); + + pageListItem *IceBox = new pageListItem(activator); + IceBox->setText("冰箱 - 普通模式","adb shell sh /sdcard/Android/data/com.catchingnow.icebox/files/start.sh"); + IceBox->setPic(":/activatorApps/image/activatorApps/icebox.png"); + IceBox->setSelectable(); + activator->addItemsToList(IceBox); + + pageListItem *StopApp = new pageListItem(activator); + StopApp->setText("小黑屋 - 设备管理员","adb shell dpm set-device-owner web1n.stopapp/.receiver.AdminReceiver"); + StopApp->setPic(":/activatorApps/image/activatorApps/blackroom.png"); + StopApp->setSelectable(); + activator->addItemsToList(StopApp); + + pageListItem *StopApp_Maxwell = new pageListItem(activator); + StopApp_Maxwell->setText("小黑屋 - 麦克斯韦妖","adb shell sh /storage/emulated/0/Android/data/web1n.stopapp/files/starter.sh"); + StopApp_Maxwell->setPic(":/activatorApps/image/activatorApps/blackroom.png"); + StopApp_Maxwell->setSelectable(); + activator->addItemsToList(StopApp_Maxwell); + + pageListItem *shizuku = new pageListItem(activator); + shizuku->setText("Shizuku","adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh"); + shizuku->setPic(":/activatorApps/image/activatorApps/shizuku.png"); + shizuku->setSelectable(); + activator->addItemsToList(shizuku); + + pageListItem *BlackHole = new pageListItem(activator); + BlackHole->setText("黑洞","adb shell dpm set-device-owner com.hld.apurikakusu/.receiver.DPMReceiver"); + BlackHole->setPic(":/activatorApps/image/activatorApps/blackhole.png"); + BlackHole->setSelectable(); + activator->addItemsToList(BlackHole); + + pageListItem *TaiChi = new pageListItem(activator); + TaiChi->setText("太极","adb shell dpm set-device-owner me.weishu.exp/.DeviceAdmin"); + TaiChi->setPic(":/activatorApps/image/activatorApps/taichi.png"); + TaiChi->setSelectable(); + activator->addItemsToList(TaiChi); + + pageListItem *Island = new pageListItem(activator); + Island->setText("Island","adb -d shell dpm set-device-owner com.oasisfeng.island/.IslandDeviceAdminReceiver"); + Island->setPic(":/activatorApps/image/activatorApps/island.png"); + Island->setSelectable(); + activator->addItemsToList(Island); + + return activator; +} + +basePage* pageMaker::createPage_apps(QWidget *parent, device dev) +{ + basePage *apps = new basePage(parent); + //activatorPage *activator = new activatorPage(parent); + apps->whoYouAre("apps"); + int val[20] = {1}; + apps->setEnableValue(val); + apps->setDev(dev); + + pageListItem *installer = new pageListItem(apps); + installer->setText("安装应用","adb install "); + installer->setPic(":/ico/image/ico/install-line.svg"); + installer->setSelectable(); + apps->addItemsToList(installer); + + return apps; +} + +basePage* pageMaker::createPage_devControl(QWidget *parent, device dev) +{ + basePage *devControl = new basePage(parent); + //activatorPage *activator = new activatorPage(parent); + devControl->whoYouAre("devControl"); + int val[20] = {1,2}; + devControl->setEnableValue(val); + devControl->setDev(dev); + + pageListItem *power = new pageListItem(devControl); + power->setText("电源","adb reboot "); + power->setPic(":/ico/image/ico/shut-down-line.svg"); + power->setSelectable(); + devControl->addItemsToList(power); + + pageListItem *btnEmulate = new pageListItem(devControl); + btnEmulate->setText("按键模拟","adb shell input keyevent "); + btnEmulate->setPic(":/ico/image/ico/drag-move-line.svg"); + btnEmulate->setSelectable(); + devControl->addItemsToList(btnEmulate); + + return devControl; +} + +basePage* pageMaker::createPage_recovery(QWidget *parent, device dev) +{ + basePage *recovery = new basePage(parent); + //activatorPage *activator = new activatorPage(parent); + recovery->whoYouAre("recovery"); + int val[20] = {1}; + recovery->setEnableValue(val); + recovery->setDev(dev); + + pageListItem *power = new pageListItem(recovery); + power->setText("侧载","adb sideload "); + power->setPic(":/ico/image/ico/refund-line.svg"); + power->setSelectable(); + recovery->addItemsToList(power); + + /* + pageListItem *btnEmulate = new pageListItem(recovery); + btnEmulate->setText("按键模拟","adb shell input keyevent "); + btnEmulate->setPic(":/ico/image/ico/refund-line.svg"); + btnEmulate->setSelectable(); + recovery->addItemsToList(btnEmulate);*/ + + return recovery; +} + +QWidget* pageMaker::createPage_about(QWidget *parent) +{ + about* abt = new about(parent); + return abt; +} diff --git a/QtAdb/pagemaker.h b/QtAdb/pagemaker.h new file mode 100644 index 0000000..e9d4d17 --- /dev/null +++ b/QtAdb/pagemaker.h @@ -0,0 +1,44 @@ +#ifndef PAGEMAKER_H +#define PAGEMAKER_H +#include "basepage.h" +#include "pagelistitem.h" +#include "adbprocess.h" +#include "textexplainer.h" +#include "about.h" + + +class pageMaker +{ +public: + //pageMaker(); + pageMaker(); + + adbProcess *process; + textExplainer *explainer; + + QWidget *createPageWithKey(int key, QWidget *parent, device dev); + + + basePage *createPage_devInfo(QWidget *parent, device dev); + basePage *createPage_devInfo_powerdown(QWidget *parent, device dev); + + basePage *createPage_acvitator(QWidget *parent, device dev); + basePage *createPage_apps(QWidget *parent,device dev); + + basePage *createPage_devControl(QWidget *parent,device dev); + + basePage *createPage_recovery(QWidget *parent, device dev); + + QWidget *createPage_about(QWidget *parent); + + + //activatorPage *createSonPage_activator(QWidget *parent, device dev); +private: + /*youtPhone*/ + + + + +}; + +#endif // PAGEMAKER_H diff --git a/QtAdb/sonPages/activator/sp_activator.cpp b/QtAdb/sonPages/activator/sp_activator.cpp new file mode 100644 index 0000000..a9d959b --- /dev/null +++ b/QtAdb/sonPages/activator/sp_activator.cpp @@ -0,0 +1,100 @@ +#include "sp_activator.h" +#include "ui_sp_activator.h" + +sp_activator::sp_activator(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_activator) +{ + ui->setupUi(this); + process = new adbProcess; + parents = parent; + + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + + shadowEffect_runBtn->setOffset(0,0); + shadowEffect_runBtn->setColor(Qt::gray); + shadowEffect_runBtn->setBlurRadius(5); + + shadowEffect_showOutputBtn->setOffset(0,0); + shadowEffect_showOutputBtn->setColor(Qt::gray); + shadowEffect_showOutputBtn->setBlurRadius(5); + + shadowEffect_back_to_basePage->setOffset(0,0); + shadowEffect_back_to_basePage->setColor(Qt::gray); + shadowEffect_back_to_basePage->setBlurRadius(5); + + shadowEffect_refreshBtn->setOffset(0,0); + shadowEffect_refreshBtn->setColor(Qt::gray); + shadowEffect_refreshBtn->setBlurRadius(5); + + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + ui->runBtn->setGraphicsEffect(shadowEffect_runBtn); + ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); + ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); + + QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(); + shadowEffect_textBrowser->setOffset(0,0); + shadowEffect_textBrowser->setColor(Qt::gray); + shadowEffect_textBrowser->setBlurRadius(5); + ui->textBrowser->setGraphicsEffect(shadowEffect_textBrowser); + + /* + QGraphicsDropShadowEffect *shadowEffect_appIcon = new QGraphicsDropShadowEffect(); + shadowEffect_appIcon->setOffset(0,0); + shadowEffect_appIcon->setColor(Qt::gray); + shadowEffect_appIcon->setBlurRadius(10); + ui->appIcon->setGraphicsEffect(shadowEffect_appIcon);*/ + /* + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + ui->widget->setGraphicsEffect(shadowEffect_widget);*/ + + //ui->textBrowser->sc +} + +sp_activator::~sp_activator() +{ + delete ui; +} + +void sp_activator::setUp(QString qss, QString title, QString profile, QString cmd) +{ + ui->appIcon->setStyleSheet(qss); + ui->appName->setText(title); + ui->textBrowser->setMarkdown(profile); + command = cmd; +} + +void sp_activator::on_runBtn_clicked() +{ + process->run(command, dev); +} + +void sp_activator::setDev(device device) +{ + dev = device; +} + +void sp_activator::on_showOutputBtn_clicked(bool checked) +{ + if(checked) + { + page = new standardOutputPage(NULL,process); + /* + parents->mapToGlobal(parents->pos()); + page->move(parents->pos().x() + parents->width() + this->width()/2 + 22,0);*/ + //page->setWindowFlags(Qt::FramelessWindowHint);parents->pos().x() + parents->width() +this->width() + 22 + page->show(); + } + else + { + page->~standardOutputPage(); + } +} diff --git a/QtAdb/sonPages/activator/sp_activator.h b/QtAdb/sonPages/activator/sp_activator.h new file mode 100644 index 0000000..a245676 --- /dev/null +++ b/QtAdb/sonPages/activator/sp_activator.h @@ -0,0 +1,41 @@ +#ifndef SP_ACTIVATOR_H +#define SP_ACTIVATOR_H + +#include +#include +#include "adbprocess.h" +#include "../sonpagebase.h" +#include "../standardoutputpage.h" + +namespace Ui { +class sp_activator; +} + +class sp_activator : public QWidget +{ + Q_OBJECT + +public: + explicit sp_activator(QWidget *parent = nullptr); + ~sp_activator(); + + void setUp(QString qss, QString title, QString profile, QString command); + QString command; + device dev; + standardOutputPage *page; + QWidget *parents; + + void setDev(device device); + +private slots: + void on_runBtn_clicked(); + + void on_showOutputBtn_clicked(bool checked); + +private: + Ui::sp_activator *ui; + + adbProcess *process; +}; + +#endif // SP_ACTIVATOR_H diff --git a/QtAdb/sonPages/activator/sp_activator.ui b/QtAdb/sonPages/activator/sp_activator.ui new file mode 100644 index 0000000..be04ef6 --- /dev/null +++ b/QtAdb/sonPages/activator/sp_activator.ui @@ -0,0 +1,295 @@ + + + sp_activator + + + + 0 + 0 + 571 + 458 + + + + Form + + + + 0 + + + 11 + + + 0 + + + 11 + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 11 + + + + + 14 + + + + + 14 + + + + + + 40 + 40 + + + + + 40 + 40 + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + + + + + + + + + + + MiSans Normal + 12 + PreferAntialias + + + + false + + + background-color: rgba(255, 255, 255, 0.9); +border:0px; border-radius:4px; + + + QTextEdit::WidgetWidth + + + true + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/terminal-box-line.svg:/ico/image/ico/terminal-box-line.svg + + + + 18 + 18 + + + + true + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/apps/sp_installer.cpp b/QtAdb/sonPages/apps/sp_installer.cpp new file mode 100644 index 0000000..41fd239 --- /dev/null +++ b/QtAdb/sonPages/apps/sp_installer.cpp @@ -0,0 +1,95 @@ +#include "sp_installer.h" +#include "ui_sp_installer.h" + +sp_installer::sp_installer(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_installer) +{ + ui->setupUi(this); + + process = new adbProcess(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(); + + shadowEffect_runBtn->setOffset(0,0); + shadowEffect_runBtn->setColor(Qt::gray); + shadowEffect_runBtn->setBlurRadius(5); + + shadowEffect_showOutputBtn->setOffset(0,0); + shadowEffect_showOutputBtn->setColor(Qt::gray); + shadowEffect_showOutputBtn->setBlurRadius(5); + + shadowEffect_back_to_basePage->setOffset(0,0); + shadowEffect_back_to_basePage->setColor(Qt::gray); + shadowEffect_back_to_basePage->setBlurRadius(5); + + shadowEffect_refreshBtn->setOffset(0,0); + shadowEffect_refreshBtn->setColor(Qt::gray); + shadowEffect_refreshBtn->setBlurRadius(5); + + shadowEffect_selectBtn->setOffset(0,0); + shadowEffect_selectBtn->setColor(Qt::gray); + shadowEffect_selectBtn->setBlurRadius(5); + + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + ui->runBtn->setGraphicsEffect(shadowEffect_runBtn); + ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); + ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); + ui->selectBtn->setGraphicsEffect(shadowEffect_selectBtn); + + /* + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + ui->widget->setGraphicsEffect(shadowEffect_widget);*/ + +} + +sp_installer::~sp_installer() +{ + delete ui; +} + +void sp_installer::setDev(device device) +{ + dev = device; +} +void sp_installer::on_runBtn_clicked() +{ + qDebug() << "enter runBtn slot"; + QString command; + if(apkPath != "") + { + command = "adb install ~ " + apkPath + " ~"; + } + else + { + command = "adb install"; + } + qDebug() << "enter runBtn slot 1"; + qDebug() << "enter runBtn slot 2"; + qDebug() << "enter runBtn slot 4"; + qDebug() << "command: " << command; + qDebug() << "running"; + process->run_contains_empty(command, dev); + apkPath.clear(); + labelDisplay.clear(); + ui->filePaths->clear(); +} + +void sp_installer::on_selectBtn_clicked() +{ + qDebug() << "enter pushbutton slot"; + apkPath.clear(); + apkPath = QFileDialog::getOpenFileName(this, QStringLiteral("选择安装包"), "F:",QStringLiteral("安装包(*.apk)")); + + ui->filePaths->setText(apkPath); + + qDebug() << "apkPathis:" << apkPath; +} diff --git a/QtAdb/sonPages/apps/sp_installer.h b/QtAdb/sonPages/apps/sp_installer.h new file mode 100644 index 0000000..1664d60 --- /dev/null +++ b/QtAdb/sonPages/apps/sp_installer.h @@ -0,0 +1,40 @@ +#ifndef SP_INSTALLER_H +#define SP_INSTALLER_H + +#include +#include +#include "adbprocess.h" +#include + +namespace Ui { +class sp_installer; +} + +class sp_installer : public QWidget +{ + Q_OBJECT + +public: + explicit sp_installer(QWidget *parent = nullptr); + ~sp_installer(); + + device dev; + + void setDev(device dev); + + adbProcess *process; + + QString labelDisplay; + +private slots: + void on_runBtn_clicked(); + + void on_selectBtn_clicked(); + +private: + Ui::sp_installer *ui; + + QString apkPath; +}; + +#endif // SP_INSTALLER_H diff --git a/QtAdb/sonPages/apps/sp_installer.ui b/QtAdb/sonPages/apps/sp_installer.ui new file mode 100644 index 0000000..39752f3 --- /dev/null +++ b/QtAdb/sonPages/apps/sp_installer.ui @@ -0,0 +1,322 @@ + + + sp_installer + + + + 0 + 0 + 489 + 405 + + + + Form + + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 11 + + + + + 14 + + + + + 14 + + + + + + 40 + 40 + + + + + 40 + 40 + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/install-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + 安装应用 + + + + + + + + + + + + 0 + 0 + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + 选择 +文件 + + + + + + + + MiSans Normal + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/terminal-box-line.svg:/ico/image/ico/terminal-box-line.svg + + + + 18 + 18 + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/devControl/btnemulator.cpp b/QtAdb/sonPages/devControl/btnemulator.cpp new file mode 100644 index 0000000..ad76d97 --- /dev/null +++ b/QtAdb/sonPages/devControl/btnemulator.cpp @@ -0,0 +1,231 @@ +#include "btnemulator.h" +#include "ui_btnemulator.h" + +btnEmulator::btnEmulator(QWidget *parent) : + QWidget(parent), + ui(new Ui::btnEmulator) +{ + ui->setupUi(this); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + process = new adbProcess(); + explainer = new textExplainer(); + + setStyles(); +} + +btnEmulator::~btnEmulator() +{ + delete ui; +} + +void btnEmulator::setDev(device device) +{ + dev = device; +} + +void btnEmulator::on_btn_back_clicked() +{ + process->run("adb shell input keyevent 4", dev); +} + +void btnEmulator::on_btn_home_clicked() +{ + process->run("adb shell input keyevent 3", dev); +} + +void btnEmulator::on_btn_menu_clicked() +{ + process->run("adb shell input keyevent 82", dev); +} + +void btnEmulator::on_btn_changeWindow_clicked() +{ + process->run("adb shell input keyevent 187", dev); +} + +void btnEmulator::on_btn_power_clicked() +{ + process->run("adb shell input keyevent 26", dev); +} + +void btnEmulator::on_btn_volUp_clicked() +{ + process->run("adb shell input keyevent 24", dev); +} + +void btnEmulator::on_btn_volDown_clicked() +{ + process->run("adb shell input keyevent 25", dev); +} + +void btnEmulator::on_btn_mute_clicked() +{ + process->run("adb shell input keyevent 164", dev); +} + +void btnEmulator::on_btn_shoot_clicked() +{ + process->run("adb shell input keyevent 27", dev); +} + +void btnEmulator::on_btn_play_stop_clicked() +{ + process->run("adb shell input keyevent 85", dev); +} + +void btnEmulator::on_btn_stop_clicked() +{ + process->run("adb shell input keyevent 86", dev); +} + +void btnEmulator::on_last_clicked() +{ + process->run("adb shell input keyevent 88", dev); +} + +void btnEmulator::on_btn_play_clicked() +{ + process->run("adb shell input keyevent 126", dev); +} + +void btnEmulator::on_btn_pause_clicked() +{ + process->run("adb shell input keyevent 127", dev); +} + +void btnEmulator::on_btn_next_clicked() +{ + process->run("adb shell input keyevent 87", dev); +} + +void btnEmulator::on_btn_light_down_clicked() +{ + process->run("adb shell input keyevent 220", dev); +} + +void btnEmulator::on_btn_light_up_clicked() +{ + process->run("adb shell input keyevent 221", dev); +} + +void btnEmulator::on_btn_sleep_clicked() +{ + process->run("adb shell input keyevent 223", dev); +} + +void btnEmulator::on_btn_sleep2_clicked() +{ + process->run("adb shell input keyevent 276", dev); +} + +void btnEmulator::on_btn_delight_clicked() +{ + process->run("adb shell input keyevent 224", dev); +} + +void btnEmulator::on_btn_call_AI_clicked() +{ + process->run("adb shell input keyevent 231", dev); +} + +void btnEmulator::on_btn_hang_up_clicked() +{ + process->run("adb shell input keyevent 6", dev); +} + +void btnEmulator::on_btn_settings_clicked() +{ + process->run("adb shell input keyevent 176", dev); +} + +void btnEmulator::on_btn_contacts_clicked() +{ + process->run("adb shell input keyevent 207", dev); +} + +void btnEmulator::on_btn_phone_clicked() +{ + process->run("adb shell input keyevent 5", dev); +} + +void btnEmulator::on_btn_browser_clicked() +{ + process->run("adb shell input keyevent 64", dev); +} + +void btnEmulator::on_btn_music_clicked() +{ + process->run("adb shell input keyevent 209", dev); +} + +void btnEmulator::on_btn_calender_clicked() +{ + process->run("adb shell input keyevent 208", dev); +} + +void btnEmulator::on_btn_calc_clicked() +{ + process->run("adb shell input keyevent 210", dev); +} + +void btnEmulator::setShadow(QWidget* wgt) +{ + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + wgt->setGraphicsEffect(shadowEffect_widget); +} + +void btnEmulator::setStyles() +{ + /* + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + ui->widget->setGraphicsEffect(shadowEffect_widget);*/ + + setShadow(ui->btn_back); + setShadow(ui->btn_home); + setShadow(ui->btn_menu); + setShadow(ui->btn_changeWindow); + setShadow(ui->btn_power); + setShadow(ui->btn_volUp); + setShadow(ui->btn_volDown); + setShadow(ui->btn_mute); + setShadow(ui->btn_shoot); + setShadow(ui->btn_play_stop); + setShadow(ui->btn_stop); + setShadow(ui->last); + setShadow(ui->btn_play); + setShadow(ui->btn_pause); + setShadow(ui->btn_next); + setShadow(ui->btn_light_down); + setShadow(ui->btn_light_up); + setShadow(ui->btn_sleep); + setShadow(ui->btn_sleep2); + setShadow(ui->btn_delight); + setShadow(ui->btn_call_AI); + setShadow(ui->btn_hang_up); + setShadow(ui->btn_settings); + setShadow(ui->btn_contacts); + setShadow(ui->btn_phone); + setShadow(ui->btn_browser); + setShadow(ui->btn_music); + setShadow(ui->btn_calender); + setShadow(ui->btn_calc); + setShadow(ui->back_to_basePage); + + setShadow(ui->label); + setShadow(ui->label_2); + setShadow(ui->label_3); + setShadow(ui->label_4); + setShadow(ui->label_5); + + ui->label->setStyleSheet("border:0px;background-color:rgba(255,255,255,0.7);"); + ui->label_2->setStyleSheet("border:0px;background-color:rgba(255,255,255,0.7);"); + ui->label_3->setStyleSheet("border:0px;background-color:rgba(255,255,255,0.7);"); + ui->label_4->setStyleSheet("border:0px;background-color:rgba(255,255,255,0.7);"); + ui->label_5->setStyleSheet("border:0px;background-color:rgba(255,255,255,0.7);"); +} diff --git a/QtAdb/sonPages/devControl/btnemulator.h b/QtAdb/sonPages/devControl/btnemulator.h new file mode 100644 index 0000000..ae3592d --- /dev/null +++ b/QtAdb/sonPages/devControl/btnemulator.h @@ -0,0 +1,91 @@ +#ifndef BTNEMULATOR_H +#define BTNEMULATOR_H + +#include +#include +#include "textexplainer.h" +#include "adbprocess.h" + +namespace Ui { +class btnEmulator; +} + +class btnEmulator : public QWidget +{ + Q_OBJECT + +public: + explicit btnEmulator(QWidget *parent = nullptr); + ~btnEmulator(); + + adbProcess* process; + textExplainer* explainer; + device dev; + void setDev(device device); + void setShadow(QWidget* wgt); + void setStyles(); + +private slots: + void on_btn_back_clicked(); + + void on_btn_home_clicked(); + + void on_btn_menu_clicked(); + + void on_btn_changeWindow_clicked(); + + void on_btn_power_clicked(); + + void on_btn_volUp_clicked(); + + void on_btn_volDown_clicked(); + + void on_btn_mute_clicked(); + + void on_btn_shoot_clicked(); + + void on_btn_play_stop_clicked(); + + void on_btn_stop_clicked(); + + void on_last_clicked(); + + void on_btn_play_clicked(); + + void on_btn_pause_clicked(); + + void on_btn_next_clicked(); + + void on_btn_light_down_clicked(); + + void on_btn_light_up_clicked(); + + void on_btn_sleep_clicked(); + + void on_btn_sleep2_clicked(); + + void on_btn_delight_clicked(); + + void on_btn_call_AI_clicked(); + + void on_btn_hang_up_clicked(); + + void on_btn_settings_clicked(); + + void on_btn_contacts_clicked(); + + void on_btn_phone_clicked(); + + void on_btn_browser_clicked(); + + void on_btn_music_clicked(); + + void on_btn_calender_clicked(); + + void on_btn_calc_clicked(); + +private: + Ui::btnEmulator *ui; +}; + +#endif // BTNEMULATOR_H diff --git a/QtAdb/sonPages/devControl/btnemulator.ui b/QtAdb/sonPages/devControl/btnemulator.ui new file mode 100644 index 0000000..3682bd7 --- /dev/null +++ b/QtAdb/sonPages/devControl/btnemulator.ui @@ -0,0 +1,1259 @@ + + + btnEmulator + + + + 0 + 0 + 615 + 450 + + + + Form + + + + 0 + + + 0 + + + + + + MiSans Normal + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 11 + + + + + 14 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + 系统 +导航 + + + Qt::AlignCenter + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 返回 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/arrow-left-s-line.svg:/ico/image/ico/btnEmulator/arrow-left-s-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 主页 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/home-2-line.svg:/ico/image/ico/btnEmulator/home-2-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 菜单 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/menu-line.svg:/ico/image/ico/btnEmulator/menu-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 切换应用 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/arrow-left-right-line.svg:/ico/image/ico/btnEmulator/arrow-left-right-line.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + 实体 +按键 + + + Qt::AlignCenter + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 电源键 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/shut-down-line.svg:/ico/image/ico/shut-down-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 音量+ + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/volume-up-line.svg:/ico/image/ico/btnEmulator/volume-up-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 音量- + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/volume-down-line.svg:/ico/image/ico/btnEmulator/volume-down-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 静音 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/volume-mute-line.svg:/ico/image/ico/btnEmulator/volume-mute-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 拍摄(在相机内) + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/camera-3-line.svg:/ico/image/ico/btnEmulator/camera-3-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 唤醒助理应用 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/psychotherapy-line.svg:/ico/image/ico/btnEmulator/psychotherapy-line.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + 媒体 +控制 + + + Qt::AlignCenter + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 播放/暂停 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/disc-line.svg:/ico/image/ico/btnEmulator/disc-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 停止播放 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/stop-fill.svg:/ico/image/ico/btnEmulator/stop-fill.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 上一曲 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/skip-back-line.svg:/ico/image/ico/btnEmulator/skip-back-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 继续 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 暂停 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/pause-line.svg:/ico/image/ico/btnEmulator/pause-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 下一曲 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/skip-forward-line.svg:/ico/image/ico/btnEmulator/skip-forward-line.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + 其它 +指令 + + + Qt::AlignCenter + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 减小亮度 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/haze-line.svg:/ico/image/ico/btnEmulator/haze-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 增加亮度 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/sun-line.svg:/ico/image/ico/btnEmulator/sun-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 休眠系统 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/zzz-line.svg:/ico/image/ico/btnEmulator/zzz-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 当没有wakelock时休眠系统 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/rest-time-line.svg:/ico/image/ico/btnEmulator/rest-time-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 点亮屏幕 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/lightbulb-line.svg:/ico/image/ico/btnEmulator/lightbulb-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 挂断 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/phone-off.svg:/ico/image/ico/btnEmulator/phone-off.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + 系统 +应用 + + + Qt::AlignCenter + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开设置 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/settings-line.svg:/ico/image/ico/btnEmulator/settings-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开联系人 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/contacts-book-line.svg:/ico/image/ico/btnEmulator/contacts-book-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开拨号 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/phone-line.svg:/ico/image/ico/btnEmulator/phone-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开浏览器 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/firefox-line.svg:/ico/image/ico/btnEmulator/firefox-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开音乐 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/disc-line.svg:/ico/image/ico/btnEmulator/disc-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开日历 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/calendar-event-line.svg:/ico/image/ico/btnEmulator/calendar-event-line.svg + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + 打开计算器 + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/btnEmulator/calculator-line.svg:/ico/image/ico/btnEmulator/calculator-line.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp b/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp new file mode 100644 index 0000000..fac46c6 --- /dev/null +++ b/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp @@ -0,0 +1,81 @@ +#include "sp_devcontrol_power.h" +#include "ui_sp_devcontrol_power.h" + +sp_devControl_power::sp_devControl_power(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_devControl_power) +{ + ui->setupUi(this); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + process = new adbProcess(); + explainer = new textExplainer(); + + /* + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + ui->widget->setGraphicsEffect(shadowEffect_widget);*/ + + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); + shadowEffect_back_to_basePage->setOffset(0,0); + shadowEffect_back_to_basePage->setColor(Qt::gray); + shadowEffect_back_to_basePage->setBlurRadius(5); + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + + QGraphicsDropShadowEffect *shadowEffect_btn_powerDown = new QGraphicsDropShadowEffect(); + shadowEffect_btn_powerDown->setOffset(0,0); + shadowEffect_btn_powerDown->setColor(Qt::gray); + shadowEffect_btn_powerDown->setBlurRadius(5); + ui->btn_powerDown->setGraphicsEffect(shadowEffect_btn_powerDown); + + QGraphicsDropShadowEffect *shadowEffect_btn_rebootToSystem = new QGraphicsDropShadowEffect(); + shadowEffect_btn_rebootToSystem->setOffset(0,0); + shadowEffect_btn_rebootToSystem->setColor(Qt::gray); + shadowEffect_btn_rebootToSystem->setBlurRadius(5); + ui->btn_rebootToSystem->setGraphicsEffect(shadowEffect_btn_rebootToSystem); + + QGraphicsDropShadowEffect *shadowEffect_rebootToRecovery_clicked = new QGraphicsDropShadowEffect(); + shadowEffect_rebootToRecovery_clicked->setOffset(0,0); + shadowEffect_rebootToRecovery_clicked->setColor(Qt::gray); + shadowEffect_rebootToRecovery_clicked->setBlurRadius(5); + ui->btn_rebootToRecovery->setGraphicsEffect(shadowEffect_rebootToRecovery_clicked); + + QGraphicsDropShadowEffect *shadowEffect_btn_rebootToFastboot = new QGraphicsDropShadowEffect(); + shadowEffect_btn_rebootToFastboot->setOffset(0,0); + shadowEffect_btn_rebootToFastboot->setColor(Qt::gray); + shadowEffect_btn_rebootToFastboot->setBlurRadius(5); + ui->btn_rebootToFastboot->setGraphicsEffect(shadowEffect_btn_rebootToFastboot); +} + +sp_devControl_power::~sp_devControl_power() +{ + delete ui; +} + +void sp_devControl_power::on_btn_powerDown_clicked() +{ + process->run("adb shell reboot -p", dev); +} + +void sp_devControl_power::setDev(device device) +{ + dev = device; +} + +void sp_devControl_power::on_btn_rebootToSystem_clicked() +{ + qDebug() << "calling process->run('adb reboot', dev);"; + process->run("adb reboot", dev); + qDebug() << "calling process->run('adb reboot', dev);"; +} + +void sp_devControl_power::on_btn_rebootToRecovery_clicked() +{ + process->run("adb reboot recovery", dev); +} + +void sp_devControl_power::on_btn_rebootToFastboot_clicked() +{ + process->run("adb reboot bootloader", dev); +} diff --git a/QtAdb/sonPages/devControl/sp_devcontrol_power.h b/QtAdb/sonPages/devControl/sp_devcontrol_power.h new file mode 100644 index 0000000..f9bf9a0 --- /dev/null +++ b/QtAdb/sonPages/devControl/sp_devcontrol_power.h @@ -0,0 +1,39 @@ +#ifndef SP_DEVCONTROL_POWER_H +#define SP_DEVCONTROL_POWER_H + +#include +#include +#include "textexplainer.h" +#include "adbprocess.h" + +namespace Ui { +class sp_devControl_power; +} + +class sp_devControl_power : public QWidget +{ + Q_OBJECT + +public: + explicit sp_devControl_power(QWidget *parent = nullptr); + ~sp_devControl_power(); + + adbProcess* process; + textExplainer* explainer; + device dev; + void setDev(device device); + +private slots: + void on_btn_powerDown_clicked(); + + void on_btn_rebootToSystem_clicked(); + + void on_btn_rebootToRecovery_clicked(); + + void on_btn_rebootToFastboot_clicked(); + +private: + Ui::sp_devControl_power *ui; +}; + +#endif // SP_DEVCONTROL_POWER_H diff --git a/QtAdb/sonPages/devControl/sp_devcontrol_power.ui b/QtAdb/sonPages/devControl/sp_devcontrol_power.ui new file mode 100644 index 0000000..40aa06c --- /dev/null +++ b/QtAdb/sonPages/devControl/sp_devcontrol_power.ui @@ -0,0 +1,357 @@ + + + sp_devControl_power + + + + 0 + 0 + 632 + 503 + + + + Form + + + + 0 + + + 0 + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 11 + + + + + 14 + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/shut-down-line.svg:/ico/image/ico/shut-down-line.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 关机 + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/android-line.svg:/ico/image/ico/android-line.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 重启到系统 + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/device-recover-line.svg:/ico/image/ico/device-recover-line.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 重启到 Recovery + + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/dvd-line.svg:/ico/image/ico/dvd-line.svg + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Normal + 12 + + + + 重启到 Fastboot + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp new file mode 100644 index 0000000..b2767ce --- /dev/null +++ b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp @@ -0,0 +1,116 @@ +#include "sp_dpichanger.h" +#include "ui_sp_dpichanger.h" + +sp_dpiChanger::sp_dpiChanger(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_dpiChanger) +{ + ui->setupUi(this); + + process = new adbProcess; + explainer = new textExplainer; + + setDpiInfo(); + + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + ui->verticalLayout->setAlignment(Qt::AlignVCenter); + + ui->back_to_basePage->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}" + "QPushButton:hover{background-color:rgba(255,255,255,0.7);}" + "QPushButton:pressed{background-color:rgba(255,255,255,0.6);}"); + ui->runBtn->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}" + "QPushButton:hover{background-color:rgba(255,255,255,0.7);}" + "QPushButton:pressed{background-color:rgba(255,255,255,0.6);}"); + ui->showOutputBtn->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}" + "QPushButton:hover{background-color:rgba(255,255,255,0.7);}" + "QPushButton:pressed{background-color:rgba(255,255,255,0.6);}"); + + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + + shadowEffect_runBtn->setOffset(0,0); + shadowEffect_runBtn->setColor(Qt::gray); + shadowEffect_runBtn->setBlurRadius(5); + + shadowEffect_showOutputBtn->setOffset(0,0); + shadowEffect_showOutputBtn->setColor(Qt::gray); + shadowEffect_showOutputBtn->setBlurRadius(5); + + shadowEffect_back_to_basePage->setOffset(0,0); + shadowEffect_back_to_basePage->setColor(Qt::gray); + shadowEffect_back_to_basePage->setBlurRadius(5); + + shadowEffect_refreshBtn->setOffset(0,0); + shadowEffect_refreshBtn->setColor(Qt::gray); + shadowEffect_refreshBtn->setBlurRadius(5); + + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + ui->runBtn->setGraphicsEffect(shadowEffect_runBtn); + ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); + ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); + + /* + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + ui->widget->setGraphicsEffect(shadowEffect_widget);*/ +} + +sp_dpiChanger::~sp_dpiChanger() +{ + delete ui; +} + +void sp_dpiChanger::setDpiInfo() +{ + qDebug() << "dve of sonPage = " << dev.addr; + QString profile = process->run("adb shell wm density", dev).replace("Physical density", "默认").replace("Override density","当前").simplified(); + qDebug() << profile; + ui->dpiInfo->setText(profile); +} + +void sp_dpiChanger::on_runBtn_clicked() +{ + if(ui->lineEdit->text().toInt()){ + QString output; + this->setDisabled(true); + output = process->run("adb shell wm density " + ui->lineEdit->text().simplified() , dev); + + this->setDisabled(false); + qDebug() << output; + + refresh(); + ui->lineEdit->setPlaceholderText("已修改"); + } + else if(!ui->lineEdit->text().toInt()) + { + ui->lineEdit->clear(); + ui->lineEdit->setPlaceholderText("输入无效"); + } + else + { + ui->lineEdit->clear(); + ui->lineEdit->setPlaceholderText("error"); + } +} + +void sp_dpiChanger::refresh() +{ + setDpiInfo(); + ui->lineEdit->clear(); +} + +void sp_dpiChanger::on_refreshBtn_clicked() +{ + refresh(); +} + +void sp_dpiChanger::setDev(device device) +{ + dev = device; + setDpiInfo(); +} diff --git a/QtAdb/sonPages/devInfo/sp_dpichanger.h b/QtAdb/sonPages/devInfo/sp_dpichanger.h new file mode 100644 index 0000000..48e493a --- /dev/null +++ b/QtAdb/sonPages/devInfo/sp_dpichanger.h @@ -0,0 +1,38 @@ +#ifndef SP_DPICHANGER_H +#define SP_DPICHANGER_H + +#include +#include + +#include "adbprocess.h" +#include "textexplainer.h" + +namespace Ui { +class sp_dpiChanger; +} + +class sp_dpiChanger : public QWidget +{ + Q_OBJECT + +public: + explicit sp_dpiChanger(QWidget *parent = nullptr); + ~sp_dpiChanger(); + + adbProcess *process; + textExplainer *explainer; + device dev; + + void setDev(device device); + +private slots: + void on_runBtn_clicked(); + void on_refreshBtn_clicked(); + +private: + Ui::sp_dpiChanger *ui; + void setDpiInfo(); + void refresh(); +}; + +#endif // SP_DPICHANGER_H diff --git a/QtAdb/sonPages/devInfo/sp_dpichanger.ui b/QtAdb/sonPages/devInfo/sp_dpichanger.ui new file mode 100644 index 0000000..51507a6 --- /dev/null +++ b/QtAdb/sonPages/devInfo/sp_dpichanger.ui @@ -0,0 +1,403 @@ + + + sp_dpiChanger + + + + 0 + 0 + 571 + 428 + + + + + + + Form + + + + 0 + + + 11 + + + 0 + + + 11 + + + + + + + + /*background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(238, 154, 229, 255), stop:1 rgba(89, 97, 249, 255));*/ +/*border-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(238, 154, 229, 255), stop:1 rgba(89, 97, 249, 255));*/ +border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + + + + + + + + 40 + 40 + + + + + 40 + 40 + + + + image:url(:/ico/image/ico/grid-line.svg); + + + + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Normal + true + + + + border:0px; +background-color: rgba(255, 255, 255, 0); + + + <html><head/><body><p><span style=" font-size:18pt; font-weight:700;">更改DPI</span></p></body></html> + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Normal + 12 + + + + border:0px; +background-color: rgba(255, 255, 255, 0); + + + DPI 信息: + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Normal + 12 + + + + border:0px; +background-color: rgba(255, 255, 255, 0); + + + 未知 + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Normal + 12 + + + + border:0px; +background-color: rgba(255, 255, 255, 0); + + + 修改为: + + + + + + + + 0 + 0 + + + + + 60 + 30 + + + + + 16777215 + 30 + + + + + 60 + 30 + + + + + MiSans Normal + 12 + + + + border:1px solid #BDBDBD; +background-color: rgba(255, 255, 255, 0); + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + + + 返回 + + + + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + 1 + 1 + + + + + + + border:0px; + + + + + + + :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + + + + + + + + + + :/ico/image/ico/terminal-box-line.svg:/ico/image/ico/terminal-box-line.svg + + + + 18 + 18 + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/pay.cpp b/QtAdb/sonPages/pay.cpp new file mode 100644 index 0000000..2f9bb6d --- /dev/null +++ b/QtAdb/sonPages/pay.cpp @@ -0,0 +1,14 @@ +#include "pay.h" +#include "ui_pay.h" + +pay::pay(QWidget *parent) : + QWidget(parent), + ui(new Ui::pay) +{ + ui->setupUi(this); +} + +pay::~pay() +{ + delete ui; +} diff --git a/QtAdb/sonPages/pay.h b/QtAdb/sonPages/pay.h new file mode 100644 index 0000000..c0bffa3 --- /dev/null +++ b/QtAdb/sonPages/pay.h @@ -0,0 +1,22 @@ +#ifndef PAY_H +#define PAY_H + +#include + +namespace Ui { +class pay; +} + +class pay : public QWidget +{ + Q_OBJECT + +public: + explicit pay(QWidget *parent = nullptr); + ~pay(); + +private: + Ui::pay *ui; +}; + +#endif // PAY_H diff --git a/QtAdb/sonPages/pay.ui b/QtAdb/sonPages/pay.ui new file mode 100644 index 0000000..1c42e60 --- /dev/null +++ b/QtAdb/sonPages/pay.ui @@ -0,0 +1,147 @@ + + + pay + + + + 0 + 0 + 270 + 200 + + + + Form + + + + + + false + + + background-color: rgba(255, 255, 255, 1); +border-color: rgba(255, 255, 255, 0); +border:0px; + + + + + + + :/ico/image/ico/about/wechat-pay-line.svg:/ico/image/ico/about/wechat-pay-line.svg + + + + + + + false + + + + 0 + 0 + + + + + 120 + 120 + + + + + 120 + 120 + + + + background-color: rgba(255, 255, 255, 1); +border-color: rgba(255, 255, 255, 0); +border:0px; + + + + + + + :/ico/image/ico/about/wechat.svg:/ico/image/ico/about/wechat.svg + + + + 400 + 300 + + + + + + + + false + + + + 0 + 0 + + + + + 120 + 120 + + + + + 120 + 120 + + + + background-color: rgba(255, 255, 255, 1); +border-color: rgba(255, 255, 255, 0); +border:0px; + + + + + + + :/ico/image/ico/about/alipay.svg:/ico/image/ico/about/alipay.svg + + + + 400 + 300 + + + + + + + + false + + + background-color: rgba(255, 255, 255, 1); +border-color: rgba(255, 255, 255, 0); +border:0px; + + + + + + + :/ico/image/ico/about/alipay-line.svg:/ico/image/ico/about/alipay-line.svg + + + + + + + + + + diff --git a/QtAdb/sonPages/recovery/sp_recovery.cpp b/QtAdb/sonPages/recovery/sp_recovery.cpp new file mode 100644 index 0000000..79a48ee --- /dev/null +++ b/QtAdb/sonPages/recovery/sp_recovery.cpp @@ -0,0 +1,86 @@ +#include "sp_recovery.h" +#include "ui_sp_recovery.h" + +sp_recovery::sp_recovery(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_recovery) +{ + ui->setupUi(this); + + process = new adbProcess(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(); + + shadowEffect_runBtn->setOffset(0,0); + shadowEffect_runBtn->setColor(Qt::gray); + shadowEffect_runBtn->setBlurRadius(5); + + shadowEffect_showOutputBtn->setOffset(0,0); + shadowEffect_showOutputBtn->setColor(Qt::gray); + shadowEffect_showOutputBtn->setBlurRadius(5); + + shadowEffect_back_to_basePage->setOffset(0,0); + shadowEffect_back_to_basePage->setColor(Qt::gray); + shadowEffect_back_to_basePage->setBlurRadius(5); + + shadowEffect_refreshBtn->setOffset(0,0); + shadowEffect_refreshBtn->setColor(Qt::gray); + shadowEffect_refreshBtn->setBlurRadius(5); + + shadowEffect_selectBtn->setOffset(0,0); + shadowEffect_selectBtn->setColor(Qt::gray); + shadowEffect_selectBtn->setBlurRadius(5); + + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + ui->runBtn->setGraphicsEffect(shadowEffect_runBtn); + ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); + ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); + ui->selectBtn->setGraphicsEffect(shadowEffect_selectBtn); +} + +sp_recovery::~sp_recovery() +{ + delete ui; +} + +void sp_recovery::setDev(device device) +{ + dev = device; +} +void sp_recovery::on_runBtn_clicked() +{ + qDebug() << "enter runBtn slot"; + QString command; + + if(zipPath != "") + { + command = "adb sideload ~ " + zipPath + " ~"; + } + else + { + command = "adb sideload"; + } + + qDebug() << "command: " << command; + qDebug() << "running"; + process->run_contains_empty(command, dev); + zipPath.clear(); + labelDisplay.clear(); + ui->filePaths->clear(); +} + +void sp_recovery::on_selectBtn_clicked() +{ + qDebug() << "enter pushbutton slot"; + zipPath.clear(); + zipPath = QFileDialog::getOpenFileName(this, QStringLiteral("选择zip包"), "F:",QStringLiteral("压缩包(*.zip)")); + + ui->filePaths->setText(zipPath); + + qDebug() << "zipPathis:" << zipPath; +} diff --git a/QtAdb/sonPages/recovery/sp_recovery.h b/QtAdb/sonPages/recovery/sp_recovery.h new file mode 100644 index 0000000..cda837c --- /dev/null +++ b/QtAdb/sonPages/recovery/sp_recovery.h @@ -0,0 +1,40 @@ +#ifndef SP_RECOVERY_H +#define SP_RECOVERY_H + +#include +#include +#include "adbprocess.h" +#include + +namespace Ui { +class sp_recovery; +} + +class sp_recovery : public QWidget +{ + Q_OBJECT + +public: + explicit sp_recovery(QWidget *parent = nullptr); + ~sp_recovery(); + + device dev; + + void setDev(device dev); + + adbProcess *process; + + QString labelDisplay; + +private slots: + void on_runBtn_clicked(); + + void on_selectBtn_clicked(); + +private: + Ui::sp_recovery *ui; + + QString zipPath; +}; + +#endif // SP_RECOVERY_H diff --git a/QtAdb/sonPages/recovery/sp_recovery.ui b/QtAdb/sonPages/recovery/sp_recovery.ui new file mode 100644 index 0000000..fd651f6 --- /dev/null +++ b/QtAdb/sonPages/recovery/sp_recovery.ui @@ -0,0 +1,322 @@ + + + sp_recovery + + + + 0 + 0 + 651 + 536 + + + + Form + + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 11 + + + + + 14 + + + + + 14 + + + + + + 40 + 40 + + + + + 40 + 40 + + + + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/refund-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + adb sideload + + + + + + + + + + + + 0 + 0 + + + + + 50 + 50 + + + + + 50 + 50 + + + + + MiSans Normal + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + 选择 +文件 + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/terminal-box-line.svg:/ico/image/ico/terminal-box-line.svg + + + + 18 + 18 + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/sonpagebase.cpp b/QtAdb/sonPages/sonpagebase.cpp new file mode 100644 index 0000000..b9cf32d --- /dev/null +++ b/QtAdb/sonPages/sonpagebase.cpp @@ -0,0 +1,14 @@ +#include "sonpagebase.h" +#include "ui_sonpagebase.h" + +sonPageBase::sonPageBase(QWidget *parent) : + QWidget(parent), + ui(new Ui::sonPageBase) +{ + ui->setupUi(this); +} + +sonPageBase::~sonPageBase() +{ + delete ui; +} diff --git a/QtAdb/sonPages/sonpagebase.h b/QtAdb/sonPages/sonpagebase.h new file mode 100644 index 0000000..96bc19d --- /dev/null +++ b/QtAdb/sonPages/sonpagebase.h @@ -0,0 +1,25 @@ +#ifndef SONPAGEBASE_H +#define SONPAGEBASE_H + +#include + +namespace Ui { +class sonPageBase; +} + +class sonPageBase : public QWidget +{ + Q_OBJECT + +public: + explicit sonPageBase(QWidget *parent = nullptr); + ~sonPageBase(); + + QWidget *parents; + void setTitle(QString title); + +private: + Ui::sonPageBase *ui; +}; + +#endif // SONPAGEBASE_H diff --git a/QtAdb/sonPages/sonpagebase.ui b/QtAdb/sonPages/sonpagebase.ui new file mode 100644 index 0000000..a56cdad --- /dev/null +++ b/QtAdb/sonPages/sonpagebase.ui @@ -0,0 +1,225 @@ + + + sonPageBase + + + + 0 + 0 + 607 + 492 + + + + Form + + + + 0 + + + 8 + + + 0 + + + 30 + + + + + border-radius: 4px; +border:1px solid #BDBDBD; + + + + 11 + + + 11 + + + 11 + + + 11 + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg + + + + 18 + 18 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}QPushButton:hover{background-color:rgba(255,255,255,0.7);}QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/terminal-box-line.svg:/ico/image/ico/terminal-box-line.svg + + + + 18 + 18 + + + + + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.7);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg + + + + 30 + 30 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/sonpagemanager.cpp b/QtAdb/sonPages/sonpagemanager.cpp new file mode 100644 index 0000000..76a1bfe --- /dev/null +++ b/QtAdb/sonPages/sonpagemanager.cpp @@ -0,0 +1,243 @@ +#include "sonpagemanager.h" + +sonPageManager::sonPageManager() +{ + process = new adbProcess(); + explainer = new textExplainer(); +} + +QWidget* sonPageManager::selector(QWidget *parent , QString parentName, int key, device dev) +{ + if(parentName == "devInfo") + { + qDebug() << "dev.addr=" << dev.addr; + return createSonPageFor_devInfo(parent, key , dev); + //return createSonPageFor_activator(parent); + } + else if(parentName == "activator") + { + return createSonPageFor_activator(parent, key , dev); + } + else if(parentName == "apps") + { + return createSonPageFor_apps(parent, key , dev); + } + else if(parentName == "devControl") + { + return createSonPageFor_devControl(parent, key , dev); + } + else if(parentName == "recovery") + { + return createSonPageFor_recovery(parent, key , dev); + } + + throw "failed to create sonPage!"; + return NULL; +} + +sp_dpiChanger* sonPageManager::createSonPageFor_devInfo(QWidget *parent, int key, device dev) +{ + switch(key +1) + { + case 3: + { + sp_dpiChanger *page = new sp_dpiChanger(parent); + page->setDev(dev); + return page; + } + break; + } + return NULL; +} + +sp_activator* sonPageManager::createSonPageFor_activator(QWidget *parent, int key, device dev) +{ + //sp_activator *page = new sp_activator(parent); + //return page; + switch(key + 1) + { + case 1 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/brevent.png);", + "激活 黑阈", + "黑阈™不需要 root 也不需要解锁,能有效防止恶意应用在后台运行,从而让手机流畅省电。\n" + "黑阈主要采取以下手段来限制应用后台:\n" + "1. 停用状态。应用处于停用状态时,不会收到 Android 系统及 GMS 发送的广播,从而避免“被动运行”。\n" + "2. 待机。待机以后,应用无法访问网络,执行任务与同步等。这减少Android 系统被动运行该应用,同时即使运行也减少其网络活动。\n", + "adb -d shell sh /data/data/me.piebridge.brevent/brevent.sh"); + return page; + break; + } + case 2 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/icebox.png);", + "激活 冰箱 - 设备管理员", + "使用**设备管理器**模式激活冰箱前,请按下列步骤操作:\n" + "1. 确保手机上已安装冰箱,删除屏幕锁,索尼手机取出 SIM 卡,MIUI 开启「USB 调试(安全设置)」并关闭「MIUI 优化」\n" + "2. 在系统设置中,**注销所有帐号**,如小米帐号、华为帐号、Google 帐号等,激活后可以再登录回来。\n", + "adb shell dpm set-device-owner com.catchingnow.icebox/.receiver.DPMReceiver"); + return page; + break; + } + case 3 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/icebox.png);", + "激活 冰箱 - 普通模式", + "如果您未能成功配置设备管理员模式的冰箱,则可以考虑使用普通 ADB 模式。\n" + "- 优点:无需删除帐号等复杂步骤,直接使用\n" + "- 缺点:每次重启手机后必须要重新激活,否则无法冻结解冻 App\n" + "- 激活后需保持 USB 调试始终打开,设置 USB 连接设置为「仅充电」(MIUI 需开启「USB 调试(安全设置)」)\n", + "adb shell sh /sdcard/Android/data/com.catchingnow.icebox/files/start.sh"); + return page; + break; + } + case 4 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/blackroom.png);", "激活 小黑屋 - 设备管理员", + "使用**设备管理器**模式激活小黑屋前,注意以下事项:\n" + "1. 打开手机开发者选项与 USB 调试,将 USB 连接设置为「仅充电」(小米手机需开启开发者选项「USB 调试(安全设置)」)。\n" + "2. 进入手机「设置 - 帐号」,删除所有的帐号,包括你的 Google 帐号、小米账号、华为账号等(激活后可以再登录回来)。\n" + "3. 如果您之前设置过访客模式、应用双开或是多用户设置等,也需要一并关闭或删除(激活后可以打开)。\n", + "adb shell dpm set-device-owner web1n.stopapp/.receiver.AdminReceiver"); + return page; + break; + } + case 5 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/blackroom.png);", + "激活 小黑屋 - 麦克斯韦妖", + "麦克斯韦妖是小黑屋的一款冻结模式。借助它,小黑屋可以免 Root 权限冻结应用程序。 \n" + "麦克斯韦妖引擎与 ROM 的兼容性很好,不会出现设备管理员模式与 ROM 之间的一些兼容性问题。 \n" + "**麦克斯韦妖优点** \n" + "- 无需移除账号与用户等操作,激活成功率极高。 \n" + "- 冻结速度快,点击即冻结。 \n\n" + "**麦克斯韦妖缺点** \n" + "- 关机后即失效,因此每次开机需要重新激活。若不重新激活将无法打开已冻结 app。 \n", + "adb shell sh /storage/emulated/0/Android/data/web1n.stopapp/files/starter.sh"); + return page; + break; + } + case 6 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/shizuku.png);", "激活 Shizuku", + "Android 11 及以上支持无线调试,您可以直接在设备上启动 Shizuku。 \n" + "对于未 root 设备,则需要借助 adb 启动。 \n" + "**请注意** \n" + "- 设备重新启动后需要再次连接电脑。 \n" + "在一些定制系统上 Shizuku 可能会随机停止,此时: \n\n" + "- 不要关闭“USB 调试”及“开发者选项” \n" + "- 保证在连接电脑期间 USB 使用模式不变。通常的做法是在“开发者选项”中将 USB 使用模式改为“仅充电” \n" + "- 连接 USB 后,若弹出类似“是否允许访问文件”的对话框,请不要点击它,因为点击后 USB 使用模式会发生变化。 \n" + "- Sony 设备不要点击连接 USB 后弹出的对话框。 \n", + "adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh"); + return page; + break; + } + case 7 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/blackhole.png);", "激活 黑洞", + "**黑洞**已在各大平台下架且无法找到帮助文档。 \n" + "但您仍可通过 QtAdb 激活它的设备管理员模式。", + "adb shell dpm set-device-owner com.hld.apurikakusu/.receiver.DPMReceiver"); + return page; + break; + } + case 8 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/taichi.png);", "激活 太极", + "**阴阳之门的用途** \n" + "1. 可以大幅优化 太极 创建应用和升级应用的流程;不再需要手动确认,整个流程可以一气呵成。 \n" + "2. 额外提供类似冰箱的冻结功能;可以冻结和隐藏应用。 \n\n" + "**注意事项** \n" + "1. 首先确保您已安装太极。 \n" + "2. 进入手机「设置 - 帐户」,删除 所有 的帐户,包括你的 Google 帐户(之后可以再登录回来)。 \n" + "3. 如果您之前设置过多用户或手机自带访客模式、应用双开等,也需要一并关闭或删除(之后可以打开)。 \n", + "adb shell dpm set-device-owner me.weishu.exp/.DeviceAdmin"); + return page; + break; + } + case 9 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/island.png);", "激活 炼妖壶Island - 上帝模式", + "激活 Island 『上帝模式』:(可冻结任何应用,而不仅限于 Island 空间内的应用) \n" + "由于 Android 系统的限制,首先需要在系统设置 - 账户 中移除所有已登录的账户 及 除了主用户外的其它用户(包括曾使用过的『访客』用户)。 \n" + "账户移除后,对应的应用可能需要重新登录,但大部分国内应用并不影响登录(因为它们使用账户机制是别的目的)。 \n" + "其次,如果你已经创建了 Island 空间(Work profile),也必须先在 Island - Settings - Setup 中移除。在激活『上帝模式』后,你可以再重新创建 Island 空间。 \n", + "adb -d shell dpm set-device-owner com.oasisfeng.island/.IslandDeviceAdminReceiver"); + return page; + break; + } + + break; + } + return NULL; +} + +sp_installer* sonPageManager::createSonPageFor_apps(QWidget *parent, int key, device dev) +{ + switch(key +1) + { + case 1: + { + sp_installer *page = new sp_installer(parent); + page->setDev(dev); + return page; + } + break; + } + return NULL; +} + +QWidget* sonPageManager::createSonPageFor_devControl(QWidget *parent, int key, device dev) +{ + switch(key +1) + { + case 1: + { + sp_devControl_power *page = new sp_devControl_power(parent); + page->setDev(dev); + return page; + } + case 2: + { + btnEmulator *page = new btnEmulator(parent); + page->setDev(dev); + return page; + } + break; + } + return NULL; +} + +QWidget* sonPageManager::createSonPageFor_recovery(QWidget *parent, int key, device dev) +{ + switch(key +1) + { + case 1: + { + sp_recovery *page = new sp_recovery(parent); + page->setDev(dev); + return page; + } + break; + } + return NULL; +} diff --git a/QtAdb/sonPages/sonpagemanager.h b/QtAdb/sonPages/sonpagemanager.h new file mode 100644 index 0000000..716e5ec --- /dev/null +++ b/QtAdb/sonPages/sonpagemanager.h @@ -0,0 +1,34 @@ +#ifndef SONPAGEMANAGER_H +#define SONPAGEMANAGER_H + +#include "adbprocess.h" +#include "textexplainer.h" +#include "devInfo/sp_dpichanger.h" +#include "activator/sp_activator.h" +#include "apps/sp_installer.h" +#include "devControl/sp_devcontrol_power.h" +#include "devControl/btnemulator.h" +#include "recovery/sp_recovery.h" + + +class sonPageManager +{ +public: + sonPageManager(); + + adbProcess *process; + textExplainer *explainer; + + + QWidget *selector(QWidget *parent, QString parentName, int key , device dev); + +private: + + sp_dpiChanger* createSonPageFor_devInfo(QWidget *parent, int key, device dev); + sp_activator* createSonPageFor_activator(QWidget *parent, int key, device dev); + sp_installer* createSonPageFor_apps(QWidget *parent, int key, device dev); + QWidget* createSonPageFor_devControl(QWidget *parent, int key, device dev); + QWidget* createSonPageFor_recovery(QWidget *parent, int key, device dev); +}; + +#endif // SONPAGEMANAGER_H diff --git a/QtAdb/sonPages/standardoutputpage.cpp b/QtAdb/sonPages/standardoutputpage.cpp new file mode 100644 index 0000000..eb1a921 --- /dev/null +++ b/QtAdb/sonPages/standardoutputpage.cpp @@ -0,0 +1,42 @@ +#include "standardoutputpage.h" +#include "ui_standardoutputpage.h" + +standardOutputPage::standardOutputPage(QWidget *parent, adbProcess *cess) : + QWidget(parent), + ui(new Ui::standardOutputPage) +{ + ui->setupUi(this); + process = cess; + + QTimer *timer = new QTimer(this); //初始化一个定时器。 + connect(timer, SIGNAL(timeout()), this, SLOT(update())); //设置信号与槽 ,槽函数update()需要再类中声明一下。 + timer->start(1000 / 30); //设置定时器刷新频率,即变量刷新频率。 + ui->textBrowser->setText("该功能暂未实现,敬请期待!"); +} + +standardOutputPage::~standardOutputPage() +{ + delete ui; +} + +void standardOutputPage::update() +{ + ui->textBrowser->setText(process->standardOutput); +} + +void standardOutputPage::on_refreshBtn_clicked() +{ + update(); +} + + +void standardOutputPage::on_clearBtn_clicked() +{ + ui->textBrowser->clear(); +} + +void standardOutputPage::on_copyBtn_clicked() +{ + QClipboard *clip = QApplication::clipboard(); + clip->setText(ui->textBrowser->toPlainText()); +} diff --git a/QtAdb/sonPages/standardoutputpage.h b/QtAdb/sonPages/standardoutputpage.h new file mode 100644 index 0000000..b661bc8 --- /dev/null +++ b/QtAdb/sonPages/standardoutputpage.h @@ -0,0 +1,33 @@ +#ifndef STANDARDOUTPUTPAGE_H +#define STANDARDOUTPUTPAGE_H + +#include +#include +#include +#include "adbprocess.h" + +namespace Ui { +class standardOutputPage; +} + +class standardOutputPage : public QWidget +{ + Q_OBJECT + +public: + explicit standardOutputPage(QWidget *parent = nullptr , adbProcess *cess = NULL); + ~standardOutputPage(); + adbProcess *process; + +private: + Ui::standardOutputPage *ui; + +public slots: + void update(); +private slots: + void on_refreshBtn_clicked(); + void on_clearBtn_clicked(); + void on_copyBtn_clicked(); +}; + +#endif // STANDARDOUTPUTPAGE_H diff --git a/QtAdb/sonPages/standardoutputpage.ui b/QtAdb/sonPages/standardoutputpage.ui new file mode 100644 index 0000000..1bc7416 --- /dev/null +++ b/QtAdb/sonPages/standardoutputpage.ui @@ -0,0 +1,72 @@ + + + standardOutputPage + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + refresh + + + + + + + clear + + + + + + + copy + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/textexplainer.cpp b/QtAdb/textexplainer.cpp new file mode 100644 index 0000000..67835ce --- /dev/null +++ b/QtAdb/textexplainer.cpp @@ -0,0 +1,249 @@ +#include "textexplainer.h" + +textExplainer::textExplainer() +{ + +} + +QList textExplainer::getDevList(QString tmpStr) +{ + + QStringList tmpList; + QList devList; + + tmpList = tmpStr.split("\n"); + + //qDebug() << "tmplist: " << tmpList << "\n"; + //qDebug() << tmpList.size() << "\n"; + + for(int i = 1; i < tmpList.size() ; i++) + { + qDebug() << "fuckQt1"; + //qDebug() << "tmplist[" << i << "]\n"; + tmpList[i] = tmpList[i].simplified(); + + if (tmpList[i] == "") + { + continue; + } + + QStringList tmp = tmpList[i].split("device product:"); + QString tmpInfo = tmp[1]; + QStringList finalInfo = tmpInfo.split(" "); + + for (int i = 1; i <= 3; i++ ) + { + QStringList infoSimplier = finalInfo[i].split(":"); + finalInfo[i] = infoSimplier[1]; + } + finalInfo.prepend(tmp[0]); + //qDebug() << "finalDevInfo NO." << i << ":" << finalInfo; + device dev; + //qDebug() << i; + dev.addr = finalInfo[0].simplified(); + //qDebug() << "dev.addr:" << dev.addr; + dev.device_product = finalInfo[1]; + //qDebug() << "device_product:" << dev.device_product; + dev.model = finalInfo[2]; + //qDebug() << "model:" << dev.model; + dev.device_debug = finalInfo[3]; + //qDebug() << "device_debug:" << dev.device_debug; + dev.transport_id = finalInfo[4]; + //qDebug() << "transport_id:" << dev.transport_id; + devList.append(dev); + //qDebug() << dev.addr; + } + + return devList; +} + +QList textExplainer::getDevList_windows(QString tmpStr) +{ + + QStringList tmpList; + QList devList; + + tmpList = tmpStr.split("\n"); + + //qDebug() << "tmplist: " << tmpList << "\n"; + //qDebug() << tmpList.size() << "\n"; + + for(int i = 1; i < tmpList.size() ; i++) + { + tmpList[i] = tmpList[i].simplified(); + + if (tmpList[i] == "") + { + continue; + } + + QStringList tmp = tmpList[i].split(" "); + + device dev; + + dev.addr = tmp[0]; + dev.state = setState(tmp[1]); + dev.device_product = tmp[2]; + dev.model = tmp[3]; + dev.device_debug = tmp[4]; + dev.transport_id = tmp[5]; + devList.append(dev); + } + return devList; +} + +QString textExplainer::get_words_after(QString str , QString key) +{ + QString text = str; + //qDebug() << "text is:" << text << "\n"; + int index = str.lastIndexOf(key); + //qDebug() << "index =" << index << "\n"; + text = text.right(text.size()-index-key.size()); + //qDebug() << "key.size =" << key.size() << "\n"; + text = text.simplified(); + return text; +} + +QString textExplainer::explain_cpu_output(QString str) +{ + QString text = str; + QStringList tmpList = text.split("\n"); + QString tmpInfo = tmpList[tmpList.count()-2]; + //qDebug() << tmpList; + tmpInfo = tmpInfo.simplified(); + //qDebug() << "tmpInfo =" << tmpInfo << "\n"; + + + return get_words_after(tmpInfo, ":"); +} + +bool textExplainer::explainError(QString err) +{ + qDebug() << "err = " << err; + err = err.simplified(); + + /*普通*/ + if(err.contains("No such file or directory")) + { + qDebug() << "into if"; + showMsgBox("失败"," · 应用未安装 \n · 应用安装后未首次运行"); + } + else if(err.contains("Permission denied")) + { + showMsgBox("失败"," · 请先运行应用"); + } + /*启动*/ + else if(err.contains("daemon not running")){} + else if(err.contains("daemon started successfully")){} + /*应用安装*/ + else if(err.contains("install requires an argument")) + { + showMsgBox("提示"," · 请先选择安装包"); + } + else if(err.contains("failed to install") && err.contains("cmd: not found")) + { + showMsgBox("错误"," · 当前设备状态无法安装应用"); + } + /* 设备管理员 */ + else if(err.contains("Not allowed to set the device owner because there are already several users on the device")) + { + showMsgBox("失败"," · 请先清除所有用户并关闭多用户模式"); + } + else if(err.contains("Unknown admin")) + { + showMsgBox("失败"," · 设备管理员应用未安装"); + } + else if(err.contains("Not allowed to set the device owner because there are already some accounts on the device")) + { + showMsgBox("失败"," · 请先退出所有账户"); + } + else if(err.contains("Trying to set the device owner, but device owner is already set.")) + { + showMsgBox("失败"," · 存在冲突的设备管理员应用"); + } + /*无线调试*/ + //No pairing code provided + else if(err.contains("No pairing code provided")) + { + showMsgBox("失败"," · 请输入配对码"); + } + /*recovery*/ + else if(err.contains("cmd: not found")) + { + showMsgBox("错误"," · 当前设备状态无法执行该命令\n · 请确认当前设备状态(开机、REC等)能否执行该操作"); + } + else if(err.contains("dpm: not found")) + { + showMsgBox("错误"," · 当前设备状态无法执行该命令\n · 请确认当前设备状态(开机、REC等)能否执行该操作"); + } + else if(err.contains("am: not found")) + { + showMsgBox("错误"," · 当前设备状态无法执行该命令\n · 请确认当前设备状态(开机、REC等)能否执行该操作"); + } + else if(err.contains("input: not found")) + { + showMsgBox("错误"," · 当前设备状态无法执行该命令\n · 请确认当前设备状态(开机、REC等)能否执行该操作"); + } + /*其他情况*/ + else if(err.contains("could not start server")) + { + showMsgBox("提示"," · 程序上次运行时异常退出,您可以反馈此问题"); + } + else if(err.contains("Done")) + { + showMsgBox("完成"," · 成功\n · 你之所以会看到这条提示,是因为ADB本身将成功的消息以错误输出方式输出\n · 您无需关注此错误"); + } + else + { + showMsgBox("错误"," · 未知错误!\n" + err +"\n · 若此处出现并不完整的报错或一大串包含 '.android.os'、'java' 等字样的错误,您可以视情况忽忽视它,并查阅另一条报错\n"); + } + qDebug() << "<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>" << "\n" << err; + return true; +} + +bool textExplainer::explainOutput(QString op) +{ + qDebug() << "output = " << op; + op = op.simplified(); + + /*普通*/ + if(op.contains("No such file or directory")) + { + showMsgBox("失败"," · 应用未安装 \n · 应用安装后未首次运行"); + } + qDebug() << "+++++++++++++++++Output+++++++++++++++++" << "\n" << op; + return true; +} + +void textExplainer::showMsgBox(QString title, QString msg) +{ + msgBox = new QMessageBox; + msgBox->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); + msgBox->setStyleSheet("background-color:rgba(255,255,255,1);border:0px; border-radius:0px;"); + msgBox->setWindowTitle(title); + msgBox->setText(msg); + msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); + msgBox->show(); +} + +QString textExplainer::setState(QString state) +{ + if(state == "offline") + { + return "[未响应]"; + } + else if(state == "device") + { + return "[开机]"; + } + else if(state == "recovery") + { + return "[REC]"; + } + else if(state == "sideload") + { + return "[侧载]"; + } + return "出错"; +} + diff --git a/QtAdb/textexplainer.h b/QtAdb/textexplainer.h new file mode 100644 index 0000000..2d4173b --- /dev/null +++ b/QtAdb/textexplainer.h @@ -0,0 +1,40 @@ +#ifndef TEXTEXPLAINER_H +#define TEXTEXPLAINER_H +#include +#include +#include +#include +#include +#include + +struct device +{ + QString addr; + QString state; + QString device_product; + QString model; + QString device_debug; + QString transport_id; +}; + +class textExplainer +{ +public: + textExplainer(); + + QList getDevList(QString tmpStr); + QList getDevList_windows(QString tmpStr); + QString get_words_after(QString str , QString key); + QString explain_cpu_output(QString str); + + void showMsgBox(QString title,QString msg); + + bool explainError(QString err); + bool explainOutput(QString op); + QMessageBox *msgBox; + +private: + QString setState(QString state); +}; + +#endif // TEXTEXPLAINER_H diff --git a/QtAdb/threads/thread_createpage.cpp b/QtAdb/threads/thread_createpage.cpp new file mode 100644 index 0000000..485e8e5 --- /dev/null +++ b/QtAdb/threads/thread_createpage.cpp @@ -0,0 +1,25 @@ +#include "thread_createpage.h" + +thread_createPage::thread_createPage(QObject *parent) + : QThread{parent} +{ + +} + +QWidget* thread_createPage::createBasePage(int key, QWidget *parent, device dev, QWidget *page) +{ + //bPage = new basePage(); + qDebug() << "thread_createPage : creating BasePage"; + page = maker->createPageWithKey(key,parent,dev); + qDebug() << "thread_createPage : BasePage created"; + emit basePageCreated(); + qDebug() << "thread_createPage : emit SIGNAL 'basePageCreated'"; + return NULL; +} + +QWidget * thread_createPage::createSonPage(QWidget *parent, QString parentName, int key, device dev) +{ + sPage = SPManager->selector(parent,parentName,key,dev); + emit sonPageCreated(); + return NULL; +} diff --git a/QtAdb/threads/thread_createpage.h b/QtAdb/threads/thread_createpage.h new file mode 100644 index 0000000..5ae0402 --- /dev/null +++ b/QtAdb/threads/thread_createpage.h @@ -0,0 +1,32 @@ +#ifndef THREAD_CREATEPAGE_H +#define THREAD_CREATEPAGE_H + +#include +#include "../basepage.h" +#include "../pagemaker.h" +#include "../sonPages/sonpagemanager.h" +#include "../adbprocess.h" + +class thread_createPage : public QThread +{ + Q_OBJECT +public: + explicit thread_createPage(QObject *parent = nullptr); + + pageMaker *maker; + + basePage* bPage; + + sonPageManager *SPManager; + QWidget *createSonPage(QWidget *parent, QString parentName, int key , device dev); + QWidget *sPage; + +public slots: + QWidget* createBasePage(int key, QWidget *parent, device dev, QWidget* page); +signals: + void basePageCreated(); + void sonPageCreated(); + +}; + +#endif // THREAD_CREATEPAGE_H diff --git a/QtAdb/welcomepage.cpp b/QtAdb/welcomepage.cpp new file mode 100644 index 0000000..b81c8f5 --- /dev/null +++ b/QtAdb/welcomepage.cpp @@ -0,0 +1,14 @@ +#include "welcomepage.h" +#include "ui_welcomepage.h" + +welcomePage::welcomePage(QWidget *parent) : + QWidget(parent), + ui(new Ui::welcomePage) +{ + ui->setupUi(this); +} + +welcomePage::~welcomePage() +{ + delete ui; +} diff --git a/QtAdb/welcomepage.h b/QtAdb/welcomepage.h new file mode 100644 index 0000000..d00fccd --- /dev/null +++ b/QtAdb/welcomepage.h @@ -0,0 +1,22 @@ +#ifndef WELCOMEPAGE_H +#define WELCOMEPAGE_H + +#include + +namespace Ui { +class welcomePage; +} + +class welcomePage : public QWidget +{ + Q_OBJECT + +public: + explicit welcomePage(QWidget *parent = nullptr); + ~welcomePage(); + +private: + Ui::welcomePage *ui; +}; + +#endif // WELCOMEPAGE_H diff --git a/QtAdb/welcomepage.ui b/QtAdb/welcomepage.ui new file mode 100644 index 0000000..d34eda9 --- /dev/null +++ b/QtAdb/welcomepage.ui @@ -0,0 +1,100 @@ + + + welcomePage + + + + 0 + 0 + 667 + 530 + + + + Form + + + + + + background-color: rgba(255, 255, 255, 0); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image:url(:/ico/image/ico/connect.svg); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..c1110fb --- /dev/null +++ b/README.md @@ -0,0 +1,169 @@ +# QtAdb + +QtAdb 是一个基于 [Qt](https://www.qt.io/) 的 Android 工具集合。 + +## 🧑‍💻开发目的 + +[Android 调试桥 (adb)](https://developer.android.google.cn/studio/command-line/adb?hl=zh-cn) 是一种功能多样的命令行工具,可让开发者与设备之间进行通信。adb 命令可用于执行各种设备操作(例如安装和调试应用),并提供对 Unix shell(可用来在设备上运行各种命令)的访问权限。 + +Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌现出众多的命令用法。非开发者的Android 爱好者经常根据需求运行 adb 命令以提升使用体验。 + +但由于 adb 涉及到环境配置、终端执行等操作,对于不会使用的人可能造成困扰;一些命令行参数的记忆对于并不熟悉的人来说同样令人头疼。所以可供一键式操作,并且已内置环境的图形窗口有一定需求。 + +~~其实就是拿来练练手,不写代码憋得慌~~ + +## 🔩特性 + +- QtAdb 已**内置 adb 环境**,并可在运行时自行配置,使用者无需关心环境变量的配置情况。封装命令的具体内容将在后文说明。 + +- 支持 Windows 11 中的 Android 子系统(**WSA**)。*仅可在 WSA 运行时连接 WSA。 + +- 支持 Android R (11) 及以上版本的**无线调试**。 + +- ~~不仅支持 adb 命令,还集成了一定数量的 **Fastboot** 命令,方便刷机等操作。~~*暂未实现* +- 提供命令模板,使用者可直接复制命令并自行执行。 +- 支持多种状态显示及使用:开机、Recovery、Fastboot 及 adb sideload. + +## 🛠️功能 + +### ℹ️设备信息 + +- 获取设备型号、屏幕分辨率、屏幕密度(DPI)、Android Id、安卓版本以及处理器型号的信息 +- 修改 DPI + +### ✔️激活 + +- 提供主流工具应用的激活:[黑阈](https://brevent.jianyv.com/)、[冰箱](https://iceboxdoc.catchingnow.com/)、[小黑屋](https://stopapp.https.gs/)、[Shizuku](https://shizuku.rikka.app/zh-hans/)、*黑洞*、[太极](https://taichi.cool/)、[Island](https://island.oasisfeng.com/) +- 更多应用正在添加中。 + +### 🎮设备控制 + +- 电源控制: + - 关机 + - 重启到系统 + - 重启到 Recovery + - 重启到 Fastboot + +- 按键模拟: + - 系统导航:返回键、主页键、菜单键、任务键 + - 实体按键:电源键、音量 + 、音量 - 、静音、拍照(处于相机应用中时)、唤起助理应用 + - 媒体控制:播放音乐、停止播放、上一曲、继续、暂停、下一曲 + - 其他指令:亮度 - 、亮度 + 、系统休眠、点亮屏幕、挂断电话 + - 拉起系统应用:设置、通讯录、拨号、浏览器、音乐、日历、计算器 + +### 💣不稳定功能 + +- *安装应用:暂未实现安装进度显示* + +- *侧载:未实现进度条且侧载不稳定,**不建议使用该功能**,可能导致刷入失败,无法开机* + +### *🍘饼* + +> *由于个人学业紧迫(貌似考不上研了),饼中的内容添加将十分缓慢,可能在过年后,甚至再多一年后才能开始全力开发,请见谅!* + +- 完整的软件包管理器 +- 跨平台 +- 完善网站 +- 文件管理(~~都连上电脑了,为什么不直接用电脑的文件管理~~) +- 设备插拔检测 +- 集成scrcpy +- 视觉反馈 + - 页面切换加载进度条 + - 页面切换动画效果 + - 安装应用进度条 + - 侧载进度条 +- 命令 + - 获取 Google 服务框架 Android ID + - 更改屏幕分辨率 + - 更改屏幕边距 +- 控制台 + - 唤起 adb shell 窗口 + - 显示输出 + - 优化 err 处理 +- Fastboot + - 可实现完整的刷机流程 + - 刷写特定分区 + + + +## 💕Q&A + +- **Q:还有其它名为 QtAdb 的项目/软件,此项目与它们是什么关系?** + + A:我写这篇文档时才发现已经有好多个 QtAdb了(悲,这也没有办法,只能将错就错了😔。此前的几个项目有比本项目功能更丰富的,也有功能专一且强大的,但他们都已停更许久。在未来可能会参考这几个项目,不过目前并没有这样做(~~看不懂而且没时间~~)。 + +- **Q:不是有环境吗?怎么还是跑不了🥺** + + A:您下载的是压缩包,请全部解压后再使用。 + +- **Q:怎么这么多类似乱码的报错😱** + + A:我已经尽可能让它减少报错了,若弹出的“未知错误”对话框中的报错无法构成一个完整的句子,那么您可以根据它的内容视情况忽略它,并查看另一条报错。 + + Tips:使用 Qt 所封装的进程类在获取 adb 输出的错误时,容易将一条错误随机分成多段错误处理,而每一段错误将被报告为一条单独的错误。所以程序用于识别报错类型所需的关键字信息可能只在其中一条错误中,甚至可能被拦腰斩断,分散在两条报错中,此时 QtAdb 将无法分辨这些不包含关键字的信息,从而弹出“未知错误”对话框,并显示这些错误。这个问题目前没有找到彻底的解决办法,仍在努力研究中。 + +- **Q:应用无法安装🙁** + + A:应用安装功能暂未完全实现,为不稳定功能。应用安装完成后没有视觉反馈,请查看您的启动器先确认它确实没有安装上,其次注意安装包大小,过大的安装包可能导致 QtAdb 主界面未响应,此时不要进行任何操作,更不要杀死 adb 进程,等待手机上出现应用图标即可。若有报错可以进行反馈。 + + Tips:发出命令后QtAdb并没有监视命令的运行情况,若安装仍在进行且时间较长,可能主窗口会恢复到可以操作的状态,看上去就像什么都没有发生,侧载未响应原理与此相同。监视运行情况的功能正在开发中,请尽量不要使用此功能。(QtAdb 提供了命令模板,您可自行运行此命令) + +- **Q:侧载未响应** + + A:侧载与应用安装类似,功能暂未完全实现,为不稳定功能。若侧载压缩包过大将会导致主界面阻塞时间过长,请不要进行操作,具体以 recovery 输出为准。**请具备一定查错能力后再使用。**(~~会用的话直接自己开命令行罢~~) + +- **Q:按键模拟不生效🤨** + + A:此功能因设备而异,部分ROM中并没有提供相关功能(比如播放音乐、拉起计算器等)。若弹出错误提示,可以进行反馈。 + +- **Q:连接无线调试卡死** + + A:需要分情况讨论:若更换另一部手机可以连接,则可能是手机端 ROM 出现问题,请重启并尝试再次连接;若设备没有问题则可能是路由器出现问题,请更换其它WI-FI网络再尝试。 + +- **Q:连续报了一大堆错并闪退** + + A:可能是您在拔出设备后执行了命令,重新打开并连接即可。QtAdb 仍处于开发中,这是不稳定因素之一。 + +- **Q:无法连接WSA** + + A:请确保 WSA 已安装并正在运行:仅仅安装完成是不够的,还需要在开始菜单中打开 “适用于 Android^TM^ 的 Windows 子系统设置” 应用,选择 “开发人员” ,并打开 “开发人员模式”。在此之后,你可能还需要选择“系统” ,打开 “文件” 以确保 WSA 正在运行中。 + +- **Q:闪退** + + A:您可能连续点击了两次杀死 ”adb进程“ 按钮,请不要这样做;其余情况请提交反馈,并描述发生闪退之前您进行的操作,谢谢! + +- **Q:我可以催更吗**🥺 + + A:~~你可以请我喝可乐吗🥺~~当然可以催更,它现在仍处于开发中,并没有正式release,仍需要长时间的调试。 + +## 🙋反馈 + +若您对代码有优化建议,或是有新的命令用法想要添加,请直接提交 issue + +若您有想要添加的可激活的应用,请告诉我它的命令,最好带上该应用的文档/官网,提交 issue 或联系我。 + +十分感谢你的建议! + +## 🧬资源 + +### 图标 + +- 主要:[RemixIcon](https://github.com/Remix-Design/RemixIcon) + +- 补充:[IconPark](https://github.com/bytedance/IconPark) + +### 字体 + +- [Misans](https://web.vip.miui.com/page/info/mio/mio/detail?postId=33935854) +- *没有应用上 Misans 的地方一定是 bug,请进行反馈。* + + + +## 🤙联系 + +- Github:@[LapplandSp](https://github.com/LapplandSP) + +- 邮箱:DXLin666@outlook.com + +- Telegram:@[LapplandSP](https://t.me/LapplandSP) +