复制appjson内容到输入框 即可一键生成小程序分包所有路径 分包多的情况下可以用 使用网址所有的qq.com
// ==UserScript==
// @name 小程序反编译提取分包路径并生成wxml页面即分包跳转路径 ,粘贴到小程序开发者wxml,真机预览点击对应按钮即可获得分包(自用)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 复制appjson内容到输入框 即可一键生成小程序分包所有路径 分包多的情况下可以用 使用网址所有的qq.com
// @author You
// @match *://*.qq.com/*
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_addStyle
// ==/UserScript==
(function() {
GM_addStyle(`
.input{
padding-left: 10px;
width:250px;
height:100px;
}
.blue{
width: 62px;
padding:2px;
line-height: 25px;
font-size: 14px;
color: white;
margin:0 2px 2px 0;
border-radius: 5px;
position: relative;
overflow: hidden;
border:1px solid #1e7db9;
box-shadow: 0 1px 2px #8fcaee inset,0 -1px 0 #497897 inset,0 -2px 3px #8fcaee inset;
background: -webkit-linear-gradient(top,#42a4e0,#2e88c0)
}
`)
var background = document.createElement("div")
background.id = "background"
background.innerHTML = "<boby style='position: fixed;padding-left:20px'> <div ><input id='appid' placeholder='输入APPID' ></input> <button class='blue' id ='one' >执行</button></div> <textArea id='json' class='input' placeholder='复制appjson源码到这里'></textArea></boby> "
background.setAttribute("style", "position:fixed;bottom:15vh;z-index: 9999999999; float:right; width:300px;height:200px;background:#707070 "); //背景样式
document.body.appendChild(background)
document.getElementById('one')
.addEventListener('click', function() {
var appid = document.getElementById("appid")
.value;
var json = document.getElementById("json")
.value
if (typeof json == 'string') {
try {
var jsonStr = JSON.parse(json);
var sub = jsonStr.subPackages
for (var i = 0; i < sub.length; i++) {
(function(j) {
setTimeout(function() {
var pa = sub[j].root + sub[j].pages[0]
var aaa = '<navigator target="miniProgram" style="float: left;border-style:double;margin:10px;" open-type="navigate" path="' + pa + '" app-id="' + appid + '" >第' + i-- + '个</navigator>'
document.writeln(aaa);
var test = document.getElementsByTagName('html')[0].innerHTML;
navigator.clipboard.writeText(test)
}, 1000, j)
})(i)
}
alert("提取成功,可直接粘贴到wxml页面")
} catch(e) {
alert("输入的内容有误,请全选复制APP.json内容")
}
}
})
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址