Thread: JBPatch
View Single Post
Old 10-30-2012, 10:26 AM   #893
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by dung.saga View Post
Eclipse is too bloat for my taste. So, after some searching, I use JD-GUI instead.

Arggg!!! Amazon obfuscated many class names in recent firmware updates. I wasted some time trying to figure it out. This is much harder than I expected.

Thanks to ixtab, I grabbed the firmware 5.0.0 and extract the JARs from it. All the class and method names are back . But it seems that the decompiler can't differentiate among local variables, all of them are named "a" . Does anybody know how to fix this?
No easy way to fix it. The decompiler decompiles correctly - the variables *are* all named "a" because of obfuscation. (Yes, even 5.0.0 is slightly obfuscated). You might be able to "rename" them by modifying the constants pool of the class file, and correctly "linking" the variables there. If you're lucky, there is some deobfuscator out there which can do that, but I don't remember seeing one. If you do find one, then I'm very interested in it, because yes, it's a PITA to read such code.

One more comment concerning 5.0.0/5.1.x/5.2.0: I'm also usually resorting to the 5.0.0 version to understand what's going on, and then try to matchmake with the newer version. Just remember that the code may change slightly between the versions (some parts also changed heavily), and that ultimately you have to figure out the patch for the code of the exact version that you want to support. Oh, and a hint: "jad -a" is your friend.
ixtab is offline   Reply With Quote