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
fb6032f2
Commit
fb6032f2
authored
Dec 12, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加运营商信息上送
parent
ec5c3105
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
760 additions
and
29 deletions
+760
-29
InitAppService.kt
...y/app/src/main/java/com/mints/goodmoney/InitAppService.kt
+0
-6
DeviceInfo.kt
...pp/src/main/java/com/mints/goodmoney/common/DeviceInfo.kt
+87
-2
AwardPresenter.java
...va/com/mints/goodmoney/mvp/presenters/AwardPresenter.java
+2
-3
DrawcashPresenter.java
...com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
+3
-3
HomePresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
+2
-2
LoginPresenter.kt
...java/com/mints/goodmoney/mvp/presenters/LoginPresenter.kt
+1
-2
MyPresenter.kt
...in/java/com/mints/goodmoney/mvp/presenters/MyPresenter.kt
+1
-1
PanPresenter.kt
...n/java/com/mints/goodmoney/mvp/presenters/PanPresenter.kt
+1
-1
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+3
-2
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+0
-2
WrapperActivity.kt
.../java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
+0
-1
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+1
-2
SimUtils.java
...app/src/main/java/com/mints/goodmoney/utils/SimUtils.java
+344
-0
StorageQueryUtil.java
...main/java/com/mints/goodmoney/utils/StorageQueryUtil.java
+255
-0
SystemUtils.kt
...pp/src/main/java/com/mints/goodmoney/utils/SystemUtils.kt
+60
-2
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/InitAppService.kt
View file @
fb6032f2
...
...
@@ -6,12 +6,7 @@ import android.content.Context
import
android.content.Intent
import
cn.jpush.android.api.BasicPushNotificationBuilder
import
cn.jpush.android.api.JPushInterface
import
com.fly.scenemodule.SceneUtil
import
com.fly.scenemodule.model.GDTInfo
import
com.fly.scenemodule.model.TTInfo
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.BxmManager.initBxm
import
com.mints.goodmoney.manager.SceneManager
import
com.mints.library.utils.CommonUtils
import
com.mob.MobSDK
import
com.orhanobut.logger.AndroidLogAdapter
...
...
@@ -22,7 +17,6 @@ import com.tendcloud.tenddata.TCAgent
import
com.umeng.analytics.MobclickAgent
import
com.umeng.commonsdk.UMConfigure
/**
* 子线程初始化SDK
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/DeviceInfo.kt
View file @
fb6032f2
...
...
@@ -10,13 +10,15 @@ import android.net.Proxy
import
android.net.wifi.WifiInfo
import
android.net.wifi.WifiManager
import
android.os.Build
import
android.os.SystemClock
import
android.provider.Settings
import
android.telephony.TelephonyManager
import
android.text.TextUtils
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.utils.SimUtils
import
com.mints.goodmoney.utils.StorageQueryUtil
import
com.mints.goodmoney.utils.SystemUtils
import
com.mints.library.utils.json.JsonUtil
import
java.io.*
import
java.net.NetworkInterface
...
...
@@ -42,6 +44,89 @@ class DeviceInfo private constructor() {
return
proxyUrl
}
/**
* android4.2以上
* 系统从启动到现在的时间
* 单位:ms
*
*/
val
elapsedRealtime
=
SystemClock
.
elapsedRealtime
()
/**
*
*/
val
newModel
:
String
get
()
{
return
brand
+
" "
+
mobileModel
+
" "
+
totalMemory
+
"+"
+
totalStorage
+
" "
+
operator
}
/**
* 运营商名称
*
*/
val
operator
:
String
get
()
{
val
sb
=
StringBuilder
(
""
)
try
{
var
needSingleSim
=
false
// 卡1
val
simStateBySlotIdx1
=
SimUtils
.
getSimStateBySlotIdx
(
MintsApplication
.
getContext
(),
0
)
// 卡2
val
simStateBySlotIdx2
=
SimUtils
.
getSimStateBySlotIdx
(
MintsApplication
.
getContext
(),
1
)
if
(
simStateBySlotIdx1
)
{
val
providersName1
=
SimUtils
.
getSimOperatorName2
(
MintsApplication
.
getContext
(),
0
)
if
(
TextUtils
.
equals
(
providersName1
,
"unknown"
))
{
needSingleSim
=
true
sb
.
append
(
SimUtils
.
getSimOperatorNameBySingle
(
MintsApplication
.
getContext
())
+
" "
)
}
else
{
sb
.
append
(
"$providersName1 "
)
}
}
else
{
sb
.
append
(
"未插卡 "
)
}
if
(
simStateBySlotIdx2
)
{
val
providersName2
=
SimUtils
.
getSimOperatorName2
(
MintsApplication
.
getContext
(),
1
)
if
(
TextUtils
.
equals
(
providersName2
,
"unknown"
)
&&
!
needSingleSim
)
{
sb
.
append
(
SimUtils
.
getSimOperatorNameBySingle
(
MintsApplication
.
getContext
())
+
" "
)
}
else
{
sb
.
append
(
"$providersName2 "
)
}
}
else
{
sb
.
append
(
"未插卡 "
)
}
}
catch
(
e
:
Exception
)
{
}
return
sb
.
toString
()
}
/**
* 手机内存大小
*
*/
val
totalMemory
:
String
get
()
{
return
SystemUtils
.
getTotalMemory
()
}
/**
* 手机存储大小
*
*/
val
totalStorage
:
String
get
()
{
return
StorageQueryUtil
.
getTotalStorageSize
(
MintsApplication
.
getContext
())
}
/**
* get device's IMSI
*
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/AwardPresenter.java
View file @
fb6032f2
...
...
@@ -9,7 +9,6 @@ import com.mints.goodmoney.manager.AppHttpManager;
import
com.mints.goodmoney.manager.ShumeiManager
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.model.UserBean
;
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
;
import
com.mints.goodmoney.mvp.views.AwardView
;
import
com.mints.goodmoney.utils.DeviceUuidFactory
;
import
com.mints.goodmoney.utils.rxutil.CommonRxTask
;
...
...
@@ -49,7 +48,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
switch
(
code
)
{
case
200
:
//成功
JsonObject
data
=
baseResponse
.
getData
();
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
view
.
getUserTaskMsgSuc
(
data
.
get
(
"coin"
).
getAsInt
());
}
break
;
...
...
@@ -82,7 +81,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
vo
.
put
(
"androidid"
,
deviceInfo
.
getAndroidId
(
null
));
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"shumeiId"
,
ShumeiManager
.
getInstance
().
getShumeiDeviceId
());
vo
.
put
(
"model"
,
deviceInfo
.
get
Brand
()
+
" "
+
deviceInfo
.
getMobile
Model
());
vo
.
put
(
"model"
,
deviceInfo
.
get
New
Model
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
View file @
fb6032f2
...
...
@@ -69,7 +69,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
/**
* 修改用户信息
*/
public
void
editUserMsg
(
String
wxOpenid
,
String
wxInfo
)
{
public
void
editUserMsg
(
String
wxOpenid
,
String
wxInfo
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"type"
,
"OPENID"
);
vo
.
put
(
"value"
,
wxInfo
);
...
...
@@ -107,7 +107,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
view
.
editUserMsgSuc
();
}
break
;
case
612
:
case
612
:
view
.
mergeAccount
(
UserManager
.
getInstance
().
getMobile
(),
wxOpenid
,
baseResponse
.
getData
().
getToKeepAnAccount
());
break
;
default
:
...
...
@@ -144,7 +144,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo
.
put
(
"androidid"
,
deviceInfo
.
getAndroidId
(
null
));
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"shumeiId"
,
ShumeiManager
.
getInstance
().
getShumeiDeviceId
());
vo
.
put
(
"model"
,
deviceInfo
.
get
Brand
()
+
" "
+
deviceInfo
.
getMobile
Model
());
vo
.
put
(
"model"
,
deviceInfo
.
get
New
Model
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
View file @
fb6032f2
...
...
@@ -34,7 +34,7 @@ class HomePresenter : BasePresenter<HomeView>() {
vo
[
"imei"
]
=
deviceInfo
.
iMEI
vo
[
"oaid"
]
=
MintsApplication
.
OAID
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
brand
+
" "
+
deviceInfo
.
mobile
Model
vo
[
"model"
]
=
deviceInfo
.
new
Model
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
...
...
@@ -167,7 +167,7 @@ class HomePresenter : BasePresenter<HomeView>() {
vo
[
"oaid"
]
=
MintsApplication
.
OAID
}
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
brand
+
" "
+
deviceInfo
.
mobile
Model
vo
[
"model"
]
=
deviceInfo
.
new
Model
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/LoginPresenter.kt
View file @
fb6032f2
...
...
@@ -247,7 +247,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo
[
"oaid"
]
=
MintsApplication
.
OAID
}
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
brand
+
" "
+
deviceInfo
.
mobile
Model
vo
[
"model"
]
=
deviceInfo
.
new
Model
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
...
...
@@ -280,6 +280,5 @@ class LoginPresenter : BasePresenter<LoginView>() {
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/MyPresenter.kt
View file @
fb6032f2
...
...
@@ -193,7 +193,7 @@ class MyPresenter : BasePresenter<MyView>() {
vo
[
"oaid"
]
=
MintsApplication
.
OAID
}
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
brand
+
" "
+
deviceInfo
.
mobile
Model
vo
[
"model"
]
=
deviceInfo
.
new
Model
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/PanPresenter.kt
View file @
fb6032f2
...
...
@@ -67,7 +67,7 @@ class PanPresenter : BasePresenter<PanView>() {
vo
[
"oaid"
]
=
MintsApplication
.
OAID
}
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
brand
+
" "
+
deviceInfo
.
mobile
Model
vo
[
"model"
]
=
deviceInfo
.
new
Model
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
fb6032f2
...
...
@@ -2,14 +2,15 @@ package com.mints.goodmoney.ui.activitys
import
android.content.Context
import
android.media.AudioManager
import
android.os.Build
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentManager
import
androidx.fragment.app.FragmentTransaction
import
com.bytedance.hume.readapk.HumeSDK
import
com.ireader.ireadersdk.IreaderApi
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.video.VedioAdingManager
import
com.mints.goodmoney.common.AppConfig
...
...
@@ -19,9 +20,9 @@ import com.mints.goodmoney.mvp.views.MainView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.*
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.SimUtils
import
kotlinx.android.synthetic.main.activity_main.*
/**
* 描述:main
* 作者:孟崔广
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
fb6032f2
...
...
@@ -42,8 +42,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
override
fun
initViewsAndEvents
()
{
settingsPresenter
.
attachView
(
this
)
SceneUtil
.
signIn
(
this
,
SceneManager
.
SCENE_CHANNEL_Id
,
userManager
.
userID
,
MintsApplication
.
OAID
)
initLayout
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
View file @
fb6032f2
...
...
@@ -7,7 +7,6 @@ import com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import
com.mints.goodmoney.ui.fragment.RsNewsFragment
import
com.mints.goodmoney.ui.fragment.ZhangyueFragment
import
kotlinx.android.synthetic.main.header_layout.*
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
fb6032f2
...
...
@@ -839,7 +839,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
// 聚乐云
// 聚乐云
初始化
SceneManager
.
initScene
()
// 同步账户
SceneUtil
.
signIn
(
requireActivity
(),
SceneManager
.
SCENE_CHANNEL_Id
,
userManager
.
userID
,
MintsApplication
.
OAID
)
...
...
@@ -881,7 +881,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
// vedioAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate)
vedioAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
// 广告视频数
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/SimUtils.java
0 → 100644
View file @
fb6032f2
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/StorageQueryUtil.java
0 → 100644
View file @
fb6032f2
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/SystemUtils.kt
View file @
fb6032f2
package
com.mints.goodmoney.utils
import
android.app.ActivityManager
import
android.app.usage.StorageStatsManager
import
android.content.Context
import
android.os.Build
import
android.os.Environment
import
android.os.StatFs
import
android.os.storage.StorageManager
import
androidx.core.content.ContextCompat.getSystemService
import
java.io.BufferedReader
import
java.io.File
import
java.io.FileReader
import
java.io.IOException
import
java.lang.reflect.Field
import
java.lang.reflect.Method
import
java.util.*
import
kotlin.math.ceil
object
SystemUtils
{
...
...
@@ -21,8 +36,8 @@ object SystemUtils {
fun
getProcessName
(
cxt
:
Context
,
pid
:
Int
):
String
?
{
val
am
:
ActivityManager
=
cxt
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
)
as
ActivityManager
val
runningApps
:
List
<
ActivityManager
.
RunningAppProcessInfo
>
=
am
.
runningAppProcesses
?:
return
null
am
.
runningAppProcesses
?:
return
null
for
(
procInfo
in
runningApps
)
{
if
(
procInfo
.
pid
==
pid
)
{
return
procInfo
.
processName
...
...
@@ -30,4 +45,47 @@ object SystemUtils {
}
return
null
}
/**
* ram
*/
fun
getTotalMemory
():
String
{
// 系统内存信息文件
val
file
=
"/proc/meminfo"
val
memInfo
:
String
val
strs
:
Array
<
String
>
var
memory
:
Long
=
0
try
{
val
fileReader
=
FileReader
(
file
)
val
bufferedReader
=
BufferedReader
(
fileReader
,
8192
)
// 读取meminfo第一行,系统内存大小
memInfo
=
bufferedReader
.
readLine
()
strs
=
memInfo
.
split
(
"\\s+"
.
toRegex
()).
toTypedArray
()
// 获得系统总内存,单位KB
memory
=
Integer
.
valueOf
(
strs
[
1
]).
toLong
()
bufferedReader
.
close
()
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
return
""
+
ceil
((
memory
.
toFloat
()
/
(
1024
*
1024
).
toDouble
())).
toInt
()
+
"GB"
}
/**
* 获取手机内部空间总大小
*
* @return 大小,字节为单位
*/
fun
getTotalInternalMemorySize
():
String
{
//获取内部存储根目录
val
path
:
File
=
Environment
.
getExternalStorageDirectory
()
//系统的空间描述类
val
stat
=
StatFs
(
path
.
absolutePath
)
//每个区块占字节数
val
totalSize
=
stat
.
totalBytes
return
""
+
ceil
((
totalSize
.
toFloat
()
/
(
1024
*
1024
*
1024
).
toDouble
())).
toInt
()
+
"GB"
}
}
\ No newline at end of file
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