diff --git a/QtAdb/QtAdb.pro b/QtAdb/QtAdb.pro index 43f09ce..7075cb6 100644 --- a/QtAdb/QtAdb.pro +++ b/QtAdb/QtAdb.pro @@ -16,21 +16,28 @@ SOURCES += \ indexlistitem.cpp \ main.cpp \ mainwindow.cpp \ + monitor.cpp \ pagelistitem.cpp \ pagemaker.cpp \ sonPages/activator/sp_activator.cpp \ + sonPages/advanced/sp_accounts.cpp \ + sonPages/advanced/sp_captive_portal.cpp \ sonPages/advanced/sp_customize_cmd.cpp \ + sonPages/advanced/sp_scales.cpp \ + sonPages/advanced/sp_status_bar.cpp \ sonPages/apps/sp_features.cpp \ sonPages/apps/sp_installer.cpp \ sonPages/apps/sp_libraries.cpp \ sonPages/apps/sp_packages.cpp \ sonPages/apps/sp_permissiongroups.cpp \ sonPages/apps/sp_permissions.cpp \ + sonPages/apps/sp_users.cpp \ sonPages/apps/tp_packageprofile.cpp \ sonPages/devControl/btnemulator.cpp \ sonPages/devControl/sp_devcontrol_power.cpp \ sonPages/devInfo/sp_dpichanger.cpp \ sonPages/devInfo/sp_wmsize.cpp \ + sonPages/links.cpp \ sonPages/pay.cpp \ sonPages/recovery/sp_recovery.cpp \ sonPages/sonpagebase.cpp \ @@ -39,6 +46,7 @@ SOURCES += \ textexplainer.cpp \ threads/adbthread.cpp \ threads/thread_createpage.cpp \ + threads/thread_monitor.cpp \ usb_listener.cpp \ welcomepage.cpp @@ -49,21 +57,28 @@ HEADERS += \ basepage.h \ indexlistitem.h \ mainwindow.h \ + monitor.h \ pagelistitem.h \ pagemaker.h \ sonPages/activator/sp_activator.h \ + sonPages/advanced/sp_accounts.h \ + sonPages/advanced/sp_captive_portal.h \ sonPages/advanced/sp_customize_cmd.h \ + sonPages/advanced/sp_scales.h \ + sonPages/advanced/sp_status_bar.h \ sonPages/apps/sp_features.h \ sonPages/apps/sp_installer.h \ sonPages/apps/sp_libraries.h \ sonPages/apps/sp_packages.h \ sonPages/apps/sp_permissiongroups.h \ sonPages/apps/sp_permissions.h \ + sonPages/apps/sp_users.h \ sonPages/apps/tp_packageprofile.h \ sonPages/devControl/btnemulator.h \ sonPages/devControl/sp_devcontrol_power.h \ sonPages/devInfo/sp_dpichanger.h \ sonPages/devInfo/sp_wmsize.h \ + sonPages/links.h \ sonPages/pay.h \ sonPages/recovery/sp_recovery.h \ sonPages/sonpagebase.h \ @@ -72,6 +87,7 @@ HEADERS += \ textexplainer.h \ threads/adbthread.h \ threads/thread_createpage.h \ + threads/thread_monitor.h \ usb_listener.h \ welcomepage.h @@ -80,20 +96,27 @@ FORMS += \ basepage.ui \ indexlistitem.ui \ mainwindow.ui \ + monitor.ui \ pagelistitem.ui \ sonPages/activator/sp_activator.ui \ + sonPages/advanced/sp_accounts.ui \ + sonPages/advanced/sp_captive_portal.ui \ sonPages/advanced/sp_customize_cmd.ui \ + sonPages/advanced/sp_scales.ui \ + sonPages/advanced/sp_status_bar.ui \ sonPages/apps/sp_features.ui \ sonPages/apps/sp_installer.ui \ sonPages/apps/sp_libraries.ui \ sonPages/apps/sp_packages.ui \ sonPages/apps/sp_permissiongroups.ui \ sonPages/apps/sp_permissions.ui \ + sonPages/apps/sp_users.ui \ sonPages/apps/tp_packageprofile.ui \ sonPages/devControl/btnemulator.ui \ sonPages/devControl/sp_devcontrol_power.ui \ sonPages/devInfo/sp_dpichanger.ui \ sonPages/devInfo/sp_wmsize.ui \ + sonPages/links.ui \ sonPages/pay.ui \ sonPages/recovery/sp_recovery.ui \ sonPages/sonpagebase.ui \ diff --git a/QtAdb/about.cpp b/QtAdb/about.cpp index 0fe964d..0cab997 100644 --- a/QtAdb/about.cpp +++ b/QtAdb/about.cpp @@ -51,9 +51,15 @@ about::about(QWidget *parent) : shadowEffect_btn_version->setOffset(0,0); shadowEffect_btn_version->setColor(Qt::gray); shadowEffect_btn_version->setBlurRadius(5); - ui->btn_version->setGraphicsEffect(shadowEffect_btn_version); + QGraphicsDropShadowEffect *shadowEffect_btn_links = new QGraphicsDropShadowEffect(this); + shadowEffect_btn_links->setOffset(0,0); + shadowEffect_btn_links->setColor(Qt::gray); + shadowEffect_btn_links->setBlurRadius(5); + ui->btn_links->setGraphicsEffect(shadowEffect_btn_links); + + ui->btn_money->hide(); ui->btn_money_3->hide(); ui->btn_money_4->hide(); @@ -92,3 +98,10 @@ void about::on_btn_money_2_clicked() payPage->show(); } + +void about::on_btn_links_clicked() +{ + links *linksPage = new links(); + linksPage->show(); +} + diff --git a/QtAdb/about.h b/QtAdb/about.h index a72392b..92a3059 100644 --- a/QtAdb/about.h +++ b/QtAdb/about.h @@ -7,6 +7,7 @@ #include "basepage.h" #include "sonPages/pay.h" #include "animationwidget.h" +#include "sonPages/links.h" namespace Ui { class about; @@ -29,6 +30,8 @@ private slots: void on_btn_money_2_clicked(); + void on_btn_links_clicked(); + private: Ui::about *ui; }; diff --git a/QtAdb/about.ui b/QtAdb/about.ui index ea86de2..c0db9ec 100644 --- a/QtAdb/about.ui +++ b/QtAdb/about.ui @@ -6,20 +6,14 @@ 0 0 - 644 - 496 + 634 + 465 Form - - - 0 - - - 0 - + @@ -45,6 +39,9 @@ background-color: rgba(255, 255, 255, 0); 11 + + 0 + 11 @@ -54,7 +51,7 @@ background-color: rgba(255, 255, 255, 0); 14 - 11 + 5 @@ -108,11 +105,12 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + MiSans Medium 12 - 测试版本:beta-v0.6 + 测试版本:beta-v1.0 @@ -170,11 +168,12 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + MiSans Medium 12 - 网站:https://lapplandsp.github.io/QtAdb-pages/ + 官方网站:https://lapplandsp.github.io/QtAdb-pages/ @@ -232,6 +231,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + MiSans Medium 12 @@ -294,6 +294,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + MiSans Medium 12 @@ -304,6 +305,57 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + + + 0 + 0 + + + + + 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/link.svg:/ico/image/ico/link.svg + + + + + + + + MiSans Medium + 12 + + + + 相关链接 + + + + + @@ -461,6 +513,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + MiSans Medium 12 diff --git a/QtAdb/animationwidget.cpp b/QtAdb/animationwidget.cpp index 1ae0628..b77d6c5 100644 --- a/QtAdb/animationwidget.cpp +++ b/QtAdb/animationwidget.cpp @@ -15,14 +15,14 @@ void animationWidget::playLoadAnimation() qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { - animation->setEndValue(QRect(301, 117 - 6, 600,wgtHeight)); + animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, 600,wgtHeight)); } else { - animation->setEndValue(QRect(301, 117 - 6, parent->width(),wgtHeight)); + animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),wgtHeight)); } //animation->setStartValue(QPoint(301 + 50,117)); - animation->setStartValue(QRect(301 + 50, 117 - 6, parent->width()-50,wgtHeight)); + animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,wgtHeight)); animation->setEasingCurve(QEasingCurve::OutQuart); @@ -38,14 +38,14 @@ void animationWidget::playLoadAnimation(int h) //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { - animation->setEndValue(QRect(301, 117 - 6, 600,h)); + animation->setEndValue(QRect(301 - 30, 117 - 6 -11, 600,h)); } else { - animation->setEndValue(QRect(301, 117 - 6, parent->width(),h)); + animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),h)); } //animation->setStartValue(QPoint(301 + 50,117)); - animation->setStartValue(QRect(301 + 50, 117 - 6, parent->width()-50,h)); + animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,h)); animation->setEasingCurve(QEasingCurve::OutQuart); diff --git a/QtAdb/ico.qrc b/QtAdb/ico.qrc index 6bbb4db..06d7f15 100644 --- a/QtAdb/ico.qrc +++ b/QtAdb/ico.qrc @@ -72,6 +72,12 @@ image/ico/logo.svg image/ico/code-s-slash-line.svg image/ico/share-box-line.svg + image/ico/user-line.svg + image/ico/user-settings-line.svg + image/ico/signal-wifi-error-line.svg + image/ico/donut-chart-line.svg + image/ico/layout-top-2-line.svg + image/ico/stack-line.svg image/test/back.png @@ -88,5 +94,37 @@ image/activatorApps/island.png image/activatorApps/shizuku.png image/activatorApps/taichi.png + image/activatorApps/scene5.png + image/activatorApps/watchfps.png + image/activatorApps/permissiondog.png + image/activatorApps/hail.png + image/activatorApps/bg.png + image/activatorApps/apkinstaller.png + + + image/webicons/android.png + image/webicons/cheri.png + image/webicons/crd.png + image/webicons/dot.png + image/webicons/evoX.png + image/webicons/havoc.png + image/webicons/nus.png + image/webicons/OF.png + image/webicons/OFlogo.svg + image/webicons/paranoid.png + image/webicons/pp.png + image/webicons/projectarcana.png + image/webicons/rr.png + image/webicons/spark.svg + image/webicons/syb.png + image/webicons/twrp.png + image/webicons/atmb.png + image/webicons/jamcz.png + image/webicons/los.png + image/webicons/lsposed.png + image/webicons/magisk.png + image/webicons/pe.png + image/webicons/scrcpy.svg + image/webicons/MIUI.png diff --git a/QtAdb/image/activatorApps/apkinstaller.png b/QtAdb/image/activatorApps/apkinstaller.png new file mode 100644 index 0000000..82d3b79 Binary files /dev/null and b/QtAdb/image/activatorApps/apkinstaller.png differ diff --git a/QtAdb/image/activatorApps/bg.png b/QtAdb/image/activatorApps/bg.png new file mode 100644 index 0000000..bc5c782 Binary files /dev/null and b/QtAdb/image/activatorApps/bg.png differ diff --git a/QtAdb/image/activatorApps/hail.png b/QtAdb/image/activatorApps/hail.png new file mode 100644 index 0000000..bfcf2c0 Binary files /dev/null and b/QtAdb/image/activatorApps/hail.png differ diff --git a/QtAdb/image/activatorApps/permissiondog.png b/QtAdb/image/activatorApps/permissiondog.png new file mode 100644 index 0000000..73bb5cf Binary files /dev/null and b/QtAdb/image/activatorApps/permissiondog.png differ diff --git a/QtAdb/image/activatorApps/scene5.png b/QtAdb/image/activatorApps/scene5.png new file mode 100644 index 0000000..bd6a4c9 Binary files /dev/null and b/QtAdb/image/activatorApps/scene5.png differ diff --git a/QtAdb/image/activatorApps/watchfps.png b/QtAdb/image/activatorApps/watchfps.png new file mode 100644 index 0000000..e2d08fc Binary files /dev/null and b/QtAdb/image/activatorApps/watchfps.png differ diff --git a/QtAdb/image/ico/donut-chart-line.svg b/QtAdb/image/ico/donut-chart-line.svg new file mode 100644 index 0000000..1b6599c --- /dev/null +++ b/QtAdb/image/ico/donut-chart-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/layout-top-2-line.svg b/QtAdb/image/ico/layout-top-2-line.svg new file mode 100644 index 0000000..073a019 --- /dev/null +++ b/QtAdb/image/ico/layout-top-2-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/signal-wifi-error-line.svg b/QtAdb/image/ico/signal-wifi-error-line.svg new file mode 100644 index 0000000..d372fe7 --- /dev/null +++ b/QtAdb/image/ico/signal-wifi-error-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/stack-line.svg b/QtAdb/image/ico/stack-line.svg new file mode 100644 index 0000000..1bd316f --- /dev/null +++ b/QtAdb/image/ico/stack-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/user-line.svg b/QtAdb/image/ico/user-line.svg new file mode 100644 index 0000000..a7a180a --- /dev/null +++ b/QtAdb/image/ico/user-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/user-settings-line.svg b/QtAdb/image/ico/user-settings-line.svg new file mode 100644 index 0000000..7a714f3 --- /dev/null +++ b/QtAdb/image/ico/user-settings-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/webicons/MIUI.png b/QtAdb/image/webicons/MIUI.png new file mode 100644 index 0000000..d97ebce Binary files /dev/null and b/QtAdb/image/webicons/MIUI.png differ diff --git a/QtAdb/image/webicons/OF.png b/QtAdb/image/webicons/OF.png new file mode 100644 index 0000000..69f3cbc Binary files /dev/null and b/QtAdb/image/webicons/OF.png differ diff --git a/QtAdb/image/webicons/OFlogo.svg b/QtAdb/image/webicons/OFlogo.svg new file mode 100644 index 0000000..6516b03 --- /dev/null +++ b/QtAdb/image/webicons/OFlogo.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/QtAdb/image/webicons/android.png b/QtAdb/image/webicons/android.png new file mode 100644 index 0000000..dae0541 Binary files /dev/null and b/QtAdb/image/webicons/android.png differ diff --git a/QtAdb/image/webicons/atmb.png b/QtAdb/image/webicons/atmb.png new file mode 100644 index 0000000..2b1540d Binary files /dev/null and b/QtAdb/image/webicons/atmb.png differ diff --git a/QtAdb/image/webicons/cheri.png b/QtAdb/image/webicons/cheri.png new file mode 100644 index 0000000..e09c5c5 Binary files /dev/null and b/QtAdb/image/webicons/cheri.png differ diff --git a/QtAdb/image/webicons/crd.png b/QtAdb/image/webicons/crd.png new file mode 100644 index 0000000..a36c35d Binary files /dev/null and b/QtAdb/image/webicons/crd.png differ diff --git a/QtAdb/image/webicons/dot.png b/QtAdb/image/webicons/dot.png new file mode 100644 index 0000000..2caebc3 Binary files /dev/null and b/QtAdb/image/webicons/dot.png differ diff --git a/QtAdb/image/webicons/evoX.png b/QtAdb/image/webicons/evoX.png new file mode 100644 index 0000000..78846bd Binary files /dev/null and b/QtAdb/image/webicons/evoX.png differ diff --git a/QtAdb/image/webicons/havoc.png b/QtAdb/image/webicons/havoc.png new file mode 100644 index 0000000..a728232 Binary files /dev/null and b/QtAdb/image/webicons/havoc.png differ diff --git a/QtAdb/image/webicons/jamcz.png b/QtAdb/image/webicons/jamcz.png new file mode 100644 index 0000000..60e153a Binary files /dev/null and b/QtAdb/image/webicons/jamcz.png differ diff --git a/QtAdb/image/webicons/los.png b/QtAdb/image/webicons/los.png new file mode 100644 index 0000000..7ad11ee Binary files /dev/null and b/QtAdb/image/webicons/los.png differ diff --git a/QtAdb/image/webicons/lsposed.png b/QtAdb/image/webicons/lsposed.png new file mode 100644 index 0000000..e941b43 Binary files /dev/null and b/QtAdb/image/webicons/lsposed.png differ diff --git a/QtAdb/image/webicons/magisk.png b/QtAdb/image/webicons/magisk.png new file mode 100644 index 0000000..95224dd Binary files /dev/null and b/QtAdb/image/webicons/magisk.png differ diff --git a/QtAdb/image/webicons/nus.png b/QtAdb/image/webicons/nus.png new file mode 100644 index 0000000..28ceb1d Binary files /dev/null and b/QtAdb/image/webicons/nus.png differ diff --git a/QtAdb/image/webicons/paranoid.png b/QtAdb/image/webicons/paranoid.png new file mode 100644 index 0000000..6c4795e Binary files /dev/null and b/QtAdb/image/webicons/paranoid.png differ diff --git a/QtAdb/image/webicons/pe.png b/QtAdb/image/webicons/pe.png new file mode 100644 index 0000000..3574763 Binary files /dev/null and b/QtAdb/image/webicons/pe.png differ diff --git a/QtAdb/image/webicons/pp.png b/QtAdb/image/webicons/pp.png new file mode 100644 index 0000000..5e2ac4a Binary files /dev/null and b/QtAdb/image/webicons/pp.png differ diff --git a/QtAdb/image/webicons/projectarcana.png b/QtAdb/image/webicons/projectarcana.png new file mode 100644 index 0000000..1d5ecd9 Binary files /dev/null and b/QtAdb/image/webicons/projectarcana.png differ diff --git a/QtAdb/image/webicons/rr.png b/QtAdb/image/webicons/rr.png new file mode 100644 index 0000000..52c09e9 Binary files /dev/null and b/QtAdb/image/webicons/rr.png differ diff --git a/QtAdb/image/webicons/scrcpy.svg b/QtAdb/image/webicons/scrcpy.svg new file mode 100644 index 0000000..0ab92c2 --- /dev/null +++ b/QtAdb/image/webicons/scrcpy.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/QtAdb/image/webicons/spark.svg b/QtAdb/image/webicons/spark.svg new file mode 100644 index 0000000..e0b8138 --- /dev/null +++ b/QtAdb/image/webicons/spark.svg @@ -0,0 +1,3 @@ + + + diff --git a/QtAdb/image/webicons/syb.png b/QtAdb/image/webicons/syb.png new file mode 100644 index 0000000..751c70d Binary files /dev/null and b/QtAdb/image/webicons/syb.png differ diff --git a/QtAdb/image/webicons/twrp.png b/QtAdb/image/webicons/twrp.png new file mode 100644 index 0000000..8f2fa91 Binary files /dev/null and b/QtAdb/image/webicons/twrp.png differ diff --git a/QtAdb/mainwindow.cpp b/QtAdb/mainwindow.cpp index e3986aa..bad8b27 100644 --- a/QtAdb/mainwindow.cpp +++ b/QtAdb/mainwindow.cpp @@ -1,4 +1,5 @@ #include "mainwindow.h" +#include "qobjectdefs.h" #include "ui_mainwindow.h" /* @@ -46,6 +47,7 @@ MainWindow::MainWindow(QWidget *parent) //connect(listener, SIGNAL(DevicePlugOut()),this,SLOT(DevicePlugOut())); connect(listener, SIGNAL(DeviceChanged()),this,SLOT(refreshDevListLater())); connect(this, SIGNAL(adbDeviceChanged()),this,SLOT(DeviceChanged())); + qApp->installNativeEventFilter(listener); //listener->EmitMySignal(); @@ -63,6 +65,8 @@ MainWindow::MainWindow(QWidget *parent) initBasePage(6); currentPage->playLoadAnimation(427); lock(); + + reset_monitorBars(); } MainWindow::~MainWindow() @@ -89,17 +93,17 @@ void MainWindow::refreshDevList() //方法:刷新设备列 //ui->comboBox->clear(); /*DEBUG*/ bool changed = false; - qDebug() << "******************一次调用*********************"; - qDebug() << "refreshDevList devList is empty? " << devList.isEmpty() << QTime::currentTime(); - qDebug() << "devList.size()" << devList.size(); + //qDebug() << "******************一次调用*********************"; + //qDebug() << "refreshDevList devList is empty? " << devList.isEmpty() << QTime::currentTime(); + //qDebug() << "devList.size()" << devList.size(); for(int i = 0; i < devList.size();i++) { - qDebug() << "devList[" << i << "] is :" << devList[i].addr; + //qDebug() << "devList[" << i << "] is :" << devList[i].addr; } /*DEBUG_END*/ - qDebug() << "shit 0"; + //qDebug() << "shit 0"; bool devList_is_empty = devList.isEmpty(); QList tmpList; @@ -109,7 +113,7 @@ void MainWindow::refreshDevList() //方法:刷新设备列 { for(int i = 0; i < devList.size();i++) { - qDebug() << "shit 3.1"; + //qDebug() << "shit 3.1"; device dev; dev.device_debug = devList[i].device_debug; dev.device_product = devList[i].device_product; @@ -120,12 +124,12 @@ void MainWindow::refreshDevList() //方法:刷新设备列 tmpList.append(dev); } } - qDebug() << "tmpList.size()" << tmpList.size(); + //qDebug() << "tmpList.size()" << tmpList.size(); //ui->comboBox->clear(); devList.clear(); //清空设备列表 devList = explainer->getDevList_windows(process->run("adb devices -l")); //重新赋值 - qDebug() << "devList after explain:" << devList.isEmpty(); + //qDebug() << "devList after explain:" << devList.isEmpty(); /* qDebug() << "shit 1"; @@ -175,7 +179,7 @@ void MainWindow::refreshDevList() //方法:刷新设备列 } else { - qDebug() << "else:" << devList.isEmpty() << tmpList.isEmpty() << devList_is_empty; + //qDebug() << "else:" << devList.isEmpty() << tmpList.isEmpty() << devList_is_empty; } QList off; //未响应设备索引 @@ -188,7 +192,7 @@ void MainWindow::refreshDevList() //方法:刷新设备列 { QString devItem = devList[i].state + " " + explainer->get_words_after(devList[i].model, ":") + " " + devList[i].addr; l.append(devItem); - qDebug() << "l[" << i << "] = " << l[i]; + //qDebug() << "l[" << i << "] = " << l[i]; if(devList[i].state == "[未响应]") { off.append(i); @@ -201,14 +205,14 @@ void MainWindow::refreshDevList() //方法:刷新设备列 if(changed) { - qDebug() <<"changed so clear"; + //qDebug() <<"changed so clear"; ui->comboBox->clear(); ui->comboBox->addItems(l); } if(!liangYi) { - qDebug() <<"liangYi so clear"; + //qDebug() <<"liangYi so clear"; ui->comboBox->clear(); ui->comboBox->addItems(l); } @@ -232,11 +236,25 @@ void MainWindow::refreshDevList() //方法:刷新设备列 liangYi = false; - qDebug() << "******************一次调用结束*********************"; + //qDebug() << "******************一次调用结束*********************"; } void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 { + if(thread_mon != NULL) + { + //siXiangTimer->stop(); + siXiangTimer->deleteLater(); + siXiangTimer = NULL; + qDebug() <<"thread_mon != NULL"; + qDebug() <<"disconnect"; + thread_mon->disconnect(); + qDebug() <<"exit()"; + thread_mon->quit(); + qDebug() <<"deleteLater()"; + //thread_mon->deleteLater(); + } + refreshDevList(); lock(); @@ -248,12 +266,45 @@ void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 }*/ initBasePage(6); + reset_monitorBars(); } void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 { + qDebug() <<"MainWindow:if"; + + if(thread_mon != NULL && siXiangTimer != NULL) + { + qDebug() <<"stop"; + //siXiangTimer->stop(); + qDebug() <<"delete"; + siXiangTimer->deleteLater(); + qDebug() <<"=NULL"; + siXiangTimer = NULL; + qDebug() <<"thread_mon != NULL"; + qDebug() <<"disconnect"; + thread_mon->disconnect(); + qDebug() <<"exit()"; + thread_mon->quit(); + qDebug() <<"deleteLater()"; + thread_mon->deleteLater(); + } + + + if(index >= 0) { + qDebug() <<"NEW"; + siXiangTimer = new QTimer(); + thread_mon = new thread_monitor(devList[current_device]); + qDebug() <<"CONNECT"; + connect(siXiangTimer,SIGNAL(timeout()),thread_mon,SLOT(getInfo())); + connect(thread_mon,SIGNAL(signal_monitor(float,float)),this,SLOT(slot_update_monitor(float,float))); + qDebug() <<"START"; + thread_mon->start(); + siXiangTimer->start(2000); + ui->progressBar_CPU->setRange(0,100); + ui->progressBar_RAM->setRange(0,100); if(currentPage != NULL) { @@ -371,7 +422,7 @@ void MainWindow::addIndexItems() //方法:初始化向index //:/ico/image/ico/code-s-slash-line.svg //05 indexListItem *advanced = new indexListItem(this->ui->indexList); - advanced->setText("高级"); + advanced->setText("其它"); advanced->setPic("image:url(:/ico/image/ico/code-s-slash-line.svg);background-color:rgba(255,255,255,0);"); addItemToIndex(advanced); @@ -430,7 +481,7 @@ void MainWindow::setStyles() //方法:设置样式 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->iconLabel->setStyleSheet("background-color:transparent;"); ui->fakeSpacer->setStyleSheet("background-color:transparent;"); QGraphicsDropShadowEffect *shadowEffect_refreshButton = new QGraphicsDropShadowEffect(this); @@ -458,11 +509,17 @@ void MainWindow::setStyles() //方法:设置样式 shadowEffect_cmdBtn->setColor(Qt::gray); shadowEffect_cmdBtn->setBlurRadius(5); + QGraphicsDropShadowEffect *shadowEffect_monitor = new QGraphicsDropShadowEffect(this); + shadowEffect_monitor->setOffset(0,0); + shadowEffect_monitor->setColor(Qt::gray); + shadowEffect_monitor->setBlurRadius(5); + ui->refreshButton->setGraphicsEffect(shadowEffect_refreshButton); ui->adbKillerBtn->setGraphicsEffect(shadowEffect_killAdbBtn); ui->WIFIBtn->setGraphicsEffect(shadowEffect_testBtn); ui->WSABtn->setGraphicsEffect(shadowEffect_WSABtn); ui->cmdBtn->setGraphicsEffect(shadowEffect_cmdBtn); + ui->widget_monitor->setGraphicsEffect(shadowEffect_monitor); } void MainWindow::initSonPage(int key) //槽:生成子页面 @@ -588,7 +645,7 @@ void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试 connect(getInfoBtn,SIGNAL(clicked()),this,SLOT(connectWIFIDev())); getInfo->show(); - qDebug() << "size is " << getInfo->geometry(); + //qDebug() << "size is " << getInfo->geometry(); } void MainWindow::connectWIFIDev() //槽:连接无线调试设备 @@ -714,3 +771,24 @@ void MainWindow::refreshDevListLater() timer->start(1000); //timer->deleteLater(); } + +void MainWindow::slot_update_monitor(float cpu_useage, float mem_useage) +{ + //qDebug() << "cpu_useage is " <progressBar_CPU->setValue(cpu_credit); + + int mem_credit = (int)(mem_useage*100); + //qDebug() << "mem_credit" << mem_credit; + ui->progressBar_RAM->setValue(mem_credit); +} + +void MainWindow::reset_monitorBars() +{ + //qDebug() << "reset"; + ui->progressBar_CPU->setValue(0); + ui->progressBar_RAM->setValue(0); +} diff --git a/QtAdb/mainwindow.h b/QtAdb/mainwindow.h index 96fb1bf..c4d9411 100644 --- a/QtAdb/mainwindow.h +++ b/QtAdb/mainwindow.h @@ -20,6 +20,7 @@ #include "pagemaker.h" #include "about.h" #include "usb_listener.h" +#include "threads/thread_monitor.h" #include #include @@ -95,18 +96,24 @@ private: bool firstBoot = true; QTimer *taiChiTimer; QTimer *baguaTimer; + QTimer *siXiangTimer = NULL; basePage * currentPage; animationWidget * tmpPage; about * WCMPage2; usb_listener *listener; + thread_monitor *thread_mon = NULL; + + public slots: void DevicePlugIn(); void DevicePlugOut(); void DeviceChanged(); void slot_refreshDevList(); void refreshDevListLater(); + void slot_update_monitor(float,float); + void reset_monitorBars(); }; #endif // MAINWINDOW_H diff --git a/QtAdb/mainwindow.ui b/QtAdb/mainwindow.ui index 97d5020..650dcb1 100644 --- a/QtAdb/mainwindow.ui +++ b/QtAdb/mainwindow.ui @@ -18,8 +18,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));*/ - - + + + 0 + + @@ -29,9 +32,12 @@ 11 - + + + 5 + - + 250 @@ -44,74 +50,236 @@ 100 - - - MiSans Demibold - - - - <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 + + background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}\nQPushButton:hover{background-color:rgba(255,255,255,0.7); + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + 3 + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + background-color: rgba(255, 255, 255, 0); + + + CPU + + + + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + background-color: rgba(255, 255, 255, 0); + + + RAM + + + + + + + + + 3 + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + MiSans Medium + 9 + false + false + + + + QProgressBar{ + font:9pt; + border-radius:10px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + background-color: rgba(255,255,255,0); +} +QProgressBar:chunk{ + border-radius:10px; + background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); +} + + + + 100 + + + 50 + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + MiSans Medium + 9 + false + false + + + + QProgressBar{ + font:9pt; + border-radius:10px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + background-color: rgba(255,255,255,0); +} +QProgressBar:chunk{ + border-radius:10px; + background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); +} + + + + 50 + + + + + + + + + + + 7 + + + + + + 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 + + + + + + + - - - - - - - 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 - - - - - - @@ -140,13 +308,13 @@ - 30 + 0 0 - 30 + 0 16777215 @@ -163,7 +331,7 @@ 11 - 16 + 5 16 diff --git a/QtAdb/monitor.cpp b/QtAdb/monitor.cpp new file mode 100644 index 0000000..9e0606b --- /dev/null +++ b/QtAdb/monitor.cpp @@ -0,0 +1,14 @@ +#include "monitor.h" +#include "ui_monitor.h" + +monitor::monitor(QWidget *parent) : + QWidget(parent), + ui(new Ui::monitor) +{ + ui->setupUi(this); +} + +monitor::~monitor() +{ + delete ui; +} diff --git a/QtAdb/monitor.h b/QtAdb/monitor.h new file mode 100644 index 0000000..d281632 --- /dev/null +++ b/QtAdb/monitor.h @@ -0,0 +1,22 @@ +#ifndef MONITOR_H +#define MONITOR_H + +#include + +namespace Ui { +class monitor; +} + +class monitor : public QWidget +{ + Q_OBJECT + +public: + explicit monitor(QWidget *parent = nullptr); + ~monitor(); + +private: + Ui::monitor *ui; +}; + +#endif // MONITOR_H diff --git a/QtAdb/monitor.ui b/QtAdb/monitor.ui new file mode 100644 index 0000000..9ab19a8 --- /dev/null +++ b/QtAdb/monitor.ui @@ -0,0 +1,137 @@ + + + monitor + + + + 0 + 0 + 574 + 85 + + + + Form + + + + 3 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + 3 + + + + + + MiSans Medium + + + + CPU + + + + + + + + MiSans Medium + + + + RAM + + + + + + + + + 3 + + + + + + MiSans Medium + 9 + false + false + + + + QProgressBar{ + font:9pt; + border-radius:0px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + background-color: rgba(255,255,255,0.8); +} +QProgressBar:chunk{ + border-radius:0px; + background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); +} + + + + 100 + + + 50 + + + + + + + + MiSans Medium + 9 + false + false + + + + QProgressBar{ + font:9pt; + border-radius:0px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + background-color: rgba(255,255,255,0.8); +} +QProgressBar:chunk{ + border-radius:0px; + background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); +} + + + + 50 + + + + + + + + + + diff --git a/QtAdb/pagemaker.cpp b/QtAdb/pagemaker.cpp index 294771f..db79191 100644 --- a/QtAdb/pagemaker.cpp +++ b/QtAdb/pagemaker.cpp @@ -265,7 +265,7 @@ basePage* pageMaker::createPage_acvitator(QWidget *parent, device dev) activator->isBasePage = true; //activatorPage *activator = new activatorPage(parent); activator->whoYouAre("activator"); - int val[20] = {1,2,3,4,5,6,7,8,9}; + int val[20] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; activator->setEnableValue(val); activator->setDev(dev); @@ -323,6 +323,55 @@ basePage* pageMaker::createPage_acvitator(QWidget *parent, device dev) Island->setSelectable(); activator->addItemsToList(Island); + pageListItem *scene = new pageListItem(activator); + scene->setText("Scene","adb shell sh /data/user/0/com.omarea.vtools/files/up.sh"); + scene->setPic(":/activatorApps/image/activatorApps/scene5.png"); + scene->setSelectable(); + activator->addItemsToList(scene); + + pageListItem *watchfps = new pageListItem(activator); + watchfps->setText("看帧数+","adb shell sh /sdcard/Download/watchfps/watchfps.sh"); + watchfps->setPic(":/activatorApps/image/activatorApps/watchfps.png"); + watchfps->setSelectable(); + activator->addItemsToList(watchfps); + + pageListItem *permissiondog = new pageListItem(activator); + permissiondog->setText("权限狗","adb shell sh /storage/emulated/0/Android/data/com.web1n.permissiondog/files/starter.sh"); + permissiondog->setPic(":/activatorApps/image/activatorApps/permissiondog.png"); + permissiondog->setSelectable(); + activator->addItemsToList(permissiondog); + + pageListItem *hail = new pageListItem(activator); + hail->setText("雹","adb shell dpm set-device-owner com.aistra.hail/.receiver.DeviceAdminReceiver"); + hail->setPic(":/activatorApps/image/activatorApps/hail.png"); + hail->setSelectable(); + activator->addItemsToList(hail); + + pageListItem *bg_useage = new pageListItem(activator); + bg_useage->setText("BatteryGuru - 使用情况访问权限","adb shell pm grant com.paget96.batteryguru android.permission.PACKAGE_USAGE_STATS"); + bg_useage->setPic(":/activatorApps/image/activatorApps/bg.png"); + bg_useage->setSelectable(); + activator->addItemsToList(bg_useage); + + pageListItem *bg_secure = new pageListItem(activator); //15 + bg_secure->setText("BatteryGuru - 修改安全系统设置","adb shell pm grant com.paget96.batteryguru android.permission.WRITE_SECURE_SETTINGS"); + bg_secure->setPic(":/activatorApps/image/activatorApps/bg.png"); + bg_secure->setSelectable(); + activator->addItemsToList(bg_secure); + + pageListItem *bg_dump = new pageListItem(activator); + bg_dump->setText("BatteryGuru - 读取 DUMP","adb shell pm grant com.paget96.batteryguru android.permission.DUMP"); + bg_dump->setPic(":/activatorApps/image/activatorApps/bg.png"); + bg_dump->setSelectable(); + activator->addItemsToList(bg_dump); + + pageListItem *apkInstaller = new pageListItem(activator); + apkInstaller->setText("安装狮","adb shell dpm set-device-owner com.modosa.apkinstaller/.receiver.AdminReceiver"); + apkInstaller->setPic(":/activatorApps/image/activatorApps/apkinstaller.png"); + apkInstaller->setSelectable(); + activator->addItemsToList(apkInstaller); + + return activator; } @@ -332,7 +381,7 @@ basePage* pageMaker::createPage_apps(QWidget *parent, device dev) apps->isBasePage = true; //activatorPage *activator = new activatorPage(parent); apps->whoYouAre("apps"); - int val[20] = {1,2,3,4,5,6}; + int val[20] = {1,2,3,4,5,6,7}; apps->setEnableValue(val); apps->setDev(dev); @@ -368,10 +417,16 @@ basePage* pageMaker::createPage_apps(QWidget *parent, device dev) pageListItem *libraries = new pageListItem(apps); libraries->setText("库","adb shell pm list libraries"); - libraries->setPic(":/ico/image/ico/btnEmulator/menu-line.svg"); + libraries->setPic(":/ico/image/ico/stack-line.svg"); libraries->setSelectable(); apps->addItemsToList(libraries); + pageListItem *users = new pageListItem(apps); + users->setText("用户","adb shell pm list users"); + users->setPic(":/ico/image/ico/user-line.svg"); + users->setSelectable(); + apps->addItemsToList(users); + return apps; } @@ -447,7 +502,7 @@ basePage* pageMaker::createPage_advanced(QWidget *parent, device dev) advanced->isBasePage = true; //activatorPage *activator = new activatorPage(parent); advanced->whoYouAre("advanced"); - int val[20] = {1}; + int val[20] = {1,2,3,4,5}; advanced->setEnableValue(val); advanced->setDev(dev); @@ -457,6 +512,31 @@ basePage* pageMaker::createPage_advanced(QWidget *parent, device dev) customize_command->setSelectable(); advanced->addItemsToList(customize_command); + pageListItem *accounts = new pageListItem(advanced); + accounts->setText("账户","adb shell dumpsys account"); + accounts->setPic(":/ico/image/ico/user-settings-line.svg"); + accounts->setSelectable(); + advanced->addItemsToList(accounts); + + pageListItem *captive_portal = new pageListItem(advanced); + captive_portal->setText("去除叹号","adb shell settings put global captive_portal_http_url "); + captive_portal->setPic(":/ico/image/ico/signal-wifi-error-line.svg"); + captive_portal->setSelectable(); + advanced->addItemsToList(captive_portal); + + pageListItem *scales = new pageListItem(advanced); + scales->setText("过渡动画","adb shell settings put global "); + scales->setPic(":/ico/image/ico/donut-chart-line.svg"); + scales->setSelectable(); + advanced->addItemsToList(scales); + + pageListItem *status_bar = new pageListItem(advanced); + status_bar->setText("状态栏与导航栏","adb shell settings put secure icon_blacklist "); + status_bar->setPic(":/ico/image/ico/layout-top-2-line.svg"); + status_bar->setSelectable(); + advanced->addItemsToList(status_bar); + + //:/ico/image/ico/layout-top-2-line.svg /* pageListItem *btnEmulate = new pageListItem(recovery); btnEmulate->setText("按键模拟","adb shell input keyevent "); diff --git a/QtAdb/sonPages/activator/sp_activator.cpp b/QtAdb/sonPages/activator/sp_activator.cpp index 197091b..ad1f5c9 100644 --- a/QtAdb/sonPages/activator/sp_activator.cpp +++ b/QtAdb/sonPages/activator/sp_activator.cpp @@ -46,6 +46,7 @@ sp_activator::sp_activator(QWidget *parent) : QFile file("://qss/scrollbar.qss"); file.open(QFile::ReadOnly); ui->textBrowser->verticalScrollBar()->setStyleSheet(file.readAll()); + ui->textBrowser->setTextInteractionFlags(Qt::NoTextInteraction); } sp_activator::~sp_activator() diff --git a/QtAdb/sonPages/advanced/sp_accounts.cpp b/QtAdb/sonPages/advanced/sp_accounts.cpp new file mode 100644 index 0000000..7ace3a7 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_accounts.cpp @@ -0,0 +1,109 @@ +#include "sp_accounts.h" +#include "ui_sp_accounts.h" + +sp_accounts::sp_accounts(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_accounts) +{ + ui->setupUi(this); + setParent(parent); + + ui->progressBar->hide(); + ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers); + + thread = new adbThread(); + process = new adbProcess(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + connect(thread,SIGNAL(signal_output(QString)),this,SLOT(refresh_tableView(QString))); + + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_deleteBtn = new QGraphicsDropShadowEffect(this); + + 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_deleteBtn->setOffset(0,0); + shadowEffect_deleteBtn->setColor(Qt::gray); + shadowEffect_deleteBtn->setBlurRadius(5); + + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); + ui->pushButton->setGraphicsEffect(shadowEffect_deleteBtn); + + QFile file("://qss/scrollbar.qss"); + file.open(QFile::ReadOnly); + ui->listView->verticalScrollBar()->setStyleSheet(file.readAll()); + on_refreshBtn_clicked(); +} + +sp_accounts::~sp_accounts() +{ + delete ui; +} + +void sp_accounts::on_refreshBtn_clicked() +{ + thread->initThread("adb shell dumpsys account",dev,"#PERMISSIONGROUPS#"); + ui->progressBar->setVisible(true); + thread->start(); +} + +void sp_accounts::refresh_tableView(QString s) +{ + QStandardItemModel* emptyModel = new QStandardItemModel(this); + ui->listView->setModel(emptyModel); + //thread->exit(); + //qDebug() << "before"; + QStringList accountsList = explainer->explainAccounts(s); + //qDebug() << "after"; + QStandardItemModel* model = new QStandardItemModel(this); + if(!accountsList.isEmpty()) + { + for(int i = 0; i < accountsList.count(); i++) + { + //qDebug() << "permissionList.count() = " << permissionList.count() <<"\nbefore index out of range: \n i = " << i << "\n permissionList[i] = "<< permissionList[i]; + if(accountsList[i] != "") + { + model->setItem(i,0,new QStandardItem(accountsList[i].simplified())); + } + } + ui->listView->setModel(model); + this->update(); + } + ui->progressBar->setVisible(false); + delete emptyModel; +} + +void sp_accounts::setDev(device device) +{ + dev = device; + on_refreshBtn_clicked(); +} + +void sp_accounts::on_pushButton_clicked() +{ + /* + QString user_id = explainer->get_words_before(explainer->get_words_after(ui->listView->model()->data(ui->listView->currentIndex()).toString(), "{"), ":"); + QMessageBox::StandardButton result=QMessageBox::question(NULL, "删除用户","您确定要删除用户吗?"); + qDebug() << "result =" << result; + if(result == QMessageBox::Yes) + { + if(user_id == "Users") + { + QMessageBox::information(NULL, "选择错误","请选择一个用户,而不是标题"); + } + else + { + process->run("adb shell pm remove-user " + user_id ,dev); + qDebug() << "user_id:" << user_id; + } + }*/ + //qDebug() << "clicked"; +} diff --git a/QtAdb/sonPages/advanced/sp_accounts.h b/QtAdb/sonPages/advanced/sp_accounts.h new file mode 100644 index 0000000..bbc476c --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_accounts.h @@ -0,0 +1,45 @@ +#ifndef SP_ACCOUNTS_H +#define SP_ACCOUNTS_H + +#include +#include +#include +//#include +#include "../../threads/adbthread.h" +#include +#include + +namespace Ui { +class sp_accounts; +} + +class sp_accounts : public QWidget +{ + Q_OBJECT + +public: + explicit sp_accounts(QWidget *parent = nullptr); + ~sp_accounts(); + + device dev; + void setDev(device dev); + +private slots: + void on_refreshBtn_clicked(); + + void on_pushButton_clicked(); + +public slots: + void refresh_tableView(QString); + + +private: + Ui::sp_accounts *ui; + + adbProcess *process; + adbThread *thread; + textExplainer *explainer; +}; + + +#endif // SP_ACCOUNTS_H diff --git a/QtAdb/sonPages/advanced/sp_accounts.ui b/QtAdb/sonPages/advanced/sp_accounts.ui new file mode 100644 index 0000000..c9c7ca6 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_accounts.ui @@ -0,0 +1,263 @@ + + + sp_accounts + + + + 0 + 0 + 686 + 542 + + + + Form + + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 0 + + + 11 + + + + + 14 + + + + + 0 + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + MiSans Medium + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/user-settings-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + 所有账户 + + + + + + + + + QProgressBar{ + font:9pt; + border-radius:4px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + background-color: qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); +} +QProgressBar:chunk{ + border-radius:4px; + background-color:rgba(255,255,255,0.2); +} + + + + 0 + + + -1 + + + true + + + + + + + true + + + + + + + + + + false + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + 12 + + + + 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);} + + + 根据信息卸载或停用相应应用,即可移除账户 + + + + + + + + + + 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 + + + + + 30 + 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/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/advanced/sp_captive_portal.cpp b/QtAdb/sonPages/advanced/sp_captive_portal.cpp new file mode 100644 index 0000000..a338b4f --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_captive_portal.cpp @@ -0,0 +1,157 @@ +#include "sp_captive_portal.h" +#include "ui_sp_captive_portal.h" + +sp_captive_portal::sp_captive_portal(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_captive_portal) +{ + ui->setupUi(this); + setParent(parent); + + process = new adbProcess(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + setShadow(ui->label); + setShadow(ui->label_3); + setShadow(ui->label_5); + setShadow(ui->android_version); + setShadow(ui->back_to_basePage); + setShadow(ui->current_server); + //setShadow(ui->delete_directly); + setShadow(ui->restore); + setShadow(ui->modify); + //setShadow(ui->comboBox); + setShadow(ui->pushButton); + + QStringList serverLists; + serverLists.append("connect.rom.miui.com/generate_204"); + serverLists.append("connectivitycheck.platform.hicloud.com/generate_204"); + serverLists.append("wifi.vivo.com.cn/generate_204"); + serverLists.append("www.qualcomm.cn/generate_204"); + serverLists.append("edge.microsoft.com/captiveportal/generate_204"); + serverLists.append("cp.cloudflare.com/generate_204"); + serverLists.append("g.cn/generate_204"); + serverLists.append("google.cn/generate_204"); + serverLists.append("dl.google.com/generate_204"); + serverLists.append("google.com"); + ui->comboBox->addItems(serverLists); + + + refresh(); + //process->run("adb shell settings get secure android_id", dev).simplified(); +} + +sp_captive_portal::~sp_captive_portal() +{ + delete ui; +} + +void sp_captive_portal::setDev(device device) +{ + dev = device; +} + +void sp_captive_portal::setShadow(QWidget* wgt) +{ + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(this); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + wgt->setGraphicsEffect(shadowEffect_widget); +} + +void sp_captive_portal::refresh() +{ + ui->android_version->setText(process->run("adb shell getprop ro.build.version.release", dev).simplified()); + QString ver = ui->android_version->text().simplified().simplified()[0]; + if(ver.toInt() < 7 && ver.toInt() >= 5) + { + ui->current_server->setVisible(true); + ui->label->setVisible(true); + //adb shell settings get global captive_portal_server + ui->current_server->setText(process->run("adb shell settings get global captive_portal_server", dev).simplified()); + } + else + { + ui->current_server->setVisible(false); + ui->label->setVisible(false); + } + + + ui->comboBox->setPlaceholderText("服务器未选择"); + ui->comboBox->setCurrentIndex(-1); +} + +void sp_captive_portal::on_modify_clicked() +{ + if(ui->comboBox->currentIndex() >= 0) + { + QMessageBox::StandardButton result=QMessageBox::question(NULL, "修改","您确定要将验证服务器修改为" + ui->comboBox->currentText() + "吗?"); + if(result) + { + QString ver = ui->android_version->text().simplified().simplified()[0]; + if(ver.toInt() < 7 && ver.toInt() >= 5) + { + //adb shell settings put global captive_portal_server + QString cmd = "adb shell settings put global captive_portal_server "; + cmd.append("http://"); + cmd.append(ui->comboBox->currentText()); + qDebug() << "cmd = " << cmd; + process->run(cmd, dev); + } + else + { + QString cmd_http = "adb shell settings put global captive_portal_http_url "; + cmd_http.append("http://"); + cmd_http.append(ui->comboBox->currentText()); + + QString cmd_https = "adb shell settings put global captive_portal_https_url "; + cmd_https.append("https://"); + cmd_https.append(ui->comboBox->currentText()); + process->run(cmd_http, dev); + process->run(cmd_https,dev); + } + QMessageBox::information(NULL, "修改","已修改"); + + + refresh(); + } + } + else + { + ui->comboBox->setPlaceholderText("服务器未选择"); + } +} + +void sp_captive_portal::on_restore_clicked() +{ + QMessageBox::StandardButton result=QMessageBox::question(NULL, "重置","您确定要重置吗?"); + + if(result) + { + QString ver = ui->android_version->text().simplified().simplified()[0]; + if(ver.toInt() < 7 && ver.toInt() >= 5) + { + //adb shell settings put global captive_portal_server + QString cmd = "adb shell settings delete global captive_portal_server"; + process->run(cmd, dev); + } + else + { + QString cmd_http = "adb shell settings delete global captive_portal_https_url"; + QString cmd_https = "adb shell settings delete global captive_portal_http_url"; + process->run(cmd_http, dev); + process->run(cmd_https,dev); + } + QMessageBox::information(NULL, "重置","已重置"); + refresh(); + } +} + + + +//屎山 +void sp_captive_portal::on_delete_directly_clicked() +{ + +} diff --git a/QtAdb/sonPages/advanced/sp_captive_portal.h b/QtAdb/sonPages/advanced/sp_captive_portal.h new file mode 100644 index 0000000..3190df0 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_captive_portal.h @@ -0,0 +1,44 @@ +#ifndef SP_CAPTIVE_PORTAL_H +#define SP_CAPTIVE_PORTAL_H + +#include +#include +#include +//#include +#include "../../threads/adbthread.h" +#include +#include + +namespace Ui { +class sp_captive_portal; +} + +class sp_captive_portal : public QWidget +{ + Q_OBJECT + +public: + explicit sp_captive_portal(QWidget *parent = nullptr); + ~sp_captive_portal(); + + device dev; + void setDev(device dev); + + void refresh(); + +private slots: + void on_modify_clicked(); + + void on_delete_directly_clicked(); + + void on_restore_clicked(); + +private: + Ui::sp_captive_portal *ui; + + adbProcess *process; + textExplainer *explainer; + void setShadow(QWidget* wgt); +}; + +#endif // SP_CAPTIVE_PORTAL_H diff --git a/QtAdb/sonPages/advanced/sp_captive_portal.ui b/QtAdb/sonPages/advanced/sp_captive_portal.ui new file mode 100644 index 0000000..fe775a0 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_captive_portal.ui @@ -0,0 +1,494 @@ + + + sp_captive_portal + + + + 0 + 0 + 641 + 519 + + + + + MiSans Medium + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 0 + + + 11 + + + + + 14 + + + + + 0 + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + MiSans Medium + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/signal-wifi-error-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + 去除叹号 + + + + + + + + + + + + 150 + 35 + + + + + 150 + 35 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + Android版本 + + + Qt::AlignCenter + + + + + + + + 0 + 35 + + + + + 114514 + 35 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + + + + Qt::AlignCenter + + + + + + + + + + + + 150 + 35 + + + + + 150 + 35 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + 当前验证服务器 + + + Qt::AlignCenter + + + + + + + + 0 + 35 + + + + + 16777215 + 35 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + + + + Qt::AlignCenter + + + + + + + + + + + + 150 + 35 + + + + + 150 + 35 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + 选择验证服务器 + + + Qt::AlignCenter + + + + + + + + 0 + 35 + + + + + 16777215 + 35 + + + + + MiSans Medium + 10 + + + + QComboBox{color:black;border-bottom:1px solid #BDBDBD;border-radius:0px;background-color:white;} +QComboBox::drop-down{border: 0px solid rgba(255,255,255,255);background-color:rgba(255,255,255,255);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} + + + + + + + + 35 + 35 + + + + + 35 + 35 + + + + + MiSans Medium + 12 + + + + 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);} + + + 修改 + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 12 + + + + 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);} + + + 直接关闭(不建议) + + + + + + + + 0 + 35 + + + + + 114514 + 35 + + + + + MiSans Medium + 12 + + + + 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 + + + + + + + + false + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + 12 + + + + QPushButton{background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px;} +QPushButton:hover{background-color:rgba(255,255,255,0.6);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + 切换验证服务器后,开启再关闭飞行模式即可去除叹号 + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/advanced/sp_customize_cmd.cpp b/QtAdb/sonPages/advanced/sp_customize_cmd.cpp index 90bff69..c5449c3 100644 --- a/QtAdb/sonPages/advanced/sp_customize_cmd.cpp +++ b/QtAdb/sonPages/advanced/sp_customize_cmd.cpp @@ -48,6 +48,7 @@ sp_customize_cmd::~sp_customize_cmd() delete ui; } + void sp_customize_cmd::on_runBtn_clicked() { process->run(ui->lineEdit->text()); diff --git a/QtAdb/sonPages/advanced/sp_scales.cpp b/QtAdb/sonPages/advanced/sp_scales.cpp new file mode 100644 index 0000000..4c0c750 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_scales.cpp @@ -0,0 +1,83 @@ +#include "sp_scales.h" +#include "ui_sp_scales.h" + +sp_scales::sp_scales(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_scales) +{ + ui->setupUi(this); + + process = new adbProcess(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + setShadow(ui->back_to_basePage); + setShadow(ui->pushButton); + setShadow(ui->pushButton_animation); + setShadow(ui->pushButton_transition); + setShadow(ui->pushButton_window); + setShadow(ui->current_window); + setShadow(ui->current_animator); + setShadow(ui->current_transition); + setShadow(ui->label_animator); + setShadow(ui->label_window); + setShadow(ui->label_transition); + + ui->lineEdit_window->setPlaceholderText("修改为"); + ui->lineEdit_animator->setPlaceholderText("修改为"); + ui->lineEdit_transition->setPlaceholderText("修改为"); + + ui->lineEdit_transition->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); + ui->lineEdit_animator->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); + ui->lineEdit_window->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); + + refresh(); +} + +sp_scales::~sp_scales() +{ + delete ui; +} + +void sp_scales::setDev(device device) +{ + dev = device; +} + + +void sp_scales::setShadow(QWidget* wgt) +{ + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(this); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + wgt->setGraphicsEffect(shadowEffect_widget); +} + +void sp_scales::refresh() +{ + ui->current_animator->setText("当前:" + process->run("adb shell settings get global animator_duration_scale",dev).simplified()); + ui->current_transition->setText("当前:" + process->run("adb shell settings get global transition_animation_scale",dev).simplified()); + ui->current_window->setText("当前:" + process->run("adb shell settings get global window_animation_scale",dev).simplified()); + ui->lineEdit_transition->clear(); + ui->lineEdit_window->clear(); + ui->lineEdit_animator->clear(); +} + +void sp_scales::on_pushButton_animation_clicked() +{ + //QMessageBox::StandardButton result=QMessageBox::warning(NULL, "动画时长缩放","确定修改"); + process->run("adb shell settings put global animator_duration_scale " + ui->lineEdit_animator->text().simplified(), dev); + refresh(); +} + +void sp_scales::on_pushButton_transition_clicked() +{ + process->run("adb shell settings put global transition_animation_scale " + ui->lineEdit_transition->text().simplified(), dev); + refresh(); +} + +void sp_scales::on_pushButton_window_clicked() +{ + process->run("adb shell settings put global window_animation_scale " + ui->lineEdit_window->text().simplified(), dev); + refresh(); +} diff --git a/QtAdb/sonPages/advanced/sp_scales.h b/QtAdb/sonPages/advanced/sp_scales.h new file mode 100644 index 0000000..f87d455 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_scales.h @@ -0,0 +1,42 @@ +#ifndef SP_SCALES_H +#define SP_SCALES_H + +#include +#include +#include +//#include +#include "../../adbprocess.h" + +namespace Ui { +class sp_scales; +} + +class sp_scales : public QWidget +{ + Q_OBJECT + +public: + explicit sp_scales(QWidget *parent = nullptr); + ~sp_scales(); + + device dev; + void setDev(device dev); + +private slots: + void on_pushButton_animation_clicked(); + + void on_pushButton_transition_clicked(); + + void on_pushButton_window_clicked(); + +private: + Ui::sp_scales *ui; + + adbProcess *process; + textExplainer *explainer; + + void setShadow(QWidget* wgt); + void refresh(); +}; + +#endif // SP_SCALES_H diff --git a/QtAdb/sonPages/advanced/sp_scales.ui b/QtAdb/sonPages/advanced/sp_scales.ui new file mode 100644 index 0000000..df0471e --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_scales.ui @@ -0,0 +1,601 @@ + + + sp_scales + + + + 0 + 0 + 477 + 403 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 11 + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 0 + + + 11 + + + 11 + + + + + 14 + + + + + 0 + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + MiSans Medium + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/donut-chart-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + 过渡动画 + + + + + + + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + 动画时长 + + + Qt::AlignCenter + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + 过渡动画 + + + Qt::AlignCenter + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + 窗口动画 + + + Qt::AlignCenter + + + + + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + NULL + + + Qt::AlignCenter + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + NULL + + + Qt::AlignCenter + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px; + + + NULL + + + Qt::AlignCenter + + + + + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + border:1px solid #BDBDBD; +background-color: rgba(255, 255, 255, 0); + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + border:1px solid #BDBDBD; +background-color: rgba(255, 255, 255, 0); + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + MiSans Medium + 12 + + + + border:1px solid #BDBDBD; +background-color: rgba(255, 255, 255, 0); + + + + + + + + + + + + 40 + 40 + + + + + 40 + 40 + + + + + MiSans Medium + 12 + + + + 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 + + + + + + + + 40 + 40 + + + + + 40 + 40 + + + + + MiSans Medium + 12 + + + + 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 + + + + + + + + 40 + 40 + + + + + 40 + 40 + + + + + MiSans Medium + 12 + + + + 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 + + + + + + + + + + + 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 + + + + + + + + false + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + 12 + + + + 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);} + + + 若要修改为极大或极小的值,请谨慎 + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/advanced/sp_status_bar.cpp b/QtAdb/sonPages/advanced/sp_status_bar.cpp new file mode 100644 index 0000000..300db4a --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_status_bar.cpp @@ -0,0 +1,149 @@ +#include "sp_status_bar.h" +#include "ui_sp_status_bar.h" + +sp_status_bar::sp_status_bar(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_status_bar) +{ + ui->setupUi(this); + + process = new adbProcess(); + explainer = new textExplainer(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + setShadow(ui->pushButton_hide); + setShadow(ui->pushButton); + setShadow(ui->pushButton_restore); + setShadow(ui->hide_restore); + setShadow(ui->hide_navigation); + setShadow(ui->hide_status); + setShadow(ui->back_to_basePage); + setShadow(ui->pushButton_2); +} + +sp_status_bar::~sp_status_bar() +{ + delete ui; +} + +void sp_status_bar::setDev(device device) +{ + dev = device; +} + +void sp_status_bar::setShadow(QWidget* wgt) +{ + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(this); + shadowEffect_widget->setOffset(0,0); + shadowEffect_widget->setColor(Qt::gray); + shadowEffect_widget->setBlurRadius(5); + wgt->setGraphicsEffect(shadowEffect_widget); +} + +void sp_status_bar::on_pushButton_hide_clicked() +{ + QString cmd = "adb shell settings put secure icon_blacklist "; + if(ui->volume->isChecked()) + { + cmd.append(",volume"); + qDebug() << "ui->volume->isChecked() cmd = " <location->isChecked()) + { + cmd.append(",location"); + qDebug() << "location isChecked() cmd = " <speakerphone->isChecked()) + { + cmd.append(",speakerphone"); + } + if(ui->wifi->isChecked()) + { + cmd.append(",wifi"); + qDebug() << "wifi isChecked() cmd = " <hotspot->isChecked()) + { + cmd.append(",hotspot"); + } + if(ui->alarm_clock->isChecked()) + { + cmd.append(",alarm_clock"); + } + if(ui->bluetooth->isChecked()) + { + cmd.append(",bluetooth"); + } + if(ui->airplane->isChecked()) + { + cmd.append(",airplane"); + } + if(ui->headphone->isChecked()) + { + cmd.append(",headphone"); + } + if(ui->cast->isChecked()) + { + cmd.append(",cast"); + } + if(ui->nfc->isChecked()) + { + cmd.append(",nfc"); + } + + process->run(cmd,dev); + refreshBtns(); + + QMessageBox::information(NULL, "隐藏图标","已隐藏选中图标"); +} + + +void sp_status_bar::on_pushButton_restore_clicked() +{ + process->run("adb shell settings put secure icon_blacklist null",dev); + QMessageBox::information(NULL, "取消隐藏图标","状态栏图标已全部取消隐藏"); +} + +void sp_status_bar::on_hide_status_clicked() +{ + process->run("adb shell settings put global policy_control immersive.status=*",dev); + QMessageBox::information(NULL, "隐藏状态栏","已隐藏状态栏"); +} + + +void sp_status_bar::on_hide_navigation_clicked() +{ + process->run("adb shell settings put global policy_control immersive.navigation=*",dev); + QMessageBox::information(NULL, "隐藏导航栏","已隐藏导航栏"); +} + +void sp_status_bar::on_hide_restore_clicked() +{ + //adb shell settings put global policy_control null + process->run("adb shell settings put global policy_control null",dev); + QMessageBox::information(NULL, "重置","已将状态栏与导航栏取消隐藏"); +} + +void sp_status_bar::on_pushButton_2_clicked() +{ + process->run("adb shell settings put global policy_control immersive.full=*",dev); + QMessageBox::information(NULL, "同时隐藏","已将导航栏与状态栏同时全局隐藏"); +} + + + +void sp_status_bar::refreshBtns() +{ + ui->airplane->setChecked(false); + ui->alarm_clock->setChecked(false); + ui->bluetooth->setChecked(false); + ui->cast->setChecked(false); + ui->bluetooth->setChecked(false); + ui->headphone->setChecked(false); + ui->hotspot->setChecked(false); + ui->location->setChecked(false); + ui->nfc->setChecked(false); + ui->wifi->setChecked(false); + ui->volume->setChecked(false); +} + diff --git a/QtAdb/sonPages/advanced/sp_status_bar.h b/QtAdb/sonPages/advanced/sp_status_bar.h new file mode 100644 index 0000000..1b74460 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_status_bar.h @@ -0,0 +1,47 @@ +#ifndef SP_STATUS_BAR_H +#define SP_STATUS_BAR_H + +#include +#include +#include "../../adbprocess.h" + +namespace Ui { +class sp_status_bar; +} + +class sp_status_bar : public QWidget +{ + Q_OBJECT + +public: + explicit sp_status_bar(QWidget *parent = nullptr); + ~sp_status_bar(); + + device dev; + void setDev(device dev); + + +private slots: + void on_pushButton_hide_clicked(); + + void on_pushButton_restore_clicked(); + + void on_hide_status_clicked(); + + void on_hide_navigation_clicked(); + + void on_hide_restore_clicked(); + + void on_pushButton_2_clicked(); + +private: + Ui::sp_status_bar *ui; + + adbProcess *process; + textExplainer *explainer; + + void setShadow(QWidget* wgt); + void refreshBtns(); +}; + +#endif // SP_STATUS_BAR_H diff --git a/QtAdb/sonPages/advanced/sp_status_bar.ui b/QtAdb/sonPages/advanced/sp_status_bar.ui new file mode 100644 index 0000000..19a2967 --- /dev/null +++ b/QtAdb/sonPages/advanced/sp_status_bar.ui @@ -0,0 +1,611 @@ + + + sp_status_bar + + + + 0 + 0 + 544 + 437 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 0 + + + 11 + + + 11 + + + + + 14 + + + + + 0 + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + MiSans Medium + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/layout-top-2-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + 状态栏与导航栏 + + + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:1px solid #BDBDBD; + + + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.8);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + + + 隐藏状态栏图标 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 静音 /震动 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 飞行模式 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 麦克风 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 蓝牙 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 热点 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + NFC + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + WIFI + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + 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);} + + + 隐藏 + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + 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 Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 定位 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 闹钟 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 录屏状态 + + + + + + + + MiSans Medium + + + + background-color:rgba(255,255,255,0);border-radius:4px;border:0px; + + + 耳机 + + + + + + + + + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:1px solid #BDBDBD; + + + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.8);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + + + 全局隐藏 + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + 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);} + + + 全局隐藏状态栏 + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + 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);} + + + 全局隐藏导航栏 + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + 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);} + + + 同时隐藏 + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + + + + 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 + + + + + + + + false + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + 12 + + + + 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);} + + + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/apps/sp_libraries.ui b/QtAdb/sonPages/apps/sp_libraries.ui index 739bfd5..55f2433 100644 --- a/QtAdb/sonPages/apps/sp_libraries.ui +++ b/QtAdb/sonPages/apps/sp_libraries.ui @@ -61,7 +61,7 @@ border:0px solid #BDBDBD; border-radius: 4px; border:0px solid #BDBDBD; -image: url(:/ico/image/ico/btnEmulator/menu-line.svg); +image: url(:/ico/image/ico/stack-line.svg); diff --git a/QtAdb/sonPages/apps/sp_packages.cpp b/QtAdb/sonPages/apps/sp_packages.cpp index e009f38..623955f 100644 --- a/QtAdb/sonPages/apps/sp_packages.cpp +++ b/QtAdb/sonPages/apps/sp_packages.cpp @@ -87,12 +87,14 @@ void sp_packages::refresh_tableView(QString s) } } ui->listView->setStyleSheet("QListView::item{height:24px;}"); + model->sort(Qt::AscendingOrder); ui->listView->setModel(model); this->update(); } ui->progressBar->setVisible(false); delete emptyModel; + } void sp_packages::on_listView_clicked(const QModelIndex &index) diff --git a/QtAdb/sonPages/apps/sp_users.cpp b/QtAdb/sonPages/apps/sp_users.cpp new file mode 100644 index 0000000..0f02c09 --- /dev/null +++ b/QtAdb/sonPages/apps/sp_users.cpp @@ -0,0 +1,107 @@ +#include "sp_users.h" +#include "ui_sp_users.h" + +sp_users::sp_users(QWidget *parent) : + QWidget(parent), + ui(new Ui::sp_users) +{ + ui->setupUi(this); + setParent(parent); + + ui->progressBar->hide(); + ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers); + + thread = new adbThread(); + process = new adbProcess(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); + + connect(thread,SIGNAL(signal_output(QString)),this,SLOT(refresh_tableView(QString))); + + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_deleteBtn = new QGraphicsDropShadowEffect(this); + + 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_deleteBtn->setOffset(0,0); + shadowEffect_deleteBtn->setColor(Qt::gray); + shadowEffect_deleteBtn->setBlurRadius(5); + + ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); + ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); + ui->pushButton->setGraphicsEffect(shadowEffect_deleteBtn); + + QFile file("://qss/scrollbar.qss"); + file.open(QFile::ReadOnly); + ui->listView->verticalScrollBar()->setStyleSheet(file.readAll()); +} + +sp_users::~sp_users() +{ + delete ui; +} + +void sp_users::on_refreshBtn_clicked() +{ + thread->initThread("adb shell pm list users",dev,"#PERMISSIONGROUPS#"); + ui->progressBar->setVisible(true); + thread->start(); +} + +void sp_users::refresh_tableView(QString s) +{ + QStandardItemModel* emptyModel = new QStandardItemModel(this); + ui->listView->setModel(emptyModel); + //thread->exit(); + //qDebug() << "before"; + QStringList permissionList = explainer->explainPermissionGroups(s); + //qDebug() << "after"; + QStandardItemModel* model = new QStandardItemModel(this); + if(!permissionList.isEmpty()) + { + for(int i = 0; i < permissionList.count(); i++) + { + //qDebug() << "permissionList.count() = " << permissionList.count() <<"\nbefore index out of range: \n i = " << i << "\n permissionList[i] = "<< permissionList[i]; + if(permissionList[i] != "") + { + model->setItem(i,0,new QStandardItem(permissionList[i].simplified())); + } + } + ui->listView->setModel(model); + this->update(); + } + ui->progressBar->setVisible(false); + delete emptyModel; +} + +void sp_users::setDev(device device) +{ + dev = device; + on_refreshBtn_clicked(); +} + +void sp_users::on_pushButton_clicked() +{ + QString user_id = explainer->get_words_before(explainer->get_words_after(ui->listView->model()->data(ui->listView->currentIndex()).toString(), "{"), ":"); + QMessageBox::StandardButton result=QMessageBox::question(NULL, "删除用户","您确定要删除用户吗?"); + qDebug() << "result =" << result; + if(result == QMessageBox::Yes) + { + if(user_id == "Users") + { + QMessageBox::information(NULL, "选择错误","请选择一个用户,而不是标题"); + } + else + { + process->run("adb shell pm remove-user " + user_id ,dev); + //qDebug() << "user_id:" << user_id; + on_refreshBtn_clicked(); + } + } +} diff --git a/QtAdb/sonPages/apps/sp_users.h b/QtAdb/sonPages/apps/sp_users.h new file mode 100644 index 0000000..8ec6db7 --- /dev/null +++ b/QtAdb/sonPages/apps/sp_users.h @@ -0,0 +1,43 @@ +#ifndef SP_USERS_H +#define SP_USERS_H + +#include +#include +#include +//#include +#include "../../threads/adbthread.h" +#include +#include + +namespace Ui { +class sp_users; +} + +class sp_users : public QWidget +{ + Q_OBJECT + +public: + explicit sp_users(QWidget *parent = nullptr); + ~sp_users(); + + device dev; + void setDev(device dev); + +private slots: + void on_refreshBtn_clicked(); + + void on_pushButton_clicked(); + +public slots: + void refresh_tableView(QString); + +private: + Ui::sp_users *ui; + + adbProcess *process; + adbThread *thread; + textExplainer *explainer; +}; + +#endif // SP_USERS_H diff --git a/QtAdb/sonPages/apps/sp_users.ui b/QtAdb/sonPages/apps/sp_users.ui new file mode 100644 index 0000000..75f9f6e --- /dev/null +++ b/QtAdb/sonPages/apps/sp_users.ui @@ -0,0 +1,262 @@ + + + sp_users + + + + 0 + 0 + 665 + 543 + + + + Form + + + + + + border-radius: 4px; +background-color: rgba(255, 255, 255, 0); +border:0px solid #BDBDBD; + + + + 11 + + + 0 + + + 11 + + + + + 14 + + + + + 0 + + + + + + 30 + 30 + + + + + 30 + 30 + + + + + MiSans Medium + + + + border-radius: 4px; +border:0px solid #BDBDBD; +image: url(:/ico/image/ico/user-line.svg); + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 18 + true + + + + border-radius: 4px; +border:0px solid #BDBDBD; + + + 所有用户 + + + + + + + + + QProgressBar{ + font:9pt; + border-radius:4px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + background-color: qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); +} +QProgressBar:chunk{ + border-radius:4px; + background-color:rgba(255,255,255,0.2); +} + + + + 0 + + + -1 + + + true + + + + + + + true + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + MiSans Medium + 12 + + + + 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);} + + + 删除选中用户 + + + + + + + + + + 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 + + + + + 30 + 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/refresh-line.svg:/ico/image/ico/refresh-line.svg + + + + 18 + 18 + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/links.cpp b/QtAdb/sonPages/links.cpp new file mode 100644 index 0000000..0a747bc --- /dev/null +++ b/QtAdb/sonPages/links.cpp @@ -0,0 +1,25 @@ +#include "links.h" +#include "qicon.h" +#include "qscrollbar.h" +#include "ui_links.h" + +links::links(QWidget *parent) : + QWidget(parent), + ui(new Ui::links) +{ + ui->setupUi(this); + + + this->setWindowTitle("相关链接"); + this->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); + + QFile file("://qss/scrollbar.qss"); + file.open(QFile::ReadOnly); + ui->scrollArea->verticalScrollBar()->setStyleSheet(file.readAll()); + ui->scrollArea->horizontalScrollBar()->setStyleSheet(file.readAll()); +} + +links::~links() +{ + delete ui; +} diff --git a/QtAdb/sonPages/links.h b/QtAdb/sonPages/links.h new file mode 100644 index 0000000..67a8d3c --- /dev/null +++ b/QtAdb/sonPages/links.h @@ -0,0 +1,23 @@ +#ifndef LINKS_H +#define LINKS_H + +#include +#include + +namespace Ui { +class links; +} + +class links : public QWidget +{ + Q_OBJECT + +public: + explicit links(QWidget *parent = nullptr); + ~links(); + +private: + Ui::links *ui; +}; + +#endif // LINKS_H diff --git a/QtAdb/sonPages/links.ui b/QtAdb/sonPages/links.ui new file mode 100644 index 0000000..2b6d468 --- /dev/null +++ b/QtAdb/sonPages/links.ui @@ -0,0 +1,1716 @@ + + + links + + + + 0 + 0 + 836 + 508 + + + + Form + + + 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));*/ + + + + + + border:0px; + + + true + + + + + 0 + -1495 + 797 + 1981 + + + + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:1px solid #BDBDBD; + + + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.8);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + + + ADB + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/android.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://developer.android.google.cn/studio/command-line/adb?hl=zh-cn>Android Developers + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/scrcpy.svg); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://github.com/Genymobile/scrcpy>Scrcpy + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/atmb.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + PointingHandCursor + + + <a style='color: black; text-decoration: none' href = https://github.com/Genymobile/scrcpy>秋之盒 AutumnBox + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/jamcz.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + PointingHandCursor + + + <a style='color: black; text-decoration: none' href = https://jamcz.com>晨钟酱 + + + true + + + + + + + + + + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:1px solid #BDBDBD; + + + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.8);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + + + Recovery + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/twrp.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://twrp.me>TeamWin - TWRP + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/OFlogo.svg); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://orangefox.download/zh-CN>OrangeFox Recovery + + + true + + + + + + + + + + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:1px solid #BDBDBD; + + + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.8);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + + + 模块 + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/magisk.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://github.com/topjohnwu/Magisk>Magisk + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/lsposed.png); +border-radius:4px; + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://github.com/LSPosed>LSPosed + + + true + + + + + + + + + + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:1px solid #BDBDBD; + + + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0.8);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + + + ROMs + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/spark.svg); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://spark-os.live>SparkOS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/paranoid.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://paranoidandroid.co>paranoidandroid + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/projectarcana.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://projectarcana-aosp.github.io/devices.html>PROJECT ARCANA + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/los.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://lineageos.org>Lineage OS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/pe.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://download.pixelexperience.org>Pixel Experience + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/nus.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://nusantararom.org>Nusantara + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/havoc.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://havoc-os.com>Havoc-OS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/dot.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://www.droidontime.com>dotOS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/rr.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://resurrectionremix.com>Resurrection Remix OS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/evoX.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://evolution-x.org>Evolution X + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/crd.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://crdroid.net>crDroid + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/cheri.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://cherishos.com>CherishOS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/syb.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://syberiaos.com>Syberia OS + + + true + + + + + + + + + + + 1 + 1 + + + + background-color:rgba(255,255,255,0.8);border-radius:4px;border:0px solid #BDBDBD; + + + + + + + 50 + 50 + + + + + 50 + 50 + + + + border:0px;image:url(:/linkIcons/image/webicons/MIUI.png); + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + MiSans Medium + 12 + + + + <a style='color: black; text-decoration: none' href = https://www.miui.gq>MIUI + + + true + + + + + + + + + + + + + + + + + + diff --git a/QtAdb/sonPages/sonpagemanager.cpp b/QtAdb/sonPages/sonpagemanager.cpp index 2f10ee2..f3dfeb3 100644 --- a/QtAdb/sonPages/sonpagemanager.cpp +++ b/QtAdb/sonPages/sonpagemanager.cpp @@ -202,9 +202,120 @@ sp_activator* sonPageManager::createSonPageFor_activator(QWidget *parent, int ke return page; break; } + case 10 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/scene5.png);", "激活 Scene5", + "激活 Scene5 的 ADB 模式 \n" + "可以使用大部分查看功能和部分修改功能 \n", + "adb shell sh /data/user/0/com.omarea.vtools/files/up.sh"); + return page; + break; + } + + case 11 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/watchfps.png);", "激活 看帧数+", + "激活 看帧数+ 的 ADB 模式 \n" + "在屏幕上直观的显示当前帧数。 \n" + "方便、简单、美观。 \n" + "不用复杂的操作,没有任何风险 \n", + "adb shell sh /sdcard/Download/watchfps/watchfps.sh"); + return page; + break; + } + + case 12 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/permissiondog.png);", "激活 权限狗", + "激活 权限狗 的 ADB 模式 \n" + "**什么是 AppOps?** \n" + "AppOps 是 Android 系统内存在的一个权限管理功能.与大家熟知的 运行时权限 不同,它至今没有开放管理入口,因此这项功能鲜为人知. \n" + "正因为包括许多开发者的人们不了解 AppOps,应用通常不会检测 AppOps 设置,我们得以借助它在不会被应用发现的条件下拒绝应用申请的权限.(例如某应用不授权定位权限就无法使用,我们可以设置此应用的 AppOps 定位权限为忽略.这样我们就可以在拒绝定位权限后正常使用此应用了.) \n" + "**权限狗又是什么?** \n" + "我们知道,Android 尚未开放 AppOps 管理功能.而权限狗就是一个能够管理 AppOps 设置的第三方工具. \n", + "adb shell sh /storage/emulated/0/Android/data/com.web1n.permissiondog/files/starter.sh"); + return page; + break; + } + + case 13 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/hail.png);", "激活 雹", + "激活 雹 的 「设备所有者 - 隐藏」 模式 \n" + "此模式通过将雹设置为设备所有者 (Device Owner),调用```DevicePolicyManager.setApplicationHidden```方法隐藏应用。 \n", + "adb shell dpm set-device-owner com.aistra.hail/.receiver.DeviceAdminReceiver"); + return page; + break; + } + + case 14 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/bg.png);", "为 BatteryGuru 授予 使用情况访问 权限", + "授予 BatteryGuru 使用情况访问权限 \n" + "在某些定制 ROM 上可能不会生效 \n" + "授予应用程序权限,否则 BatteryGuru 的一些功能将无法工作。 \n", + "adb shell pm grant com.paget96.batteryguru android.permission.PACKAGE_USAGE_STATS"); + return page; + break; + } + + case 15 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/bg.png);", "为 BatteryGuru 授予 修改安全系统设置 权限", + "授予 BatteryGuru 修改安全系统设置权限 \n" + "在某些定制 ROM 上可能不会生效 \n" + "用于更改一些系统设置,例如 Android Doze 参数或系统节电状态 \n" + "也可以使用 Root \n", + "adb shell pm grant com.paget96.batteryguru android.permission.WRITE_SECURE_SETTINGS"); + return page; + break; + } + + case 16 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/bg.png);", "为 BatteryGuru 授予 DUMP 权限", + "授予 BatteryGuru 读取 DUMP 权限 \n" + "在某些定制 ROM 上可能不会生效 \n" + "允许应用检查系统内部状态的权限,用来检测设置状态(例如空闲和 Doze 模式)。 \n" + "也可以使用 Root \n", + "adb shell pm grant com.paget96.batteryguru android.permission.DUMP"); + return page; + break; + } + + case 17 : + { + sp_activator *page = new sp_activator(parent); + page->setDev(dev); + page->setUp("border:0px;image:url(:/activatorApps/image/activatorApps/apkinstaller.png);", "激活 安装狮", + "激活 安装狮 - DPM \n" + "安装狮的主要功能是安装APK和卸载应用 \n" + "除了原生 Android 外的绝大部分定制系统由于系统的限制,无法将本应用设置为默认安装与卸载应用,而且发起安装时这些系统会直接让系统默认的软件包安装程序来处理,也没有很好的解决办法 \n" + "这种情况推荐用本应用内的 选择文件安装 功能或用一些支持选择打开方式的文件管理器等来发起安装 \n" + "安装前请关闭Google Play的安全扫描,请在开发者选项打开USB安装、关闭监控ADB安装应用等等以防止安装失败。 \n", + "adb shell dpm set-device-owner com.modosa.apkinstaller/.receiver.AdminReceiver"); + return page; + break; + } + break; } + return NULL; } @@ -238,7 +349,7 @@ QWidget* sonPageManager::createSonPageFor_apps(QWidget *parent, int key, device } case 5: { - qDebug() << "SPM.DEV = " << dev.model; + //qDebug() << "SPM.DEV = " << dev.model; sp_features *page = new sp_features(parent); page->setDev(dev); return page; @@ -248,6 +359,12 @@ QWidget* sonPageManager::createSonPageFor_apps(QWidget *parent, int key, device sp_libraries *page = new sp_libraries(parent); page->setDev(dev); return page; + } + case 7: + { + sp_users *page = new sp_users(parent); + page->setDev(dev); + return page; } break; } @@ -300,6 +417,31 @@ QWidget* sonPageManager::createSonPageFor_advanced(QWidget *parent, int key, dev //page->setDev(dev); return page; } + case 2: + { + sp_accounts *page = new sp_accounts(parent); + page->setDev(dev); + return page; + } + case 3: + { + sp_captive_portal *page = new sp_captive_portal(parent); + page->setDev(dev); + return page; + } + case 4: + { + sp_scales *page = new sp_scales(parent); + page->setDev(dev); + return page; + } + case 5: + { + sp_status_bar *page = new sp_status_bar(parent); + page->setDev(dev); + return page; + } + break; } return NULL; diff --git a/QtAdb/sonPages/sonpagemanager.h b/QtAdb/sonPages/sonpagemanager.h index c42198d..25377dd 100644 --- a/QtAdb/sonPages/sonpagemanager.h +++ b/QtAdb/sonPages/sonpagemanager.h @@ -13,10 +13,15 @@ #include "apps/sp_packages.h" #include "apps/sp_features.h" #include "apps/sp_libraries.h" +#include "apps/sp_users.h" #include "devControl/sp_devcontrol_power.h" #include "devControl/btnemulator.h" #include "recovery/sp_recovery.h" #include "advanced/sp_customize_cmd.h" +#include "advanced/sp_accounts.h" +#include "advanced/sp_captive_portal.h" +#include "advanced/sp_scales.h" +#include "advanced/sp_status_bar.h" class sonPageManager diff --git a/QtAdb/textexplainer.cpp b/QtAdb/textexplainer.cpp index c162ef3..6e557b9 100644 --- a/QtAdb/textexplainer.cpp +++ b/QtAdb/textexplainer.cpp @@ -118,6 +118,18 @@ QString textExplainer::get_words_after(QString str , QString key) return text; } +QString textExplainer::get_words_before(QString str , QString key) +{ + QString text = str; + //qDebug() << "text is:" << text << "\n"; + int index = str.indexOf(key); + //qDebug() << "index =" << index << "\n"; + text = text.left(index); + //qDebug() << "key.size =" << key.size() << "\n"; + text = text.simplified(); + return text; +} + QString textExplainer::explain_cpu_output(QString str) { QString text = str; @@ -148,7 +160,8 @@ bool textExplainer::explainError(QString err) /*启动*/ else if(err.contains("daemon not running")){} else if(err.contains("daemon started successfully")){} - /*应用安装*/ + else if(err.contains("doesn't match this client")){} + /*软件包*/ else if(err.contains("install requires an argument")) { showMsgBox("提示"," · 请先选择安装包"); @@ -157,10 +170,23 @@ bool textExplainer::explainError(QString err) { showMsgBox("错误"," · 当前设备状态无法安装应用"); } + else if(err.contains("Shell cannot change component state for") && err.contains("cmd: not found")) + { + showMsgBox("错误"," · 无法执行该指令"); + } + /*用户*/ + else if(err.contains("couldn't remove user id 0")) + { + showMsgBox("无法操作"," · 无法删除默认用户"); + } + else if(err.contains("no user id specified")) + { + showMsgBox("未选择"," · 请先选择一个用户"); + } /* 设备管理员 */ else if(err.contains("Not allowed to set the device owner because there are already several users on the device")) { - showMsgBox("失败"," · 请先清除所有用户并关闭多用户模式"); + showMsgBox("失败"," · 请先清除所有用户并关闭多用户模式 \n · 可在「软件包管理器」-「用户」中查看并删除用户 \n"); } else if(err.contains("Unknown admin")) { @@ -168,7 +194,7 @@ bool textExplainer::explainError(QString err) } else if(err.contains("Not allowed to set the device owner because there are already some accounts on the device")) { - showMsgBox("失败"," · 请先退出所有账户"); + showMsgBox("失败"," · 请先退出所有账户 \n · 可在「其它」-「账户」中查看设备中的账户 \n · 或在设备设置中查看并退出账户 \n"); } else if(err.contains("Trying to set the device owner, but device owner is already set.")) { @@ -206,10 +232,15 @@ bool textExplainer::explainError(QString err) { showMsgBox("完成"," · 成功\n · 你之所以会看到这条提示,是因为ADB本身将成功的消息以错误输出方式输出\n · 您无需关注此错误"); } + else if(err.contains("Bad arguments")) + { + showMsgBox("错误"," · 参数有误"); + } else { showMsgBox("错误"," · 未知错误!\n" + err +"\n · 若此处出现并不完整的报错或一大串包含 '.android.os'、'java' 等字样的错误,您可以视情况忽忽视它,并查阅另一条报错\n"); } + qDebug() << "<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>" << "\n" << err; return true; } @@ -280,12 +311,30 @@ QStringList textExplainer::explainPermissionGroups(QString s) { QStringList list; list = s.split("\n"); - /* - for(int i = 0; i<=list.count(); i--) - { - qDebug() << "/+*********\nlist.count() = " << list.count() <<"\nbefore index out of range: \n i = " << i << "\n list[i] = "<< list[i] << "\n ***************+/"; - QString tmpStr = get_words_after(list[i],"permission group:"); - list[i] = tmpStr; - }*/ + return list; } + +QStringList textExplainer::explainAccounts(QString s) +{ + QStringList final; + QStringList classific_as_users; + classific_as_users = s.split("}:"); + + for(int i = 1; ithread = true; + //timer->start(1000); + /* + while(true) + { + + }*/ +} + +void thread_monitor::getInfo() +{ + //qDebug() << ">> getInfo()"; + cpu_t2 = process->run("adb shell cat proc/stat", dev); + mem = process->run("adb shell cat /proc/meminfo",dev); + + //qDebug() << "cpu_t2 =" << cpu_t2; + //qDebug() << mem; + + if(cpu_t1 != "#FIRSTBOOT#" && !cpu_t2.isEmpty() && !mem.isEmpty()) + { + //qDebug() << "before, cpu_t1 = " <get_words_before(explainer->get_words_after(mem.split("\n")[0] , "MemTotal:") , "kB").simplified().simplified().toInt(); + //int MemFree = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[1] , "MemFree:") , "kB").simplified().simplified().toInt(); + int MemAvailable = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[2] , "MemAvailable:") , "kB").simplified().simplified().toInt(); + qDebug() << "Mem = " << mem; + qDebug() << "MemTotal = " << MemTotal; + //qDebug() << "MemFree = " << MemFree; + //float mem_use = (float)(MemTotal - MemFree) / (float)MemTotal; + float mem_use = (float)(MemTotal - MemAvailable) / (float)MemTotal; + + qDebug() << "mem_use = " << mem_use; + + mem = ""; + emit signal_monitor(cpu_use, mem_use); + } + else + { + //qDebug() << "cpu_t2.isEmpty?" << cpu_t2.isEmpty(); + //qDebug() << "mem.isEmpty?" << mem.isEmpty(); + cpu_t1 = process->run("adb shell cat proc/stat", dev); + } + //cpu_t1 = ""; +} diff --git a/QtAdb/threads/thread_monitor.h b/QtAdb/threads/thread_monitor.h new file mode 100644 index 0000000..f268d45 --- /dev/null +++ b/QtAdb/threads/thread_monitor.h @@ -0,0 +1,37 @@ +#ifndef THREAD_MONITOR_H +#define THREAD_MONITOR_H + +#include +#include +#include +#include "../adbprocess.h" + + +class thread_monitor : public QThread +{ + Q_OBJECT + +public: + thread_monitor(device dev); + adbProcess *process; + textExplainer *explainer; + //QTimer *timer; + + device dev; + + QString cpu_t1 = "#FIRSTBOOT#"; + QString cpu_t2; + QString mem; + +signals: + void signal_output(QString); + void signal_monitor(float,float); + +protected: + void run() override; + +public slots: + void getInfo(); +}; + +#endif // THREAD_MONITOR_H diff --git a/QtAdb/usb_listener.cpp b/QtAdb/usb_listener.cpp index 121666b..a03d3b5 100644 --- a/QtAdb/usb_listener.cpp +++ b/QtAdb/usb_listener.cpp @@ -16,11 +16,11 @@ bool usb_listener::nativeEventFilter(const QByteArray &eventType, void *message, //qDebug() << "msgType = " << msgType; //qDebug() << "WM_DEVICECHANGE = " << WM_DEVICECHANGE; - qDebug() << "wParam = " << msg->wParam; + //qDebug() << "wParam = " << msg->wParam; //qDebug() << "lParam = " << msg->lParam; //qDebug() << "WM_DEVICECHANGE = " << WM_DEVICECHANGE; - qDebug() << "DBT_DEVICEARRIVAL = " << DBT_DEVICEARRIVAL; - qDebug() << "DBT_DEVICEREMOVECOMPLETE = " << DBT_DEVICEREMOVECOMPLETE; + //qDebug() << "DBT_DEVICEARRIVAL = " << DBT_DEVICEARRIVAL; + //qDebug() << "DBT_DEVICEREMOVECOMPLETE = " << DBT_DEVICEREMOVECOMPLETE; /* PDEV_BROADCAST_HDR lpdb = PDEV_BROADCAST_HDR(msg->lParam); qDebug() << "lpdb = " << msg->lParam; diff --git a/README.md b/README.md index 778a09d..6df2a4f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 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 命令以提升使用体验。 +Android 系统的可玩性在 adb 的加成下变得更加丰富,由此涌现出众多的命令用法。非开发者的Android 爱好者经常根据需求运行 adb 命令以提升使用体验。 但由于 adb 涉及到环境配置、终端执行等操作,对于不会使用的人可能造成困扰;一些命令行参数的记忆对于并不熟悉的人来说同样令人头疼。所以可供一键式操作,并且已内置环境的图形窗口有一定需求。 @@ -28,16 +28,20 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 - 提供命令模板,使用者可直接复制命令并自行执行。 - 支持多种状态显示及使用:开机、Recovery、~~Fastboot~~及 adb sideload. +*注意:QtAdb 暂不支持比 Windows10 更早的 Windows 系统,具体原因正在排查* + ## 🛠️功能 ### ℹ️设备信息 - 获取设备型号、屏幕分辨率、屏幕密度(DPI)、Android Id、安卓版本以及处理器型号的信息 - 修改 DPI、修改屏幕分辨率 +- 实时监控CPU使用率、内存使用率。 ### ✔️激活 -- 提供主流工具应用的激活:[黑阈](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/) +- 提供主流工具应用的激活:[黑阈](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/)、Scene、[看帧数+](https://www.coolapk.com/apk/com.watchfps)、[权限狗](https://www.coolapk.com/apk/com.web1n.permissiondog)、[雹](https://github.com/aistra0528/Hail)、[安装狮](https://www.coolapk.com/apk/com.modosa.apkinstaller) +- 为应用授予其所需的权限:BatteryGuru(使用情况访问、修改安全系统设置、读取DUMP) - 更多应用正在添加中。 ### 🎮设备控制 @@ -62,13 +66,25 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 ### 📦软件包管理器: - 安装应用 - - 列出已知的权限、权限组 + - 列出已知的权限 + - 可单独打开大窗口查看列表 + - 可按以下要求输出: + - 按权限组进行整理 + - 输出所有信息 + - 输出简短摘要 + - 仅列出危险权限 + - 仅列出用户将看到的权限 + + - 列出已知的权限组 - 列出软件包 - 卸载、停用、启用、清除数据 - 获取软件包包名、安装者、关联文件等信息 - - 列出系统的所有功能 - 列出当前设备支持的所有库 + - 用户 + - 列出当前设备中的所有用户 + - 删除选中用户 + ### 🔧Recovery 功能: @@ -77,6 +93,28 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 - **这是危险功能,即使正确地使用也可能导致设备故障,请确保您有足够的排障能力后使用** - **使用侧载功能时请不要关闭程序** +### 🔮其它功能 + +- 账户 + + - 查看设备中各个用户已登录的账户 + +- 去除叹号 + + - 修改验证服务器,提供了多个预设选项(MIUI、EMUI等国内验证服务器) + +- 修改过渡动画 + + - 修改动画时长 + - 修改过渡动画 + - 修改窗口动画 + +- 状态栏与导航栏 + + - 隐藏状态栏图标:静音/震动、定位、麦克风、录屏状态、WIFI、热点、飞行模式、耳机、闹钟、蓝牙、NFC + - 重置状态栏图标 + - 全局隐藏状态栏、导航栏 + ### 💣不稳定功能 - ~~*安装应用*~~ *暂未实现错误提示细节* @@ -85,7 +123,7 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 ### *🍘饼* -> *由于个人学业紧迫(**确实**考不上研了),饼中的内容添加将十分缓慢,可能在过年后,甚至再多一年后才能开始全力开发,请见谅!* +> *由于个人学业紧迫(**已经**考不上研了),饼中的内容添加将十分缓慢,可能在过年后,甚至再多一年后才能开始全力开发,请见谅!* - ~~完整的软件包管理器~~ - 跨平台 @@ -100,7 +138,7 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 - ~~安装应用进度条~~ - ~~侧载进度条~~ - 命令 - - 获取 Google 服务框架 Android ID + - ~~获取 Google 服务框架 Android ID~~ (需要 Root,暂时不涉及 Root 操作) - ~~更改屏幕分辨率~~ - 更改屏幕边距 - 控制台 @@ -121,23 +159,27 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 - **Q:不是有环境吗?怎么还是跑不了🥺** - A:您下载的是压缩包,请全部解压后再使用。 + A:您下载的是压缩包,请全部解压后再使用;请确保您的设备已打开USB调试并正确连接。 + +- **Q:我已经解压,仍然无法使用** + + A:部分 ADB 工具,如秋之盒、搞机工具箱等在退出后不会杀死其拉起的 ADB 服务端;QtADB异常退出后也可能来不及杀死 adb 进程,请进入任务管理器中结束 “adb.exe” 进程后重试,若仍无法使用请尝试重新启动。 - **Q:怎么这么多类似乱码的报错😱** A:我已经尽可能让它减少报错了,若弹出的“未知错误”对话框中的报错无法构成一个完整的句子,那么您可以根据它的内容视情况忽略它,并查看另一条报错。 - Tips:使用 Qt 所封装的进程类在获取 adb 输出的错误时,容易将一条错误随机分成多段错误处理,而每一段错误将被报告为一条单独的错误。所以程序用于识别报错类型所需的关键字信息可能只在其中一条错误中,甚至可能被拦腰斩断,分散在两条报错中,此时 QtAdb 将无法分辨这些不包含关键字的信息,从而弹出“未知错误”对话框,并显示这些错误。这个问题目前没有找到彻底的解决办法,仍在努力研究中。 + > Tips:使用 Qt 所封装的进程类在获取 adb 输出的错误时,容易将一条错误随机分成多段错误处理,而每一段错误将被报告为一条单独的错误。所以程序用于识别报错类型所需的关键字信息可能只在其中一条错误中,甚至可能被拦腰斩断,分散在两条报错中,此时 QtAdb 将无法分辨这些不包含关键字的信息,从而弹出“未知错误”对话框,并显示这些错误。这个问题目前没有找到彻底的解决办法,仍在努力研究中。 - **Q:应用无法安装🙁** - A:~~应用安装功能暂未完全实现,为不稳定功能。应用安装完成后没有视觉反馈,请查看您的启动器先确认它确实没有安装上,其次注意安装包大小,过大的安装包可能导致 QtAdb 主界面未响应,此时不要进行任何操作,更不要杀死 adb 进程,等待手机上出现应用图标即可。若有报错可进行反馈。~~请排查您是否为:降级安装、在不兼容的安卓版本上安装等等,错误提示暂时没有完全实现,请自行判断。 + A:~~应用安装功能暂未完全实现,为不稳定功能。应用安装完成后没有视觉反馈,请查看您的启动器先确认它确实没有安装上,其次注意安装包大小,过大的安装包可能导致 QtAdb 主界面未响应,此时不要进行任何操作,更不要杀死 adb 进程,等待手机上出现应用图标即可。若有报错可进行反馈。~~请排查您是否为:降级安装、在不兼容的安卓版本上安装等等,错误提示暂时没有完全实现,请自行判断。降级安装等功能请期待后续版本。 ~~Tips:发出命令后QtAdb并没有监视命令的运行情况,若安装仍在进行且时间较长,可能主窗口会恢复到可以操作的状态,看上去就像什么都没有发生,侧载未响应原理与此相同。监视运行情况的功能正在开发中,请尽量不要使用此功能。(QtAdb 提供了命令模板,您可自行运行此命令)~~ -- **Q:侧载未响应** +- ~~**Q:侧载未响应**~~ - A:侧载与应用安装类似,功能暂未完全实现,为不稳定功能。若侧载压缩包过大将会导致主界面阻塞时间过长,请不要进行操作,具体以 recovery 输出为准。**请具备一定查错能力后再使用。**(~~会用的话直接自己开命令行罢~~) + ~~A:侧载与应用安装类似,功能暂未完全实现,为不稳定功能。若侧载压缩包过大将会导致主界面阻塞时间过长,请不要进行操作,具体以 recovery 输出为准。~~**请具备一定查错能力后再使用。** - **Q:按键模拟不生效🤨** @@ -147,21 +189,23 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 A:需要分情况讨论:若更换另一部手机可以连接,则可能是手机端 ROM 出现问题,请重启并尝试再次连接;若设备没有问题则可能是路由器出现问题,请更换其它WI-FI网络再尝试。 -- **Q:连续报了一大堆错并闪退** +- ~~**Q:连续报了一大堆错并闪退**~~ - A:可能是您在拔出设备后执行了命令,重新打开并连接即可。QtAdb 仍处于开发中,这是不稳定因素之一。 + ~~A:可能是您在拔出设备后执行了命令,重新打开并连接即可。QtAdb 仍处于开发中,这是不稳定因素之一。~~ - **Q:无法连接WSA** - A:请确保 WSA 已安装并正在运行:仅仅安装完成是不够的,还需要在开始菜单中打开 “适用于 Android^TM^ 的 Windows 子系统设置” 应用,选择 “开发人员” ,并打开 “开发人员模式”。在此之后,你可能还需要选择“系统” ,打开 “文件” 以确保 WSA 正在运行中。 + A:请确保 **WSA 已安装并正在运行**:仅仅安装完成是不够的,还需要在开始菜单中打开 “适用于 Android^TM^ 的 Windows 子系统设置” 应用,选择 “开发人员” ,并打开 “开发人员模式”。在此之后,你可能还需要选择“系统” ,打开 “文件” 以确保 WSA 正在运行中。 - **Q:闪退** - A:您可能连续点击了两次杀死 ”adb进程“ 按钮,请不要这样做;也可能是您在拔出设备后执行了命令,重新打开并连接即可。其余情况请提交反馈,并描述发生闪退之前您进行的操作,谢谢! + ~~A:您可能连续点击了两次杀死 ”adb进程“ 按钮,请不要这样做;也可能是您在拔出设备后执行了命令,重新打开并连接即可。~~ + + A:请提交反馈,并描述发生闪退之前您进行的操作,谢谢! - **Q:我可以催更吗**🥺 - A:~~你可以请我喝可乐吗🥺~~当然可以催更,它现在仍处于开发中,并没有正式release,仍需要长时间的调试。 + A:~~你可以请我喝可乐吗🥺~~当然可以催更,它现在仍处于开发中,并没有正式发布,仍需要长时间的调试。 ## 🙋反馈