Commit 0bd6c189 0bd6c1898824d96269c3cfe5154469bbabf0a668 by 金学艇

Merge branch 'master' into fujian

# Conflicts:
#	build/jsb-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml
#	build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java
2 parents 2da9e428 89afe4b2
Showing 20 changed files with 40 additions and 56 deletions
...@@ -525,7 +525,7 @@ cc.Class({ ...@@ -525,7 +525,7 @@ cc.Class({
525 try { 525 try {
526 cc.log("onCheckQueryNewTV start..."); 526 cc.log("onCheckQueryNewTV start...");
527 this._cLog.screenI("SubIndex拿到播放播放地址" + options); 527 this._cLog.screenI("SubIndex拿到播放播放地址" + options);
528 // jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail"); 528 // jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail");
529 529
530 this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 530 this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试
531 let options = {}; 531 let options = {};
......
...@@ -91,6 +91,9 @@ cc.Class({ ...@@ -91,6 +91,9 @@ cc.Class({
91 }, 91 },
92 92
93 saveHistory: function () { 93 saveHistory: function () {
94 if (!this._oSceneContext._cellData) {
95 return;
96 }
94 var oDataCell = JSON.parse(this._oSceneContext._cellData); 97 var oDataCell = JSON.parse(this._oSceneContext._cellData);
95 var gameHistory = JSON.parse(cc.sys.localStorage.getItem("gameHistoryList")); 98 var gameHistory = JSON.parse(cc.sys.localStorage.getItem("gameHistoryList"));
96 if (gameHistory != null) { 99 if (gameHistory != null) {
...@@ -201,9 +204,9 @@ cc.Class({ ...@@ -201,9 +204,9 @@ cc.Class({
201 return; 204 return;
202 } 205 }
203 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就判断奥比游戏 206 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就判断奥比游戏
204 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "isExistObiApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk"); 207 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "isExistObiApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk");
205 } else { 208 } else {
206 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "isExistApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk"); 209 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "isExistApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk");
207 } 210 }
208 }, 211 },
209 212
...@@ -495,13 +498,13 @@ cc.Class({ ...@@ -495,13 +498,13 @@ cc.Class({
495 } 498 }
496 if (this._bIsExistApk == "true") { 499 if (this._bIsExistApk == "true") {
497 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏 500 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
498 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", Common.TOPDRAW_API_SERVER + this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, ""); 501 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", Common.TOPDRAW_API_SERVER + this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "");
499 } else { 502 } else {
500 //这里应该转圈圈等待加载游戏 503 //这里应该转圈圈等待加载游戏
501 // cc.find("LoadingLabel", this.node).opacity = 255; 504 // cc.find("LoadingLabel", this.node).opacity = 255;
502 // cc.find("Loading/LoadingIcon", this.node).opacity = 255; 505 // cc.find("Loading/LoadingIcon", this.node).opacity = 255;
503 // cc.find("Loading/LoadingIcon", this.node).getComponent(cc.Animation).play(); 506 // cc.find("Loading/LoadingIcon", this.node).getComponent(cc.Animation).play();
504 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, ""); 507 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "");
505 } 508 }
506 } else { 509 } else {
507 this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); 510 this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
......
...@@ -41,9 +41,9 @@ cc.Class({ ...@@ -41,9 +41,9 @@ cc.Class({
41 return; 41 return;
42 } 42 }
43 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏 43 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
44 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "updateProgress"); 44 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "updateProgress");
45 } else { 45 } else {
46 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "updateProgress"); 46 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "updateProgress");
47 } 47 }
48 }, 48 },
49 49
...@@ -101,7 +101,7 @@ cc.Class({ ...@@ -101,7 +101,7 @@ cc.Class({
101 case Common.ANDROID_KEY.back: 101 case Common.ANDROID_KEY.back:
102 this._bIsFocusInit = true; 102 this._bIsFocusInit = true;
103 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏 103 if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
104 jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "closeDownloadObiApk", "()V"); 104 jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "closeDownloadObiApk", "()V");
105 } 105 }
106 this.backAScene(); 106 this.backAScene();
107 break; 107 break;
......
1 const player = "com/topdraw/component/CocosMediaPlayer"; 1 const player = "org/cocos2dx/javascript/component/CocosMediaPlayer";
2 2
3 const CALLBACK_FUNCS = { 3 const CALLBACK_FUNCS = {
4 INFO: null, 4 INFO: null,
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
24 ****************************************************************************/ 24 ****************************************************************************/
25 package org.cocos2dx.javascript; 25 package org.cocos2dx.javascript;
26 26
27 import org.cocos2dx.javascript.common.OBiPluginLoader;
28 import org.cocos2dx.javascript.common.PluginLoader;
29 import org.cocos2dx.javascript.component.NewTVSDK;
27 import org.cocos2dx.lib.Cocos2dxActivity; 30 import org.cocos2dx.lib.Cocos2dxActivity;
28 import org.cocos2dx.lib.Cocos2dxGLSurfaceView; 31 import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
29 import org.cocos2dx.lib.Cocos2dxJavascriptJavaBridge;
30 32
31 import android.app.AlertDialog; 33 import android.app.AlertDialog;
32 import android.content.BroadcastReceiver; 34 import android.content.BroadcastReceiver;
...@@ -40,11 +42,9 @@ import android.os.Bundle; ...@@ -40,11 +42,9 @@ import android.os.Bundle;
40 42
41 import android.content.Intent; 43 import android.content.Intent;
42 import android.content.res.Configuration; 44 import android.content.res.Configuration;
43 import android.os.Environment;
44 import android.os.Handler; 45 import android.os.Handler;
45 import android.provider.Settings; 46 import android.provider.Settings;
46 import android.util.Log; 47 import android.util.Log;
47 import android.view.KeyEvent;
48 import android.view.LayoutInflater; 48 import android.view.LayoutInflater;
49 import android.view.View; 49 import android.view.View;
50 import android.view.WindowManager; 50 import android.view.WindowManager;
...@@ -54,20 +54,12 @@ import android.webkit.WebView; ...@@ -54,20 +54,12 @@ import android.webkit.WebView;
54 import android.webkit.WebViewClient; 54 import android.webkit.WebViewClient;
55 import android.widget.FrameLayout; 55 import android.widget.FrameLayout;
56 import android.widget.ImageView; 56 import android.widget.ImageView;
57 import android.widget.LinearLayout;
58 import android.widget.RelativeLayout; 57 import android.widget.RelativeLayout;
59 import android.widget.TextView; 58 import android.widget.TextView;
60 import android.widget.Toast; 59 import android.widget.Toast;
61
62 import com.knowyou_jni.single.SDKUtil; 60 import com.knowyou_jni.single.SDKUtil;
63 import com.topdraw.component.CocosMediaPlayer;
64 import com.topdraw.component.NewTVSDK;
65 import com.topdraw.forfun.R; 61 import com.topdraw.forfun.R;
66 import com.topdraw.melody.CommonUtils; 62
67 import com.topdraw.melody.MelodyApplication;
68 import com.topdraw.melody.OBiPluginLoader;
69 import com.topdraw.melody.PluginLoader;
70 import com.topdraw.melody.TopdrawSDKWrapper;
71 import com.topdraw.sdk.ITopdrawResultListener; 63 import com.topdraw.sdk.ITopdrawResultListener;
72 import com.topdraw.sdk.ITopdrawSDK; 64 import com.topdraw.sdk.ITopdrawSDK;
73 import com.topdraw.sdk.TopdrawSDK; 65 import com.topdraw.sdk.TopdrawSDK;
...@@ -79,6 +71,11 @@ import java.util.Map; ...@@ -79,6 +71,11 @@ import java.util.Map;
79 import tv.icntv.adsdk.AdSDK; 71 import tv.icntv.adsdk.AdSDK;
80 import tv.icntv.logsdk.logSDK; 72 import tv.icntv.logsdk.logSDK;
81 import tv.icntv.ottlogin.loginSDK; 73 import tv.icntv.ottlogin.loginSDK;
74 import org.cocos2dx.javascript.component.CocosMediaPlayer;
75 import com.topdraw.forfun.R;
76 import org.cocos2dx.javascript.common.CommonUtils;
77 import org.cocos2dx.javascript.common.MelodyApplication;
78 import org.cocos2dx.javascript.common.TopdrawSDKWrapper;
82 79
83 public class AppActivity extends Cocos2dxActivity { 80 public class AppActivity extends Cocos2dxActivity {
84 private static String TAG = "AppActivity"; 81 private static String TAG = "AppActivity";
......
1 package com.topdraw.melody; 1 package org.cocos2dx.javascript.common;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.pm.PackageInfo; 4 import android.content.pm.PackageInfo;
......
1 package com.topdraw.melody; 1 package org.cocos2dx.javascript.common;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.util.Log; 4 import android.util.Log;
......
1 package com.topdraw.melody; 1 package org.cocos2dx.javascript.common;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.os.Environment;
5 import android.os.Handler;
6 import android.util.Log; 4 import android.util.Log;
7 5
8 import org.json.JSONArray;
9 import org.json.JSONObject;
10
11 import java.io.BufferedInputStream; 6 import java.io.BufferedInputStream;
12 import java.io.ByteArrayOutputStream;
13 import java.io.File; 7 import java.io.File;
14 import java.io.FileInputStream;
15 import java.io.FileOutputStream; 8 import java.io.FileOutputStream;
16 import java.io.IOException; 9 import java.io.IOException;
17 import java.net.HttpURLConnection; 10 import java.net.HttpURLConnection;
18 import java.net.URL; 11 import java.net.URL;
19 import java.security.MessageDigest;
20 import java.util.ArrayList;
21 import java.util.HashMap;
22 import java.util.List;
23 import java.util.Map;
24 import java.util.regex.Pattern; 12 import java.util.regex.Pattern;
25 13
26 /** 14 /**
......
1 package com.topdraw.melody; 1 package org.cocos2dx.javascript.common;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.os.Handler; 4 import android.os.Handler;
......
1 package com.topdraw.melody; 1 package org.cocos2dx.javascript.common;
2 2
3 import android.content.ComponentName; 3 import android.content.ComponentName;
4 import android.content.Context; 4 import android.content.Context;
5 import android.content.Intent; 5 import android.content.Intent;
6 import android.content.pm.ApplicationInfo;
7 import android.content.pm.PackageInfo; 6 import android.content.pm.PackageInfo;
8 import android.content.pm.PackageManager; 7 import android.content.pm.PackageManager;
9 import android.net.Uri; 8 import android.net.Uri;
10 import android.os.Environment;
11 import android.text.TextUtils; 9 import android.text.TextUtils;
12 import android.util.Log; 10 import android.util.Log;
13 import android.view.View; 11 import android.view.View;
...@@ -21,8 +19,6 @@ import com.topdraw.forfun.R; ...@@ -21,8 +19,6 @@ import com.topdraw.forfun.R;
21 import com.topdraw.sdk.*; 19 import com.topdraw.sdk.*;
22 20
23 import java.io.File; 21 import java.io.File;
24 import java.io.IOException;
25 import java.util.*;
26 22
27 import org.cocos2dx.javascript.AppActivity; 23 import org.cocos2dx.javascript.AppActivity;
28 import org.json.JSONArray; 24 import org.json.JSONArray;
......
1 package com.topdraw.component; 1 package org.cocos2dx.javascript.component;
2 2
3 import android.annotation.SuppressLint; 3 import android.annotation.SuppressLint;
4 import android.content.Context; 4 import android.content.Context;
......
1 package com.topdraw.component; 1 package org.cocos2dx.javascript.component;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Context; 4 import android.content.Context;
...@@ -7,7 +7,7 @@ import android.os.Message; ...@@ -7,7 +7,7 @@ import android.os.Message;
7 import android.util.Log; 7 import android.util.Log;
8 import android.widget.FrameLayout; 8 import android.widget.FrameLayout;
9 9
10 import com.topdraw.component.player.AndroidMediaPlayer; 10 import org.cocos2dx.javascript.component.player.AndroidMediaPlayer;
11 //import com.topdraw.component.player.NewTVMediaPlayer; 11 //import com.topdraw.component.player.NewTVMediaPlayer;
12 //import com.topdraw.component.player.VitamioMediaPlayer; 12 //import com.topdraw.component.player.VitamioMediaPlayer;
13 13
......
1 package com.topdraw.component; 1 package org.cocos2dx.javascript.component;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.os.Handler; 4 import android.os.Handler;
......
1 package com.topdraw.component; 1 package org.cocos2dx.javascript.component;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.util.Log; 4 import android.util.Log;
......
1 package com.topdraw.component; 1 package org.cocos2dx.javascript.component;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.pm.ApplicationInfo; 4 import android.content.pm.ApplicationInfo;
......
1 package com.topdraw.component.player; 1 package org.cocos2dx.javascript.component.player;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.graphics.PixelFormat; 4 import android.graphics.PixelFormat;
...@@ -10,8 +10,8 @@ import android.view.SurfaceHolder; ...@@ -10,8 +10,8 @@ import android.view.SurfaceHolder;
10 import android.view.SurfaceView; 10 import android.view.SurfaceView;
11 import android.widget.FrameLayout; 11 import android.widget.FrameLayout;
12 12
13 import com.topdraw.component.CocosMediaPlayer; 13 import org.cocos2dx.javascript.component.CocosMediaPlayer;
14 import com.topdraw.component.IMediaPlayer; 14 import org.cocos2dx.javascript.component.IMediaPlayer;
15 15
16 import java.io.IOException; 16 import java.io.IOException;
17 17
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
6 //import android.util.Log; 6 //import android.util.Log;
7 //import android.widget.FrameLayout; 7 //import android.widget.FrameLayout;
8 // 8 //
9 //import com.topdraw.component.CocosMediaPlayer; 9 //import CocosMediaPlayer;
10 //import com.topdraw.component.IMediaPlayer; 10 //import IMediaPlayer;
11 // 11 //
12 //import org.json.JSONException; 12 //import org.json.JSONException;
13 //import org.json.JSONObject; 13 //import org.json.JSONObject;
......
1 package com.topdraw.component.player;//package com.topdraw.component.player; 1 package org.cocos2dx.javascript.component.player;//package com.topdraw.component.player;
2 // 2 //
3 //import android.content.Context; 3 //import android.content.Context;
4 //import android.graphics.PixelFormat; 4 //import android.graphics.PixelFormat;
...@@ -8,8 +8,8 @@ package com.topdraw.component.player;//package com.topdraw.component.player; ...@@ -8,8 +8,8 @@ package com.topdraw.component.player;//package com.topdraw.component.player;
8 //import android.view.SurfaceView; 8 //import android.view.SurfaceView;
9 //import android.widget.FrameLayout; 9 //import android.widget.FrameLayout;
10 // 10 //
11 //import com.topdraw.component.CocosMediaPlayer; 11 //import CocosMediaPlayer;
12 //import com.topdraw.component.IMediaPlayer; 12 //import IMediaPlayer;
13 // 13 //
14 //import java.io.IOException; 14 //import java.io.IOException;
15 // 15 //
......