Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Proguard and Netty 5 on Android

I have fixed this issue with some carefully* applied Proguard rules after reading through parts of the rather huge Netty sources:

-keepattributes Signature,InnerClasses
-keepclasseswithmembers class io.netty.** {
-keepnames class io.netty.** {

My original exception was caused by the type variables being removed from the bytecode, which Netty uses via reflection. Signature in -keepattributes keeps this information.

You get a slightly different exception if you only do Signature on -keepattributes - adding InnerClasses fixes this one by bringing back even more information in the class files.

Later, I got java.lang.NoSuchFieldException: ctl; that's what -keepnames is for. This way, the field is still called ctl like Netty expects.

Finally, some members (like ctl, seen earlier) were being removed by Proguard because Netty only uses them via reflection. The final rule, -keepclasseswithmembers, makes sure Proguard doesn't remove them.

If you take this approach, I strongly recommend you use only the Netty jars you need, instead of the -all jar. Switching from -all to just the required Netty jars brought my method count way down after I had gone past the 65k limit. Reducing your jars requires bit of trial-and-error though as the separation is unclear and there's not really any resources saying what's what.

* not carefully at all, I just slapped rules into the file and removed them if they did nothing. There's probably a better way to do this that doesn't keep this information in the entire program, but instead just Netty.

Categories : Android

Related to : Proguard and Netty 5 on Android
Proguard Error Code 1: Proguard.ParseException
I faced the same error and finally sorted it out by keeping the below line in the proguard-project.txt file -libraryjars /libs/Your_Jar_File.jar Just exclude jar file which ever you feel it is causing you the expection. I am facing this issue due to one external jar file. Where proguard is obfuscating it. As in my case airpush jar file is creating the problem. Just exclude it.

Categories : Android
Keep .so files from being trimmed when use Proguard in Android
Proguard shouldn't remove .so files, I guess your issue comes from something else. When you use "add native support" from eclipse, eclipse creates an empty ndk library project (a jni folder with empty sources and a sample Makefile). So when you build your app, eclipse empties libs/*/ folders, then build and install the newly created library here. If you don't use the NDK yourself (not compiling

Categories : Android
Netty Handler not called
You're using ChannelInboundHandlerAdapter, which is fine, for your "middle" handler ConfigXxxxxHandler. But you use channelRead method and then use inside ctx.write(msg). ctx.write(msg) will write the msg back to the other server through the previous handler first (ObjectDecoder), not to the next handler (FeedbackClientHandler in your case). You should use the following if you want to send the m

Categories : Java
DSE Solr: Netty errors during concurrent query requests
Seems to be a Netty/JVM bug, related to: Could you try another OS and/or JVM version?

Categories : Solr
eclipse: after signing with proguard, apk crashes
You can add this option to make the stacktraces a little more obvious but still obfuscated: -keepattributes SourceFile,LineNumberTable,Signature Alternatively you should de-obfuscate your stacktrace using the mapping.txt file that is generated when you create your proguarded build. This file is the "key" to changing your code back to normal. It is different every time you build a new apk so en

Categories : Android
Recently Add
Wait for all requests in Android Volley
android scrollview not working
Android: How to prevent a Wifi disconnect on DHCP renewal?
Using HorizontalScrollView for gallery - no pictures inside
-bash: export: not a valid identifier
m3u8 Video stops with MediaPlayer: Error (1,-1004)
java.lang.IndexOutOfBoundsException at ListView android
Facebook REST calls for mobile cross-platform app
How to returning image from camera intent and placing in google maps api v2 as thumbnail
How can I add a row to a ListView in one Fragment by clicking the button in another Fragment?
Using MediaController on Android 5
Is TCP packet filtering possible on mobile platforms?
Spinner from editext android
Incomplete file downloaded in android using DataInputStream
How do I delete a row form SQLite DB via ListView and refresh list view?
Change action bar to toolbar, and now I am having force closes. What am I doing wrong here?
Adding buttons below GraphView, all inside a Fragment
Get rotation and display in degrees
What methods are available to execute things in the background
Data Persistence Android
Intent not delivered correctly
Android Studio 1.0 RC 1 Gradle build issues - Could not run build action using Gradle installation
otto eventbus for android behaves differently in release build
How get item ID from ListFragment in android?
Receive bluetooth connection changes after reboot
Encrypting plain-text passwords and passing variables to xml for display in android
android html5 video fullscreenchange not called on entering fullscreen
Want to create API for my android application done using Intel XDK
Gps not getting location
Spannable Text is not working in Dialog Fragment
© Copyright 2017 Publishing Limited. All rights reserved.