美文网首页
JS解析ipa/apk

JS解析ipa/apk

作者: 哎哟我去 | 来源:发表于2021-03-29 15:40 被阅读0次
    • 引入最重要的一个js文件:app-info-parser.js
    • 使用layui+tp6解析ipa的代码示例(apk同理)
    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>upload模块快速使用</title>
        <link rel="stylesheet" href="/static/zsign/layui/css/layui.css" media="all">
    </head>
    <body>
    
    <div class="layui-upload-drag" id="test10">
        <i class="layui-icon"></i>
        <p>点击上传,或将文件拖拽到此处</p>
        <br>
        <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="demo">
            <div class="layui-progress-bar" lay-percent="0%"></div>
        </div>
    </div>
    
    <script src="/static/zsign/layui/layui.js"></script>
    <script src="/static/admin/js/zsign/app-info-parser.js"></script>
    <script>
        layui.use(['upload', 'element'], function () {
            let upload = layui.upload;
            let element = layui.element;
            //拖拽上传
            upload.render({
                elem: '#test10'
                , accept: 'file'
                , auto: false
                , url: '{:url("admin/zsign.Upload/uploadIpa")}'
                , choose: function (obj) {
                    obj.preview(function (index, file, result) {
                        new AppInfoParser(file).parse().then(appInfo => {
                            console.log(appInfo);
                        });
                    });
                    layer.load();
                }
                , progress: function (n, elem) {
                    let percent = n + '%'
                    element.progress('demo', percent);
                }
                , done: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg);
                    } else {
                        layer.alert(res.msg);
                    }
                }
            });
        });
    </script>
    </body>
    </html>
    
    • 没问题的话会看到一下画面


      1617003546(1).jpg

    相关文章

      网友评论

          本文标题:JS解析ipa/apk

          本文链接:https://www.haomeiwen.com/subject/kgybhltx.html