瀏覽代碼

fix. android native secret key nil

matrixbirds 5 年之前
父節點
當前提交
3ce8000cbb
共有 4 個檔案被更改,包括 12 行新增3 行删除
  1. 10
    1
      android/build.gradle
  2. 0
    0
      android/gradlew
  3. 0
    0
      android/gradlew.bat
  4. 2
    2
      android/src/main/java/com/syan/agora/AgoraManager.java

+ 10
- 1
android/build.gradle 查看文件

@@ -1,5 +1,14 @@
1 1
 apply plugin: 'com.android.library'
2 2
 
3
+allprojects {
4
+    gradle.projectsEvaluated {
5
+        tasks.withType(JavaCompile) {
6
+            options.encoding = 'utf-8'
7
+            options.compilerArgs << "-Xlint:deprecation"
8
+        }
9
+    }
10
+}
11
+
3 12
 buildscript {
4 13
     repositories {
5 14
         google()
@@ -67,7 +76,7 @@ repositories {
67 76
     mavenCentral()
68 77
     mavenLocal()
69 78
     maven {
70
-        url "file:///Users/ly/GithubPremium/react-native-agora/node_modules/react-native"
79
+        url "$rootDir/../node_modules/react-native/android"
71 80
     }
72 81
     jcenter()
73 82
     google()

+ 0
- 0
android/gradlew 查看文件


+ 0
- 0
android/gradlew.bat 查看文件


+ 2
- 2
android/src/main/java/com/syan/agora/AgoraManager.java 查看文件

@@ -93,9 +93,9 @@ public class AgoraManager {
93 93
         //create rtcEngine instance and setup rtcEngine eventHandler
94 94
         try {
95 95
             mRtcEngine = RtcEngine.create(context, options.getString("appid"), mRtcEventHandler);
96
-            if (null != options.getString("secret")) {
96
+            if (options.hasKey("secret") && null != options.getString("secret")) {
97 97
                 mRtcEngine.setEncryptionSecret(options.getString("secret"));
98
-                if (null != options.getString("secretMode")) {
98
+                if (options.hasKey("secretMode") && null != options.getString("secretMode")) {
99 99
                     mRtcEngine.setEncryptionMode(options.getString("secretMode"));
100 100
                 }
101 101
             }