3

I have an Android app using nutiteq OSM map, with mapsforge renderer, and a map file stored in the assets folder. It works perfectly without proguard, but after obfuscation, the app freezes, without any log info.

In the proguard.cfg:

-keep class com.nutiteq.** { ; } -keep class org.mapsforge.* { *; }

But even if I keep all code from my package, it doesn't help.

Any idea?

Thanks

Szoszi

UPDATE

Without irrelevant info.

proguard.cfg:

-printmapping proguard.map

-keepattributes SourceFile,LineNumberTable,*Annotation*,Signature

#-optimizationpasses 5
-dontpreverify

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-libraryjars /libs/mapsforge-map-0.3.1-with-dependencies.jar
-libraryjars /libs/nineoldandroids-2.4.0.jar
-libraryjars /libs/nutiteq-3d-sdk-2.3.0.jar

-verbose

#Libraries
-keep class com.google.protobuf.** { *; }
-keep class com.nutiteq.** { *; }
-keep class org.mapsforge.** { *; }
-keep class mypackage.util.MapsforgeRasterDataSource.** { *; }
Szoszi
  • 41
  • 5

2 Answers2

1

Are you using source code for nutiteq and mapsforge, or jar files? If you're using jar files, you can define them as a libraryjar in proguard instead of an injar. An example:

proguard.cfg
-injars build\myproject.jar
-injars build\myOtherProject.jar
-outjars proguard\obfuscated
-libraryjars nutiteq.jar
-libraryjars mapsforge.jar
...
...
...

This way proguard can keep track of the references your code makes to your third party libraries, but does not bother trying to obfuscate them unnecessarily.

AWT
  • 3,657
  • 5
  • 32
  • 60
  • I'm using jars, and as you mentioned, like -libraryjars nutiteq.jar. And -keep class csom.nutiteq.** { *; } , but doesn't work for me. – Szoszi Jul 17 '14 at 14:50
  • Can you post your proguard.cfg file? – AWT Jul 17 '14 at 15:03
  • It looks like you're using absolute paths for your library jars. Is that really where they are (in the /libs folder of your root filesystem)? Can you also include the output produced by running proguard with this config? – AWT Jul 17 '14 at 19:28
  • Other libraries are added the same mode and same folder, and they are working – Szoszi Jul 18 '14 at 07:28
1

Finally, the solution had found. Proguard removes all logs from code, but nutiteq uses its own log methods...also removed. Everything works fine, if you keep logs.

Thx for replies.

Szoszi
  • 41
  • 5