From 84d66219c8b82bb77124151d38212226ec9d2a13 Mon Sep 17 00:00:00 2001 From: cw Date: Tue, 20 May 2014 11:44:46 +0800 Subject: [PATCH] fixed android degbug --- .../frameworks/runtime-src/proj.android/jni/lua/main.cpp | 9 +++++++++ .../proj.android/src/org/cocos2dx/lua/AppActivity.java | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp index 3aae632663..87ff60db09 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp @@ -25,5 +25,14 @@ extern "C" } return ConfigParser::getInstance()->isLanscape(); } + + bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz) + { + #ifdef NDEBUG + return false; + #else + return true; + #endif + } } diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java index d03b838a65..8386cd32ea 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java @@ -69,8 +69,8 @@ public class AppActivity extends Cocos2dxActivity{ //2.Set the format of window - // Check the wifi is opened when the android:debuggable is "true". - if(0!=((this.getApplicationInfo().flags) & ApplicationInfo.FLAG_DEBUGGABLE)) + // Check the wifi is opened when the native is debug. + if(nativeIsDebug()) { if(!isWifiConnected()) {