r/mAndroidDev • u/bernaferrari MINSDK28 • Feb 14 '26
@Deprecated Android 17 deprecated static final fields not being final
98
Upvotes
r/mAndroidDev • u/bernaferrari MINSDK28 • Feb 14 '26
54
u/SonOfBowser Uses Vim Feb 14 '26
So now Android will immediately crash the application for me? They really are taking our jobs...
19
u/programadorthi Feb 14 '26
Now static final AsyncTask are truly final
16
u/budius333 Still using AsyncTask Feb 14 '26
What type of crazy hack were devs doing to change final stuff via reflection??
9
u/MrBIMC Feb 14 '26
I wonder how it will affect the hooking frameworks.
I’ve worked on a platform where we had a hook entry point inside the Applocation.Java and then used reflection to hook into any arbitrary spot inside the process of an application we aim to hook.
With this new limitation it might be that static fields are not modifiable anymore, which will fuckup the flow for this case.
3
u/FlykeSpice Feb 15 '26
That will (silently) crash so many apps that use jni libs
2
u/MouadAitali__ Feb 14 '26
Damn, the Application class will now be empty.
2
u/rpuxa1 Feb 14 '26
But Java and Kotlin compilers already inline all static final fields. So changing them through reflection won't affect anything. What optimization are they talking about?
1
u/fukarra Feb 14 '26
That sounds like a bad idea