Because I wrote more than one cocos2d-x extension so I found some code can be moved out as a common codebase.
View my repositories to know what extensions I provided for you. Focus on those starts with "cocos2dx" prefix.
cocos2dx-common project refers cocos2d-x project. You must clone cocos2d-x repository to a folder named "cocos2d-x", and then clone cocos2dx-common in the same parent folder.
There is a test project in test folder, it supports iOS and android. If you want other platform, do it yourself.
For iOS, just drag cocos2dx-common project into your project. For Android, just import cocos2dx-common module. If not clear, refer to demo code.
Here is my extensions which refer to this common base: