Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
apk_product
/
ForFun
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
b15bc319
...
b15bc319e93be8ec2adfb7a1e48324ea9be56108
authored
2020-04-10 15:26:57 +0800
by
金学艇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.修正未来SDK的参数AppSecret,解决未来SDK认证模块失败的问题
1 parent
511cd2b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
9 deletions
assets/resources/GameLoading/icon_bg.png
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
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/component/NewTVSDK.java
assets/resources/GameLoading/icon_bg.png
View file @
b15bc31
1.11 MB
|
W:
|
H:
344 KB
|
W:
|
H:
2-up
Swipe
Onion skin
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml
View file @
b15bc31
...
...
@@ -73,7 +73,7 @@
android:value=
"4b9ee656631d5d78f112c7ad2b71ea5d"
/>
<meta-data
android:name=
"NewTV.AppSecret"
android:value=
"35199e11ef90c60e51187498e5e4769"
/>
android:value=
"
a
35199e11ef90c60e51187498e5e4769"
/>
<activity
android:name=
"org.cocos2dx.javascript.AppActivity"
...
...
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java
View file @
b15bc31
...
...
@@ -40,6 +40,8 @@ import android.content.IntentFilter;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager
;
import
android.database.Cursor
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.content.Intent
;
...
...
@@ -59,6 +61,7 @@ import android.widget.ImageView;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.knowyou_jni.single.SDKUtil
;
import
com.topdraw.forfun.R
;
...
...
@@ -111,6 +114,9 @@ public class AppActivity extends Cocos2dxActivity {
initSdkData
();
String
token
=
getToken
();
Log
.
d
(
TAG
,
"获取机顶盒的Token..."
+
token
);
//----解决游戏页按返回退出时,背景图透明度过高,onPause和onResume中控制显示还是隐藏
singleView
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
activity_main_single_color
,
null
);
mRLSingleColor
=
singleView
.
findViewById
(
R
.
id
.
ll_single
);
...
...
@@ -168,6 +174,25 @@ public class AppActivity extends Cocos2dxActivity {
SDKWrapper
.
getInstance
().
init
(
this
);
}
private
String
getToken
()
{
String
value
=
""
;
Uri
uri
=
Uri
.
parse
(
"content://stbconfig/authentication/user_token"
);
Cursor
c
=
null
;
try
{
c
=
getContentResolver
().
query
(
uri
,
null
,
"name = ?"
,
new
String
[]{
"stb_device_name "
},
null
);
// 建议使用这种name=?参数化的查询语句来操作
if
(
c
!=
null
&&
c
.
moveToFirst
())
{
value
=
c
.
getString
(
c
.
getColumnIndex
(
"value"
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
c
!=
null
)
{
c
.
close
();
// 游标放到finally块来释放。
}
}
return
value
;
}
private
void
initSdkData
()
{
//init topdraw.jar-----
ApplicationInfo
appInfo
=
null
;
...
...
@@ -415,6 +440,7 @@ public class AppActivity extends Cocos2dxActivity {
SDKUtil
.
isOpenLog
=
true
;
int
sdkResult
=
SDKUtil
.
getInstance
().
ky_initWithAppKey
(
AppActivity
.
this
,
APP_KEY
,
getPackageManager
().
getPackageInfo
(
getPackageName
(),
0
).
versionName
);
Log
.
d
(
TAG
,
"sdkResult..."
+
sdkResult
);
baminSDKInited
=
(
sdkResult
==
0
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"appId"
,
TOPDRAW_APPID
);
...
...
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/component/NewTVSDK.java
View file @
b15bc31
...
...
@@ -54,18 +54,18 @@ public class NewTVSDK {
loginSDK
sdk
=
loginSDK
.
getInstance
();
//这里的账号返回1003,签名错误
//
String newTVAPPID = appInfo.metaData.getString("NewTV.APPID");
//
String newTVChannelCode = appInfo.metaData.getString("NewTV.channelCode");
//
String newTVAppkey = appInfo.metaData.getString("NewTV.Appkey");
//
String newTVAppSecret = appInfo.metaData.getString("NewTV.AppSecret");
String
newTVAPPID
=
appInfo
.
metaData
.
getString
(
"NewTV.APPID"
);
String
newTVChannelCode
=
appInfo
.
metaData
.
getString
(
"NewTV.channelCode"
);
String
newTVAppkey
=
appInfo
.
metaData
.
getString
(
"NewTV.Appkey"
);
String
newTVAppSecret
=
appInfo
.
metaData
.
getString
(
"NewTV.AppSecret"
);
// String newTVAPPID = "4bf34d0e9acf4aa";
// String newTVChannelCode = "2626046001";
// String newTVAppkey = "2e535b79fc515eb17c3c2039517d6c27";
// String newTVAppSecret = "4160dcc2d67eecea0410dc770856d3ae";
String
newTVAPPID
=
"0e0777adb659479"
;
//东成私塾
String
newTVChannelCode
=
"2626035001"
;
String
newTVAppkey
=
"df4fc19c4673bf9b5e70a7a56ece35e5"
;
String
newTVAppSecret
=
"ec695c7b7371db8dbd84a6d01e4c66a9"
;
//
String newTVAPPID = "0e0777adb659479"; //东成私塾
//
String newTVChannelCode = "2626035001";
//
String newTVAppkey = "df4fc19c4673bf9b5e70a7a56ece35e5";
//
String newTVAppSecret = "ec695c7b7371db8dbd84a6d01e4c66a9";
boolean
flag
=
sdk
.
sdkInit
(
loginSDK
.
TYPE_COMMON
,
newTVChannelCode
,
newTVAppkey
,
newTVAppSecret
,
context
);
//初始化是成功的
String
retDeviceLogin
=
sdk
.
deviceLogin
();
Log
.
d
(
"NewTVSDK"
,
flag
+
" init->deviceLogin..."
+
sdk
.
toString
());
...
...
Please
register
or
sign in
to post a comment