Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d505cb3

Browse files
committed
Merge pull request #23 from chuanweizhang2013/v3luaruntime
fixed android degbug
2 parents a2be973 + 84d6621 commit d505cb3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,14 @@ extern "C"
2525
}
2626
return ConfigParser::getInstance()->isLanscape();
2727
}
28+
29+
bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz)
30+
{
31+
#ifdef NDEBUG
32+
return false;
33+
#else
34+
return true;
35+
#endif
36+
}
2837
}
2938

templates/lua-template-runtime/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ protected void onCreate(Bundle savedInstanceState) {
6969

7070
//2.Set the format of window
7171

72-
// Check the wifi is opened when the android:debuggable is "true".
73-
if(0!=((this.getApplicationInfo().flags) & ApplicationInfo.FLAG_DEBUGGABLE))
72+
// Check the wifi is opened when the native is debug.
73+
if(nativeIsDebug())
7474
{
7575
if(!isWifiConnected())
7676
{

0 commit comments

Comments
 (0)