EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SBB and ProGuard

Posted: 01/21/2015 08:56:36
by David ErÅ¡il (Standard support level)
Joined: 01/15/2013
Posts: 38


I just came across following problem. When I use ProGuard obfuscator to shrink my Android application code, I got this exception thrown during SBUtils.setLicenseKey(<demo license code>):

   at cz.myapp.MainActivity.onCreate(MainActivity.java:72)
   at android.app.Activity.performCreate(Activity.java:4465)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
   at android.app.ActivityThread.access$600(ActivityThread.java:123)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:4424)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
   at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
   at org.freepascal.rtl.FpcBaseProcVarType.setFpcBaseProcVarTypeBySignature(system.pp)
   at org.freepascal.rtl.FpcBaseProcVarType.<init>(system.pp)
   at SecureBlackbox.Base.TCharsetLibraryRegProc.<init>(SBChSConvBase.pas)
   at SecureBlackbox.Base.SBChSConv.initCharsets(SBChSConv.pas:853)
   at SecureBlackbox.Base.TPlConverter.<init>(SBChSConv.pas:2085)
   at SecureBlackbox.Base.TPlConverter.<init>(SBChSConv.pas:2080)
   at SecureBlackbox.Base.TElUnicodeConverter.<init>(SBUnicode.pas:120)
   at SecureBlackbox.Base.SBUtils.<clinit>(SBUtils.pas:18549)
   ... 15 more

My sample application has only one method for signing Office document, which works well in plain (non-obfuscated) code. The setLicenseKey call is the first thing of this method.

I tried to set proguard exceptions to keep both SecureBlackbox and org.freepascal classes and their subclasses, but with no luck.
-keep class SecureBlackbox.** { *; }
-keep class org.freepascal.** { *; }

I know this is not necesarily a bug in SBB (using 12.0.263), but are you, by any chance, aware of this issue and able to tell me what more do I have to do to get my application working also when obfuscated?
Posted: 01/22/2015 04:29:34
by Vsevolod Ievgiienko (Team)


I've just checked that simple project protected by ProGuard works correctly on Android. Could you please post your problematic project via Helpdesk to check - its possible that some specific classes are the reason of the exception.



Topic viewed 671 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!