mirror of
https://github.com/LapplandSP/QtAdb.git
synced 2025-05-29 15:06:06 +08:00
基本实现软件包管理器,优化动画
This commit is contained in:
parent
8eb6c503ec
commit
d48772206b
|
@ -19,7 +19,13 @@ SOURCES += \
|
|||
pagemaker.cpp \
|
||||
sonPages/activator/sp_activator.cpp \
|
||||
sonPages/advanced/sp_customize_cmd.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/tp_packageprofile.cpp \
|
||||
sonPages/devControl/btnemulator.cpp \
|
||||
sonPages/devControl/sp_devcontrol_power.cpp \
|
||||
sonPages/devInfo/sp_dpichanger.cpp \
|
||||
|
@ -44,7 +50,13 @@ HEADERS += \
|
|||
pagemaker.h \
|
||||
sonPages/activator/sp_activator.h \
|
||||
sonPages/advanced/sp_customize_cmd.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/tp_packageprofile.h \
|
||||
sonPages/devControl/btnemulator.h \
|
||||
sonPages/devControl/sp_devcontrol_power.h \
|
||||
sonPages/devInfo/sp_dpichanger.h \
|
||||
|
@ -66,7 +78,13 @@ FORMS += \
|
|||
pagelistitem.ui \
|
||||
sonPages/activator/sp_activator.ui \
|
||||
sonPages/advanced/sp_customize_cmd.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/tp_packageprofile.ui \
|
||||
sonPages/devControl/btnemulator.ui \
|
||||
sonPages/devControl/sp_devcontrol_power.ui \
|
||||
sonPages/devInfo/sp_dpichanger.ui \
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
<font/>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
|
@ -114,7 +112,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>测试版本:beta-v0.2</string>
|
||||
<string>测试版本:beta-v0.4</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -11,8 +11,8 @@ animationWidget::animationWidget(QWidget *p)
|
|||
void animationWidget::playLoadAnimation()
|
||||
{
|
||||
animation->setDuration(750);
|
||||
animation->setEndValue(QRect(301, 111, this->width(),this->height()));
|
||||
animation->setStartValue(QRect(301 + 50, 111, this->width(),this->height()));
|
||||
animation->setEndValue(QRect(301, 117, this->width(),this->height()));
|
||||
animation->setStartValue(QRect(301 + 50, 117, this->width(),this->height()));
|
||||
|
||||
animation->setEasingCurve(QEasingCurve::OutQuart);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>11</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="mainLayout">
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
<file>image/ico/about/wechat.svg</file>
|
||||
<file>image/ico/logo.svg</file>
|
||||
<file>image/ico/code-s-slash-line.svg</file>
|
||||
<file>image/ico/share-box-line.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/test">
|
||||
<file>image/test/back.png</file>
|
||||
|
|
1
QtAdb/image/ico/share-box-line.svg
Normal file
1
QtAdb/image/ico/share-box-line.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 3v2H5v14h14v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h6zm7.586 2H13V3h8v8h-2V6.414l-7 7L10.586 12l7-7z"/></svg>
|
After Width: | Height: | Size: 255 B |
|
@ -76,18 +76,34 @@ void MainWindow::refreshDevList() //方法:刷新设备列
|
|||
devList.clear(); //清空设备列表
|
||||
devList = explainer->getDevList_windows(process->run("adb devices -l")); //重新赋值
|
||||
|
||||
QList<int> off; //未响应设备索引
|
||||
|
||||
/*将设备信息传入 List l ,并将l的值显示在combobox中*/
|
||||
QStringList l;
|
||||
l.clear();
|
||||
|
||||
for (int i = 0 ; i < devList.size() ; i++ )
|
||||
{
|
||||
QString devItem =devList[i].state + " " + explainer->get_words_after(devList[i].device_product, ":") + " " + explainer->get_words_after(devList[i].model, ":");
|
||||
QString devItem = devList[i].state + " " + explainer->get_words_after(devList[i].model, ":") + " " + devList[i].addr;
|
||||
l.append(devItem);
|
||||
if(devList[i].state == "[未响应]")
|
||||
{
|
||||
off.append(i);
|
||||
/*
|
||||
QVariant v(0);
|
||||
ui->comboBox->setItemData(i, v, Qt::UserRole - 1);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
ui->comboBox->addItems(l);
|
||||
|
||||
for(int i = 0; i < off.count();i++)
|
||||
{
|
||||
QVariant v(0);
|
||||
ui->comboBox->setItemData(off[i], v, Qt::UserRole - 1);
|
||||
}
|
||||
|
||||
if(devList.isEmpty())
|
||||
{
|
||||
current_device = -1; //重设当前设备
|
||||
|
@ -132,12 +148,12 @@ void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
|
|||
//initBasePage(0);
|
||||
if(ui->indexList->currentRow() == 0)
|
||||
{
|
||||
qDebug() << "initBasePage";
|
||||
//qDebug() << "initBasePage";
|
||||
initBasePage(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "setCurrentRow";
|
||||
//qDebug() << "setCurrentRow";
|
||||
ui->indexList->setCurrentRow(0);
|
||||
|
||||
}
|
||||
|
@ -149,7 +165,8 @@ void MainWindow::initBasePage(int key) //槽:生成basePages
|
|||
{
|
||||
while(key != -1)
|
||||
{
|
||||
this->setEnabled(false);
|
||||
//this->setEnabled(false);
|
||||
this->lock();
|
||||
|
||||
if(currentPage != NULL) //销毁上一个basePage
|
||||
{
|
||||
|
@ -160,6 +177,7 @@ void MainWindow::initBasePage(int key) //槽:生成basePages
|
|||
}
|
||||
|
||||
currentPage = new basePage(this);
|
||||
connect(currentPage,SIGNAL(animationEnd()),this,SLOT(slot_taiChi()));
|
||||
|
||||
if(devList.isEmpty())
|
||||
{
|
||||
|
@ -176,8 +194,11 @@ void MainWindow::initBasePage(int key) //槽:生成basePages
|
|||
|
||||
currentPage->playLoadAnimation();
|
||||
//currentPage->repaint();
|
||||
taiChiTimer = new QTimer(this);
|
||||
connect(taiChiTimer, SIGNAL(timeout()), this, SLOT(slot_taiChi()));
|
||||
taiChiTimer->setSingleShot(true);
|
||||
taiChiTimer->start(750);
|
||||
|
||||
this->setEnabled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +227,7 @@ void MainWindow::addIndexItems() //方法:初始化向index
|
|||
addItemToIndex(activator);
|
||||
|
||||
indexListItem *apps = new indexListItem(this->ui->indexList);
|
||||
apps->setText("应用");
|
||||
apps->setText("软件包管理器");
|
||||
apps->setPic("image:url(:/ico/image/ico/google-play-line.svg);background-color:rgba(255,255,255,0);");
|
||||
addItemToIndex(apps);
|
||||
|
||||
|
@ -468,3 +489,27 @@ void MainWindow::on_WSABtn_clicked() //槽:连接WSA
|
|||
msgBox->addButton(" ✓ ", QMessageBox::AcceptRole);
|
||||
msgBox->show();
|
||||
}
|
||||
|
||||
void MainWindow::slot_taiChi()
|
||||
{
|
||||
//qDebug() <<"taiChi -" << taiChi;
|
||||
/*
|
||||
if(taiChi)
|
||||
{
|
||||
this->resize(this->geometry().width() + 5,this->geometry().height());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->resize(this->geometry().width() - 5,this->geometry().height());
|
||||
}*/
|
||||
taiChi = !taiChi;
|
||||
currentPage->repaint();
|
||||
delete taiChiTimer;
|
||||
taiChiTimer = NULL;
|
||||
|
||||
if(ui->comboBox->currentIndex() != -1)
|
||||
{
|
||||
this->unlock();
|
||||
}
|
||||
//this->setEnabled(true);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <QSizePolicy>
|
||||
#include <QScroller>
|
||||
#include <QLineEdit>
|
||||
#include <QMouseEvent>
|
||||
#include "adbprocess.h"
|
||||
#include "textexplainer.h"
|
||||
#include "indexlistitem.h"
|
||||
|
@ -69,6 +70,7 @@ private slots:
|
|||
void connectWIFIDev();
|
||||
|
||||
void on_WSABtn_clicked();
|
||||
void slot_taiChi();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
@ -77,6 +79,9 @@ private:
|
|||
void addIndexItems();
|
||||
void setStyles();
|
||||
|
||||
bool taiChi = true;
|
||||
QTimer *taiChiTimer;
|
||||
|
||||
basePage * currentPage;
|
||||
animationWidget * tmpPage;
|
||||
about * WCMPage2;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="bottomMargin">
|
||||
<number>11</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="2,0,10">
|
||||
|
|
|
@ -9,7 +9,7 @@ pageListItem::pageListItem(QWidget *parent) :
|
|||
ui->enableLight->setVisible(false);
|
||||
|
||||
ui->widget->setStyleSheet("QWidget{background-color:transparent; border-radius:4px; border-color:gray;border:0px;}");
|
||||
ui->pic->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}");
|
||||
ui->pic->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.7);border-radius:4px;border:0px;}");
|
||||
|
||||
setStyles();
|
||||
}
|
||||
|
@ -56,7 +56,9 @@ void pageListItem::on_copyButton_clicked()
|
|||
|
||||
void pageListItem::setSelectable()
|
||||
{
|
||||
ui->enableLight->setVisible(true);
|
||||
//ui->enableLight->setVisible(true);
|
||||
//shadowEffect_icon->setColor(Qt::green);
|
||||
ui->pic->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}");
|
||||
}
|
||||
|
||||
void pageListItem::slot_setText(QString t, QString p)
|
||||
|
@ -87,7 +89,7 @@ void pageListItem::setStyles()
|
|||
graphicsOpacityEffect->setOpacity(1.0);
|
||||
ui->pic->setGraphicsEffect(graphicsOpacityEffect);
|
||||
|
||||
QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect(this);
|
||||
shadowEffect_icon = new QGraphicsDropShadowEffect(this);
|
||||
shadowEffect_icon->setOffset(0,0);
|
||||
shadowEffect_icon->setColor(Qt::gray);
|
||||
shadowEffect_icon->setBlurRadius(5);
|
||||
|
|
|
@ -39,6 +39,8 @@ private slots:
|
|||
private:
|
||||
Ui::pageListItem *ui;
|
||||
|
||||
QGraphicsDropShadowEffect *shadowEffect_icon;
|
||||
|
||||
public slots:
|
||||
void slot_setText(QString t, QString p);
|
||||
void slot_setText_title(QString t);
|
||||
|
|
|
@ -301,7 +301,7 @@ basePage* pageMaker::createPage_apps(QWidget *parent, device dev)
|
|||
apps->isBasePage = true;
|
||||
//activatorPage *activator = new activatorPage(parent);
|
||||
apps->whoYouAre("apps");
|
||||
int val[20] = {1};
|
||||
int val[20] = {1,2,3,4,5,6};
|
||||
apps->setEnableValue(val);
|
||||
apps->setDev(dev);
|
||||
|
||||
|
@ -311,6 +311,36 @@ basePage* pageMaker::createPage_apps(QWidget *parent, device dev)
|
|||
installer->setSelectable();
|
||||
apps->addItemsToList(installer);
|
||||
|
||||
pageListItem *permissionGroups = new pageListItem(apps);
|
||||
permissionGroups->setText("已知权限组","adb shell pm list permission-groups");
|
||||
permissionGroups->setPic(":/ico/image/ico/about/information-line.svg");
|
||||
permissionGroups->setSelectable();
|
||||
apps->addItemsToList(permissionGroups);
|
||||
|
||||
pageListItem *permissions = new pageListItem(apps);
|
||||
permissions->setText("已知权限","adb shell pm list permissions");
|
||||
permissions->setPic(":/ico/image/ico/about/information-line.svg");
|
||||
permissions->setSelectable();
|
||||
apps->addItemsToList(permissions);
|
||||
|
||||
pageListItem *packages = new pageListItem(apps);
|
||||
packages->setText("软件包","adb shell pm list packages");
|
||||
packages->setPic(":/ico/image/ico/android-line.svg");
|
||||
packages->setSelectable();
|
||||
apps->addItemsToList(packages);
|
||||
|
||||
pageListItem *features = new pageListItem(apps);
|
||||
features->setText("系统功能","adb shell pm list features");
|
||||
features->setPic(":/ico/image/ico/tools-line.svg");
|
||||
features->setSelectable();
|
||||
apps->addItemsToList(features);
|
||||
|
||||
pageListItem *libraries = new pageListItem(apps);
|
||||
libraries->setText("库","adb shell pm list libraries");
|
||||
libraries->setPic(":/ico/image/ico/btnEmulator/menu-line.svg");
|
||||
libraries->setSelectable();
|
||||
apps->addItemsToList(libraries);
|
||||
|
||||
return apps;
|
||||
}
|
||||
|
||||
|
|
82
QtAdb/sonPages/apps/sp_features.cpp
Normal file
82
QtAdb/sonPages/apps/sp_features.cpp
Normal file
|
@ -0,0 +1,82 @@
|
|||
#include "sp_features.h"
|
||||
#include "ui_sp_features.h"
|
||||
|
||||
sp_features::sp_features(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::sp_features)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setParent(parent);
|
||||
|
||||
ui->progressBar->hide();
|
||||
ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
||||
thread = new adbThread();
|
||||
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);
|
||||
|
||||
shadowEffect_back_to_basePage->setOffset(0,0);
|
||||
shadowEffect_back_to_basePage->setColor(Qt::gray);
|
||||
shadowEffect_back_to_basePage->setBlurRadius(5);
|
||||
|
||||
shadowEffect_refreshBtn->setOffset(0,0);
|
||||
shadowEffect_refreshBtn->setColor(Qt::gray);
|
||||
shadowEffect_refreshBtn->setBlurRadius(5);
|
||||
|
||||
ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
|
||||
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
|
||||
|
||||
}
|
||||
|
||||
sp_features::~sp_features()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void sp_features::on_refreshBtn_clicked()
|
||||
{
|
||||
thread->initThread("adb shell pm list features",dev,"#PERMISSIONGROUPS#");
|
||||
ui->progressBar->setVisible(true);
|
||||
thread->start();
|
||||
}
|
||||
|
||||
void sp_features::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++)
|
||||
{
|
||||
QStringList tmpList;
|
||||
tmpList = permissionList[i].split(":");
|
||||
//qDebug() << "permissionList.count() = " << permissionList.count() <<"\nbefore index out of range: \n i = " << i << "\n permissionList[i] = "<< permissionList[i];
|
||||
if(tmpList.count() >= 2)
|
||||
{
|
||||
model->setItem(i,0,new QStandardItem(tmpList[1]));
|
||||
}
|
||||
}
|
||||
ui->listView->setModel(model);
|
||||
this->update();
|
||||
}
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
}
|
||||
|
||||
void sp_features::setDev(device device)
|
||||
{
|
||||
qDebug() << "setDev.DEVICE" << device.model;
|
||||
dev = device;
|
||||
qDebug() << "setDev.DEV" << dev.model;
|
||||
on_refreshBtn_clicked();
|
||||
}
|
37
QtAdb/sonPages/apps/sp_features.h
Normal file
37
QtAdb/sonPages/apps/sp_features.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef SP_FEATURES_H
|
||||
#define SP_FEATURES_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
//#include <QAbstractItemView>
|
||||
#include "../../threads/adbthread.h"
|
||||
|
||||
namespace Ui {
|
||||
class sp_features;
|
||||
}
|
||||
|
||||
class sp_features : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit sp_features(QWidget *parent = nullptr);
|
||||
~sp_features();
|
||||
|
||||
device dev;
|
||||
void setDev(device dev);
|
||||
|
||||
private slots:
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
public slots:
|
||||
void refresh_tableView(QString);
|
||||
|
||||
private:
|
||||
Ui::sp_features *ui;
|
||||
adbThread *thread;
|
||||
textExplainer *explainer;
|
||||
};
|
||||
|
||||
#endif // SP_FEATURES_H
|
223
QtAdb/sonPages/apps/sp_features.ui
Normal file
223
QtAdb/sonPages/apps/sp_features.ui
Normal file
|
@ -0,0 +1,223 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>sp_features</class>
|
||||
<widget class="QWidget" name="sp_features">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>488</width>
|
||||
<height>394</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;
|
||||
image: url(:/ico/image/ico/tools-line.svg);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>系统功能</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="listView">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="back_to_basePage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../ico.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
79
QtAdb/sonPages/apps/sp_libraries.cpp
Normal file
79
QtAdb/sonPages/apps/sp_libraries.cpp
Normal file
|
@ -0,0 +1,79 @@
|
|||
#include "sp_libraries.h"
|
||||
#include "ui_sp_libraries.h"
|
||||
|
||||
sp_libraries::sp_libraries(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::sp_libraries)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setParent(parent);
|
||||
|
||||
ui->progressBar->hide();
|
||||
ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
||||
thread = new adbThread();
|
||||
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);
|
||||
|
||||
shadowEffect_back_to_basePage->setOffset(0,0);
|
||||
shadowEffect_back_to_basePage->setColor(Qt::gray);
|
||||
shadowEffect_back_to_basePage->setBlurRadius(5);
|
||||
|
||||
shadowEffect_refreshBtn->setOffset(0,0);
|
||||
shadowEffect_refreshBtn->setColor(Qt::gray);
|
||||
shadowEffect_refreshBtn->setBlurRadius(5);
|
||||
|
||||
ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
|
||||
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
|
||||
|
||||
}
|
||||
|
||||
sp_libraries::~sp_libraries()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void sp_libraries::on_refreshBtn_clicked()
|
||||
{
|
||||
thread->initThread("adb shell pm list features",dev,"#PERMISSIONGROUPS#");
|
||||
ui->progressBar->setVisible(true);
|
||||
thread->start();
|
||||
}
|
||||
|
||||
void sp_libraries::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++)
|
||||
{
|
||||
QStringList tmpList;
|
||||
tmpList = permissionList[i].split(":");
|
||||
//qDebug() << "permissionList.count() = " << permissionList.count() <<"\nbefore index out of range: \n i = " << i << "\n permissionList[i] = "<< permissionList[i];
|
||||
if(tmpList.count() >= 2)
|
||||
{
|
||||
model->setItem(i,0,new QStandardItem(tmpList[1]));
|
||||
}
|
||||
}
|
||||
ui->listView->setModel(model);
|
||||
this->update();
|
||||
}
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
}
|
||||
|
||||
void sp_libraries::setDev(device device)
|
||||
{
|
||||
dev = device;
|
||||
on_refreshBtn_clicked();
|
||||
}
|
39
QtAdb/sonPages/apps/sp_libraries.h
Normal file
39
QtAdb/sonPages/apps/sp_libraries.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
#ifndef SP_LIBRARIES_H
|
||||
#define SP_LIBRARIES_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
//#include <QAbstractItemView>
|
||||
#include "../../threads/adbthread.h"
|
||||
|
||||
namespace Ui {
|
||||
class sp_libraries;
|
||||
}
|
||||
|
||||
class sp_libraries : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit sp_libraries(QWidget *parent = nullptr);
|
||||
~sp_libraries();
|
||||
|
||||
device dev;
|
||||
void setDev(device dev);
|
||||
|
||||
private slots:
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
public slots:
|
||||
void refresh_tableView(QString);
|
||||
|
||||
|
||||
private:
|
||||
Ui::sp_libraries *ui;
|
||||
adbThread *thread;
|
||||
textExplainer *explainer;
|
||||
|
||||
};
|
||||
|
||||
#endif // SP_LIBRARIES_H
|
223
QtAdb/sonPages/apps/sp_libraries.ui
Normal file
223
QtAdb/sonPages/apps/sp_libraries.ui
Normal file
|
@ -0,0 +1,223 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>sp_libraries</class>
|
||||
<widget class="QWidget" name="sp_libraries">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>556</width>
|
||||
<height>382</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;
|
||||
image: url(:/ico/image/ico/btnEmulator/menu-line.svg);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>库</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="listView">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="back_to_basePage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../ico.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
125
QtAdb/sonPages/apps/sp_packages.cpp
Normal file
125
QtAdb/sonPages/apps/sp_packages.cpp
Normal file
|
@ -0,0 +1,125 @@
|
|||
#include "sp_packages.h"
|
||||
#include "ui_sp_packages.h"
|
||||
|
||||
sp_packages::sp_packages(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::sp_packages)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
pa = parent;
|
||||
|
||||
ui->progressBar->hide();
|
||||
ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
||||
thread = new adbThread();
|
||||
connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage()));
|
||||
|
||||
|
||||
connect(thread,SIGNAL(signal_output(QString)),this,SLOT(refresh_tableView(QString)));
|
||||
connect(ui->checkBox_d,SIGNAL(clicked()),this,SLOT(setArgs()));
|
||||
connect(ui->checkBox_e,SIGNAL(clicked()),this,SLOT(setArgs()));
|
||||
connect(ui->checkBox_s,SIGNAL(clicked()),this,SLOT(setArgs()));
|
||||
connect(ui->checkBox_3,SIGNAL(clicked()),this,SLOT(setArgs()));
|
||||
|
||||
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
|
||||
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = 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);
|
||||
|
||||
ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
|
||||
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
|
||||
|
||||
}
|
||||
|
||||
sp_packages::~sp_packages()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void sp_packages::setDev(device device)
|
||||
{
|
||||
dev = device;
|
||||
on_refreshBtn_clicked();
|
||||
}
|
||||
|
||||
void sp_packages::on_refreshBtn_clicked()
|
||||
{
|
||||
QString cmd = "adb shell pm list packages";
|
||||
//setArgs();
|
||||
thread->initThread(cmd.append(arg) , dev, "#PERMISSIONGROUPS#");
|
||||
ui->progressBar->setVisible(true);
|
||||
thread->start();
|
||||
arg.clear();
|
||||
}
|
||||
|
||||
void sp_packages::refresh_tableView(QString s)
|
||||
{
|
||||
QStandardItemModel* emptyModel = new QStandardItemModel(this);
|
||||
ui->listView->setModel(emptyModel);
|
||||
//thread->exit();
|
||||
//qDebug() << "before";
|
||||
QStringList packagesList = explainer->explainPermissionGroups(s);
|
||||
//qDebug() << "after";
|
||||
QStandardItemModel* model = new QStandardItemModel(this);
|
||||
|
||||
if(!packagesList.isEmpty())
|
||||
{
|
||||
for(int i = 0; i < packagesList.count(); i++)
|
||||
{
|
||||
//qDebug() << "permissionList.count() = " << packagesList.count() <<"\nbefore index out of range: \n i = " << i << "\n permissionList[i] = "<< packagesList[i];
|
||||
QStringList tempList;
|
||||
tempList = packagesList[i].simplified().split(":");
|
||||
|
||||
if(tempList.count() >= 2)
|
||||
{
|
||||
model->setItem(i,0,new QStandardItem(tempList[1]));
|
||||
}
|
||||
}
|
||||
ui->listView->setStyleSheet("QListView::item{height:24px;}");
|
||||
ui->listView->setModel(model);
|
||||
this->update();
|
||||
}
|
||||
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
}
|
||||
|
||||
void sp_packages::on_listView_clicked(const QModelIndex &index)
|
||||
{
|
||||
QString name = ui->listView->model()->data(index).toString();
|
||||
tp_packageProfile * profilePage = new tp_packageProfile(NULL,name);
|
||||
profilePage->setDevice(dev);
|
||||
connect(profilePage,SIGNAL(packageChanged()),this,SLOT(on_refreshBtn_clicked()));
|
||||
profilePage->show();
|
||||
}
|
||||
|
||||
void sp_packages::setArgs()
|
||||
{
|
||||
if(ui->checkBox_e->isChecked())
|
||||
{
|
||||
arg.append(" -e");
|
||||
}
|
||||
|
||||
if(ui->checkBox_d->isChecked())
|
||||
{
|
||||
arg.append(" -d");
|
||||
}
|
||||
|
||||
if(ui->checkBox_s->isChecked())
|
||||
{
|
||||
arg.append(" -s");
|
||||
}
|
||||
|
||||
if(ui->checkBox_3->isChecked())
|
||||
{
|
||||
arg.append(" -3");
|
||||
}
|
||||
on_refreshBtn_clicked();
|
||||
}
|
53
QtAdb/sonPages/apps/sp_packages.h
Normal file
53
QtAdb/sonPages/apps/sp_packages.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
#ifndef SP_PACKAGES_H
|
||||
#define SP_PACKAGES_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QWidget>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QStandardItemModel>
|
||||
#include "adbprocess.h"
|
||||
#include <QFileDialog>
|
||||
#include "../../threads/adbthread.h"
|
||||
#include "tp_packageprofile.h"
|
||||
/*
|
||||
struct package
|
||||
{
|
||||
QString package_name;
|
||||
};*/
|
||||
|
||||
namespace Ui {
|
||||
class sp_packages;
|
||||
}
|
||||
|
||||
class sp_packages : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit sp_packages(QWidget *parent = nullptr);
|
||||
~sp_packages();
|
||||
|
||||
device dev;
|
||||
void setDev(device dev);
|
||||
|
||||
QWidget *pa;
|
||||
|
||||
QString current_package = "";
|
||||
|
||||
private slots:
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
void on_listView_clicked(const QModelIndex &index);
|
||||
void setArgs();
|
||||
|
||||
public slots:
|
||||
void refresh_tableView(QString);
|
||||
|
||||
private:
|
||||
Ui::sp_packages *ui;
|
||||
adbThread *thread;
|
||||
textExplainer *explainer;
|
||||
|
||||
QString arg = "";
|
||||
};
|
||||
#endif // SP_PACKAGES_H
|
254
QtAdb/sonPages/apps/sp_packages.ui
Normal file
254
QtAdb/sonPages/apps/sp_packages.ui
Normal file
|
@ -0,0 +1,254 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>sp_packages</class>
|
||||
<widget class="QWidget" name="sp_packages">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>592</width>
|
||||
<height>557</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;
|
||||
image: url(:/ico/image/ico/android-line.svg);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>应用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="listView">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_d">
|
||||
<property name="text">
|
||||
<string>仅显示已停用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_e">
|
||||
<property name="text">
|
||||
<string>仅显示已启用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>第三方</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_s">
|
||||
<property name="text">
|
||||
<string>系统</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="back_to_basePage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../ico.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
73
QtAdb/sonPages/apps/sp_permissiongroups.cpp
Normal file
73
QtAdb/sonPages/apps/sp_permissiongroups.cpp
Normal file
|
@ -0,0 +1,73 @@
|
|||
#include "sp_permissiongroups.h"
|
||||
#include "ui_sp_permissiongroups.h"
|
||||
|
||||
sp_permissionGroups::sp_permissionGroups(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::sp_permissionGroups)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setParent(parent);
|
||||
|
||||
ui->progressBar->hide();
|
||||
ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
||||
thread = new adbThread();
|
||||
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);
|
||||
|
||||
shadowEffect_back_to_basePage->setOffset(0,0);
|
||||
shadowEffect_back_to_basePage->setColor(Qt::gray);
|
||||
shadowEffect_back_to_basePage->setBlurRadius(5);
|
||||
|
||||
shadowEffect_refreshBtn->setOffset(0,0);
|
||||
shadowEffect_refreshBtn->setColor(Qt::gray);
|
||||
shadowEffect_refreshBtn->setBlurRadius(5);
|
||||
|
||||
ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
|
||||
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
|
||||
}
|
||||
|
||||
sp_permissionGroups::~sp_permissionGroups()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void sp_permissionGroups::on_refreshBtn_clicked()
|
||||
{
|
||||
thread->initThread("adb shell pm list permission-groups",dev,"#PERMISSIONGROUPS#");
|
||||
ui->progressBar->setVisible(true);
|
||||
thread->start();
|
||||
}
|
||||
|
||||
void sp_permissionGroups::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];
|
||||
model->setItem(i,0,new QStandardItem(permissionList[i]));
|
||||
}
|
||||
ui->listView->setModel(model);
|
||||
this->update();
|
||||
}
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
}
|
||||
|
||||
void sp_permissionGroups::setDev(device device)
|
||||
{
|
||||
dev = device;
|
||||
on_refreshBtn_clicked();
|
||||
}
|
37
QtAdb/sonPages/apps/sp_permissiongroups.h
Normal file
37
QtAdb/sonPages/apps/sp_permissiongroups.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef SP_PERMISSIONGROUPS_H
|
||||
#define SP_PERMISSIONGROUPS_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
//#include <QAbstractItemView>
|
||||
#include "../../threads/adbthread.h"
|
||||
|
||||
namespace Ui {
|
||||
class sp_permissionGroups;
|
||||
}
|
||||
|
||||
class sp_permissionGroups : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit sp_permissionGroups(QWidget *parent = nullptr);
|
||||
~sp_permissionGroups();
|
||||
|
||||
device dev;
|
||||
void setDev(device dev);
|
||||
|
||||
private slots:
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
public slots:
|
||||
void refresh_tableView(QString);
|
||||
|
||||
private:
|
||||
Ui::sp_permissionGroups *ui;
|
||||
adbThread *thread;
|
||||
textExplainer *explainer;
|
||||
};
|
||||
|
||||
#endif // SP_PERMISSIONGROUPS_H
|
225
QtAdb/sonPages/apps/sp_permissiongroups.ui
Normal file
225
QtAdb/sonPages/apps/sp_permissiongroups.ui
Normal file
|
@ -0,0 +1,225 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>sp_permissionGroups</class>
|
||||
<widget class="QWidget" name="sp_permissionGroups">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>635</width>
|
||||
<height>534</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;
|
||||
image: url(:/ico/image/ico/about/information-line.svg);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>已知权限组</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="listView">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="back_to_basePage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../ico.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
381
QtAdb/sonPages/apps/sp_permissions.cpp
Normal file
381
QtAdb/sonPages/apps/sp_permissions.cpp
Normal file
|
@ -0,0 +1,381 @@
|
|||
#include "sp_permissions.h"
|
||||
#include "ui_sp_permissions.h"
|
||||
|
||||
sp_permissions::sp_permissions(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::sp_permissions)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
pa = parent;
|
||||
|
||||
ui->progressBar->hide();
|
||||
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
||||
thread = new adbThread();
|
||||
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_settingsBtn = new QGraphicsDropShadowEffect(this);
|
||||
QGraphicsDropShadowEffect *shadowEffect_openBtn = 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_settingsBtn->setOffset(0,0);
|
||||
shadowEffect_settingsBtn->setColor(Qt::green);
|
||||
shadowEffect_settingsBtn->setBlurRadius(5);
|
||||
|
||||
shadowEffect_openBtn->setOffset(0,0);
|
||||
shadowEffect_openBtn->setColor(Qt::gray);
|
||||
shadowEffect_openBtn->setBlurRadius(5);
|
||||
|
||||
|
||||
ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
|
||||
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
|
||||
ui->back_to_basePage_2->setGraphicsEffect(shadowEffect_settingsBtn);
|
||||
ui->open_another_window->setGraphicsEffect(shadowEffect_openBtn);
|
||||
|
||||
}
|
||||
|
||||
sp_permissions::~sp_permissions()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void sp_permissions::on_back_to_basePage_2_clicked()
|
||||
{
|
||||
arg = "";
|
||||
arg_g = false;
|
||||
arg_f = false;
|
||||
arg_s = false;
|
||||
arg_d = false;
|
||||
arg_u = false;
|
||||
settings = new QDialog();
|
||||
group = new QButtonGroup(settings);
|
||||
|
||||
btn_g = new QRadioButton();
|
||||
btn_f = new QRadioButton();
|
||||
btn_s = new QRadioButton();
|
||||
btn_d = new QRadioButton();
|
||||
btn_u = new QRadioButton();
|
||||
closeBtn = new QPushButton();
|
||||
|
||||
btn_g->setText("【高级】按组进行整理");
|
||||
btn_f->setText("【高级】输出所有信息");
|
||||
btn_s->setText("简短摘要(推荐)");
|
||||
btn_d->setText("仅列出危险权限");
|
||||
btn_u->setText("仅列出用户将看到的权限");
|
||||
closeBtn->setText("确定");
|
||||
|
||||
btn_g->autoExclusive();
|
||||
btn_f->autoExclusive();
|
||||
btn_s->autoExclusive();
|
||||
btn_d->autoExclusive();
|
||||
btn_u->autoExclusive();
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout();
|
||||
|
||||
settings->setLayout(layout);
|
||||
group->addButton(btn_g);
|
||||
group->addButton(btn_f);
|
||||
group->addButton(btn_s);
|
||||
group->addButton(btn_d);
|
||||
group->addButton(btn_u);
|
||||
layout->addWidget(btn_g);
|
||||
layout->addWidget(btn_f);
|
||||
layout->addWidget(btn_s);
|
||||
layout->addWidget(btn_d);
|
||||
layout->addWidget(btn_u);
|
||||
layout->addWidget(closeBtn);
|
||||
settings->setStyleSheet("background-color:white;border:0px solid white;border-radius:4px;");
|
||||
|
||||
connect(btn_g, SIGNAL(clicked()), this,SLOT(setArg()));
|
||||
connect(btn_f, SIGNAL(clicked()), this,SLOT(setArg()));
|
||||
connect(btn_s, SIGNAL(clicked()), this,SLOT(setArg()));
|
||||
connect(btn_d, SIGNAL(clicked()), this,SLOT(setArg()));
|
||||
connect(btn_u, SIGNAL(clicked()), this,SLOT(setArg()));
|
||||
|
||||
connect(closeBtn, SIGNAL(clicked()), this,SLOT(setArg()));
|
||||
connect(closeBtn, SIGNAL(clicked()), settings,SLOT(close()));
|
||||
connect(closeBtn, SIGNAL(clicked()), this,SLOT(on_refreshBtn_clicked()));
|
||||
|
||||
settings->setWindowTitle("选项");
|
||||
settings->move(ui->back_to_basePage_2->geometry().x(),ui->back_to_basePage_2->geometry().y());
|
||||
settings->exec();
|
||||
}
|
||||
|
||||
void sp_permissions::setArg()
|
||||
{
|
||||
//qDebug() << "\narg_g = " << arg_g << "arg_f = " << arg_f << "arg_s = " << arg_s << "arg_d = " << arg_d << "arg_u = " << arg_u;
|
||||
if(btn_g->isChecked())
|
||||
{
|
||||
//qDebug() << "g";
|
||||
arg = "-g";
|
||||
arg_g = true;
|
||||
arg_f = false;
|
||||
arg_s = false;
|
||||
arg_d = false;
|
||||
arg_u = false;
|
||||
}
|
||||
else if(btn_f->isChecked())
|
||||
{
|
||||
//qDebug() << "f";
|
||||
arg = "-f";
|
||||
arg_g = false;
|
||||
arg_f = true;
|
||||
arg_s = false;
|
||||
arg_d = false;
|
||||
arg_u = false;
|
||||
}
|
||||
else if(btn_s->isChecked())
|
||||
{
|
||||
//qDebug() << "s";
|
||||
arg = "-s";
|
||||
arg_g = false;
|
||||
arg_f = false;
|
||||
arg_s = true;
|
||||
arg_d = false;
|
||||
arg_u = false;
|
||||
}
|
||||
else if(btn_d->isChecked())
|
||||
{
|
||||
//qDebug() << "d";
|
||||
arg = "-d";
|
||||
arg_g = false;
|
||||
arg_f = false;
|
||||
arg_s = false;
|
||||
arg_d = true;
|
||||
arg_u = false;
|
||||
}
|
||||
else if(btn_u->isChecked())
|
||||
{
|
||||
//qDebug() << "u";
|
||||
arg = "-u";
|
||||
arg_g = false;
|
||||
arg_f = false;
|
||||
arg_s = false;
|
||||
arg_d = false;
|
||||
arg_u = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//qDebug() << "g";
|
||||
arg = "";
|
||||
arg_g = false;
|
||||
arg_f = false;
|
||||
arg_s = false;
|
||||
arg_d = false;
|
||||
arg_u = false;
|
||||
}
|
||||
|
||||
//qDebug() << "clicked,arg = " << arg;
|
||||
}
|
||||
|
||||
void sp_permissions::setDev(device device)
|
||||
{
|
||||
dev = device;
|
||||
on_refreshBtn_clicked();
|
||||
}
|
||||
|
||||
void sp_permissions::on_refreshBtn_clicked()
|
||||
{
|
||||
QString cmd = "adb shell pm list permissions";
|
||||
thread->initThread(cmd.append(" ").append(arg) , dev, "#PERMISSIONGROUPS#");
|
||||
ui->progressBar->setVisible(true);
|
||||
thread->start();
|
||||
}
|
||||
|
||||
void sp_permissions::refresh_tableView(QString s)
|
||||
{
|
||||
if(arg_g)
|
||||
{
|
||||
//arg = "-g";
|
||||
//qDebug() << "**************#01# formating data*****************";
|
||||
//qDebug() << "arg = " << arg;
|
||||
//qDebug() << "###################### s = \n" << s;
|
||||
QStandardItemModel* emptyModel = new QStandardItemModel(this);
|
||||
ui->tableView->setModel(emptyModel);
|
||||
QStringList groupList = s.split("group:");
|
||||
//qDebug() << "###################### groupList = \n" << groupList;
|
||||
QList<QStringList> groups;
|
||||
|
||||
|
||||
|
||||
//qDebug() << "###################### split####################";
|
||||
for(int i = 0 , j = i; i < groupList.count(); i++)
|
||||
{
|
||||
QStringList tmpList;
|
||||
tmpList = groupList[i].split("\n");
|
||||
groups.append(tmpList);
|
||||
j++;
|
||||
}
|
||||
|
||||
//qDebug() << "###################### groups = \n" << groups;
|
||||
|
||||
//qDebug() << "**************#02# adding title*****************";
|
||||
QStandardItemModel* model = new QStandardItemModel(this);
|
||||
|
||||
if(!groupList.isEmpty())
|
||||
{
|
||||
for(int i = 1; i < groups.count();i++)
|
||||
{
|
||||
//qDebug() << "**************header data***************** =" << groups[i][0];
|
||||
model->setColumnCount(groups.count());
|
||||
model->setHeaderData(i-1,Qt::Horizontal, groups[i][0]);
|
||||
|
||||
for(int j = 1; j< groups[i].count();j++)
|
||||
{
|
||||
model->setItem(j-1,i-1,new QStandardItem(groups[i][j].simplified().simplified()));
|
||||
}
|
||||
}
|
||||
|
||||
ui->tableView->horizontalHeader()->setDefaultSectionSize(150);
|
||||
ui->tableView->setModel(model);
|
||||
current_model = model;
|
||||
|
||||
this->update();
|
||||
}
|
||||
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
}
|
||||
else if(arg_f)
|
||||
{
|
||||
//arg = "-g";
|
||||
//qDebug() << "**************#01# formating data*****************";
|
||||
//qDebug() << "arg = " << arg;
|
||||
//qDebug() << "###################### s = \n" << s;
|
||||
QStandardItemModel* emptyModel = new QStandardItemModel(this);
|
||||
ui->tableView->setModel(emptyModel);
|
||||
QStringList groupList = s.split("+");
|
||||
//qDebug() << "###################### groupList = \n" << groupList;
|
||||
QList<QStringList> groups;
|
||||
|
||||
|
||||
|
||||
//qDebug() << "###################### split####################";
|
||||
for(int i = 0 , j = i; i < groupList.count(); i++)
|
||||
{
|
||||
QStringList tmpList;
|
||||
tmpList = groupList[i].split("\n");
|
||||
groups.append(tmpList);
|
||||
j++;
|
||||
}
|
||||
|
||||
//qDebug() << "###################### groups = \n" << groups;
|
||||
|
||||
//qDebug() << "**************#02# adding title*****************";
|
||||
QStandardItemModel* model = new QStandardItemModel(this);
|
||||
|
||||
if(!groupList.isEmpty())
|
||||
{
|
||||
model->setColumnCount(5);
|
||||
model->setHeaderData(0,Qt::Horizontal, "permission");
|
||||
model->setHeaderData(1,Qt::Horizontal, "package");
|
||||
model->setHeaderData(2,Qt::Horizontal, "label");
|
||||
model->setHeaderData(3,Qt::Horizontal, "description");
|
||||
model->setHeaderData(4,Qt::Horizontal, "protectionLevel");
|
||||
|
||||
for(int i = 1; i < groups.count();i++)
|
||||
{
|
||||
//qDebug() << "**************header data***************** =" << groups[i][0];
|
||||
|
||||
for(int j = 0; j< groups[i].count() && j <= 5;j++)
|
||||
{
|
||||
QStringList tempList;
|
||||
tempList = groups[i][j].simplified().simplified().split(":");
|
||||
//qDebug() << "********************" << tempList << tempList.count();;
|
||||
|
||||
if(tempList.count() >= 2)
|
||||
{
|
||||
//qDebug() << "来做死";
|
||||
model->setItem(i-1,j,new QStandardItem(tempList[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ui->tableView->horizontalHeader()->setDefaultSectionSize(150);
|
||||
ui->tableView->setModel(model);
|
||||
current_model = model;
|
||||
|
||||
this->update();
|
||||
}
|
||||
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
//arg = "-f";
|
||||
}
|
||||
else if(arg_s)
|
||||
{
|
||||
//arg = "-s";
|
||||
generalMode(s);
|
||||
}
|
||||
else if(arg_d)
|
||||
{
|
||||
generalMode(s);
|
||||
}
|
||||
else if(arg_u)
|
||||
{
|
||||
//arg = "-u";
|
||||
generalMode(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
//arg = "";
|
||||
generalMode(s);
|
||||
}
|
||||
}
|
||||
|
||||
void sp_permissions::on_open_another_window_clicked()
|
||||
{
|
||||
QWidget *wgt = new QWidget();
|
||||
QVBoxLayout *layout = new QVBoxLayout();
|
||||
QTableView *view = new QTableView();
|
||||
view->setModel(current_model);
|
||||
wgt->setLayout(layout);
|
||||
layout->addWidget(view);
|
||||
wgt ->showMaximized();
|
||||
}
|
||||
|
||||
void sp_permissions::generalMode(QString s)
|
||||
{
|
||||
QStandardItemModel* emptyModel = new QStandardItemModel(this);
|
||||
ui->tableView->setModel(emptyModel);
|
||||
QStringList permissionList = s.split("\n");
|
||||
QStandardItemModel* model = new QStandardItemModel(this);
|
||||
|
||||
if(!permissionList.isEmpty())
|
||||
{
|
||||
model->setHeaderData(0,Qt::Horizontal, permissionList[0]);
|
||||
for(int i = 2,j = i; i < permissionList.count();i++)
|
||||
{
|
||||
//qDebug() << "IT IS:" << permissionList[i];
|
||||
if(permissionList[i] == "" || permissionList[i] == "\r")
|
||||
{
|
||||
//qDebug() << "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
//qDebug() << "2";
|
||||
model->setItem(j-2,0,new QStandardItem(permissionList[i].simplified().simplified()));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
ui->tableView->horizontalHeader()->setDefaultSectionSize(pa->geometry().width() - 200);
|
||||
ui->tableView->setModel(model);
|
||||
current_model = model;
|
||||
this->update();
|
||||
}
|
||||
|
||||
ui->progressBar->setVisible(false);
|
||||
delete emptyModel;
|
||||
}
|
66
QtAdb/sonPages/apps/sp_permissions.h
Normal file
66
QtAdb/sonPages/apps/sp_permissions.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
#ifndef SP_PERMISSIONS_H
|
||||
#define SP_PERMISSIONS_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QButtonGroup>
|
||||
#include <QRadioButton>
|
||||
#include <QPushButton>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QStandardItemModel>
|
||||
#include "../../textexplainer.h"
|
||||
#include "../../threads/adbthread.h"
|
||||
|
||||
namespace Ui {
|
||||
class sp_permissions;
|
||||
}
|
||||
|
||||
class sp_permissions : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit sp_permissions(QWidget *parent = nullptr);
|
||||
~sp_permissions();
|
||||
|
||||
device dev;
|
||||
void setDev(device dev);
|
||||
QWidget *pa;
|
||||
|
||||
private slots:
|
||||
void on_back_to_basePage_2_clicked();
|
||||
void setArg();
|
||||
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
void on_open_another_window_clicked();
|
||||
|
||||
public slots:
|
||||
void refresh_tableView(QString);
|
||||
|
||||
private:
|
||||
Ui::sp_permissions *ui;
|
||||
QString arg = "";
|
||||
|
||||
QStandardItemModel* current_model;
|
||||
adbThread *thread;
|
||||
textExplainer *explainer;
|
||||
|
||||
bool arg_g = false;
|
||||
bool arg_f = false;
|
||||
bool arg_s = false;
|
||||
bool arg_d = false;
|
||||
bool arg_u = false;
|
||||
|
||||
QDialog *settings;
|
||||
QButtonGroup *group;
|
||||
QRadioButton *btn_g;
|
||||
QRadioButton *btn_f;
|
||||
QRadioButton *btn_s;
|
||||
QRadioButton *btn_d;
|
||||
QRadioButton *btn_u;
|
||||
QPushButton *closeBtn;
|
||||
|
||||
void generalMode(QString s);
|
||||
};
|
||||
|
||||
#endif // SP_PERMISSIONS_H
|
291
QtAdb/sonPages/apps/sp_permissions.ui
Normal file
291
QtAdb/sonPages/apps/sp_permissions.ui
Normal file
|
@ -0,0 +1,291 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>sp_permissions</class>
|
||||
<widget class="QWidget" name="sp_permissions">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>648</width>
|
||||
<height>534</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;
|
||||
image: url(:/ico/image/ico/about/information-line.svg);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
<pointsize>18</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-radius: 4px;
|
||||
border:0px solid #BDBDBD;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>权限</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="open_another_window">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/share-box-line.svg</normaloff>:/ico/image/ico/share-box-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="back_to_basePage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="back_to_basePage_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">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);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../ico.qrc">
|
||||
<normaloff>:/ico/image/ico/btnEmulator/settings-line.svg</normaloff>:/ico/image/ico/btnEmulator/settings-line.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../ico.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
94
QtAdb/sonPages/apps/tp_packageprofile.cpp
Normal file
94
QtAdb/sonPages/apps/tp_packageprofile.cpp
Normal file
|
@ -0,0 +1,94 @@
|
|||
#include "tp_packageprofile.h"
|
||||
#include "ui_tp_packageprofile.h"
|
||||
|
||||
tp_packageProfile::tp_packageProfile(QWidget *parent ,QString packageName) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::tp_packageProfile)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
this->setWindowTitle("软件包 ' "+packageName+" '");
|
||||
name = packageName;
|
||||
explainer = new textExplainer();
|
||||
process = new adbProcess();
|
||||
|
||||
thread_file = new adbThread();
|
||||
|
||||
|
||||
thread_installer = new adbThread();
|
||||
|
||||
ui->lineEdit_name->setText(name);
|
||||
ui->lineEdit_name->isReadOnly();
|
||||
ui->lineEdit_installer->isReadOnly();
|
||||
ui->lineEdit_path->isReadOnly();
|
||||
}
|
||||
|
||||
tp_packageProfile::~tp_packageProfile()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void tp_packageProfile::set_file(QString s)
|
||||
{
|
||||
ui->lineEdit_path->setText(explainer->get_words_after(s,"package:"));
|
||||
}
|
||||
|
||||
void tp_packageProfile::set_installer(QString s)
|
||||
{
|
||||
ui->lineEdit_installer->setText(explainer->get_words_after(s,"installer="));
|
||||
}
|
||||
|
||||
void tp_packageProfile::on_uninstall_clicked()
|
||||
{
|
||||
QString cmd = "adb shell pm uninstall ";
|
||||
cmd.append(name);
|
||||
process->run(cmd,dev);
|
||||
|
||||
emit packageChanged();
|
||||
this->close();
|
||||
}
|
||||
|
||||
|
||||
void tp_packageProfile::on_clear_clicked()
|
||||
{
|
||||
QString cmd = "adb shell pm clear ";
|
||||
cmd.append(name);
|
||||
process->run(cmd,dev);
|
||||
}
|
||||
|
||||
|
||||
void tp_packageProfile::on_enable_clicked()
|
||||
{
|
||||
QString cmd = "adb shell pm enable ";
|
||||
cmd.append(name);
|
||||
process->run(cmd,dev);
|
||||
|
||||
emit packageChanged();
|
||||
}
|
||||
|
||||
|
||||
void tp_packageProfile::on_disable_clicked()
|
||||
{
|
||||
QString cmd = "adb shell pm disable ";
|
||||
cmd.append(name);
|
||||
process->run(cmd,dev);
|
||||
|
||||
emit packageChanged();
|
||||
}
|
||||
|
||||
void tp_packageProfile::setDevice(device d)
|
||||
{
|
||||
dev = d;
|
||||
|
||||
QString command_file = "adb shell pm list packages -f ";
|
||||
command_file.append(name);
|
||||
thread_file->initThread(command_file , dev);
|
||||
connect(thread_file,SIGNAL(signal_output(QString)),this,SLOT(set_file(QString)));
|
||||
thread_file->start();
|
||||
|
||||
QString command_installer = "adb shell pm list packages -i ";
|
||||
command_installer.append(name);
|
||||
thread_installer->initThread(command_installer , dev);
|
||||
connect(thread_installer,SIGNAL(signal_output(QString)),this,SLOT(set_installer(QString)));
|
||||
thread_installer->start();
|
||||
}
|
49
QtAdb/sonPages/apps/tp_packageprofile.h
Normal file
49
QtAdb/sonPages/apps/tp_packageprofile.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
#ifndef TP_PACKAGEPROFILE_H
|
||||
#define TP_PACKAGEPROFILE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "../../textexplainer.h"
|
||||
#include "../../adbprocess.h"
|
||||
#include "../../threads/adbthread.h"
|
||||
|
||||
namespace Ui {
|
||||
class tp_packageProfile;
|
||||
}
|
||||
|
||||
class tp_packageProfile : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit tp_packageProfile(QWidget *parent = nullptr, QString packageName = "");
|
||||
~tp_packageProfile();
|
||||
|
||||
QString name = "";
|
||||
device dev;
|
||||
void setDevice(device d);
|
||||
|
||||
private:
|
||||
Ui::tp_packageProfile *ui;
|
||||
|
||||
adbThread * thread_file;
|
||||
adbThread * thread_installer;
|
||||
adbThread * thread_btn;
|
||||
adbProcess * process;
|
||||
textExplainer *explainer;
|
||||
signals:
|
||||
void packageChanged();
|
||||
/*
|
||||
void lock();
|
||||
void unlock();*/
|
||||
public slots:
|
||||
void set_file(QString);
|
||||
void set_installer(QString);
|
||||
|
||||
private slots:
|
||||
void on_uninstall_clicked();
|
||||
void on_clear_clicked();
|
||||
void on_enable_clicked();
|
||||
void on_disable_clicked();
|
||||
};
|
||||
|
||||
#endif // TP_PACKAGEPROFILE_H
|
182
QtAdb/sonPages/apps/tp_packageprofile.ui
Normal file
182
QtAdb/sonPages/apps/tp_packageprofile.ui
Normal file
|
@ -0,0 +1,182 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>tp_packageProfile</class>
|
||||
<widget class="QWidget" name="tp_packageProfile">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>767</width>
|
||||
<height>206</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>包名</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>关联文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>安装者</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_name">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_path">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_installer">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="uninstall">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>卸载</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="clear">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>清除所有数据</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QPushButton" name="enable">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>启用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="disable">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MiSans Medium</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>停用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -201,7 +201,7 @@ sp_activator* sonPageManager::createSonPageFor_activator(QWidget *parent, int ke
|
|||
return NULL;
|
||||
}
|
||||
|
||||
sp_installer* sonPageManager::createSonPageFor_apps(QWidget *parent, int key, device dev)
|
||||
QWidget* sonPageManager::createSonPageFor_apps(QWidget *parent, int key, device dev)
|
||||
{
|
||||
switch(key +1)
|
||||
{
|
||||
|
@ -210,6 +210,37 @@ sp_installer* sonPageManager::createSonPageFor_apps(QWidget *parent, int key, de
|
|||
sp_installer *page = new sp_installer(parent);
|
||||
page->setDev(dev);
|
||||
return page;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
sp_permissionGroups *page = new sp_permissionGroups(parent);
|
||||
page->setDev(dev);
|
||||
return page;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
sp_permissions *page = new sp_permissions(parent);
|
||||
page->setDev(dev);
|
||||
return page;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
sp_packages *page = new sp_packages(parent);
|
||||
page->setDev(dev);
|
||||
return page;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
qDebug() << "SPM.DEV = " << dev.model;
|
||||
sp_features *page = new sp_features(parent);
|
||||
page->setDev(dev);
|
||||
return page;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
sp_libraries *page = new sp_libraries(parent);
|
||||
page->setDev(dev);
|
||||
return page;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
#include "devInfo/sp_dpichanger.h"
|
||||
#include "activator/sp_activator.h"
|
||||
#include "apps/sp_installer.h"
|
||||
#include "apps/sp_permissiongroups.h"
|
||||
#include "apps/sp_permissions.h"
|
||||
#include "apps/sp_packages.h"
|
||||
#include "apps/sp_features.h"
|
||||
#include "apps/sp_libraries.h"
|
||||
#include "devControl/sp_devcontrol_power.h"
|
||||
#include "devControl/btnemulator.h"
|
||||
#include "recovery/sp_recovery.h"
|
||||
|
@ -29,7 +34,7 @@ private:
|
|||
|
||||
sp_dpiChanger* createSonPageFor_devInfo(QWidget *parent, int key, device dev);
|
||||
sp_activator* createSonPageFor_activator(QWidget *parent, int key, device dev);
|
||||
sp_installer* createSonPageFor_apps(QWidget *parent, int key, device dev);
|
||||
QWidget* createSonPageFor_apps(QWidget *parent, int key, device dev);
|
||||
QWidget* createSonPageFor_devControl(QWidget *parent, int key, device dev);
|
||||
QWidget* createSonPageFor_recovery(QWidget *parent, int key, device dev);
|
||||
QWidget* createSonPageFor_advanced(QWidget *parent, int key, device dev);
|
||||
|
|
|
@ -72,7 +72,8 @@ QList<device> textExplainer::getDevList_windows(QString tmpStr)
|
|||
{
|
||||
tmpList[i] = tmpList[i].simplified();
|
||||
|
||||
if (tmpList[i] == "")
|
||||
//qDebug() << "tmplist[" << i << "] =" << tmpList[i];
|
||||
if (tmpList[i] == "" || tmpList[i] == "\r")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -83,13 +84,26 @@ QList<device> textExplainer::getDevList_windows(QString tmpStr)
|
|||
|
||||
dev.addr = tmp[0];
|
||||
dev.state = setState(tmp[1]);
|
||||
//qDebug() << dev.state;
|
||||
//qDebug() << "*tmplist[" << i << "] =" << tmpList[i];
|
||||
if(dev.state == "[未响应]")
|
||||
{
|
||||
dev.transport_id = tmp[2];
|
||||
devList.append(dev);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
dev.device_product = tmp[2];
|
||||
dev.model = tmp[3];
|
||||
dev.device_debug = tmp[4];
|
||||
dev.transport_id = tmp[5];
|
||||
devList.append(dev);
|
||||
}
|
||||
//qDebug() << "**tmplist[" << i << "] =" << tmpList[i];
|
||||
}
|
||||
return devList;
|
||||
//qDebug() << "get dev list success!";
|
||||
}
|
||||
|
||||
QString textExplainer::get_words_after(QString str , QString key)
|
||||
|
@ -261,3 +275,17 @@ void textExplainer::slot_explain_cpu_output(QString s)
|
|||
emit textExplained(str);
|
||||
}
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -31,14 +31,18 @@ public:
|
|||
|
||||
bool explainError(QString err);
|
||||
bool explainOutput(QString op, bool thread);
|
||||
|
||||
QMessageBox *msgBox;
|
||||
bool thread = false;
|
||||
|
||||
QStringList explainPermissionGroups(QString s);
|
||||
|
||||
private:
|
||||
QString setState(QString state);
|
||||
|
||||
signals:
|
||||
void textExplained(QString);
|
||||
void permissionGroupsExplained(QStringList);
|
||||
|
||||
public slots:
|
||||
void slot_get_words_after(QString s, QString k);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
adbThread::adbThread(QObject* parent)
|
||||
{
|
||||
|
||||
setParent(parent);
|
||||
}
|
||||
|
||||
void adbThread::initThread(QString cmd, device d)
|
||||
|
@ -14,8 +14,10 @@ void adbThread::initThread(QString cmd, device d)
|
|||
|
||||
void adbThread::initThread(QString cmd, device d, QString key)
|
||||
{
|
||||
qDebug() << "d = " << d.model <<cmd << key;
|
||||
command = cmd;
|
||||
dev = d;
|
||||
qDebug() << "dev = " << dev.model;
|
||||
explain = true;
|
||||
explainKey = key;
|
||||
}
|
||||
|
@ -41,6 +43,14 @@ void adbThread::run()
|
|||
exit();
|
||||
}
|
||||
|
||||
else if(explainKey == "#PERMISSIONGROUPS#")
|
||||
{
|
||||
//qDebug() << "dev = " << &dev;
|
||||
QString output = process->run(command, dev);
|
||||
emit signal_output(output);
|
||||
exit();
|
||||
}
|
||||
|
||||
else if(explainKey == "#INSTALL#")
|
||||
{
|
||||
connect(process,SIGNAL(outputGet(QString)),this,SLOT(result(QString)));
|
||||
|
|
13
README.md
13
README.md
|
@ -52,10 +52,21 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌
|
|||
- 媒体控制:播放音乐、停止播放、上一曲、继续、暂停、下一曲
|
||||
- 其他指令:亮度 - 、亮度 + 、系统休眠、点亮屏幕、挂断电话
|
||||
- 拉起系统应用:设置、通讯录、拨号、浏览器、音乐、日历、计算器
|
||||
|
||||
- 命令行:
|
||||
- 运行自定义的 adb 命令
|
||||
- 直接在 adb 环境中打开命令行窗口
|
||||
|
||||
### 📦软件包管理器:
|
||||
|
||||
- 安装应用
|
||||
- 列出已知的权限、权限组
|
||||
- 列出软件包
|
||||
- 卸载、停用、启用、清除数据
|
||||
- 获取软件包包名、安装者、关联文件等信息
|
||||
|
||||
- 列出系统的所有功能
|
||||
- 列出当前设备支持的所有库
|
||||
|
||||
### 💣不稳定功能
|
||||
|
||||
|
@ -67,7 +78,7 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌
|
|||
|
||||
> *由于个人学业紧迫(**确实**考不上研了),饼中的内容添加将十分缓慢,可能在过年后,甚至再多一年后才能开始全力开发,请见谅!*
|
||||
|
||||
- 完整的软件包管理器
|
||||
- ~~完整的软件包管理器~~
|
||||
- 跨平台
|
||||
- 完善网站
|
||||
- 文件管理(~~都连上电脑了,为什么不直接用电脑的文件管理~~)
|
||||
|
|
Loading…
Reference in New Issue
Block a user