sky201503 / android-apktool2

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Wrong name for .java file #178

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When an application contains a lot of ofuscated classes. Some class are named: 
if, do, etc.
Those name are java keyword and produce error when using eclipse or netbeans. I 
used apktool in debug mode.

It is expected to rename the class name wihout using a java keyword (eclipse or 
netbeans use keyword instead of classname)

Windows 7 x64. apktool 1.4.1

example:
<<
class if {/*

.class public Lif;
.super Lgm;
>>

# static fields
.field public static ag:Ljava/lang/String;

Original issue reported on code.google.com by arnaud.p...@gmail.com on 12 Jun 2011 at 5:27

GoogleCodeExporter commented 9 years ago
Unfortunately, it would be very hard to fix this. Also I think such 
functionality should be a part of a separate tool for dex refactoring. I was 
thinking about such project, but I don't have time for it right now.

You should be able to fix this by hand - just rename if.java to if2.java, 
"class if" to "class if2" and search&replace Lif; to Lif2; in all *.java files.

Original comment by Brut.alll on 5 Nov 2011 at 7:21