小编Vin*_*vin的帖子

Proguard 找不到引用的类,jar 是由 Eclipse 制作的

我有一个引用库的项目(即 Apache POI)。因此,在 Eclipse 中,项目属性 -> Java 构建路径 -> 添加外部 JAR,我从库中包含了 4 个 jar(poi、poi-ooxml、poi-ooxml-schemas、xmlbeans)

当我构建 jar 时,我选择了 File -> Export,Runnable JAR 文件,将所需的库提取到生成的 JAR 中。我已经验证这个未混淆的 jar 工作正常。

在 Proguard GUI 中,我添加了输入文件(Eclipse 生成的 JAR)和输出文件,我希望在其中保存输出。

由于它是一个 javaFX 项目并使用 javax.crypto 库,因此我也必须在 Proguard 中手动添加库 jar:jfxrt.jar 和 jce.jar。这可能是问题所在。也许我还需要从 Apache POI 库中添加 jars?但是这样做给了我“库类的重复定义......”警告,并没有解决无法找到引用的类警告。

我尝试忽略警告,但混淆的 JAR 不起作用。

确实有很多警告,但这里是前五个:

Note: org.apache.xmlbeans.impl.jam.internal.reflect.ReflectClassBuilder calls 'Field.getType'
Warning: org.apache.xmlbeans.impl.jam.internal.javadoc.JavadocRunner: can't find superclass or interface com.sun.javadoc.Doclet
Warning: org.apache.xmlbeans.impl.tool.XMLBean: can't find superclass or interface org.apache.tools.ant.taskdefs.MatchingTask
Warning: com.microsoft.schemas.office.excel.CTClientData: can't find referenced class com.microsoft.schemas.office.excel.STCF
Warning: com.microsoft.schemas.office.excel.CTClientData: can't …
Run Code Online (Sandbox Code Playgroud)

java eclipse obfuscation jar proguard

5
推荐指数
0
解决办法
635
查看次数

jquery $(document).one('ready',function(){...}不起作用

使用$(document).ready(function(){...});(版本1)时,文档就绪功能将无限期触发.我的猜测是每当jquery .load函数完成时就会触发就绪?想确认一下.

所以我尝试使用jquery的$(document).one('ready', function(){...});函数(版本2),但该函数根本不会触发.这有什么不对?

index.html的:

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="/vendor/jquery/jquery-3.1.0.min.js"></script>
    <script src="/js/index.js"></script>
</head>
<body>
    <div class="index__header"></div>
    <div class="index__content"></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

index.js版本1:

var _index = {
    loadLogin : function () {
        $(".index__content").load("/view/login.html");
    }
};

$(document).ready ( function () {
    $(".index__header").load("/view/header.html");
    _index.loadLogin();
});
Run Code Online (Sandbox Code Playgroud)

index.js版本2:

var _index = {
    loadLogin : function () {
        $(".index__content").load("/view/login.html");
    }
};

$(document).one ('ready', function () {
    console.log('ready...');
    $(".index__header").load("/view/header.html");
    _index.loadLogin();
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery

3
推荐指数
2
解决办法
4389
查看次数

标签 统计

eclipse ×1

jar ×1

java ×1

javascript ×1

jquery ×1

obfuscation ×1

proguard ×1