update
This commit is contained in:
104
index.html
104
index.html
@@ -18,8 +18,8 @@
|
||||
</select>
|
||||
<input id="btn" name="btn" type="button" value="执行" class="layui-btn layui-btn-normal" />
|
||||
|
||||
<button type="button" class="layui-btn" id="upload">
|
||||
<i class="layui-icon"></i>上传APK
|
||||
<button type="button" class="layui-btn" id="setSignFile">
|
||||
<i class="layui-icon"></i>设置签名
|
||||
</button>
|
||||
<input id="flush" name="flush" type="button" value="刷新设备列表" class="layui-btn" />
|
||||
<input id="showPack" name="showPack" type="button" value="已安装列表" class="layui-btn" />
|
||||
@@ -36,6 +36,28 @@
|
||||
|
||||
</body>
|
||||
<script>
|
||||
function showWindows() {
|
||||
utools.showMainWindow()
|
||||
}
|
||||
function uploadSign(alias, aliasPassword, password, sign) {
|
||||
utools.db.put({
|
||||
_id: "alias",
|
||||
data: alias
|
||||
})
|
||||
utools.db.put({
|
||||
_id: "aliasPassword",
|
||||
data: aliasPassword
|
||||
})
|
||||
utools.db.put({
|
||||
_id: "password",
|
||||
data: password
|
||||
})
|
||||
utools.db.put({
|
||||
_id: "sign",
|
||||
data: sign
|
||||
})
|
||||
|
||||
}
|
||||
function log(data) {
|
||||
console.log("日志输出:" + data)
|
||||
$('#log').val($('#log').val() + "\n" + data)
|
||||
@@ -84,6 +106,9 @@
|
||||
$('#flush').click(function () {
|
||||
reload()
|
||||
})
|
||||
$('#setSignFile').click(function () {
|
||||
setSign()
|
||||
})
|
||||
|
||||
reload()
|
||||
utools.onPluginEnter(({
|
||||
@@ -91,22 +116,64 @@
|
||||
type,
|
||||
payload
|
||||
}) => {
|
||||
if (type == 'files') {
|
||||
console.log(code)
|
||||
if (type != 'window')
|
||||
path = payload[0].path;
|
||||
if (code == 'install') {
|
||||
console.log("检测到文件:" + path)
|
||||
log("准备安装:" + path)
|
||||
}
|
||||
reload()
|
||||
})
|
||||
} else if (code == 'unapk') {
|
||||
log("准备反编译:" + path)
|
||||
window.unapk(payload[0].path, (stdout, error) => {
|
||||
log(stdout)
|
||||
utools.shellBeep()
|
||||
})
|
||||
} else if (code == 'apkinfo') {
|
||||
window.apkinfo(path, (stdout, error) => {
|
||||
log(stdout)
|
||||
})
|
||||
} else if (code == 'packapk') {
|
||||
utools.readCurrentFolderPath().then((dir) => {
|
||||
log("正在回编译")
|
||||
window.packapk(dir, (stdout, error) => {
|
||||
log(stdout)
|
||||
})
|
||||
})
|
||||
} else if (code == 'signapk') {
|
||||
let isUseSign = utools.db.get('sign')
|
||||
if (isUseSign == null) {
|
||||
setSign()
|
||||
} else {
|
||||
log("正在签名:" + path)
|
||||
window.signapk(payload[0].path, (stdout, error) => {
|
||||
log(stdout)
|
||||
utools.shellBeep()
|
||||
log('签名完成')
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
function setSign() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '设置签名'
|
||||
, area: ['350px', '300px']
|
||||
, content: ['sign_dialog.html', 'no']
|
||||
, cancel: function (index, layero) {
|
||||
layer.close(index)
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reload() {
|
||||
chinese = [];
|
||||
$('#device').empty();
|
||||
$('#log').val('');
|
||||
|
||||
window.adb('adb devices', (stdout,error) => {
|
||||
if(error==true){
|
||||
window.adb('adb devices', (stdout, error) => {
|
||||
if (error == true) {
|
||||
log(stdout)
|
||||
return;
|
||||
}
|
||||
@@ -149,31 +216,34 @@
|
||||
log("没有连接设备");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
$('#showPack').click(function () {
|
||||
window.adb("adb shell pm list package", (stdout,error) => {
|
||||
if(error==true){
|
||||
var dv = devices[0].split(/\s+/);
|
||||
window.adb("adb -s "+dv[0]+" shell pm list package", (stdout, error) => {
|
||||
if (error == true) {
|
||||
log(stdout)
|
||||
return;
|
||||
}
|
||||
log(stdout)
|
||||
})
|
||||
})
|
||||
$('#show').click(function(){
|
||||
console.log("aapt dump badging \""+path+"\"")
|
||||
window.adb("aapt dump badging \""+path+"\"",(stdout,error) => {
|
||||
if(error==true){
|
||||
$('#show').click(function () {
|
||||
console.log("aapt dump badging \"" + path + "\"")
|
||||
window.adb("aapt dump badging \"" + path + "\"", (stdout, error) => {
|
||||
if (error == true) {
|
||||
log(stdout)
|
||||
return;
|
||||
}
|
||||
log(stdout)
|
||||
window.adb("aapt dump xmltree \""+path+"\" AndroidManifest.xml",(stdout,error)=>{
|
||||
window.adb("aapt dump xmltree \"" + path + "\" AndroidManifest.xml", (stdout, error) => {
|
||||
log(stdout)
|
||||
})
|
||||
})
|
||||
})
|
||||
$('#showTopActivity').click(function(){
|
||||
window.adb("adb shell dumpsys window | findstr mCurrentFocus",(data,error)=>{
|
||||
$('#showTopActivity').click(function () {
|
||||
var dv = devices[0].split(/\s+/);
|
||||
window.adb("adb -s "+dv[0]+" shell dumpsys window | findstr mCurrentFocus", (data, error) => {
|
||||
log(data)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user