Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't release app on Google Play, need to update LibPNG and OpenSSL libraries #1186

Open
jpienbro opened this issue Mar 1, 2017 · 10 comments

Comments

@jpienbro
Copy link

jpienbro commented Mar 1, 2017

Google Play requires newer versions of these libraries because of vulnerabilities:
See LibPNG requirement: https://support.google.com/faqs/answer/7011127?hl=en
See OpenSSL requirement: https://support.google.com/faqs/answer/6376725?hl=en

I tried updating them myself by updating all references I could find in project & makefiles. Only managed to get LibPNG working. OpenSSL is giving a lot of issues.

P.S. I am using the moai-community repo/branch currently. That's the only one I managed to get working/building on Mac

@halfnelson
Copy link
Contributor

Thanks for the report!, libpng should be easy enough to replace, but openssl 1.0.0m to 1.0.2 is a bit of a pain for all platforms. Talk is underway about replacing with mbedtls.

@halfnelson
Copy link
Contributor

halfnelson commented Mar 5, 2017

https://github.com/moai/moai-community branch pull-180 should get you what you need
it has libpng 1.4.20 and has removed openssl and replaced with latest version of mbedtls. It would be greate if you could give that go for your project.

don't forget you might need to do a git submodule update --init --recursive
since the moai sdk now has a couple more submodules (libcurl and mbedtls)

@seclorum
Copy link
Contributor

seclorum commented Mar 5, 2017

Can confirm, this builds fine, will use it as my testing MOAI bin for the week and report any issues .. thanks and well done!

EDIT: it does not build fine on another machine, will investigate and find out why (libmoai-ios-3rdparty-mbedtls.a not included in build stage?)

@jpienbro
Copy link
Author

jpienbro commented Mar 6, 2017

Thanks, I will test that branch too. I'll try building it on Mac for Android, iOS and OSX.

@jpienbro
Copy link
Author

jpienbro commented Mar 6, 2017

Got it working for OSX and iOS, still trying to fix it for Android:
"/Volumes/HDD/Repositories/moai-community/sdk/moai/3rdparty/curl/include/curl/curl.h:38:61: fatal error: curlbuild.h: No such file or directory
#include "curlbuild.h" /* libcurl build definitions */"

These are the modifications I made for OSX and iOS:
OSX:

  1. Xcode: Removed references to libmoai-osx-3rdparty-crypto in moai-osx and moai-osx-static build targets
  2. Xcode: Added mbedtls build targets to libmoai-osx-all build target
  3. Xcode: Added target dependency "libmoai-ios-3rdparty-mbedtls" to moai-ios
  4. Xcode: Added reference to libmoai-osx-3rdparty-mbedtls.a (Add Files to "moai-osx-static" and link to lib/osx/libmoai-osx-3rdparty-mbedtls.a)
  5. Xcode: Added target dependency "libmoai-ios-3rdparty-mbedtls" to moai-ios
  6. Xcode: In host-templates/osx/Moai Template/Moai Template.xcodeproj remove references to libmoai-osx-3rdparty-crypto
  7. Copied libraries from lib/ios temporarily to host-templates/osx/Moai Template/lib
  8. Xcode: Added reference "libmoai-osx-3rdparty-mbedtls" to lib group
  9. Removed temporarily "lib" folder from host-templates/osx/Moai Template/
  10. Terminal: execute build-osx.sh
  11. Terminal: pito host create osx

iOS:

  1. Xcode: Removed references to libmoai-osx-3rdparty-crypto in moai-ios-static build target
  2. Xcode: Added mbedtls build targets to libmoai-ios-all build target
  3. Xcode: Added target dependency "libmoai-ios-3rdparty-mbedtls" to moai-ios
  4. Xcode: In host-templates/ios/Moai Template/Moai Template.xcodeproj remove references to libmoai-ios-3rdparty-crypto
  5. Copied libraries from lib/ios temporarily to host-templates/ios/Moai Template/lib
  6. Xcode: Added reference "libmoai-ios-3rdparty-mbedtls" to Moai Libraries group
  7. Removed temporarily "lib" folder from host-templates/ios/Moai Template/
  8. Terminal: execute build-ios.sh
  9. Terminal: pito host create ios

@halfnelson
Copy link
Contributor

Thanks, looks like I forgot to update the host projects and ios-static osx-static. I am following along and updating (osx done and pushed). I will get to android, I think I must have not copied it to the folder, so it worked on my machine since configure had run. I will copy to correct location and push.

@halfnelson
Copy link
Contributor

@jpienbro added a bunch more commits which have your fixes above plus similar fixes to android and windows.

@jpienbro
Copy link
Author

jpienbro commented Mar 6, 2017

OK, will check it out

@jpienbro
Copy link
Author

jpienbro commented Mar 6, 2017

Seems to build correctly now for Android, OSX and iOS.
Needs a bugfix for iOS, otherwise it will crash when trying access extension of iOS classes.

In src/moai-ios/host.mm AKUIosAppInitialize() was empty.
Fixed it with:

void AKUIosAppInitialize () {

loadMoaiLib_NSArray ();
loadMoaiLib_NSData ();
loadMoaiLib_NSDate ();
loadMoaiLib_NSDictionary ();
loadMoaiLib_NSError ();
loadMoaiLib_NSNumber ();
loadMoaiLib_NSObject ();
loadMoaiLib_NSString ();

}

I noticed it before, but hadn't reported it yet

My game crashes for some weird reason on Android when loading a certain menu. I'll need to do some more debugging for that one.

@david-pershouse
Copy link

looks like the right fix for the NSArray stuff is to link/include https://github.com/moai/moai-dev/blob/feature/community-1.7.5/src/moai-apple/host.mm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants