Cocos2d-x 2.x Android Libpng Vulnerability fix

If you receive the following error on Google Play Developer console:

Please migrate your app(s) to libpng v1.0.66, v.1.2.56, v.1.4.19, v1.5.26 or higher as soon as possible and increment the version number of the upgraded APK. Beginning Sep 17, 2016, Google Play will block publishing of any new apps or updates that use vulnerable versions of libpng. Your published app version will remain unaffected, however any updates to the app will be blocked unless they address this vulnerability.

https://support.google.com/faqs/answer/7011127

A simple fix is to extract the following zip file into your “cocos2dx\platform\third_party\android\prebuilt” folder:

Download the fix from here:
libpng_fix.zip for Cocos2d-x 2.x

And change “Android.mk” file under “cocos2dx” folder:

Change:
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libpng_static

to
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libzlib_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libpng_static

Change:
$(call import-module,libpng)

to:
$(call import-module,libzlib)
$(call import-module,libpng)

You are also invited to checkout our games and apps:
Bengigi Apps and Games

 
Add a comment

Comments (14)