Comments (2)
We have a similar problem. We've updated our (maven) tycho version, which compiles with a newer JDT, and now we get an additional warning from proguard.
This is approximately the pattern we have:
// package a;
public interface A {
default void m() {
throw new UnsupportedOperationException("");
}
}
public class L {
public void onEvent() {}
public void other() {}
}
// package b;
public class AImpl implements a.A {
public void addListener(L listener) {
}
}
public class OuterBase {
A createA() {
return new AImpl();
}
}
// package c;
public class ObfuscationIssue extends b.OuterBase {
public void other() {
// here, the ref works
createA();
}
@Override
a.A createA() {
// ObfuscationIssue$123
return new b.AImpl() {
private final java.util.List<java.util.function.Consumer<String>> list;
{ // anon constructor
list = java.util.List.of();
// probably unrelated: we have a ref like a.A.EnumXX.LITERAL, here
// anon a.L is ObfuscationIssue$123$1
addListener(new a.L() {
@Override public void onEvent() {
list.forEach(c -> c.accept("thing"));
}
});
}
@Override
public void m() {
// do stuff
}
};
}
}
The warning we now get is c.ObfuscationIssue$123$1: can't find enclosing method 'A createAl()' in program class c.ObfuscationIssue$123
I hope this helps, please let me know if you need something else / more info.
from proguard.
Well, it appears this may have been an issue with Eclipse and not with ProGuard. I have just updated to the latest 2024-03 version of Eclipse, and the problem does not occur anymore. Even using ProGuard 5.2.1, the project builds and obfuscates fine with no warnings about anonymous classes that have to be ignored for the obfuscation to complete successfully.
from proguard.
Related Issues (20)
- predictNullPointerExceptions is enabled when not optimizing aggressively HOT 2
- java.lang.NullPointerException: Cannot throw exception because "null" is null HOT 1
- Support K2 HOT 2
- Excluded directories are still being processed incorrectly
- Proguard removes method invocation, changing behaviour HOT 1
- keep rule not working with annotation nested inside class HOT 2
- CRITICAL PROGUARD BUG! Very simple code not working!
- adaptresourcefilecontents on path like package reference
- Gradle plugin keep rules are not task inputs - breaking up-to-date checking
- Wildcard of field type, method return type and method parameters in conditional rules can't be referenced
- java.lang.VerifyError: Bad return type
- Support for Java 22 HOT 14
- com.android.tools.r8.ResourceException: com.android.tools.r8.internal.vc: I/O exception while reading HOT 1
- Java Formats and locales do not work
- Caused by: java.lang.ClassNotFoundException: proguard.optimize.gson._OptimizedJsonWriter HOT 1
- Modular program
- ProGuard writes wrong version code in zip files
- Reproducible Build Support HOT 1
- How to find root issue relate "It appears you are missing some classes resulting in an incomplete class hierarchy" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proguard.