Comments (1)
Simple example:
public interface MyConsumer<T> {
public void accept(T t);
}
public class Test {
public static void main(String[] args) {
MyConsumer<String> c = consumer();
c.accept("Hello, World");
}
private static MyConsumer<String> consumer() {
return Test::println;
}
private static void println(String message) {
System.out.println(message);
}
}
After some testing, it is indeed seems like Proguard assumes that invocation of MyConsumer::accept
has no side effects if there are no implementations of it in the jar file. If I add at least 1 file that references MyConsumer and use it in the code issue disappears.
Small sample, change .zip to .jar
For the sake of simplicity, use Java 8. Jar doesn't include logic necessary to run on newer versions.
Proguard settings:
Shrinking enabled, Test::main is kept
Obfuscation disabled
Optimizations enabled, 5 passes, all boxes under 'Remove' and 'Remove debugging' are unchecked
dontwarn is set to 'java.lang.invoke.**'
from proguard.
Related Issues (20)
- 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
- Generics from interfaces are removed HOT 7
- When I use Spring Framework 6.x, I can mix up packaging normally, but the controller reports an error after running it HOT 1
- Annotation with parameters
- `code/simplification/object` optimisation causing `NullPointerException`
- application-kotlin example doesn't support using Kotlin imports HOT 2
- Method of lambda expression passed as an instance of an interface defined in obfuscated library is not obfuscated correclty
- kotlin 2 support HOT 1
- How to skip some jars in multi jars
- Feature request: Support for Intellji IDE Plugin
- java.lang.VerifyError: Expecting a stackmap frame at branch target 14 HOT 2
- AbstractMethodError When Using Kotlin Extension Functions (reified, inline, and crossinline keywords) with Java Swing Components that Use ActionEvent HOT 4
- Poor performance when overrunning a large obfuscation dictionary HOT 1
- Reproducible output jar
- java.lang.VerifyError: Bad type on operand stack for Kotlin 2.0 and KotlinX Serialization HOT 1
- Obfuscate HOT 2
- How to obfuscate war HOT 1
- jar in tomcat HOT 1
- Feature request: Override the logging level for proguard() Gradle task action
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.