diff --git a/templates/cpp-template-default/proj.android/app/build.gradle b/templates/cpp-template-default/proj.android/app/build.gradle index f31528e629..7c152d4af4 100644 --- a/templates/cpp-template-default/proj.android/app/build.gradle +++ b/templates/cpp-template-default/proj.android/app/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - apply plugin: 'com.android.application' android { diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle index 65565a5b3c..86723cd750 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle @@ -1,4 +1,4 @@ -import org.apache.tools.ant.taskdefs.condition.Os +import org.gradle.internal.os.OperatingSystem; apply plugin: 'com.android.application' @@ -105,7 +105,7 @@ buildTypes { } def getCocosCommandPath() { - if (Os.isFamily(Os.FAMILY_WINDOWS)) { + if (OperatingSystem.current().isWindows()) { return 'cocos.bat' } else { diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro b/templates/js-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro index ecbfe714e5..2c062c4946 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro @@ -21,7 +21,7 @@ -dontwarn org.cocos2dx.** -keep public class com.chukong.** { *; } -dontwarn com.chukong.** --keep public com.huawei.android.** { *; } +-keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** # Proguard Apache HTTP for release diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle index 93b0b16e7d..a5ddc391d4 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle @@ -1,4 +1,4 @@ -import org.apache.tools.ant.taskdefs.condition.Os +import org.gradle.internal.os.OperatingSystem; apply plugin: 'com.android.application' @@ -106,7 +106,7 @@ android { } def getCocosCommandPath() { - if (Os.isFamily(Os.FAMILY_WINDOWS)) { + if (OperatingSystem.current().isWindows()) { return 'cocos.bat' } else { diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro index ecbfe714e5..2c062c4946 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/proguard-rules.pro @@ -21,7 +21,7 @@ -dontwarn org.cocos2dx.** -keep public class com.chukong.** { *; } -dontwarn com.chukong.** --keep public com.huawei.android.** { *; } +-keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** # Proguard Apache HTTP for release diff --git a/tests/cpp-empty-test/proj.android/app/build.gradle b/tests/cpp-empty-test/proj.android/app/build.gradle index 4cfdf3b529..8b8b38e6b3 100644 --- a/tests/cpp-empty-test/proj.android/app/build.gradle +++ b/tests/cpp-empty-test/proj.android/app/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - apply plugin: 'com.android.application' android { diff --git a/tests/cpp-tests/proj.android/app/build.gradle b/tests/cpp-tests/proj.android/app/build.gradle index f1c2fd8341..12b642a577 100644 --- a/tests/cpp-tests/proj.android/app/build.gradle +++ b/tests/cpp-tests/proj.android/app/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - apply plugin: 'com.android.application' android { diff --git a/tests/game-controller-test/proj.android/app/build.gradle b/tests/game-controller-test/proj.android/app/build.gradle index 3be0118975..0d02886dbb 100644 --- a/tests/game-controller-test/proj.android/app/build.gradle +++ b/tests/game-controller-test/proj.android/app/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - apply plugin: 'com.android.application' android { diff --git a/tests/js-tests/project/proj.android/app/build.gradle b/tests/js-tests/project/proj.android/app/build.gradle index 329bfb882c..c3238345a0 100644 --- a/tests/js-tests/project/proj.android/app/build.gradle +++ b/tests/js-tests/project/proj.android/app/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.internal.os.OperatingSystem; + apply plugin: 'com.android.application' android { @@ -104,7 +106,7 @@ android { } def getCocosCommandPath() { - if (Os.isFamily(Os.FAMILY_WINDOWS)) { + if (OperatingSystem.current().isWindows()) { return 'cocos.bat' } else { diff --git a/tests/js-tests/project/proj.android/app/proguard-rules.pro b/tests/js-tests/project/proj.android/app/proguard-rules.pro index ecbfe714e5..2c062c4946 100644 --- a/tests/js-tests/project/proj.android/app/proguard-rules.pro +++ b/tests/js-tests/project/proj.android/app/proguard-rules.pro @@ -21,7 +21,7 @@ -dontwarn org.cocos2dx.** -keep public class com.chukong.** { *; } -dontwarn com.chukong.** --keep public com.huawei.android.** { *; } +-keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** # Proguard Apache HTTP for release diff --git a/tests/lua-empty-test/project/proj.android/app/build.gradle b/tests/lua-empty-test/project/proj.android/app/build.gradle index f4a768480f..c16057ccf9 100644 --- a/tests/lua-empty-test/project/proj.android/app/build.gradle +++ b/tests/lua-empty-test/project/proj.android/app/build.gradle @@ -1,4 +1,4 @@ -import org.apache.tools.ant.taskdefs.condition.Os +import org.gradle.internal.os.OperatingSystem; apply plugin: 'com.android.application' @@ -106,7 +106,7 @@ android { } def getCocosCommandPath() { - if (Os.isFamily(Os.FAMILY_WINDOWS)) { + if (OperatingSystem.current().isWindows()) { return 'cocos.bat' } else { diff --git a/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro b/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro index ecbfe714e5..2c062c4946 100644 --- a/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro +++ b/tests/lua-empty-test/project/proj.android/app/proguard-rules.pro @@ -21,7 +21,7 @@ -dontwarn org.cocos2dx.** -keep public class com.chukong.** { *; } -dontwarn com.chukong.** --keep public com.huawei.android.** { *; } +-keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** # Proguard Apache HTTP for release diff --git a/tests/lua-game-controller-test/project/proj.android/app/build.gradle b/tests/lua-game-controller-test/project/proj.android/app/build.gradle index 4a650e9380..d52b62a97b 100644 --- a/tests/lua-game-controller-test/project/proj.android/app/build.gradle +++ b/tests/lua-game-controller-test/project/proj.android/app/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - apply plugin: 'com.android.application' android { diff --git a/tests/lua-game-controller-test/project/proj.android/app/proguard-rules.pro b/tests/lua-game-controller-test/project/proj.android/app/proguard-rules.pro index ecbfe714e5..2c062c4946 100644 --- a/tests/lua-game-controller-test/project/proj.android/app/proguard-rules.pro +++ b/tests/lua-game-controller-test/project/proj.android/app/proguard-rules.pro @@ -21,7 +21,7 @@ -dontwarn org.cocos2dx.** -keep public class com.chukong.** { *; } -dontwarn com.chukong.** --keep public com.huawei.android.** { *; } +-keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** # Proguard Apache HTTP for release diff --git a/tests/lua-tests/project/proj.android/app/build.gradle b/tests/lua-tests/project/proj.android/app/build.gradle index 262fa57c29..1fd10de990 100644 --- a/tests/lua-tests/project/proj.android/app/build.gradle +++ b/tests/lua-tests/project/proj.android/app/build.gradle @@ -1,4 +1,4 @@ -import org.apache.tools.ant.taskdefs.condition.Os +import org.gradle.internal.os.OperatingSystem; apply plugin: 'com.android.application' @@ -106,7 +106,7 @@ android { } def getCocosCommandPath() { - if (Os.isFamily(Os.FAMILY_WINDOWS)) { + if (OperatingSystem.current().isWindows()) { return 'cocos.bat' } else { diff --git a/tests/lua-tests/project/proj.android/app/proguard-rules.pro b/tests/lua-tests/project/proj.android/app/proguard-rules.pro index ecbfe714e5..2c062c4946 100644 --- a/tests/lua-tests/project/proj.android/app/proguard-rules.pro +++ b/tests/lua-tests/project/proj.android/app/proguard-rules.pro @@ -21,7 +21,7 @@ -dontwarn org.cocos2dx.** -keep public class com.chukong.** { *; } -dontwarn com.chukong.** --keep public com.huawei.android.** { *; } +-keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** # Proguard Apache HTTP for release diff --git a/tests/performance-tests/proj.android/app/build.gradle b/tests/performance-tests/proj.android/app/build.gradle index 79e9582d18..7c9467f693 100644 --- a/tests/performance-tests/proj.android/app/build.gradle +++ b/tests/performance-tests/proj.android/app/build.gradle @@ -1,5 +1,3 @@ -import org.apache.tools.ant.taskdefs.condition.Os - apply plugin: 'com.android.application' android {