[android-developers] Re: Obfuscation in eclipse for Android?

2008-10-02 Thread UBZack

Hi Peli, blindfold:

I know it's been a while, but after having put the whole obfuscation
task on the back burner, I decided to come back to it yesterday, and I
just now, with tips from both of you, I have completed setting up an
Ant build script, using ProGuard, that obfuscates my class names very
nicely, and I'd like to thank you both very much for your helpful
comments!

For those still seeking help, I'll just paste the part of my Ant build
script that calls ProGuard, which was partly inspired by the ant build
found here:  
http://code.google.com/p/zxing/source/browse/trunk/android-m3/build.xml?r=321


























This target goes after the compile target, and before the dex target.
I think I was finding that "-dontpreverify" really didn't make much
difference in the end, but -dontoptimize was needed, and -
dontusemixedcaseclassnames is DEFINITELY a must for building on
Windows, if you have a lot of java files (good call, blindfold!)
Also, as peli pointed out, I put all my AndroidManifest listed classes
- FirstView, SyncingView, and ListView - in -keep calls, to be
excluded from obfuscation and this is what made it work.

So I hope this helps other people out, it's not an easy road to
travel!
-UBZack
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Obfuscation in eclipse for Android?

2008-09-25 Thread blindfold

Also under Microsoft Windows take care to apply -
dontusemixedcaseclassnames with Proguard, or else you will run into
trouble with dex once getting beyond 26 classes a-z.

For me -optimizationpasses 1 was maximum, or else the Android emulator
would fail (in 0.9 beta, didn't bother to retry for 1.0 r1).

On Sep 25, 11:14 am, Peli <[EMAIL PROTECTED]> wrote:
> Manual obfuscation works fine, using an Ant script and ProGuard. It is
> not that difficult to set up.
>
> Few things to consider:
> * There were some problems with optimized code: Sometimes optimized
> code throws errors when converting to dex code.
> * All class names that are defined in the Manifest or used as custom
> widgets in layout files should of course be excluded from obfuscation.
> In our application this is quite a lot (activities, content providers,
> widgets), so this somehow prevents complete obfuscation, and it is
> easier to guess from the decompiled class names what they are good
> for.
>
> Other than that, I don't think there is anything wrong with
> obfuscation. It also decreases the apk size slightly, by using shorter
> strings for class and method names ("a", "b", "c", ..). Smaller file
> size is always good on mobiles :-)
>
> Let me know if you need help in setting up the ant script.
>
> Peliwww.openintents.org
>
> On Sep 24, 10:49 pm, UBZack <[EMAIL PROTECTED]> wrote:
>
> > Does anyone know if there are plans to include an option to obfuscate,
> > or encrypt class files (before they are then converted to .dex files)
> > within the ADT plugin for eclipse?  I've been searching the Android
> > group for a while now, it seems that people are manually obfuscating
> > their class files, then manually converting them to dex files, which
> > is fine if you're building using ant, but it would be really great to
> > be able to have the eclipse ADT automatically do this process.
>
> > Additionally, does anyone have some idea what exactly is Google's
> > philosophy towards obfuscation/class-encryption in Android?
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Obfuscation in eclipse for Android?

2008-09-25 Thread Peli

Manual obfuscation works fine, using an Ant script and ProGuard. It is
not that difficult to set up.

Few things to consider:
* There were some problems with optimized code: Sometimes optimized
code throws errors when converting to dex code.
* All class names that are defined in the Manifest or used as custom
widgets in layout files should of course be excluded from obfuscation.
In our application this is quite a lot (activities, content providers,
widgets), so this somehow prevents complete obfuscation, and it is
easier to guess from the decompiled class names what they are good
for.

Other than that, I don't think there is anything wrong with
obfuscation. It also decreases the apk size slightly, by using shorter
strings for class and method names ("a", "b", "c", ..). Smaller file
size is always good on mobiles :-)

Let me know if you need help in setting up the ant script.

Peli
www.openintents.org


On Sep 24, 10:49 pm, UBZack <[EMAIL PROTECTED]> wrote:
> Does anyone know if there are plans to include an option to obfuscate,
> or encrypt class files (before they are then converted to .dex files)
> within the ADT plugin for eclipse?  I've been searching the Android
> group for a while now, it seems that people are manually obfuscating
> their class files, then manually converting them to dex files, which
> is fine if you're building using ant, but it would be really great to
> be able to have the eclipse ADT automatically do this process.
>
> Additionally, does anyone have some idea what exactly is Google's
> philosophy towards obfuscation/class-encryption in Android?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---