From 42c73fb82085d248bf87b76c913b5d4695f6e7fb Mon Sep 17 00:00:00 2001 From: walzer Date: Fri, 22 Mar 2013 12:06:04 +0800 Subject: [PATCH] Fixed #1841, obfuscated js source can run on iOS correctly now. --- .../TestJavascript/Classes/AppDelegate.cpp | 5 +- .../TestJavascript/game.js.REMOVED.git-id | 2 +- .../Javascript/TestJavascript/obfuscate.xml | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../obfuscate/obfuscate_exclude_chipmunk.js | 46 +++++++++++++++++++ ...bfuscate_exclude_cocos2d.js.REMOVED.git-id | 2 +- 6 files changed, 54 insertions(+), 5 deletions(-) diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp index ab228a448e..5c82c478a1 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp @@ -46,8 +46,11 @@ bool AppDelegate::applicationDidFinishLaunching() CCScriptEngineProtocol *pEngine = ScriptingCore::getInstance(); CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine); +#ifdef JS_OBFUSCATED + ScriptingCore::getInstance()->runScript("game.js"); +#else ScriptingCore::getInstance()->runScript("tests-boot-jsb.js"); - +#endif return true; } diff --git a/samples/Javascript/TestJavascript/game.js.REMOVED.git-id b/samples/Javascript/TestJavascript/game.js.REMOVED.git-id index 7679856064..989e347537 100644 --- a/samples/Javascript/TestJavascript/game.js.REMOVED.git-id +++ b/samples/Javascript/TestJavascript/game.js.REMOVED.git-id @@ -1 +1 @@ -39fc797c760757f336e4a6a12a05d8d7dd6bcf22 \ No newline at end of file +e1f03e3925993f54e478def7760c0c849140f5d3 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/obfuscate.xml b/samples/Javascript/TestJavascript/obfuscate.xml index 53c091ce9d..3be4846e46 100644 --- a/samples/Javascript/TestJavascript/obfuscate.xml +++ b/samples/Javascript/TestJavascript/obfuscate.xml @@ -68,7 +68,7 @@ - + diff --git a/samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj/project.pbxproj.REMOVED.git-id index 5791324943..5fc75e26b9 100644 --- a/samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -bfa92b3b92891e3db2f669e67b026d155be02dd8 \ No newline at end of file +0b29dbaef87c1e7f69eea235667a2e278bec0062 \ No newline at end of file diff --git a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js b/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js index 73fbdd8b26..159c9493c3 100644 --- a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js +++ b/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js @@ -216,6 +216,52 @@ CSSProperties.prototype.SimpleMotor; CSSProperties.prototype.Base; CSSProperties.prototype._v; CSSProperties.prototype.vadd; +CSSProperties.prototype.getHandle; +CSSProperties.prototype.getGravity; +CSSProperties.prototype.getIterations; +CSSProperties.prototype.getDamping; +CSSProperties.prototype.getStaticBody; +CSSProperties.prototype.getIdleSpeedThreshold; +CSSProperties.prototype.getSleepTimeThreshold; +CSSProperties.prototype.getCollisionSlop; +CSSProperties.prototype.getCollisionBias; +CSSProperties.prototype.getCollisionPersistence; +CSSProperties.prototype.getEnableContactGraph; +CSSProperties.prototype.getAngle; +CSSProperties.prototype.getAngVel; +CSSProperties.prototype.getPos; +CSSProperties.prototype.getVel; +CSSProperties.prototype.getMoment; +CSSProperties.prototype.getBody; +CSSProperties.prototype.getGroup; +CSSProperties.prototype.getCollisionType; +CSSProperties.prototype.getMaxForce; +CSSProperties.prototype.getAnchr1; +CSSProperties.prototype.getAnchr2; +CSSProperties.prototype.setHandle; +CSSProperties.prototype._setSpace; +CSSProperties.prototype._setCPBody; +CSSProperties.prototype.setGravity; +CSSProperties.prototype.setIterations; +CSSProperties.prototype.setDamping; +CSSProperties.prototype.setStaticBody; +CSSProperties.prototype.setIdleSpeedThreshold; +CSSProperties.prototype.setSleepTimeThreshold; +CSSProperties.prototype.setCollisionSlop; +CSSProperties.prototype.setCollisionBias; +CSSProperties.prototype.setCollisionPersistence; +CSSProperties.prototype.setEnableContactGraph; +CSSProperties.prototype.setAngle; +CSSProperties.prototype.setAngVel; +CSSProperties.prototype.setPos; +CSSProperties.prototype.setVel; +CSSProperties.prototype.setMoment; +CSSProperties.prototype.setBody; +CSSProperties.prototype.setGroup; +CSSProperties.prototype.setCollisionType; +CSSProperties.prototype.setMaxForce; +CSSProperties.prototype.setAnchr1; +CSSProperties.prototype.setAnchr2; CSSProperties.prototype.vclamp; CSSProperties.prototype.vcross; CSSProperties.prototype.vdist; diff --git a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id b/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id index 04435f8b9c..1f98f8f036 100644 --- a/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id +++ b/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id @@ -1 +1 @@ -53903a43bca6db80414ef79082db3b4063514ab6 \ No newline at end of file +f92eb40bc776570519509464d3f3ba6e9d93d3a9 \ No newline at end of file