Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
92d381f9
Commit
92d381f9
authored
Nov 11, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加猎豹接口,优化启动白屏
parent
d565501d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
10 deletions
+126
-10
build.gradle
GoodMoney/app/build.gradle
+1
-1
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+23
-1
MiitHelper.java
...src/main/java/com/mints/goodmoney/manager/MiitHelper.java
+100
-0
GamePresenter.java
...ava/com/mints/goodmoney/mvp/presenters/GamePresenter.java
+2
-1
EraseActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/EraseActivity.kt
+0
-7
No files found.
GoodMoney/app/build.gradle
View file @
92d381f9
...
@@ -179,7 +179,7 @@ dependencies {
...
@@ -179,7 +179,7 @@ dependencies {
// 三方接入
// 三方接入
// leakcanary
// leakcanary
debugImplementation
'com.squareup.leakcanary:leakcanary-android:2.4'
//
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送
// 极光推送
implementation
'cn.jiguang.sdk:jpush:3.6.6'
implementation
'cn.jiguang.sdk:jpush:3.6.6'
implementation
'cn.jiguang.sdk:jcore:2.3.8'
implementation
'cn.jiguang.sdk:jcore:2.3.8'
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
92d381f9
...
@@ -6,6 +6,7 @@ import android.os.Build;
...
@@ -6,6 +6,7 @@ import android.os.Build;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.webkit.WebView
;
import
android.webkit.WebView
;
import
androidx.annotation.NonNull
;
import
androidx.localbroadcastmanager.content.LocalBroadcastManager
;
import
androidx.localbroadcastmanager.content.LocalBroadcastManager
;
import
androidx.multidex.MultiDex
;
import
androidx.multidex.MultiDex
;
import
androidx.multidex.MultiDexApplication
;
import
androidx.multidex.MultiDexApplication
;
...
@@ -14,6 +15,7 @@ import com.bun.miitmdid.core.JLibrary;
...
@@ -14,6 +15,7 @@ import com.bun.miitmdid.core.JLibrary;
import
com.component.dly.xzzq_ywsdk.YwSDK
;
import
com.component.dly.xzzq_ywsdk.YwSDK
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.LiebaoManager
;
import
com.mints.goodmoney.manager.LiebaoManager
;
import
com.mints.goodmoney.manager.MiitHelper
;
import
com.mints.goodmoney.manager.OaidManager
;
import
com.mints.goodmoney.manager.OaidManager
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.UserManager
;
import
com.mints.goodmoney.manager.UserManager
;
...
@@ -90,7 +92,7 @@ public class MintsApplication extends MultiDexApplication {
...
@@ -90,7 +92,7 @@ public class MintsApplication extends MultiDexApplication {
*/
*/
private
void
thirdConfig
()
{
private
void
thirdConfig
()
{
// 移动安全联盟 oaid
// 移动安全联盟 oaid
init
Oaid
();
init
MiitHelper
();
//Android 9 or above must be set
//Android 9 or above must be set
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
...
@@ -132,6 +134,26 @@ public class MintsApplication extends MultiDexApplication {
...
@@ -132,6 +134,26 @@ public class MintsApplication extends MultiDexApplication {
// BxmManager.INSTANCE.initBxm(this);
// BxmManager.INSTANCE.initBxm(this);
}
}
private
MiitHelper
.
AppIdsUpdater
appIdsUpdater
=
new
MiitHelper
.
AppIdsUpdater
()
{
@Override
public
void
OnIdsAvalid
(
@NonNull
String
ids
)
{
OAID
=
ids
;
}
};
/**
* 移动安装联盟 获取OAID等设备标识符
*/
private
void
initMiitHelper
()
{
try
{
MiitHelper
miitHelper
=
new
MiitHelper
(
appIdsUpdater
);
miitHelper
.
getDeviceIds
(
getApplicationContext
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LogUtil
.
e
(
e
);
}
}
/**
/**
* 移动安装联盟 获取OAID等设备标识符
* 移动安装联盟 获取OAID等设备标识符
*/
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/MiitHelper.java
0 → 100755
View file @
92d381f9
package
com
.
mints
.
goodmoney
.
manager
;
import
android.content.Context
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
com.bun.miitmdid.core.ErrorCode
;
import
com.bun.miitmdid.core.MdidSdk
;
import
com.bun.miitmdid.core.MdidSdkHelper
;
import
com.bun.supplier.IIdentifierListener
;
import
com.bun.supplier.IdSupplier
;
import
com.mints.goodmoney.MintsApplication
;
/**
* Created by zheng on 2019/8/22.
*/
public
class
MiitHelper
implements
IIdentifierListener
{
private
AppIdsUpdater
_listener
;
public
MiitHelper
(
AppIdsUpdater
callback
)
{
_listener
=
callback
;
}
public
void
getDeviceIds
(
Context
cxt
)
{
long
timeb
=
System
.
currentTimeMillis
();
int
nres
=
CallFromReflect
(
cxt
);
// int nres=DirectCall(cxt);
long
timee
=
System
.
currentTimeMillis
();
long
offset
=
timee
-
timeb
;
// if (nres == ErrorCode.INIT_ERROR_DEVICE_NOSUPPORT) {//1008612 不支持的设备
// MintsApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_LOAD_CONFIGFILE) {//1008613 加载配置文件出错
// MintsApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_MANUFACTURER_NOSUPPORT) {//1008611 不支持的设备厂商
// MintsApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_RESULT_DELAY) {//1008614 获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程
// //TODO 这种情况,还不清楚怎么解决呢。暂且先返false
// MintsApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_HELPER_CALL_ERROR) {//1008615 反射调用出错
// MintsApplication.setIsSupportOaid(false, nres);
// }
Log
.
d
(
getClass
().
getSimpleName
(),
"return value: "
+
String
.
valueOf
(
nres
));
}
/*
* 通过反射调用,解决android 9以后的类加载升级,导至找不到so中的方法
*
* */
private
int
CallFromReflect
(
Context
cxt
)
{
return
MdidSdkHelper
.
InitSdk
(
cxt
,
true
,
this
);
}
/*
* 直接java调用,如果这样调用,在android 9以前没有题,在android 9以后会抛找不到so方法的异常
* 解决办法是和JLibrary.InitEntry(cxt),分开调用,比如在A类中调用JLibrary.InitEntry(cxt),在B类中调用MdidSdk的方法
* A和B不能存在直接和间接依赖关系,否则也会报错
*
* */
private
int
DirectCall
(
Context
cxt
)
{
MdidSdk
sdk
=
new
MdidSdk
();
return
sdk
.
InitSdk
(
cxt
,
this
);
}
@Override
public
void
OnSupport
(
boolean
isSupport
,
IdSupplier
_supplier
)
{
if
(
_supplier
==
null
)
{
return
;
}
/* String oaid=_supplier.getOaid();
String vaid=_supplier.getVAID();
String aaid=_supplier.getAAID();
String udid=_supplier.getUDID();
StringBuilder builder=new StringBuilder();
builder.append("support: ").append(isSupport?"true":"false").append("\n");
builder.append("UDID: ").append(udid).append("\n");
builder.append("OAID: ").append(oaid).append("\n");
builder.append("VAID: ").append(vaid).append("\n");
builder.append("AAID: ").append(aaid).append("\n");
String idstext=builder.toString();*/
// MintsApplication.setIsSupportOaid(isSupport);
String
oaid
=
_supplier
.
getOAID
();
// _supplier.shutDown(); //关闭接口
if
(
_listener
!=
null
)
{
_listener
.
OnIdsAvalid
(
oaid
);
}
}
public
interface
AppIdsUpdater
{
void
OnIdsAvalid
(
@NonNull
String
ids
);
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/GamePresenter.java
View file @
92d381f9
...
@@ -78,7 +78,8 @@ public class GamePresenter extends BasePresenter<GameView> {
...
@@ -78,7 +78,8 @@ public class GamePresenter extends BasePresenter<GameView> {
switch
(
code
)
{
switch
(
code
)
{
case
200
:
//成功
case
200
:
//成功
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
view
.
gameInfo
(
0
,
0
,
0
);
JsonObject
gameMsg
=
data
.
getAsJsonObject
(
"msg"
);
view
.
gameInfo
(
gameMsg
.
get
(
"needSecods"
).
getAsInt
(),
gameMsg
.
get
(
"coin"
).
getAsInt
(),
gameMsg
.
get
(
"completeSeconds"
).
getAsInt
());
}
}
break
;
break
;
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/EraseActivity.kt
View file @
92d381f9
...
@@ -83,17 +83,10 @@ class EraseActivity : BaseActivity(), View.OnClickListener{
...
@@ -83,17 +83,10 @@ class EraseActivity : BaseActivity(), View.OnClickListener{
*/
*/
private
fun
loadTurnUrl
()
{
private
fun
loadTurnUrl
()
{
getTurnUrl
()
getTurnUrl
()
blEarseWebview
.
setOnTouchListener
(
object
:
View
.
OnTouchListener
{
override
fun
onTouch
(
v
:
View
?,
event
:
MotionEvent
):
Boolean
{
return
event
.
action
==
MotionEvent
.
ACTION_MOVE
}
})
blEarseWebview
.
setDefaultHandler
(
DefaultHandler
())
blEarseWebview
.
setDefaultHandler
(
DefaultHandler
())
blEarseWebview
.
setWebChromeClient
(
WebChromeClient
())
blEarseWebview
.
setWebChromeClient
(
WebChromeClient
())
blEarseWebview
.
setOnLongClickListener
(
OnLongClickListener
{
true
})
blEarseWebview
.
setOnLongClickListener
(
OnLongClickListener
{
true
})
//注册监听方法当js中调用callHandler方法时会调用此方法(handlerName必须和js中相同)
blEarseWebview
.
registerHandler
(
"getEraseResult"
,
BridgeHandler
{
data
,
function
->
blEarseWebview
.
registerHandler
(
"getEraseResult"
,
BridgeHandler
{
data
,
function
->
//{"title":"40金币","coin":40,"key":"t4"}
val
turntableBean
:
TurntableBean
=
JsonUtil
.
parseJson
(
data
,
TurntableBean
::
class
.
java
)
val
turntableBean
:
TurntableBean
=
JsonUtil
.
parseJson
(
data
,
TurntableBean
::
class
.
java
)
if
(
turntableBean
!=
null
)
{
if
(
turntableBean
!=
null
)
{
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment