Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
FileManager
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanglin
FileManager
Commits
d645bfd6
Commit
d645bfd6
authored
Aug 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
3084da4b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
665 additions
and
624 deletions
+665
-624
Project.xml
.idea/codeStyles/Project.xml
+1
-0
build.gradle
app/build.gradle
+34
-27
MainActivity.kt
app/src/main/java/com/xm/test/myfile/MainActivity.kt
+14
-15
BatteryActivity.kt
.../main/java/com/xm/test/myfile/activity/BatteryActivity.kt
+8
-7
CleanActivity.kt
...rc/main/java/com/xm/test/myfile/activity/CleanActivity.kt
+3
-2
ImageShowActivity.kt
...ain/java/com/xm/test/myfile/activity/ImageShowActivity.kt
+3
-2
MediaActivity.kt
...rc/main/java/com/xm/test/myfile/activity/MediaActivity.kt
+18
-19
MoveOrCopyActivity.kt
...in/java/com/xm/test/myfile/activity/MoveOrCopyActivity.kt
+32
-27
ResultPageActivity.kt
...in/java/com/xm/test/myfile/activity/ResultPageActivity.kt
+7
-6
ScanResultActivity.kt
...in/java/com/xm/test/myfile/activity/ScanResultActivity.kt
+76
-89
SimilarImagesActivity.kt
...java/com/xm/test/myfile/activity/SimilarImagesActivity.kt
+38
-39
EventHelper.kt
app/src/main/java/com/xm/test/myfile/ad/EventHelper.kt
+29
-32
GravitySensorManager.kt
...c/main/java/com/xm/test/myfile/ad/GravitySensorManager.kt
+2
-33
KokoReportHelper.kt
app/src/main/java/com/xm/test/myfile/ad/KokoReportHelper.kt
+41
-23
MaxAdUtils.kt
app/src/main/java/com/xm/test/myfile/ad/MaxAdUtils.kt
+110
-41
MyReportViewLisenter.kt
...c/main/java/com/xm/test/myfile/ad/MyReportViewLisenter.kt
+7
-9
CleanAdapter.kt
app/src/main/java/com/xm/test/myfile/adapter/CleanAdapter.kt
+3
-2
CleanAdapter2.kt
...src/main/java/com/xm/test/myfile/adapter/CleanAdapter2.kt
+5
-4
AntivirusActivity.kt
...in/java/com/xm/test/myfile/antivirus/AntivirusActivity.kt
+5
-7
BaseActivity.kt
app/src/main/java/com/xm/test/myfile/base/BaseActivity.kt
+128
-111
FileManagerFragment.kt
...n/java/com/xm/test/myfile/fragment/FileManagerFragment.kt
+3
-8
HomeFragment.kt
...src/main/java/com/xm/test/myfile/fragment/HomeFragment.kt
+0
-3
CustomDialog.kt
app/src/main/java/com/xm/test/myfile/view/CustomDialog.kt
+37
-40
ManageStorageDialog.kt
.../main/java/com/xm/test/myfile/view/ManageStorageDialog.kt
+3
-2
QuitDialog.kt
app/src/main/java/com/xm/test/myfile/view/QuitDialog.kt
+3
-2
activity_scan_result.xml
app/src/main/res/layout/activity_scan_result.xml
+47
-58
antivirus_success_layout.xml
app/src/main/res/layout/antivirus_success_layout.xml
+6
-13
settings.gradle
settings.gradle
+2
-3
No files found.
.idea/codeStyles/Project.xml
View file @
d645bfd6
<component
name=
"ProjectCodeStyleConfiguration"
>
<component
name=
"ProjectCodeStyleConfiguration"
>
<code_scheme
name=
"Project"
version=
"173"
>
<code_scheme
name=
"Project"
version=
"173"
>
<option
name=
"LINE_SEPARATOR"
value=
" "
/>
<option
name=
"LINE_SEPARATOR"
value=
" "
/>
<option
name=
"RIGHT_MARGIN"
value=
"120"
/>
<JetCodeStyleSettings>
<JetCodeStyleSettings>
<option
name=
"CODE_STYLE_DEFAULTS"
value=
"KOTLIN_OFFICIAL"
/>
<option
name=
"CODE_STYLE_DEFAULTS"
value=
"KOTLIN_OFFICIAL"
/>
</JetCodeStyleSettings>
</JetCodeStyleSettings>
...
...
app/build.gradle
View file @
d645bfd6
...
@@ -4,7 +4,6 @@ plugins {
...
@@ -4,7 +4,6 @@ plugins {
}
}
android
{
android
{
namespace
'com.xm.test.myfile'
namespace
'com.xm.test.myfile'
compileSdk
34
compileSdk
34
...
@@ -63,47 +62,55 @@ dependencies {
...
@@ -63,47 +62,55 @@ dependencies {
androidTestImplementation
libs
.
androidx
.
junit
androidTestImplementation
libs
.
androidx
.
junit
androidTestImplementation
libs
.
androidx
.
espresso
.
core
androidTestImplementation
libs
.
androidx
.
espresso
.
core
//noinspection GradleDependency
implementation
'androidx.viewpager2:viewpager2:1.0.0'
implementation
'androidx.viewpager2:viewpager2:1.0.0'
//Lottie动画
implementation
"com.airbnb.android:lottie:3.6.0"
implementation
"com.airbnb.android:lottie:3.6.0"
def
dialogx_version
=
"0.0.49"
def
dialogx_version
=
"0.0.49"
implementation
"com.kongzue.dialogx:DialogX:${dialogx_version}"
implementation
"com.kongzue.dialogx:DialogX:${dialogx_version}"
implementation
'com.guolindev.permissionx:permissionx:1.7.1'
implementation
'com.guolindev.permissionx:permissionx:1.7.1'
implementation
'com.github.bumptech.glide:glide:4.12.0'
implementation
'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor
'com.github.bumptech.glide:compiler:4.12.0'
annotationProcessor
'com.github.bumptech.glide:compiler:4.12.0'
implementation
'com.applovin:applovin-sdk:+'
implementation
'com.applovin.mediation:google-adapter:+'
implementation
'com.applovin.mediation:vungle-adapter:+'
implementation
'com.applovin.mediation:facebook-adapter:+'
implementation
'com.applovin.mediation:mintegral-adapter:+'
implementation
'com.applovin.mediation:bytedance-adapter:+'
implementation
'com.google.android.gms:play-services-location:21.2.0'
implementation
'com.google.android.ump:user-messaging-platform:2.1.0'
implementation
"androidx.lifecycle:lifecycle-process:2.6.2"
implementation
"androidx.lifecycle:lifecycle-process:2.6.2"
implementation
(
"androidx.datastore:datastore-preferences:1.0.0"
)
implementation
'com.google.code.gson:gson:2.10.1'
implementation
'com.squareup.okhttp3:okhttp:4.10.0'
implementation
(
"com.squareup.okhttp3:logging-interceptor:4.10.0"
)
// compile(name:'trustlook_cleanjunk_sdk_release_3.0.4.20240322',ext:'aar')
implementation
files
(
'libs/trustlook_cleanjunk_sdk_release_3.0.4.20240322.aar'
)
implementation
files
(
'libs/trustlook_cleanjunk_sdk_release_3.0.4.20240322.aar'
)
implementation
files
(
'libs/cloudscan_sdk_5.0.5.20240306.aar'
)
implementation
files
(
'libs/cloudscan_sdk_5.0.5.20240306.aar'
)
//公司配置上报相关
implementation
(
"com.blankj:utilcodex:1.31.1"
)
implementation
(
"com.blankj:utilcodex:1.31.1"
)
implementation
(
"androidx.datastore:datastore-preferences:1.0.0"
)
implementation
'com.google.code.gson:gson:2.10.1'
implementation
'com.squareup.okhttp3:okhttp:4.10.0'
implementation
(
"com.squareup.okhttp3:logging-interceptor:4.10.0"
)
//广告相关
implementation
(
fileTree
(
"libs"
))
// implementation("com.applovin:applovin-sdk:+")
// implementation 'com.applovin.mediation:google-adapter:+'
// implementation 'com.applovin.mediation:vungle-adapter:+'
// implementation 'com.applovin.mediation:facebook-adapter:+'
// implementation 'com.applovin.mediation:mintegral-adapter:+'
// implementation 'com.applovin.mediation:bytedance-adapter:+'
// implementation 'com.google.android.ump:user-messaging-platform:2.1.0'
//google
implementation
'com.google.android.gms:play-services-location:21.2.0'
implementation
(
"com.facebook.android:facebook-android-sdk:[8,9)"
)
//applovin
implementation
'com.applovin:applovin-sdk:12.4.2'
implementation
'com.applovin.mediation:google-adapter:23.0.0.0'
implementation
'com.applovin.mediation:ironsource-adapter:8.0.0.0.0'
implementation
'com.applovin.mediation:vungle-adapter:7.3.1.2'
implementation
'com.applovin.mediation:facebook-adapter:6.17.0.0'
implementation
'com.applovin.mediation:mintegral-adapter:16.7.21.0'
implementation
'com.applovin.mediation:bytedance-adapter:5.9.0.2.0'
implementation
'com.applovin.mediation:yandex-adapter:6.4.1.0'
//facebook
implementation
'com.facebook.android:facebook-android-sdk:[8,9)'
//firebase
implementation
(
platform
(
"com.google.firebase:firebase-bom:32.1.0"
))
implementation
(
"com.google.firebase:firebase-database-ktx"
)
implementation
(
"com.google.firebase:firebase-analytics-ktx"
)
}
}
app/src/main/java/com/xm/test/myfile/MainActivity.kt
View file @
d645bfd6
...
@@ -15,6 +15,7 @@ import com.xm.test.myfile.SpKey.isAgreeAppPageKey
...
@@ -15,6 +15,7 @@ import com.xm.test.myfile.SpKey.isAgreeAppPageKey
import
com.xm.test.myfile.activity.HomeActivity
import
com.xm.test.myfile.activity.HomeActivity
import
com.xm.test.myfile.ad.ComUtils
import
com.xm.test.myfile.ad.ComUtils
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.databinding.ActivityMainBinding
import
com.xm.test.myfile.databinding.ActivityMainBinding
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.delay
...
@@ -47,7 +48,7 @@ class MainActivity : AppCompatActivity() {
...
@@ -47,7 +48,7 @@ class MainActivity : AppCompatActivity() {
startAppPage
()
startAppPage
()
}
}
findViewById
<
View
>(
R
.
id
.
start_app_btn
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
start_app_btn
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
edit
=
MyApplication
.
mSp
?.
edit
()
val
edit
=
MyApplication
.
mSp
?.
edit
()
edit
?.
putBoolean
(
isAgreeAppPageKey
,
true
)
edit
?.
putBoolean
(
isAgreeAppPageKey
,
true
)
edit
?.
apply
()
edit
?.
apply
()
...
@@ -68,8 +69,7 @@ class MainActivity : AppCompatActivity() {
...
@@ -68,8 +69,7 @@ class MainActivity : AppCompatActivity() {
binding
.
llContent
.
visibility
=
View
.
VISIBLE
binding
.
llContent
.
visibility
=
View
.
VISIBLE
startProgress
()
startProgress
()
(
application
as
MyApplication
).
initMax
{
(
application
as
MyApplication
).
initMax
{
MaxAdUtils
.
loadOpenAd
{
flag
->
MaxAdUtils
.
loadOpenAd
{
if
(
flag
)
{
timer
(
period
=
300
)
{
timer
(
period
=
300
)
{
if
(
isFinishing
||
isDestroyed
)
{
if
(
isFinishing
||
isDestroyed
)
{
...
@@ -88,7 +88,6 @@ class MainActivity : AppCompatActivity() {
...
@@ -88,7 +88,6 @@ class MainActivity : AppCompatActivity() {
}
}
}
}
}
}
}
MaxAdUtils
.
loadMaxNativeAd
()
MaxAdUtils
.
loadMaxNativeAd
()
MaxAdUtils
.
loadInterstitialAd
(
this
@MainActivity
)
MaxAdUtils
.
loadInterstitialAd
(
this
@MainActivity
)
}
}
...
...
app/src/main/java/com/xm/test/myfile/activity/BatteryActivity.kt
View file @
d645bfd6
...
@@ -13,6 +13,7 @@ import android.widget.ImageView
...
@@ -13,6 +13,7 @@ import android.widget.ImageView
import
android.widget.TextView
import
android.widget.TextView
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.app.AppCompatActivity
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.util.BatteryUtil
import
com.xm.test.myfile.util.BatteryUtil
import
com.xm.test.myfile.util.SystemServerState
import
com.xm.test.myfile.util.SystemServerState
import
java.util.Calendar
import
java.util.Calendar
...
@@ -56,36 +57,36 @@ class BatteryActivity : AppCompatActivity() {
...
@@ -56,36 +57,36 @@ class BatteryActivity : AppCompatActivity() {
}
}
private
fun
setOnClickListener
()
{
private
fun
setOnClickListener
()
{
mQuitView
.
set
OnClickListener
{
mQuitView
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
}
}
mHotspotSwitch
.
set
OnClickListener
{
mHotspotSwitch
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
// isHotspotOpen = !isHotspotOpen
// isHotspotOpen = !isHotspotOpen
// setViewSwitch(mHotspotSwitch, isHotspotOpen)
// setViewSwitch(mHotspotSwitch, isHotspotOpen)
startActivity
(
Intent
(
Settings
.
ACTION_DATA_ROAMING_SETTINGS
))
startActivity
(
Intent
(
Settings
.
ACTION_DATA_ROAMING_SETTINGS
))
}
}
mBluetoothSwitch
.
set
OnClickListener
{
mBluetoothSwitch
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
// isBluetoothOpen = !isBluetoothOpen
// isBluetoothOpen = !isBluetoothOpen
// setViewSwitch(mBluetoothSwitch, isBluetoothOpen)
// setViewSwitch(mBluetoothSwitch, isBluetoothOpen)
startActivity
(
Intent
(
Settings
.
ACTION_BLUETOOTH_SETTINGS
))
startActivity
(
Intent
(
Settings
.
ACTION_BLUETOOTH_SETTINGS
))
}
}
mAutoBrightSwitch
.
set
OnClickListener
{
mAutoBrightSwitch
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
// isAutoBrightOpen = !isAutoBrightOpen
// isAutoBrightOpen = !isAutoBrightOpen
// setViewSwitch(mAutoBrightSwitch, isAutoBrightOpen)
// setViewSwitch(mAutoBrightSwitch, isAutoBrightOpen)
startActivity
(
Intent
(
Settings
.
ACTION_DISPLAY_SETTINGS
))
startActivity
(
Intent
(
Settings
.
ACTION_DISPLAY_SETTINGS
))
}
}
mGpsSwitch
.
set
OnClickListener
{
mGpsSwitch
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
// isGpsOpen = !isGpsOpen
// isGpsOpen = !isGpsOpen
// setViewSwitch(mGpsSwitch, isGpsOpen)
// setViewSwitch(mGpsSwitch, isGpsOpen)
startActivity
(
Intent
(
Settings
.
ACTION_LOCATION_SOURCE_SETTINGS
))
startActivity
(
Intent
(
Settings
.
ACTION_LOCATION_SOURCE_SETTINGS
))
}
}
findViewById
<
View
>(
R
.
id
.
battery_quit_btn_2
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
battery_quit_btn_2
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
}
}
findViewById
<
View
>(
R
.
id
.
battery_go_to_result
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
battery_go_to_result
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
intent
=
Intent
(
this
,
ResultPageActivity
::
class
.
java
)
val
intent
=
Intent
(
this
,
ResultPageActivity
::
class
.
java
)
intent
.
putExtra
(
"pageTitle"
,
"Battery"
)
intent
.
putExtra
(
"pageTitle"
,
"Battery"
)
intent
.
putExtra
(
"pageName"
,
"battery"
)
intent
.
putExtra
(
"pageName"
,
"battery"
)
...
...
app/src/main/java/com/xm/test/myfile/activity/CleanActivity.kt
View file @
d645bfd6
...
@@ -25,6 +25,7 @@ import com.cm.plugincluster.junkengine.junk.bean.MediaFile
...
@@ -25,6 +25,7 @@ import com.cm.plugincluster.junkengine.junk.bean.MediaFile
import
com.cm.plugincluster.junkengine.junk.engine.MEDIA_TYPE
import
com.cm.plugincluster.junkengine.junk.engine.MEDIA_TYPE
import
com.xm.test.myfile.MyApplication
import
com.xm.test.myfile.MyApplication
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.adapter.CleanAdapter
import
com.xm.test.myfile.adapter.CleanAdapter
import
com.xm.test.myfile.adapter.CleanAdapter2
import
com.xm.test.myfile.adapter.CleanAdapter2
import
com.xm.test.myfile.model.CleanBean
import
com.xm.test.myfile.model.CleanBean
...
@@ -135,11 +136,11 @@ class CleanActivity : AppCompatActivity(), CleanAdapter2.IClean {
...
@@ -135,11 +136,11 @@ class CleanActivity : AppCompatActivity(), CleanAdapter2.IClean {
private
fun
setViewOnclickListener
()
{
private
fun
setViewOnclickListener
()
{
mQuitBtn
?.
set
OnClickListener
{
mQuitBtn
?.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
}
}
findViewById
<
View
>(
R
.
id
.
clean_click_text
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
clean_click_text
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
mAnimation
.
visibility
=
View
.
VISIBLE
mAnimation
.
visibility
=
View
.
VISIBLE
Thread
(
Runnable
{
Thread
(
Runnable
{
Thread
.
sleep
(
1000
)
Thread
.
sleep
(
1000
)
...
...
app/src/main/java/com/xm/test/myfile/activity/ImageShowActivity.kt
View file @
d645bfd6
...
@@ -9,6 +9,7 @@ import android.widget.VideoView
...
@@ -9,6 +9,7 @@ import android.widget.VideoView
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.app.AppCompatActivity
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
class
ImageShowActivity
:
AppCompatActivity
()
{
class
ImageShowActivity
:
AppCompatActivity
()
{
...
@@ -46,11 +47,11 @@ class ImageShowActivity : AppCompatActivity() {
...
@@ -46,11 +47,11 @@ class ImageShowActivity : AppCompatActivity() {
}
}
private
fun
setOnClickListener
()
{
private
fun
setOnClickListener
()
{
mShareBtn
.
set
OnClickListener
{
mShareBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
uri
=
Uri
.
parse
(
mFilePath
)
val
uri
=
Uri
.
parse
(
mFilePath
)
shareFile
(
uri
)
shareFile
(
uri
)
}
}
mDeleteBtn
.
set
OnClickListener
{
mDeleteBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
}
}
}
}
...
...
app/src/main/java/com/xm/test/myfile/activity/MediaActivity.kt
View file @
d645bfd6
...
@@ -15,6 +15,7 @@ import com.kongzue.dialogx.dialogs.WaitDialog
...
@@ -15,6 +15,7 @@ import com.kongzue.dialogx.dialogs.WaitDialog
import
com.test.mydemo3.activity.ImageShowActivity
import
com.test.mydemo3.activity.ImageShowActivity
import
com.xm.test.myfile.MyApplication
import
com.xm.test.myfile.MyApplication
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.adapter.MediaAdapter
import
com.xm.test.myfile.adapter.MediaAdapter
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.util.FileUtil
import
com.xm.test.myfile.util.FileUtil
...
@@ -42,7 +43,8 @@ class MediaActivity : AppCompatActivity() {
...
@@ -42,7 +43,8 @@ class MediaActivity : AppCompatActivity() {
// private lateinit var binding: ActivityMediaBinding
// private lateinit var binding: ActivityMediaBinding
private
var
mItemAdapter
:
MediaAdapter
?
=
null
private
var
mItemAdapter
:
MediaAdapter
?
=
null
// private var mItemAdapter: MediaAdapter2? = null
// private var mItemAdapter: MediaAdapter2? = null
private
var
mDataList
:
ArrayList
<
String
>
=
ArrayList
<
String
>()
private
var
mDataList
:
ArrayList
<
String
>
=
ArrayList
<
String
>()
private
var
mCheckedDataList
:
ArrayList
<
FileBean
>
=
ArrayList
<
FileBean
>()
private
var
mCheckedDataList
:
ArrayList
<
FileBean
>
=
ArrayList
<
FileBean
>()
...
@@ -98,9 +100,9 @@ class MediaActivity : AppCompatActivity() {
...
@@ -98,9 +100,9 @@ class MediaActivity : AppCompatActivity() {
mItemAdapter
=
MediaAdapter
(
mItemDataList
,
this
,
mItemCheckedArray
,
mFileType
!!
,
115
)
mItemAdapter
=
MediaAdapter
(
mItemDataList
,
this
,
mItemCheckedArray
,
mFileType
!!
,
115
)
mGridView
.
adapter
=
mItemAdapter
mGridView
.
adapter
=
mItemAdapter
if
(
HomeActivity
.
isPermission
){
if
(
HomeActivity
.
isPermission
)
{
getListData
()
getListData
()
}
else
{
}
else
{
mGridView
.
visibility
=
View
.
GONE
mGridView
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
mNotPermissionView
.
visibility
=
View
.
VISIBLE
mNotPermissionView
.
visibility
=
View
.
VISIBLE
...
@@ -136,7 +138,7 @@ class MediaActivity : AppCompatActivity() {
...
@@ -136,7 +138,7 @@ class MediaActivity : AppCompatActivity() {
private
fun
setOnclickListener
()
{
private
fun
setOnclickListener
()
{
mEditBtn
.
set
OnClickListener
{
mEditBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
mQuitBtn
.
visibility
=
View
.
GONE
mQuitBtn
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
mSelectBar
.
visibility
=
View
.
VISIBLE
mSelectBar
.
visibility
=
View
.
VISIBLE
...
@@ -146,13 +148,13 @@ class MediaActivity : AppCompatActivity() {
...
@@ -146,13 +148,13 @@ class MediaActivity : AppCompatActivity() {
isClickEditBtn
=
true
isClickEditBtn
=
true
mItemAdapter
?.
notifyDataSetChanged
()
mItemAdapter
?.
notifyDataSetChanged
()
}
}
mCancelBtn
.
set
OnClickListener
{
mCancelBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
cancelBtn
()
cancelBtn
()
}
}
mQuitBtn
.
set
OnClickListener
{
mQuitBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
}
}
mCheckedBtn
.
set
OnClickListener
{
mCheckedBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
mIsCheckClick
=
!
mIsCheckClick
mIsCheckClick
=
!
mIsCheckClick
selectAll
()
selectAll
()
}
}
...
@@ -170,24 +172,21 @@ class MediaActivity : AppCompatActivity() {
...
@@ -170,24 +172,21 @@ class MediaActivity : AppCompatActivity() {
startActivity
(
intent
)
startActivity
(
intent
)
}
}
}
}
findViewById
<
View
>(
R
.
id
.
go_to_setting_btn
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
go_to_setting_btn
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
PermissionUtil
.
requestPermission
(
this
)
PermissionUtil
.
requestPermission
(
this
)
}
}
mDeleteBtn
.
setOnClickListener
{
mDeleteBtn
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
val
customDialog
=
CustomDialog
(
this
)
val
customDialog
=
CustomDialog
(
this
,
sureClick
=
{
customDialog
.
setsCancel
(
View
.
OnClickListener
{
for
(
fileBean
in
mCheckedDataList
)
{
customDialog
.
dismiss
()
}).
setsConfirm
(
View
.
OnClickListener
{
for
(
fileBean
in
mCheckedDataList
!!
){
MyApplication
.
mCleanSdk
?.
delete
(
File
(
fileBean
.
filePath
))
MyApplication
.
mCleanSdk
?.
delete
(
File
(
fileBean
.
filePath
))
mItemDataList
.
remove
(
fileBean
)
mItemDataList
.
remove
(
fileBean
)
}
}
customDialog
.
dismiss
()
mItemAdapter
?.
notifyDataSetChanged
()
mItemAdapter
?.
notifyDataSetChanged
()
}).
show
()
})
customDialog
.
show
()
customDialog
.
isShowEditText
(
false
)
customDialog
.
isShowEditText
(
false
)
customDialog
.
setsTitle
(
"Delete"
)
.
setsTitle
(
"Delete"
)
customDialog
.
setsHint
(
"Are you sure you want to delete ${mCheckedDataList.size} item?"
)
.
setsHint
(
"Are you sure you want to delete ${mCheckedDataList.size} item?"
)
}
}
}
}
...
...
app/src/main/java/com/xm/test/myfile/activity/MoveOrCopyActivity.kt
View file @
d645bfd6
...
@@ -9,6 +9,7 @@ import android.widget.Toast
...
@@ -9,6 +9,7 @@ import android.widget.Toast
import
androidx.activity.ComponentActivity
import
androidx.activity.ComponentActivity
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.adapter.FilesItemViewAdapter
import
com.xm.test.myfile.adapter.FilesItemViewAdapter
import
com.xm.test.myfile.fragment.InternalStorageFragment
import
com.xm.test.myfile.fragment.InternalStorageFragment
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.model.FileBean
...
@@ -38,15 +39,16 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -38,15 +39,16 @@ class MoveOrCopyActivity : ComponentActivity() {
}
}
private
fun
setViewOnClickListener
()
{
private
fun
setViewOnClickListener
()
{
findViewById
<
View
>(
R
.
id
.
btn_quit
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
btn_quit
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
if
(
backQuit
())
finish
()
if
(
backQuit
())
finish
()
}
}
findViewById
<
View
>(
R
.
id
.
btn_cancel_bottom
).
set
OnClickListener
(
View
.
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
btn_cancel_bottom
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
})
}
findViewById
<
View
>(
R
.
id
.
btn_move_bottom
).
setOnClickListener
(
View
.
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
btn_move_bottom
).
setMyReportViewListener
(
javaClass
.
simpleName
)
{
var
moveFile
=
if
(
mCurrentBean
!=
null
)
{
val
moveFile
=
if
(
mCurrentBean
!=
null
)
{
FileUtil
.
moveFile
(
mCheckedItems
[
0
].
filePath
,
mCurrentBean
!!
.
filePath
)
FileUtil
.
moveFile
(
mCheckedItems
[
0
].
filePath
,
mCurrentBean
!!
.
filePath
)
}
else
{
}
else
{
FileUtil
.
moveFile
(
mCheckedItems
[
0
].
filePath
,
FileUtil
.
EXTERNAL_STORAGE
)
FileUtil
.
moveFile
(
mCheckedItems
[
0
].
filePath
,
FileUtil
.
EXTERNAL_STORAGE
)
...
@@ -57,7 +59,7 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -57,7 +59,7 @@ class MoveOrCopyActivity : ComponentActivity() {
Toast
.
makeText
(
this
,
"move failed!"
,
Toast
.
LENGTH_LONG
).
show
()
Toast
.
makeText
(
this
,
"move failed!"
,
Toast
.
LENGTH_LONG
).
show
()
}
}
finish
()
finish
()
}
)
}
findViewById
<
View
>(
R
.
id
.
btn_copy_bottom
).
setOnClickListener
(
View
.
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
btn_copy_bottom
).
setOnClickListener
(
View
.
OnClickListener
{
var
moveFile
=
if
(
mCurrentBean
!=
null
)
{
var
moveFile
=
if
(
mCurrentBean
!=
null
)
{
...
@@ -98,8 +100,8 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -98,8 +100,8 @@ class MoveOrCopyActivity : ComponentActivity() {
findViewById
<
View
>(
R
.
id
.
btn_cancel_bottom
).
visibility
=
View
.
VISIBLE
findViewById
<
View
>(
R
.
id
.
btn_cancel_bottom
).
visibility
=
View
.
VISIBLE
}
}
fun
setAdapter
(){
fun
setAdapter
()
{
if
(
mItemDatas
?.
size
!!
>
0
){
if
(
mItemDatas
?.
size
!!
>
0
)
{
mNotFileFoundLayout
.
visibility
=
View
.
GONE
mNotFileFoundLayout
.
visibility
=
View
.
GONE
mListView
?.
visibility
=
View
.
VISIBLE
mListView
?.
visibility
=
View
.
VISIBLE
}
}
...
@@ -110,16 +112,17 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -110,16 +112,17 @@ class MoveOrCopyActivity : ComponentActivity() {
setOnListViewItemClickListener
()
setOnListViewItemClickListener
()
}
}
fun
setOnListViewItemClickListener
(){
fun
setOnListViewItemClickListener
()
{
findViewById
<
ListView
>(
R
.
id
.
files_item_listview
).
setOnItemClickListener
{
parent
,
view
,
position
,
id
->
findViewById
<
ListView
>(
R
.
id
.
files_item_listview
).
setOnItemClickListener
{
parent
,
view
,
position
,
id
->
mCurrentBean
=
mItemDatas
?.
get
(
position
)
mCurrentBean
=
mItemDatas
?.
get
(
position
)
if
(!
mCurrentBean
?.
fileType
.
equals
(
"dir"
)){
if
(!
mCurrentBean
?.
fileType
.
equals
(
"dir"
))
{
return
@setOnItemClickListener
return
@setOnItemClickListener
}
}
mFilesItemLists
.
add
(
mItemDatas
!!
)
mFilesItemLists
.
add
(
mItemDatas
!!
)
mCurrentBeans
.
add
(
mCurrentBean
!!
)
mCurrentBeans
.
add
(
mCurrentBean
!!
)
mCurrantFilePathTv
.
text
=
"Internal Storage/ ${mCurrentBean?.fileName}"
mCurrantFilePathTv
.
text
=
"Internal Storage/ ${mCurrentBean?.fileName}"
if
(
mCurrentBean
?.
fileType
.
equals
(
"dir"
)
&&
mCurrentBean
?.
childList
?.
size
!!
>
0
){
if
(
mCurrentBean
?.
fileType
.
equals
(
"dir"
)
&&
mCurrentBean
?.
childList
?.
size
!!
>
0
)
{
Thread
(
Runnable
{
Thread
(
Runnable
{
runOnUiThread
{
runOnUiThread
{
mItemDatas
=
mCurrentBean
!!
.
childList
mItemDatas
=
mCurrentBean
!!
.
childList
...
@@ -127,25 +130,27 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -127,25 +130,27 @@ class MoveOrCopyActivity : ComponentActivity() {
mItemAdapter
?.
setData
(
fileListSort
)
mItemAdapter
?.
setData
(
fileListSort
)
}
}
}).
start
()
}).
start
()
}
else
if
(
mCurrentBean
?.
fileType
.
equals
(
"dir"
)
&&
mCurrentBean
?.
childList
?.
size
==
0
)
{
}
else
if
(
mCurrentBean
?.
fileType
.
equals
(
"dir"
)
&&
mCurrentBean
?.
childList
?.
size
==
0
)
{
mListView
?.
visibility
=
View
.
GONE
mListView
?.
visibility
=
View
.
GONE
mNotFileFoundLayout
.
visibility
=
View
.
VISIBLE
mNotFileFoundLayout
.
visibility
=
View
.
VISIBLE
}
}
}
}
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
if
(
backQuit
())
finish
()
if
(
backQuit
())
finish
()
mItemAdapter
?.
setEditClickState
(
true
)
mItemAdapter
?.
setEditClickState
(
true
)
super
.
onDestroy
()
super
.
onDestroy
()
// BaseActivity.isClickEditBtn = true
// BaseActivity.isClickEditBtn = true
}
}
fun
backQuit
():
Boolean
{
fun
backQuit
():
Boolean
{
val
size
=
mFilesItemLists
.
size
val
size
=
mFilesItemLists
.
size
if
(
size
-
1
==
0
)
{
if
(
size
-
1
==
0
)
{
mCurrantFilePathTv
.
text
=
"Internal Storage/"
mCurrantFilePathTv
.
text
=
"Internal Storage/"
}
}
if
(
size
<
1
){
if
(
size
<
1
)
{
if
(
mNotFileFoundLayout
.
isVisible
&&
mItemDatas
?.
size
!!
>
0
){
if
(
mNotFileFoundLayout
.
isVisible
&&
mItemDatas
?.
size
!!
>
0
)
{
mListView
?.
visibility
=
View
.
VISIBLE
mListView
?.
visibility
=
View
.
VISIBLE
mNotFileFoundLayout
.
visibility
=
View
.
GONE
mNotFileFoundLayout
.
visibility
=
View
.
GONE
mItemAdapter
?.
setData
(
mItemDatas
!!
)
mItemAdapter
?.
setData
(
mItemDatas
!!
)
...
@@ -153,17 +158,17 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -153,17 +158,17 @@ class MoveOrCopyActivity : ComponentActivity() {
}
}
mCurrentBeans
.
clear
()
mCurrentBeans
.
clear
()
return
true
return
true
}
else
{
}
else
{
mItemAdapter
?.
setData
(
mFilesItemLists
[
size
-
1
])
mItemAdapter
?.
setData
(
mFilesItemLists
[
size
-
1
])
mItemDatas
=
mFilesItemLists
[
size
-
1
]
mItemDatas
=
mFilesItemLists
[
size
-
1
]
mListView
?.
visibility
=
View
.
VISIBLE
mListView
?.
visibility
=
View
.
VISIBLE
mNotFileFoundLayout
.
visibility
=
View
.
GONE
mNotFileFoundLayout
.
visibility
=
View
.
GONE
mFilesItemLists
.
remove
(
mFilesItemLists
[
size
-
1
])
mFilesItemLists
.
remove
(
mFilesItemLists
[
size
-
1
])
mCurrentBeans
.
remove
(
mCurrentBeans
[
size
-
1
])
mCurrentBeans
.
remove
(
mCurrentBeans
[
size
-
1
])
if
(
size
-
1
>
0
){
if
(
size
-
1
>
0
)
{
mCurrentBean
=
mCurrentBeans
[
size
-
2
]
mCurrentBean
=
mCurrentBeans
[
size
-
2
]
mCurrantFilePathTv
.
text
=
"Internal Storage/ ${mCurrentBean?.fileName}"
mCurrantFilePathTv
.
text
=
"Internal Storage/ ${mCurrentBean?.fileName}"
}
else
{
}
else
{
mCurrantFilePathTv
.
text
=
"Internal Storage/"
mCurrantFilePathTv
.
text
=
"Internal Storage/"
}
}
return
false
return
false
...
@@ -171,7 +176,7 @@ class MoveOrCopyActivity : ComponentActivity() {
...
@@ -171,7 +176,7 @@ class MoveOrCopyActivity : ComponentActivity() {
}
}
override
fun
onBackPressed
()
{
override
fun
onBackPressed
()
{
if
(
backQuit
()){
if
(
backQuit
())
{
super
.
onBackPressed
()
super
.
onBackPressed
()
}
}
}
}
...
...
app/src/main/java/com/xm/test/myfile/activity/ResultPageActivity.kt
View file @
d645bfd6
...
@@ -4,6 +4,7 @@ import android.content.Intent
...
@@ -4,6 +4,7 @@ import android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
androidx.activity.ComponentActivity
import
androidx.activity.ComponentActivity
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.antivirus.AntivirusActivity
import
com.xm.test.myfile.antivirus.AntivirusActivity
import
com.xm.test.myfile.databinding.ResultLayoutBinding
import
com.xm.test.myfile.databinding.ResultLayoutBinding
...
@@ -45,27 +46,27 @@ class ResultPageActivity : ComponentActivity() {
...
@@ -45,27 +46,27 @@ class ResultPageActivity : ComponentActivity() {
}
}
fun
setViewOnClickListener
(){
fun
setViewOnClickListener
(){
binding
.
goToAntivirus
.
set
OnClickListener
{
binding
.
goToAntivirus
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
startActivity
(
Intent
(
this
,
AntivirusActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
AntivirusActivity
::
class
.
java
))
finish
()
finish
()
}
}
binding
.
goToBattery
.
set
OnClickListener
{
binding
.
goToBattery
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
startActivity
(
Intent
(
this
,
BatteryActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
BatteryActivity
::
class
.
java
))
finish
()
finish
()
}
}
binding
.
goToScanLarge
.
set
OnClickListener
{
binding
.
goToScanLarge
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
startActivity
(
Intent
(
this
,
ScanLargeFilesActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
ScanLargeFilesActivity
::
class
.
java
))
finish
()
finish
()
}
}
binding
.
goToScanSimilarImages
.
set
OnClickListener
{
binding
.
goToScanSimilarImages
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
startActivity
(
Intent
(
this
,
SimilarImagesActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
SimilarImagesActivity
::
class
.
java
))
finish
()
finish
()
}
}
binding
.
goToClean
.
set
OnClickListener
{
binding
.
goToClean
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
startActivity
(
Intent
(
this
,
CleanActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
CleanActivity
::
class
.
java
))
finish
()
finish
()
}
}
binding
.
resultQuitBtn
.
set
OnClickListener
{
binding
.
resultQuitBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
}
}
}
}
...
...
app/src/main/java/com/xm/test/myfile/activity/ScanResultActivity.kt
View file @
d645bfd6
...
@@ -12,41 +12,37 @@ import androidx.appcompat.app.AppCompatActivity
...
@@ -12,41 +12,37 @@ import androidx.appcompat.app.AppCompatActivity
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.trustlook.sdk.data.AppInfo
import
com.trustlook.sdk.data.AppInfo
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.adapter.ScanResultAdapter
import
com.xm.test.myfile.adapter.ScanResultAdapter
import
com.xm.test.myfile.databinding.ActivityScanResultBinding
import
com.xm.test.myfile.view.CustomDialog
import
com.xm.test.myfile.view.CustomDialog
class
ScanResultActivity
:
AppCompatActivity
()
{
class
ScanResultActivity
:
AppCompatActivity
()
{
private
var
mResult
:
ArrayList
<
AppInfo
>?
=
null
private
var
mResult
:
ArrayList
<
AppInfo
>
=
arrayListOf
()
private
lateinit
var
mListView
:
ListView
private
lateinit
var
mScanResultAdapter
:
ScanResultAdapter
private
lateinit
var
mAppinfoPage
:
View
private
lateinit
var
mDeleteGroupView
:
View
private
lateinit
var
mGoItBtn
:
TextView
private
lateinit
var
mScanResultListLyout
:
View
private
lateinit
var
mAntivirusSuccessView
:
View
private
var
mScanResultAdapter
:
ScanResultAdapter
?
=
null
private
lateinit
var
mIdentifyText
:
TextView
private
lateinit
var
mIdentifyText
:
TextView
private
lateinit
var
mSettleText
:
TextView
private
var
mCurrentAppInfo
:
AppInfo
?
=
null
private
var
mCurrentAppInfo
:
AppInfo
?
=
null
private
var
mCurr
=
0
private
var
mCurr
=
0
//总数
private
var
mIgnoreCount
=
0
private
var
mIgnoreCount
=
0
//忽略的数量
private
lateinit
var
binding
:
ActivityScanResultBinding
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_scan_result
)
binding
=
ActivityScanResultBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
mResult
=
intent
.
getSerializableExtra
(
"result"
)
as
ArrayList
<
AppInfo
>
mResult
=
intent
.
getSerializableExtra
(
"result"
)
as
ArrayList
<
AppInfo
>
mCurr
=
intent
.
getIntExtra
(
"curr"
,
0
)
mCurr
=
intent
.
getIntExtra
(
"curr"
,
0
)
findViewById
<
TextView
>(
R
.
id
.
scan_result_secure_num_text
).
text
=
binding
.
tvScanNumber
.
text
=
intent
.
getStringExtra
(
"total"
)
intent
.
getStringExtra
(
"total"
)
initView
()
initView
()
setViewClickListener
()
setViewClickListener
()
}
}
private
fun
setViewClickListener
()
{
private
fun
setViewClickListener
()
{
mListView
.
setOnItemClickListener
{
parent
,
view
,
position
,
id
->
binding
.
lvVirusApp
.
setOnItemClickListener
{
parent
,
view
,
position
,
id
->
// Intent(this, )
val
appIcon
=
findViewById
<
ImageView
>(
R
.
id
.
scan_app_info_icon
)
val
appIcon
=
findViewById
<
ImageView
>(
R
.
id
.
scan_app_info_icon
)
val
appName
=
findViewById
<
TextView
>(
R
.
id
.
scan_app_info_name
)
val
appName
=
findViewById
<
TextView
>(
R
.
id
.
scan_app_info_name
)
val
appDate
=
findViewById
<
TextView
>(
R
.
id
.
scan_app_info_date
)
val
appDate
=
findViewById
<
TextView
>(
R
.
id
.
scan_app_info_date
)
...
@@ -57,80 +53,57 @@ class ScanResultActivity : AppCompatActivity() {
...
@@ -57,80 +53,57 @@ class ScanResultActivity : AppCompatActivity() {
appIcon
.
setImageDrawable
(
packageInfo
.
applicationInfo
.
loadIcon
(
packageManager
))
appIcon
.
setImageDrawable
(
packageInfo
.
applicationInfo
.
loadIcon
(
packageManager
))
appName
.
text
=
mResult
!!
[
position
].
appName
appName
.
text
=
mResult
!!
[
position
].
appName
mCurrentAppInfo
=
mResult
!!
[
position
]
mCurrentAppInfo
=
mResult
!!
[
position
]
// mResult!![position]
virusDetail
()
mAppinfoPage
.
visibility
=
View
.
VISIBLE
mDeleteGroupView
.
visibility
=
View
.
VISIBLE
mScanResultListLyout
.
visibility
=
View
.
GONE
mGoItBtn
.
visibility
=
View
.
GONE
}
}
findViewById
<
View
>(
R
.
id
.
scan_delete_yes
).
setOnClickListener
{
binding
.
tvDelete
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
val
customDialog
=
CustomDialog
(
this
)
val
customDialog
=
CustomDialog
(
this
,
sureClick
=
{
customDialog
.
setsCancel
{
customDialog
.
dismiss
()
}.
setsConfirm
{
val
packageName
=
mCurrentAppInfo
!!
.
packageName
// 要卸载的应用包名
val
packageName
=
mCurrentAppInfo
!!
.
packageName
// 要卸载的应用包名
val
intent
=
Intent
(
Intent
.
ACTION_UNINSTALL_PACKAGE
)
val
intent
=
Intent
(
Intent
.
ACTION_UNINSTALL_PACKAGE
)
intent
.
data
=
Uri
.
parse
(
"package:$packageName"
)
intent
.
data
=
Uri
.
parse
(
"package:$packageName"
)
startActivity
(
intent
)
startActivity
(
intent
)
mAppinfoPage
.
visibility
=
View
.
GONE
virusDetail
()
mDeleteGroupView
.
visibility
=
View
.
GONE
})
mGoItBtn
.
visibility
=
View
.
VISIBLE
mScanResultListLyout
.
visibility
=
View
.
VISIBLE
customDialog
.
show
()
customDialog
.
dismiss
()
// Intent(Intent.ACTION_DELETE, Uri.parse("package:${mCurrentAppInfo!!.packageName}"))
customDialog
// startActivity(intent)
.
isShowEditText
(
false
)
// mResult?.remove(mCurrentAppInfo!!)
.
setsTitle
(
"Delete"
)
.
setsHint
(
"Do you want to uninstall this app?"
)
}.
show
()
.
setsRightDelete
(
"Delete"
)
customDialog
.
isShowEditText
(
false
)
customDialog
.
setsTitle
(
"Delete"
)
customDialog
.
setsHint
(
"Do you want to uninstall this app?"
)
customDialog
.
setsRightDelete
(
"Delete"
)
}
}
findViewById
<
View
>(
R
.
id
.
scan_delete_ignore
).
setOnClickListener
{
binding
.
tvIgnore
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
val
customDialog
=
CustomDialog
(
this
)
val
customDialog
=
CustomDialog
(
this
,
sureClick
=
{
customDialog
.
setsCancel
{
mCurrentAppInfo
?.
let
{
customDialog
.
dismiss
()
}.
setsConfirm
{
mIgnoreCount
++
mIgnoreCount
++
mResult
?.
remove
(
mCurrentAppInfo
!!
)
mResult
.
remove
(
it
)
mAppinfoPage
.
visibility
=
View
.
GONE
virusList
()
mDeleteGroupView
.
visibility
=
View
.
GONE
mScanResultAdapter
.
notifyDataSetChanged
()
mGoItBtn
.
visibility
=
View
.
VISIBLE
}
mScanResultListLyout
.
visibility
=
View
.
VISIBLE
mScanResultAdapter
?.
notifyDataSetChanged
()
})
customDialog
.
dismiss
()
customDialog
.
show
()
}.
show
()
customDialog
.
isShowEditText
(
false
)
customDialog
.
isShowEditText
(
false
)
// customDialog.setsTitle("Delete")
.
setShowTitle
(
false
)
customDialog
.
setShowTitle
(
false
)
.
setsHint
(
"Are you sure you want to ignore the app?"
)
customDialog
.
setsHint
(
"Are you sure you want to ignore the app?"
)
.
setRightBtnText
(
"Ignore"
)
customDialog
.
setRightBtnText
(
"Ignore"
)
}
}
findViewById
<
View
>(
R
.
id
.
antivirus_success_quit_btn
).
setOnClickListener
{
binding
.
includeVirusFinish
.
ivBack
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
finish
()
finish
()
}
}
findViewById
<
View
>(
R
.
id
.
scan_result_go_it_text
).
setOnClickListener
{
binding
.
tvGot
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
mSettleText
.
text
=
mIgnoreCount
.
toString
()
mAntivirusSuccessView
.
visibility
=
View
.
VISIBLE
}
findViewById
<
View
>(
R
.
id
.
scan_result_quit_btn
).
setOnClickListener
{
if
(
mAppinfoPage
.
isVisible
)
{
mAppinfoPage
.
visibility
=
View
.
GONE
mDeleteGroupView
.
visibility
=
View
.
GONE
mGoItBtn
.
visibility
=
View
.
VISIBLE
mScanResultListLyout
.
visibility
=
View
.
VISIBLE
}
else
{
finish
()
}
}
binding
.
ivBack
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
onBackPressed
()
}
}
findViewById
<
View
>(
R
.
id
.
scan_result_finish_text
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
scan_result_finish_text
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
intent
=
Intent
(
this
,
ResultPageActivity
::
class
.
java
)
val
intent
=
Intent
(
this
,
ResultPageActivity
::
class
.
java
)
intent
.
putExtra
(
"pageTitle"
,
"Antivirus"
)
intent
.
putExtra
(
"pageTitle"
,
"Antivirus"
)
intent
.
putExtra
(
"pageName"
,
"antivirus"
)
intent
.
putExtra
(
"pageName"
,
"antivirus"
)
...
@@ -141,33 +114,47 @@ class ScanResultActivity : AppCompatActivity() {
...
@@ -141,33 +114,47 @@ class ScanResultActivity : AppCompatActivity() {
}
}
private
fun
initView
()
{
private
fun
initView
()
{
mListView
=
findViewById
(
R
.
id
.
scan_result_list
)
mAppinfoPage
=
findViewById
(
R
.
id
.
app_info_page_layout
)
mDeleteGroupView
=
findViewById
(
R
.
id
.
scan_result_delete_group_layout
)
mGoItBtn
=
findViewById
(
R
.
id
.
scan_result_go_it_text
)
mScanResultListLyout
=
findViewById
(
R
.
id
.
scan_result_list_layout
)
mAntivirusSuccessView
=
findViewById
(
R
.
id
.
antivirus_success_view
)
mIdentifyText
=
findViewById
(
R
.
id
.
identify_num_text
)
mSettleText
=
findViewById
(
R
.
id
.
settle_num_text
)
mIdentifyText
.
text
=
mCurr
.
toString
()
mIdentifyText
.
text
=
mCurr
.
toString
()
mScanResultAdapter
=
ScanResultAdapter
(
mResult
!!
,
this
)
mScanResultAdapter
=
ScanResultAdapter
(
mResult
,
this
)
mListView
.
adapter
=
mScanResultAdapter
binding
.
lvVirusApp
.
adapter
=
mScanResultAdapter
}
}
override
fun
onBackPressed
()
{
override
fun
onBackPressed
()
{
if
(
mAppinfoPage
.
isVisible
)
{
if
(
binding
.
llVirusDetail
.
isVisible
)
{
mAppinfoPage
.
visibility
=
View
.
GONE
virusList
()
mDeleteGroupView
.
visibility
=
View
.
GONE
mGoItBtn
.
visibility
=
View
.
VISIBLE
mScanResultListLyout
.
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
super
.
onBackPressed
()
super
.
onBackPressed
()
}
}
}
}
fun
virusList
()
{
binding
.
llVirusDetail
.
visibility
=
View
.
GONE
binding
.
llButtonYn
.
visibility
=
View
.
GONE
binding
.
llVirusResult
.
visibility
=
View
.
VISIBLE
binding
.
tvGot
.
visibility
=
View
.
VISIBLE
}
fun
virusDetail
()
{
binding
.
llVirusResult
.
visibility
=
View
.
GONE
binding
.
tvGot
.
visibility
=
View
.
GONE
binding
.
llVirusDetail
.
visibility
=
View
.
VISIBLE
binding
.
llButtonYn
.
visibility
=
View
.
VISIBLE
}
fun
virusFinish
()
{
binding
.
llVirusResult
.
visibility
=
View
.
GONE
binding
.
tvGot
.
visibility
=
View
.
GONE
binding
.
includeVirusFinish
.
root
.
visibility
=
View
.
VISIBLE
binding
.
includeVirusFinish
.
tvSettleNum
.
text
=
mIgnoreCount
.
toString
()
MaxAdUtils
.
showMaxNativeAd
(
this
,
binding
.
includeVirusFinish
.
flAd
,
slotname
=
"native_slot"
)
}
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
if
(
mCurrentAppInfo
!=
null
)
{
if
(
mCurrentAppInfo
!=
null
)
{
...
...
app/src/main/java/com/xm/test/myfile/activity/SimilarImagesActivity.kt
View file @
d645bfd6
...
@@ -22,7 +22,7 @@ import com.xm.test.myfile.model.FileBean
...
@@ -22,7 +22,7 @@ import com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.view.CustomDialog
import
com.xm.test.myfile.view.CustomDialog
import
java.io.File
import
java.io.File
class
SimilarImagesActivity
:
AppCompatActivity
(),
OnClickListener
,
SimilarBeanAdapter
.
RefreshNumberText
{
class
SimilarImagesActivity
:
AppCompatActivity
(),
OnClickListener
,
SimilarBeanAdapter
.
RefreshNumberText
{
private
lateinit
var
mTitleText
:
TextView
private
lateinit
var
mTitleText
:
TextView
private
lateinit
var
mShareBtn
:
ImageView
private
lateinit
var
mShareBtn
:
ImageView
...
@@ -46,7 +46,7 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -46,7 +46,7 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
private
var
mSimilarDatas
=
ArrayList
<
ArrayList
<
FileBean
>>()
private
var
mSimilarDatas
=
ArrayList
<
ArrayList
<
FileBean
>>()
companion
object
{
companion
object
{
var
isClickEditBtn
:
Boolean
=
false
var
isClickEditBtn
:
Boolean
=
false
var
switchNumber
:
Int
=
0
var
switchNumber
:
Int
=
0
var
isClickCheckBoxAllBtn
:
Boolean
=
false
var
isClickCheckBoxAllBtn
:
Boolean
=
false
...
@@ -54,7 +54,6 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -54,7 +54,6 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
}
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_duplicate_images
)
setContentView
(
R
.
layout
.
activity_duplicate_images
)
...
@@ -92,7 +91,7 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -92,7 +91,7 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
setNumber
(
0
)
setNumber
(
0
)
startDuplicateImages
()
startDuplicateImages
()
// mDeleteBtn.set
OnClickListener
{
// mDeleteBtn.set
MyReportViewListener(javaClass.simpleName)
{
// }
// }
}
}
...
@@ -127,12 +126,12 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -127,12 +126,12 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
mRecycleView
.
visibility
=
View
.
GONE
mRecycleView
.
visibility
=
View
.
GONE
findViewById
<
View
>(
R
.
id
.
not_file_found_layout
).
visibility
=
View
.
VISIBLE
findViewById
<
View
>(
R
.
id
.
not_file_found_layout
).
visibility
=
View
.
VISIBLE
mEditBtn
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
}
else
{
}
else
{
findViewById
<
View
>(
R
.
id
.
not_file_found_layout
).
visibility
=
View
.
GONE
findViewById
<
View
>(
R
.
id
.
not_file_found_layout
).
visibility
=
View
.
GONE
mRecycleView
.
visibility
=
View
.
VISIBLE
mRecycleView
.
visibility
=
View
.
VISIBLE
mEditBtn
.
visibility
=
View
.
VISIBLE
mEditBtn
.
visibility
=
View
.
VISIBLE
// mImageItemAdapter?.setData(mDataBeans)
// mImageItemAdapter?.setData(mDataBeans)
Log
.
e
(
"yanglin"
,
"onSmilarScanFinish: mSimilarDatas.size = ${mSimilarDatas.size}"
,
)
Log
.
e
(
"yanglin"
,
"onSmilarScanFinish: mSimilarDatas.size = ${mSimilarDatas.size}"
)
mSimilarBeanAdapter
?.
setData
(
mSimilarDatas
)
mSimilarBeanAdapter
?.
setData
(
mSimilarDatas
)
}
}
}
}
...
@@ -144,20 +143,23 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -144,20 +143,23 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
btn_cancel
->{
R
.
id
.
btn_cancel
->
{
cancel
()
cancel
()
}
}
R
.
id
.
btn_quit
->{
R
.
id
.
btn_quit
->
{
finish
()
finish
()
}
}
R
.
id
.
btn_new
->{
R
.
id
.
btn_new
->
{
// createNewDir()
// createNewDir()
}
}
R
.
id
.
btn_edit
->{
R
.
id
.
btn_edit
->
{
mNewBtn
.
visibility
=
View
.
GONE
mNewBtn
.
visibility
=
View
.
GONE
mQuitBtn
.
visibility
=
View
.
GONE
mQuitBtn
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
mEditBtn
.
visibility
=
View
.
GONE
mDeleteBtn
.
visibility
=
View
.
VISIBLE
mDeleteBtn
.
visibility
=
View
.
VISIBLE
mCancelBtn
.
visibility
=
View
.
VISIBLE
mCancelBtn
.
visibility
=
View
.
VISIBLE
...
@@ -169,17 +171,15 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -169,17 +171,15 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
mSimilarBeanAdapter
?.
refreshItem
()
mSimilarBeanAdapter
?.
refreshItem
()
}
}
R
.
id
.
btn_delete
->{
val
customDialog
=
CustomDialog
(
this
)
R
.
id
.
btn_delete
->
{
customDialog
.
setsCancel
(
View
.
OnClickListener
{
val
customDialog
=
CustomDialog
(
this
,
sureClick
=
{
customDialog
.
dismiss
()
for
(
fileBean
in
mSimilarBeanAdapter
?.
mCheckedLists
!!
)
{
}).
setsConfirm
(
View
.
OnClickListener
{
for
(
fileBean
in
mSimilarBeanAdapter
?.
mCheckedLists
!!
){
MyApplication
.
mCleanSdk
?.
delete
(
File
(
fileBean
.
filePath
))
MyApplication
.
mCleanSdk
?.
delete
(
File
(
fileBean
.
filePath
))
for
(
i
in
0
..
<
mSimilarDatas
.
size
){
for
(
i
in
0
..
<
mSimilarDatas
.
size
)
{
mSimilarDatas
[
i
].
forEach
{
mSimilarDatas
[
i
].
forEach
{
if
(
fileBean
.
filePath
.
contains
(
it
.
filePath
)){
if
(
fileBean
.
filePath
.
contains
(
it
.
filePath
))
{
Log
.
e
(
"yanglin"
,
"onClick: ${mSimilarDatas[i]}"
,
)
Log
.
e
(
"yanglin"
,
"onClick: ${mSimilarDatas[i]}"
)
mSimilarDatas
[
i
].
remove
(
fileBean
)
mSimilarDatas
[
i
].
remove
(
fileBean
)
return
@forEach
return
@forEach
}
}
...
@@ -191,30 +191,29 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -191,30 +191,29 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
mSimilarBeanAdapter
?.
notifyDataSetChanged
()
mSimilarBeanAdapter
?.
notifyDataSetChanged
()
mSimilarBeanAdapter
?.
refreshItem
()
mSimilarBeanAdapter
?.
refreshItem
()
setNumber
(
0
)
setNumber
(
0
)
customDialog
.
dismiss
()
})
}).
show
()
customDialog
.
show
()
customDialog
.
isShowEditText
(
false
)
customDialog
customDialog
.
setsTitle
(
"Delete"
)
.
isShowEditText
(
false
)
customDialog
.
setsHint
(
"Are you sure you want to delete ${mSimilarBeanAdapter?.mCheckedLists!!.size ?: 0} item?"
)
.
setsTitle
(
"Delete"
)
.
setsHint
(
"Are you sure you want to delete ${mSimilarBeanAdapter?.mCheckedLists!!.size ?: 0} item?"
)
}
}
R
.
id
.
checkbox_item_all
->{
R
.
id
.
checkbox_item_all
->
{
isClickCheckBoxAllBtn
=
!
isClickCheckBoxAllBtn
isClickCheckBoxAllBtn
=
!
isClickCheckBoxAllBtn
mCheckItemSelectAllBtn
.
isChecked
=
isClickCheckBoxAllBtn
mCheckItemSelectAllBtn
.
isChecked
=
isClickCheckBoxAllBtn
// mImageItemAdapter?.selectAll(isClickCheckBoxAllBtn)
mSimilarBeanAdapter
?.
selectAll
(
isClickCheckBoxAllBtn
)
mSimilarBeanAdapter
?.
selectAll
(
isClickCheckBoxAllBtn
)
mSimilarBeanAdapter
?.
refreshItem
()
mSimilarBeanAdapter
?.
refreshItem
()
// mBaseViewModel.setNumber(mSimilarBeanAdapter?.mCheckedLists!!.size)
}
}
}
}
}
}
fun
cancel
(){
fun
cancel
()
{
// setStateCheckedMap(false)
// setStateCheckedMap(false)
mSimilarBeanAdapter
?.
selectAll
(
false
)
mSimilarBeanAdapter
?.
selectAll
(
false
)
mNewBtn
.
visibility
=
View
.
VISIBLE
mNewBtn
.
visibility
=
View
.
VISIBLE
mQuitBtn
.
visibility
=
View
.
VISIBLE
mQuitBtn
.
visibility
=
View
.
VISIBLE
mEditBtn
.
visibility
=
View
.
VISIBLE
mEditBtn
.
visibility
=
View
.
VISIBLE
mCancelBtn
.
visibility
=
View
.
GONE
mCancelBtn
.
visibility
=
View
.
GONE
mDeleteBtn
.
visibility
=
View
.
GONE
mDeleteBtn
.
visibility
=
View
.
GONE
mShareBtn
.
visibility
=
View
.
GONE
mShareBtn
.
visibility
=
View
.
GONE
...
@@ -231,9 +230,9 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
...
@@ -231,9 +230,9 @@ class SimilarImagesActivity : AppCompatActivity(), OnClickListener, SimilarBeanA
}
}
override
fun
onBackPressed
()
{
override
fun
onBackPressed
()
{
if
(
mCancelBtn
.
isVisible
){
if
(
mCancelBtn
.
isVisible
)
{
cancel
()
cancel
()
}
else
{
}
else
{
super
.
onBackPressed
()
super
.
onBackPressed
()
}
}
}
}
...
...
app/src/main/java/com/xm/test/myfile/ad/EventHelper.kt
View file @
d645bfd6
...
@@ -23,26 +23,9 @@ import java.io.IOException
...
@@ -23,26 +23,9 @@ import java.io.IOException
object
EventHelper
{
object
EventHelper
{
private
val
url
by
lazy
{
fun
commonData
():
JSONObject
{
val
pkg
=
ConfigHelper
.
packageName
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.eventUrl}/${pkg.filter { it.isLowerCase() }.substring(4, 9)}sp"
)
return
JSONObject
()
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
event
(
key
:
String
,
value
:
String
?
=
null
,
ext
:
JSONObject
?
=
null
,
isSingleEvent
:
Boolean
=
false
)
{
if
(
isSingleEvent
)
{
val
stringSet
=
SPUtils
.
getInstance
().
getStringSet
(
"singleEvent"
)
if
(
stringSet
.
contains
(
key
))
{
return
}
}
val
pkg
=
ConfigHelper
.
packageName
val
d1
=
JSONObject
()
.
put
(
"action"
,
key
)
.
put
(
"value"
,
value
)
.
put
(
"ext"
,
ext
)
val
d2
=
JSONObject
()
.
put
(
"${pkg}_1"
,
"${ScreenUtils.getScreenHeight()}"
)
.
put
(
"${pkg}_1"
,
"${ScreenUtils.getScreenHeight()}"
)
.
put
(
"${pkg}_2"
,
"${ScreenUtils.getScreenWidth()}"
)
.
put
(
"${pkg}_2"
,
"${ScreenUtils.getScreenWidth()}"
)
.
put
(
"${pkg}_3"
,
DeviceUtils
.
getModel
())
.
put
(
"${pkg}_3"
,
DeviceUtils
.
getModel
())
...
@@ -57,26 +40,40 @@ object EventHelper {
...
@@ -57,26 +40,40 @@ object EventHelper {
.
put
(
"${pkg}_14"
,
"${AppUtils.getAppVersionCode()}"
)
.
put
(
"${pkg}_14"
,
"${AppUtils.getAppVersionCode()}"
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
// .put("${pkg}_25", PhoneTools.isRoot())
.
put
(
"${pkg}_25"
,
KokoReportHelper
.
isShellRooted
())
.
put
(
"${pkg}_25"
,
KokoReportHelper
.
isShellRooted
())
// .put("${pkg}_26", PhoneTools.isHooked())
.
put
(
"${pkg}_26"
,
KokoReportHelper
.
isHooked
())
.
put
(
"${pkg}_26"
,
KokoReportHelper
.
isHooked
())
// .put("${pkg}_27", PhoneTools.isEmulator())
.
put
(
"${pkg}_27"
,
KokoReportHelper
.
isVirtualMachine
())
.
put
(
"${pkg}_27"
,
KokoReportHelper
.
isVirtualMachine
())
// .put("${pkg}_29", PhoneTools.checkWifiProxy())
.
put
(
"${pkg}_28"
,
KokoReportHelper
.
isSimCardInserted
(
MyApplication
.
fContext
))
.
put
(
"${pkg}_29"
,
KokoReportHelper
.
isWifiProxy
(
MyApplication
.
fContext
))
.
put
(
"${pkg}_29"
,
KokoReportHelper
.
isProxy
(
MyApplication
.
fContext
))
// .put("${pkg}_30", PhoneTools.hasVPN())
.
put
(
"${pkg}_30"
,
KokoReportHelper
.
isVpnConnected
(
MyApplication
.
fContext
))
.
put
(
"${pkg}_30"
,
KokoReportHelper
.
isVpnConnected
(
MyApplication
.
fContext
))
// .put("${pkg}_31", if(DeviceUtils.isDevelopmentSettingsEnabled()){1} else 0)
.
put
(
"${pkg}_31"
,
KokoReportHelper
.
isEnableDeveloperDebug
(
MyApplication
.
fContext
))
.
put
(
"${pkg}_31"
,
if
(
KokoReportHelper
.
isEnableDeveloperDebug
(
MyApplication
.
fContext
))
1
else
0
)
// .put("${pkg}_32", PhoneTools.isBatteryCharg())
.
put
(
"${pkg}_32"
,
isCharging
(
MyApplication
.
fContext
))
.
put
(
"${pkg}_32"
,
isCharging
(
MyApplication
.
fContext
))
// .put("${pkg}_33", ConfigHelper.sensorParm)
.
put
(
"${pkg}_33"
,
GravitySensorManager
.
sensorParam
)
.
put
(
"${pkg}_33"
,
GravitySensorManager
.
sensorParm
)
}
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.eventUrl}/${pkg.filter { it.isLowerCase() }.substring(4, 9)}sp"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
event
(
key
:
String
,
value
:
String
?
=
null
,
ext
:
JSONObject
?
=
null
,
isSingleEvent
:
Boolean
=
false
)
{
if
(
isSingleEvent
)
{
val
stringSet
=
SPUtils
.
getInstance
().
getStringSet
(
"singleEvent"
)
if
(
stringSet
.
contains
(
key
))
{
return
}
}
val
d1
=
JSONObject
()
.
put
(
"action"
,
key
)
.
put
(
"value"
,
value
)
.
put
(
"ext"
,
ext
)
val
data
=
JSONObject
()
val
data
=
JSONObject
()
.
put
(
"data"
,
d1
)
.
put
(
"data"
,
d1
)
.
put
(
"bp"
,
d2
)
.
put
(
"bp"
,
commonData
()
)
.
toString
()
.
toString
()
...
...
app/src/main/java/com/xm/test/myfile/ad/GravitySensorManager.kt
View file @
d645bfd6
...
@@ -20,27 +20,12 @@ class GravitySensorManager(val context: Context) {
...
@@ -20,27 +20,12 @@ class GravitySensorManager(val context: Context) {
private
var
sensorManager
:
SensorManager
=
context
.
getSystemService
(
Context
.
SENSOR_SERVICE
)
as
SensorManager
private
var
sensorManager
:
SensorManager
=
context
.
getSystemService
(
Context
.
SENSOR_SERVICE
)
as
SensorManager
private
var
mySensorEventListener
:
MySensorEventListener
?
=
null
private
var
mySensorEventListener
:
MySensorEventListener
?
=
null
private
var
xWave
=
0f
private
var
yWave
=
0f
private
var
zWave
=
0f
private
val
initValue
=
AtomicBoolean
(
false
)
companion
object
{
companion
object
{
private
var
x
:
Float
=
0f
private
var
x
:
Float
=
0f
private
var
y
:
Float
=
0f
private
var
y
:
Float
=
0f
private
var
z
:
Float
=
0f
private
var
z
:
Float
=
0f
var
sensorParm
:
String
=
"$x:$y:$z"
var
sensorParam
:
String
=
"$x:$y:$z"
}
init
{
val
time
=
Timer
()
val
timerTask
=
object
:
TimerTask
()
{
override
fun
run
()
{
}
}
time
.
schedule
(
timerTask
,
5
.
seconds
.
toLong
(
DurationUnit
.
MILLISECONDS
),
20
.
seconds
.
toLong
(
DurationUnit
.
MILLISECONDS
))
}
}
inner
class
MySensorEventListener
:
SensorEventListener
{
inner
class
MySensorEventListener
:
SensorEventListener
{
...
@@ -50,27 +35,11 @@ class GravitySensorManager(val context: Context) {
...
@@ -50,27 +35,11 @@ class GravitySensorManager(val context: Context) {
*/
*/
override
fun
onSensorChanged
(
event
:
SensorEvent
)
{
override
fun
onSensorChanged
(
event
:
SensorEvent
)
{
if
(
event
.
sensor
.
type
==
Sensor
.
TYPE_ACCELEROMETER
)
{
if
(
event
.
sensor
.
type
==
Sensor
.
TYPE_ACCELEROMETER
)
{
// if (!initValue.get()) {
// x = event.values[SensorManager.DATA_X]
// y = event.values[SensorManager.DATA_Y]
// z = event.values[SensorManager.DATA_Z]
// initValue.set(true)
// } else {
//
// val changeX = x - event.values[SensorManager.DATA_X]
// val changeY = y - event.values[SensorManager.DATA_Y]
// val changeZ = z - event.values[SensorManager.DATA_Z]
//
// xWave = changeX.coerceAtLeast(xWave)
// yWave = changeY.coerceAtLeast(yWave)
// zWave = changeZ.coerceAtLeast(zWave)
//
// }
x
=
event
.
values
[
SensorManager
.
DATA_X
]
x
=
event
.
values
[
SensorManager
.
DATA_X
]
y
=
event
.
values
[
SensorManager
.
DATA_Y
]
y
=
event
.
values
[
SensorManager
.
DATA_Y
]
z
=
event
.
values
[
SensorManager
.
DATA_Z
]
z
=
event
.
values
[
SensorManager
.
DATA_Z
]
sensorParam
=
"$x:$y:$z"
// Log.e("GravitySensorManager", "$x:$y:$z")
// Log.e("GravitySensorManager", "$x:$y:$z")
}
}
}
}
...
...
app/src/main/java/com/xm/test/myfile/ad/KokoReportHelper.kt
View file @
d645bfd6
...
@@ -8,11 +8,13 @@ import android.content.pm.PackageManager
...
@@ -8,11 +8,13 @@ import android.content.pm.PackageManager
import
android.hardware.Sensor
import
android.hardware.Sensor
import
android.hardware.SensorManager
import
android.hardware.SensorManager
import
android.net.ConnectivityManager
import
android.net.ConnectivityManager
import
android.net.NetworkCapabilities
import
android.net.Proxy
import
android.net.Proxy
import
android.os.BatteryManager
import
android.os.BatteryManager
import
android.os.Build
import
android.os.Build
import
android.telephony.TelephonyManager
import
android.telephony.TelephonyManager
import
android.text.TextUtils
import
android.text.TextUtils
import
androidx.annotation.RequiresApi
import
java.io.DataOutputStream
import
java.io.DataOutputStream
import
java.io.File
import
java.io.File
import
java.lang.reflect.Method
import
java.lang.reflect.Method
...
@@ -38,8 +40,9 @@ object KokoReportHelper {
...
@@ -38,8 +40,9 @@ object KokoReportHelper {
/**
/**
* 通过执行shell命令来判断设备是否已经root
* 通过执行shell命令来判断设备是否已经root
* 0:未root,1:已root
*/
*/
fun
isShellRooted
():
Boolean
{
fun
isShellRooted
():
Int
{
try
{
try
{
val
process
=
Runtime
.
getRuntime
().
exec
(
"su"
)
val
process
=
Runtime
.
getRuntime
().
exec
(
"su"
)
val
os
=
DataOutputStream
(
process
.
outputStream
)
val
os
=
DataOutputStream
(
process
.
outputStream
)
...
@@ -48,34 +51,38 @@ object KokoReportHelper {
...
@@ -48,34 +51,38 @@ object KokoReportHelper {
os
.
flush
()
os
.
flush
()
process
.
waitFor
()
process
.
waitFor
()
if
(
process
.
exitValue
()
==
0
)
{
if
(
process
.
exitValue
()
==
0
)
{
return
true
return
1
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
// e.printStackTrace()
// e.printStackTrace()
}
}
return
false
return
0
}
}
/**
/**
* 是否是虚拟机
* 是否是虚拟机
* https://blog.51cto.com/u_16175492/7712954
* https://blog.51cto.com/u_16175492/7712954
* 检查当前设备的信息,包括设备型号、产品名称、品牌、硬件等
* 检查当前设备的信息,包括设备型号、产品名称、品牌、硬件等
* 0:非模拟器,1:是模拟器
*/
*/
fun
isVirtualMachine
():
Boolean
{
fun
isVirtualMachine
():
Int
{
val
manufacturer
=
Build
.
MANUFACTURER
val
manufacturer
=
Build
.
MANUFACTURER
val
model
=
Build
.
MODEL
val
model
=
Build
.
MODEL
val
product
=
Build
.
PRODUCT
val
product
=
Build
.
PRODUCT
return
if
(
manufacturer
.
contains
(
"Genymotion"
)
||
model
.
contains
(
"Emulator"
)
||
product
.
contains
(
"sdk"
))
{
return
if
(
manufacturer
.
contains
(
"Genymotion"
)
||
model
.
contains
(
"Emulator"
)
||
product
.
contains
(
"sdk"
))
{
true
1
}
else
false
}
else
0
}
}
/**
/**
* 是否插sim卡
* 是否插sim卡
* 0:未装,1:已装
*/
*/
fun
isSimCardInserted
(
context
:
Context
):
Boolean
{
fun
isSimCardInserted
(
context
:
Context
):
Int
{
val
telephonyManager
=
context
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
)
as
TelephonyManager
val
telephonyManager
=
context
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
)
as
TelephonyManager
return
telephonyManager
.
getSimState
()
==
TelephonyManager
.
SIM_STATE_READY
val
flag
=
telephonyManager
.
getSimState
()
==
TelephonyManager
.
SIM_STATE_READY
return
if
(
flag
)
1
else
0
}
}
...
@@ -83,9 +90,10 @@ object KokoReportHelper {
...
@@ -83,9 +90,10 @@ object KokoReportHelper {
* 是否有代理
* 是否有代理
* 判断设备 是否使用代理上网
* 判断设备 是否使用代理上网
* https://blog.csdn.net/verynewbeee/article/details/135698990
* https://blog.csdn.net/verynewbeee/article/details/135698990
* 0:未开启代理,1:已开启代理
*/
*/
@SuppressLint
(
"ObsoleteSdkInt"
)
@SuppressLint
(
"ObsoleteSdkInt"
)
fun
is
WifiProxy
(
context
:
Context
?):
Boolean
{
fun
is
Proxy
(
context
:
Context
?):
Int
{
val
IS_ICS_OR_LATER
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
ICE_CREAM_SANDWICH
val
IS_ICS_OR_LATER
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
ICE_CREAM_SANDWICH
val
proxyAddress
:
String
val
proxyAddress
:
String
val
proxyPort
:
Int
val
proxyPort
:
Int
...
@@ -97,25 +105,28 @@ object KokoReportHelper {
...
@@ -97,25 +105,28 @@ object KokoReportHelper {
proxyAddress
=
Proxy
.
getHost
(
context
)
proxyAddress
=
Proxy
.
getHost
(
context
)
proxyPort
=
Proxy
.
getPort
(
context
)
proxyPort
=
Proxy
.
getPort
(
context
)
}
}
return
!
TextUtils
.
isEmpty
(
proxyAddress
)
&&
proxyPort
!=
-
1
val
flag
=
!
TextUtils
.
isEmpty
(
proxyAddress
)
&&
proxyPort
!=
-
1
return
if
(
flag
)
1
else
0
}
}
/**
/**
* 是否开启vpn
* 是否开启vpn
* https://cloud.tencent.com/developer/ask/2122015
* https://cloud.tencent.com/developer/ask/2122015
* 0:未连接VPN,1:已连接VPN
*/
*/
@SuppressLint
(
"ObsoleteSdkInt"
)
@SuppressLint
(
"ObsoleteSdkInt"
)
fun
isVpnConnected
(
context
:
Context
):
Boolean
{
fun
isVpnConnected
(
context
:
Context
):
Any
{
val
cm
=
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
)
as
ConnectivityManager
val
cm
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
)
as
ConnectivityManager
val
networkInfo
=
cm
.
activeNetworkInfo
val
currentNetwork
=
cm
.
activeNetwork
if
(
networkInfo
!=
null
)
{
val
networkCapabilities
=
cm
.
getNetworkCapabilities
(
currentNetwork
)
return
networkInfo
.
type
==
ConnectivityManager
.
TYPE_VPN
return
if
(
networkCapabilities
!=
null
)
{
}
val
flag1
=
networkCapabilities
.
hasTransport
(
NetworkCapabilities
.
TRANSPORT_VPN
)
val
flag2
=
networkCapabilities
.
hasCapability
(
NetworkCapabilities
.
NET_CAPABILITY_INTERNET
)
if
(
flag1
&&
flag2
)
1
else
0
}
else
{
}
else
{
// 低版本 Android 系统可能需要使用其他方法检测 VPN 连接
0
}
}
return
false
}
}
...
@@ -123,9 +134,10 @@ object KokoReportHelper {
...
@@ -123,9 +134,10 @@ object KokoReportHelper {
* 开发者模式是否开启
* 开发者模式是否开启
*
*
* 检测是否开启动了usb 调试模式
* 检测是否开启动了usb 调试模式
* 0:未开启开发者模式,1:已开启开发者模式
*/
*/
@SuppressLint
(
"PrivateApi"
)
@SuppressLint
(
"PrivateApi"
)
fun
isEnableDeveloperDebug
(
context
:
Context
):
Boolean
{
fun
isEnableDeveloperDebug
(
context
:
Context
):
Int
{
var
adb
=
""
var
adb
=
""
try
{
try
{
val
clazz
=
Class
.
forName
(
"android.os.SystemProperties"
)
val
clazz
=
Class
.
forName
(
"android.os.SystemProperties"
)
...
@@ -134,21 +146,24 @@ object KokoReportHelper {
...
@@ -134,21 +146,24 @@ object KokoReportHelper {
}
catch
(
e
:
java
.
lang
.
Exception
)
{
}
catch
(
e
:
java
.
lang
.
Exception
)
{
}
}
return
adb
==
"adb"
val
flag
=
adb
==
"adb"
return
if
(
flag
)
1
else
0
}
}
/**
/**
* 是否在充电
* 是否在充电
* https://blog.csdn.net/su749520/article/details/83898354
* https://blog.csdn.net/su749520/article/details/83898354
* 0:未在充电,1:正在充电
*/
*/
fun
isCharging
(
context
:
Context
):
Boolean
{
fun
isCharging
(
context
:
Context
):
Int
{
val
batteryBroadcast
=
context
.
registerReceiver
(
val
batteryBroadcast
=
context
.
registerReceiver
(
null
,
null
,
IntentFilter
(
Intent
.
ACTION_BATTERY_CHANGED
)
IntentFilter
(
Intent
.
ACTION_BATTERY_CHANGED
)
)
)
// 0 means we are discharging, anything else means charging
// 0 means we are discharging, anything else means charging
val
isCharging
=
batteryBroadcast
!!
.
getIntExtra
(
BatteryManager
.
EXTRA_PLUGGED
,
-
1
)
!=
0
val
isCharging
=
batteryBroadcast
!!
.
getIntExtra
(
BatteryManager
.
EXTRA_PLUGGED
,
-
1
)
!=
0
return
isCharging
return
if
(
isCharging
)
1
else
0
}
}
...
@@ -181,6 +196,9 @@ object KokoReportHelper {
...
@@ -181,6 +196,9 @@ object KokoReportHelper {
return
sensorAccelerometer
!=
null
return
sensorAccelerometer
!=
null
}
}
/**
* 0:未Hook,1:已Hook
*/
fun
isHooked
():
Int
{
fun
isHooked
():
Int
{
try
{
try
{
// 检测Xposed
// 检测Xposed
...
...
app/src/main/java/com/xm/test/myfile/ad/MaxAdUtils.kt
View file @
d645bfd6
This diff is collapsed.
Click to expand it.
app/src/main/java/com/xm/test/myfile/ad/MyReportViewLisenter.kt
View file @
d645bfd6
...
@@ -4,16 +4,14 @@ import android.view.View
...
@@ -4,16 +4,14 @@ import android.view.View
object
MyReportViewListener
{
object
MyReportViewListener
{
class
ReportViewListener
(
val
className
:
String
,
val
click
:
()
->
Unit
)
:
View
.
OnClickListener
{
fun
View
.
setMyReportViewListener
(
className
:
String
,
click
:
(
view
:
View
)
->
Unit
)
{
override
fun
onClick
(
v
:
View
)
{
this
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
va
l
idString
=
v
.
context
.
resources
.
getResourceEntryName
(
v
.
id
)
va
r
idString
=
""
EventHelper
.
event
(
"viewClick_${className}_$idString"
)
runCatching
{
click
.
invoke
(
)
idString
=
it
.
context
.
resources
.
getResourceEntryName
(
it
.
id
)
}
}
EventHelper
.
event
(
"viewClick_${className}_$idString"
)
click
.
invoke
(
it
)
}
}
fun
View
.
setMyReportViewListener
(
className
:
String
,
click
:
()
->
Unit
)
{
this
.
setOnClickListener
(
ReportViewListener
(
className
,
click
))
}
}
}
}
\ No newline at end of file
app/src/main/java/com/xm/test/myfile/adapter/CleanAdapter.kt
View file @
d645bfd6
...
@@ -13,6 +13,7 @@ import android.widget.ListView
...
@@ -13,6 +13,7 @@ import android.widget.ListView
import
android.widget.RelativeLayout
import
android.widget.RelativeLayout
import
android.widget.TextView
import
android.widget.TextView
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.model.CleanBean
import
com.xm.test.myfile.model.CleanBean
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.util.FileUtil
import
com.xm.test.myfile.util.FileUtil
...
@@ -110,7 +111,7 @@ class CleanAdapter(
...
@@ -110,7 +111,7 @@ class CleanAdapter(
layoutParams
.
height
=
FileUtil
.
dpToPx
(
62
*
itemAdapters
[
position
]
?.
count
!!
,
context
)
layoutParams
.
height
=
FileUtil
.
dpToPx
(
62
*
itemAdapters
[
position
]
?.
count
!!
,
context
)
viewHolder
.
listView
?.
adapter
=
itemAdapters
[
position
]
viewHolder
.
listView
?.
adapter
=
itemAdapters
[
position
]
viewHolder
.
itemBar
?.
set
OnClickListener
{
viewHolder
.
itemBar
?.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
// Log.e("yanglin", "setViewOnclickListener: 11111111", )
// Log.e("yanglin", "setViewOnclickListener: 11111111", )
dataBeanList
[
position
].
isListViewShow
=
!
dataBeanList
[
position
].
isListViewShow
dataBeanList
[
position
].
isListViewShow
=
!
dataBeanList
[
position
].
isListViewShow
// viewHolder.listView?.visibility = if (dataBeanList[position].isListViewShow) View.GONE else View.VISIBLE
// viewHolder.listView?.visibility = if (dataBeanList[position].isListViewShow) View.GONE else View.VISIBLE
...
@@ -123,7 +124,7 @@ class CleanAdapter(
...
@@ -123,7 +124,7 @@ class CleanAdapter(
}
}
viewHolder
.
checkBox
?.
set
OnClickListener
{
viewHolder
.
checkBox
?.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
viewHolder
.
checkBox
?.
isChecked
=
!
viewHolder
.
checkBox
?.
isChecked
!!
viewHolder
.
checkBox
?.
isChecked
=
!
viewHolder
.
checkBox
?.
isChecked
!!
selectAll
(
dataBeanList
[
position
].
fileBeans
,
viewHolder
.
checkBox
?.
isChecked
!!
,
position
)
selectAll
(
dataBeanList
[
position
].
fileBeans
,
viewHolder
.
checkBox
?.
isChecked
!!
,
position
)
notifyDataSetChanged
()
notifyDataSetChanged
()
...
...
app/src/main/java/com/xm/test/myfile/adapter/CleanAdapter2.kt
View file @
d645bfd6
...
@@ -7,6 +7,7 @@ import android.view.View
...
@@ -7,6 +7,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.databinding.CleanListItemLayoutBinding
import
com.xm.test.myfile.databinding.CleanListItemLayoutBinding
import
com.xm.test.myfile.databinding.FilesItemLayoutBinding
import
com.xm.test.myfile.databinding.FilesItemLayoutBinding
import
com.xm.test.myfile.model.CleanBean
import
com.xm.test.myfile.model.CleanBean
...
@@ -79,13 +80,13 @@ class CleanAdapter2(mIClean: IClean) : RecyclerView.Adapter<CleanAdapter2.AAA>()
...
@@ -79,13 +80,13 @@ class CleanAdapter2(mIClean: IClean) : RecyclerView.Adapter<CleanAdapter2.AAA>()
}
else
{
}
else
{
holder
.
binding
.
cleanItemList
.
visibility
=
View
.
GONE
holder
.
binding
.
cleanItemList
.
visibility
=
View
.
GONE
}
}
holder
.
binding
.
cleanItemBar
.
set
OnClickListener
{
holder
.
binding
.
cleanItemBar
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
data
.
isListViewShow
=
!
data
.
isListViewShow
data
.
isListViewShow
=
!
data
.
isListViewShow
notifyItemChanged
(
position
)
notifyItemChanged
(
position
)
}
}
holder
.
binding
.
cleanItemCheckBox
.
isChecked
=
mSwitchAll
[
position
]
holder
.
binding
.
cleanItemCheckBox
.
isChecked
=
mSwitchAll
[
position
]
selectAll
(
mSwitchAll
[
position
],
position
)
selectAll
(
mSwitchAll
[
position
],
position
)
holder
.
binding
.
cleanItemCheckBox
.
set
OnClickListener
{
holder
.
binding
.
cleanItemCheckBox
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
if
(
CleanAdapter
.
isCleanOver
){
if
(
CleanAdapter
.
isCleanOver
){
mSwitchAll
[
position
]
=
!
mSwitchAll
[
position
]
mSwitchAll
[
position
]
=
!
mSwitchAll
[
position
]
selectAll
(
mSwitchAll
[
position
],
position
)
selectAll
(
mSwitchAll
[
position
],
position
)
...
@@ -165,7 +166,7 @@ class CleanAdapter2(mIClean: IClean) : RecyclerView.Adapter<CleanAdapter2.AAA>()
...
@@ -165,7 +166,7 @@ class CleanAdapter2(mIClean: IClean) : RecyclerView.Adapter<CleanAdapter2.AAA>()
holder
.
binding
.
fileSelectSwitch
.
isChecked
=
mCheckedBooleanArrays
[
itemPosition
][
position
]
holder
.
binding
.
fileSelectSwitch
.
isChecked
=
mCheckedBooleanArrays
[
itemPosition
][
position
]
holder
.
binding
.
itemLayout
.
set
OnClickListener
{
holder
.
binding
.
itemLayout
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
Log
.
e
(
"yanglin"
,
"onBindViewHolder: $itemPosition $position"
,
)
Log
.
e
(
"yanglin"
,
"onBindViewHolder: $itemPosition $position"
,
)
mCheckedBooleanArrays
[
itemPosition
].
put
(
position
,
!
mCheckedBooleanArrays
[
itemPosition
][
position
])
mCheckedBooleanArrays
[
itemPosition
].
put
(
position
,
!
mCheckedBooleanArrays
[
itemPosition
][
position
])
if
(
mCheckedBooleanArrays
[
itemPosition
][
position
]){
if
(
mCheckedBooleanArrays
[
itemPosition
][
position
]){
...
@@ -179,7 +180,7 @@ class CleanAdapter2(mIClean: IClean) : RecyclerView.Adapter<CleanAdapter2.AAA>()
...
@@ -179,7 +180,7 @@ class CleanAdapter2(mIClean: IClean) : RecyclerView.Adapter<CleanAdapter2.AAA>()
// holder.binding.fileSelectSwitch.isChecked = !holder.binding.fileSelectSwitch.isChecked
// holder.binding.fileSelectSwitch.isChecked = !holder.binding.fileSelectSwitch.isChecked
}
}
// holder.binding.fileSelectSwitch.set
OnClickListener
{
// holder.binding.fileSelectSwitch.set
MyReportViewListener(javaClass.simpleName)
{
// sibList[position].isChecked = !sibList[position].isChecked
// sibList[position].isChecked = !sibList[position].isChecked
// if (holder.binding.fileSelectSwitch.isChecked){
// if (holder.binding.fileSelectSwitch.isChecked){
// mFileCheckedItemList.add(sibList[position])
// mFileCheckedItemList.add(sibList[position])
...
...
app/src/main/java/com/xm/test/myfile/antivirus/AntivirusActivity.kt
View file @
d645bfd6
package
com.xm.test.myfile.antivirus
package
com.xm.test.myfile.antivirus
import
android.content.Intent
import
android.content.Intent
import
android.content.SharedPreferences
import
android.os.Bundle
import
android.os.Bundle
import
android.os.Handler
import
android.os.Handler
import
android.os.Looper
import
android.os.Looper
...
@@ -11,15 +10,14 @@ import android.widget.ProgressBar
...
@@ -11,15 +10,14 @@ import android.widget.ProgressBar
import
android.widget.TextView
import
android.widget.TextView
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.app.AppCompatActivity
import
androidx.datastore.preferences.core.booleanPreferencesKey
import
androidx.datastore.preferences.core.booleanPreferencesKey
import
androidx.datastore.preferences.core.stringPreferencesKey
import
com.trustlook.sdk.cloudscan.CloudScanListener
import
com.trustlook.sdk.cloudscan.CloudScanListener
import
com.trustlook.sdk.data.AppInfo
import
com.trustlook.sdk.data.AppInfo
import
com.xm.test.myfile.MyApplication
import
com.xm.test.myfile.MyApplication
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.activity.ScanResultActivity
import
com.xm.test.myfile.activity.ScanResultActivity
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.ad.queryDataStoreBlock
import
com.xm.test.myfile.ad.queryDataStoreBlock
import
com.xm.test.myfile.ad.saveDataStore
import
com.xm.test.myfile.ad.saveDataStoreBlock
import
com.xm.test.myfile.ad.saveDataStoreBlock
import
com.xm.test.myfile.databinding.ActivityAntivirusBinding
import
com.xm.test.myfile.databinding.ActivityAntivirusBinding
...
@@ -49,19 +47,19 @@ class AntivirusActivity : AppCompatActivity() {
...
@@ -49,19 +47,19 @@ class AntivirusActivity : AppCompatActivity() {
private
fun
setOnclickListener
()
{
private
fun
setOnclickListener
()
{
binding
.
ivBack
.
set
OnClickListener
{
binding
.
ivBack
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
MyApplication
.
mCloudScan
?.
cancelScan
()
MyApplication
.
mCloudScan
?.
cancelScan
()
finish
()
finish
()
}
}
binding
.
ivBack2
.
set
OnClickListener
{
binding
.
ivBack2
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
MyApplication
.
mCloudScan
?.
cancelScan
()
MyApplication
.
mCloudScan
?.
cancelScan
()
finish
()
finish
()
}
}
findViewById
<
View
>(
R
.
id
.
Start_scanning
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
Start_scanning
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
saveDataStoreBlock
(
AGREE_VIRUS_PRIVACY_KEY
,
true
)
saveDataStoreBlock
(
AGREE_VIRUS_PRIVACY_KEY
,
true
)
startAntivirus
()
startAntivirus
()
}
}
findViewById
<
View
>(
R
.
id
.
antivirus_stop_text
).
set
OnClickListener
{
findViewById
<
View
>(
R
.
id
.
antivirus_stop_text
).
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
MyApplication
.
mCloudScan
?.
cancelScan
()
MyApplication
.
mCloudScan
?.
cancelScan
()
finish
()
finish
()
}
}
...
...
app/src/main/java/com/xm/test/myfile/base/BaseActivity.kt
View file @
d645bfd6
This diff is collapsed.
Click to expand it.
app/src/main/java/com/xm/test/myfile/fragment/FileManagerFragment.kt
View file @
d645bfd6
...
@@ -10,16 +10,11 @@ import android.view.ViewGroup
...
@@ -10,16 +10,11 @@ import android.view.ViewGroup
import
android.widget.GridView
import
android.widget.GridView
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.activity.FileManagerActivity
import
com.xm.test.myfile.activity.FileManagerActivity
import
com.xm.test.myfile.activity.HomeActivity
import
com.xm.test.myfile.activity.MediaActivity
import
com.xm.test.myfile.activity.MediaActivity
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.adapter.MediaAdapter
import
com.xm.test.myfile.adapter.MediaAdapter
import
com.xm.test.myfile.databinding.FragmentFileManagerBinding
import
com.xm.test.myfile.databinding.FragmentFileManagerBinding
import
com.xm.test.myfile.databinding.FragmentHomeBinding
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.model.FileBean
import
com.xm.test.myfile.util.MediaUtil
import
com.xm.test.myfile.util.MediaUtil
import
com.xm.test.myfile.util.PermissionUtil
import
com.xm.test.myfile.view.CustomDialog
class
FileManagerFragment
:
Fragment
(),
View
.
OnClickListener
{
class
FileManagerFragment
:
Fragment
(),
View
.
OnClickListener
{
private
lateinit
var
mView
:
View
private
lateinit
var
mView
:
View
...
@@ -83,18 +78,18 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
...
@@ -83,18 +78,18 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
mTxtBtn
.
setOnClickListener
(
this
)
mTxtBtn
.
setOnClickListener
(
this
)
mRecentView
.
setOnClickListener
(
this
)
mRecentView
.
setOnClickListener
(
this
)
mImageBtn
.
set
OnClickListener
{
mImageBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
intent
=
Intent
(
context
,
MediaActivity
::
class
.
java
)
val
intent
=
Intent
(
context
,
MediaActivity
::
class
.
java
)
intent
.
putExtra
(
"fileType"
,
"image"
)
intent
.
putExtra
(
"fileType"
,
"image"
)
context
?.
startActivity
(
intent
)
context
?.
startActivity
(
intent
)
}
}
mVideoBtn
.
set
OnClickListener
{
mVideoBtn
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
intent
=
Intent
(
context
,
MediaActivity
::
class
.
java
)
val
intent
=
Intent
(
context
,
MediaActivity
::
class
.
java
)
intent
.
putExtra
(
"fileType"
,
"video"
)
intent
.
putExtra
(
"fileType"
,
"video"
)
context
?.
startActivity
(
intent
)
context
?.
startActivity
(
intent
)
}
}
mRecentView
.
set
OnClickListener
{
mRecentView
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
val
intent
=
Intent
(
context
,
MediaActivity
::
class
.
java
)
val
intent
=
Intent
(
context
,
MediaActivity
::
class
.
java
)
intent
.
putExtra
(
"fileType"
,
"image"
)
intent
.
putExtra
(
"fileType"
,
"image"
)
context
?.
startActivity
(
intent
)
context
?.
startActivity
(
intent
)
...
...
app/src/main/java/com/xm/test/myfile/fragment/HomeFragment.kt
View file @
d645bfd6
...
@@ -21,11 +21,8 @@ import com.xm.test.myfile.activity.CleanActivity
...
@@ -21,11 +21,8 @@ import com.xm.test.myfile.activity.CleanActivity
import
com.xm.test.myfile.activity.ScanEmptyFilesActivity
import
com.xm.test.myfile.activity.ScanEmptyFilesActivity
import
com.xm.test.myfile.activity.ScanLargeFilesActivity
import
com.xm.test.myfile.activity.ScanLargeFilesActivity
import
com.xm.test.myfile.activity.SimilarImagesActivity
import
com.xm.test.myfile.activity.SimilarImagesActivity
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.antivirus.AntivirusActivity
import
com.xm.test.myfile.antivirus.AntivirusActivity
import
com.xm.test.myfile.databinding.FragmentHomeBinding
import
com.xm.test.myfile.databinding.FragmentHomeBinding
import
com.xm.test.myfile.util.PermissionUtil
import
com.xm.test.myfile.view.CustomDialog
class
HomeFragment
:
Fragment
(),
OnClickListener
{
class
HomeFragment
:
Fragment
(),
OnClickListener
{
private
lateinit
var
mView
:
View
private
lateinit
var
mView
:
View
...
...
app/src/main/java/com/xm/test/myfile/view/CustomDialog.kt
View file @
d645bfd6
...
@@ -6,23 +6,31 @@ import android.graphics.Color
...
@@ -6,23 +6,31 @@ import android.graphics.Color
import
android.graphics.Point
import
android.graphics.Point
import
android.graphics.drawable.ColorDrawable
import
android.graphics.drawable.ColorDrawable
import
android.os.Bundle
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.widget.EditText
import
android.widget.EditText
import
android.widget.TextView
import
android.widget.TextView
import
com.xm.test.myfile.R
import
com.xm.test.myfile.R
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.databinding.DialogCustomLayoutBinding
class
CustomDialog
(
context
:
Context
?)
:
Dialog
(
context
!!
),
View
.
OnClickListener
{
class
CustomDialog
(
val
context
:
Context
,
val
sureClick
:
(()
->
Unit
)?
=
null
,
val
cancelClick
:
(()
->
Unit
)?
=
null
)
:
Dialog
(
context
)
{
private
lateinit
var
mEdit
:
EditText
private
lateinit
var
mEdit
:
EditText
private
lateinit
var
mCancel
:
TextView
private
lateinit
var
mCancel
:
TextView
private
lateinit
var
mSure
:
TextView
private
lateinit
var
mSure
:
TextView
private
var
mTitle
:
TextView
?
=
null
private
var
mTitle
:
TextView
?
=
null
private
var
mHint
:
TextView
?
=
null
private
var
mHint
:
TextView
?
=
null
private
var
mCancelListener
:
View
.
OnClickListener
?
=
null
private
lateinit
var
binding
:
DialogCustomLayoutBinding
private
var
mSureListener
:
View
.
OnClickListener
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
dialog_custom_layout
)
binding
=
DialogCustomLayoutBinding
.
inflate
(
LayoutInflater
.
from
(
context
))
setContentView
(
binding
.
root
)
setCancelable
(
false
)
setCancelable
(
false
)
window
?.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
TRANSPARENT
))
window
?.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
TRANSPARENT
))
...
@@ -41,65 +49,54 @@ class CustomDialog(context: Context?) : Dialog(context!!), View.OnClickListener{
...
@@ -41,65 +49,54 @@ class CustomDialog(context: Context?) : Dialog(context!!), View.OnClickListener{
mTitle
=
findViewById
(
R
.
id
.
dialog_title_text
)
mTitle
=
findViewById
(
R
.
id
.
dialog_title_text
)
mHint
=
findViewById
(
R
.
id
.
dialog_hint_text
)
mHint
=
findViewById
(
R
.
id
.
dialog_hint_text
)
mCancel
.
setOnClickListener
(
this
)
binding
.
dialogCancelBtn
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
mSure
.
setOnClickListener
(
this
)
cancelClick
?.
invoke
()
dismiss
()
}
}
binding
.
dialogSureBtn
.
setMyReportViewListener
(
javaClass
.
simpleName
)
{
fun
setsConfirm
(
sure
:
View
.
OnClickListener
):
CustomDialog
{
sureClick
?.
invoke
()
this
.
mSureListener
=
sure
dismiss
()
return
this
}
}
fun
setsCancel
(
cancel
:
View
.
OnClickListener
):
CustomDialog
{
this
.
mCancelListener
=
cancel
return
this
}
}
fun
setsTitle
(
str
:
String
):
CustomDialog
{
fun
setsTitle
(
str
:
String
):
CustomDialog
{
findViewById
<
TextView
>(
R
.
id
.
dialog_title_text
).
text
=
str
findViewById
<
TextView
>(
R
.
id
.
dialog_title_text
).
text
=
str
return
this
return
this
}
}
fun
setsHint
(
str
:
String
):
CustomDialog
{
fun
setsHint
(
str
:
String
):
CustomDialog
{
findViewById
<
TextView
>(
R
.
id
.
dialog_hint_text
).
text
=
str
findViewById
<
TextView
>(
R
.
id
.
dialog_hint_text
).
text
=
str
return
this
return
this
}
}
fun
setShowTitle
(
isShow
:
Boolean
){
fun
setShowTitle
(
isShow
:
Boolean
):
CustomDialog
{
mTitle
?.
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
mTitle
?.
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
return
this
}
}
fun
setsRightDelete
(
str
:
String
):
CustomDialog
{
fun
setsRightDelete
(
str
:
String
):
CustomDialog
{
mSure
.
text
=
str
mSure
.
text
=
str
mSure
.
setTextColor
(
Color
.
RED
)
mSure
.
setTextColor
(
Color
.
RED
)
mSure
.
setBackgroundResource
(
R
.
drawable
.
bg_btn_cancel_shape
)
mSure
.
setBackgroundResource
(
R
.
drawable
.
bg_btn_cancel_shape
)
return
this
return
this
}
}
fun
setRightBtnText
(
str
:
String
){
fun
setRightBtnText
(
str
:
String
)
{
mSure
.
text
=
str
mSure
.
text
=
str
}
}
fun
isShowEditText
(
isShow
:
Boolean
):
CustomDialog
{
mEdit
.
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
fun
isShowEditText
(
isShow
:
Boolean
):
CustomDialog
{
binding
.
dialogEdit
.
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
return
this
return
this
}
}
fun
isShowHintText
(
isShow
:
Boolean
):
CustomDialog
{
fun
isShowHintText
(
isShow
:
Boolean
):
CustomDialog
{
findViewById
<
TextView
>(
R
.
id
.
dialog_hint_text
).
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
findViewById
<
TextView
>(
R
.
id
.
dialog_hint_text
).
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
return
this
return
this
}
}
fun
getEditTextStr
():
String
{
fun
getEditTextStr
():
String
{
return
mEdit
.
text
.
toString
()
return
mEdit
.
text
.
toString
()
}
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
){
R
.
id
.
dialog_cancel_btn
->{
if
(
mCancelListener
!=
null
){
mCancelListener
?.
onClick
(
v
)
}
}
R
.
id
.
dialog_sure_btn
->{
if
(
mSureListener
!=
null
){
mSureListener
?.
onClick
(
v
)
}
}
}
}
}
}
\ No newline at end of file
app/src/main/java/com/xm/test/myfile/view/ManageStorageDialog.kt
View file @
d645bfd6
...
@@ -6,11 +6,12 @@ import android.view.Gravity
...
@@ -6,11 +6,12 @@ import android.view.Gravity
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.appcompat.app.AlertDialog
import
androidx.appcompat.app.AlertDialog
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.databinding.DialogManageStorageBinding
import
com.xm.test.myfile.databinding.DialogManageStorageBinding
object
ManageStorageDialog
{
object
ManageStorageDialog
{
fun
Context
.
showManageStorageDialog
(
action
:
()
->
Unit
)
{
fun
Context
.
showManageStorageDialog
(
action
:
()
->
Unit
)
{
val
binding
=
DialogManageStorageBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
val
binding
=
DialogManageStorageBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
val
dialog
=
AlertDialog
.
Builder
(
this
).
setView
(
binding
.
root
).
create
()
val
dialog
=
AlertDialog
.
Builder
(
this
).
setView
(
binding
.
root
).
create
()
dialog
.
setCanceledOnTouchOutside
(
false
)
dialog
.
setCanceledOnTouchOutside
(
false
)
...
@@ -24,7 +25,7 @@ object ManageStorageDialog {
...
@@ -24,7 +25,7 @@ object ManageStorageDialog {
lp
?.
gravity
=
Gravity
.
BOTTOM
lp
?.
gravity
=
Gravity
.
BOTTOM
dialog
.
window
?.
attributes
=
lp
dialog
.
window
?.
attributes
=
lp
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
binding
.
tvAllow
.
set
OnClickListener
{
binding
.
tvAllow
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
dialog
.
dismiss
()
dialog
.
dismiss
()
action
.
invoke
()
action
.
invoke
()
}
}
...
...
app/src/main/java/com/xm/test/myfile/view/QuitDialog.kt
View file @
d645bfd6
...
@@ -7,6 +7,7 @@ import android.view.View
...
@@ -7,6 +7,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.appcompat.app.AlertDialog
import
androidx.appcompat.app.AlertDialog
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MaxAdUtils
import
com.xm.test.myfile.ad.MyReportViewListener.setMyReportViewListener
import
com.xm.test.myfile.databinding.DialogWhetherQuitBinding
import
com.xm.test.myfile.databinding.DialogWhetherQuitBinding
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.MainScope
...
@@ -26,10 +27,10 @@ object QuitDialog {
...
@@ -26,10 +27,10 @@ object QuitDialog {
lp
?.
height
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
lp
?.
height
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
dialog
.
window
?.
attributes
=
lp
dialog
.
window
?.
attributes
=
lp
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
binding
.
tvCancel
.
set
OnClickListener
{
binding
.
tvCancel
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
dialog
.
dismiss
()
dialog
.
dismiss
()
}
}
binding
.
tvConfirm
.
set
OnClickListener
{
binding
.
tvConfirm
.
set
MyReportViewListener
(
javaClass
.
simpleName
)
{
dialog
.
dismiss
()
dialog
.
dismiss
()
action
.
invoke
()
action
.
invoke
()
}
}
...
...
app/src/main/res/layout/activity_scan_result.xml
View file @
d645bfd6
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/main"
android:id=
"@+id/main"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#F8F8F8"
android:background=
"#F8F8F8"
android:orientation=
"vertical"
tools:context=
".activity.ScanResultActivity"
>
tools:context=
".activity.ScanResultActivity"
>
<ImageView
<ImageView
android:id=
"@+id/
scan_result_quit_btn
"
android:id=
"@+id/
iv_back
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentStart=
"true"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:src=
"@drawable/ic_quit"
android:src=
"@drawable/ic_quit"
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_
centerHorizontal=
"true
"
android:layout_
gravity=
"center_horizontal
"
android:layout_marginTop=
"12dp"
android:layout_marginTop=
"12dp"
android:text=
"Scan Results"
android:text=
"Scan Results"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
...
@@ -28,12 +28,12 @@
...
@@ -28,12 +28,12 @@
android:textStyle=
"bold"
android:textStyle=
"bold"
tools:ignore=
"HardcodedText,SpUsage"
/>
tools:ignore=
"HardcodedText,SpUsage"
/>
<!-- 扫描列表 -->
<LinearLayout
<LinearLayout
android:id=
"@+id/
scan_result_list_layou
t"
android:id=
"@+id/
ll_virus_resul
t"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"0dp"
android:layout_above=
"@+id/ad_group_layout"
android:layout_weight=
"1"
android:layout_below=
"@+id/scan_result_quit_btn"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<RelativeLayout
<RelativeLayout
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:id=
"@+id/
scan_result_secure_num_text
"
android:id=
"@+id/
tv_scan_number
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
...
@@ -72,19 +72,20 @@
...
@@ -72,19 +72,20 @@
</RelativeLayout>
</RelativeLayout>
<ListView
<ListView
android:id=
"@+id/
scan_result_list
"
android:id=
"@+id/
lv_virus_app
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"8dp"
android:background=
"@color/white"
android:background=
"@color/white"
android:scrollbars=
"none"
/>
android:scrollbars=
"none"
/>
</LinearLayout>
</LinearLayout>
<!-- 错误详情 -->
<LinearLayout
<LinearLayout
android:id=
"@+id/
app_info_page_layout
"
android:id=
"@+id/
ll_virus_detail
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/scan_result_quit_btn"
android:layout_margin=
"16dp"
android:layout_margin=
"16dp"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:visibility=
"gone"
>
android:visibility=
"gone"
>
...
@@ -194,7 +195,6 @@
...
@@ -194,7 +195,6 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -277,27 +277,37 @@
...
@@ -277,27 +277,37 @@
</LinearLayout>
</LinearLayout>
<!--两种按钮模式 -->
<LinearLayout
<LinearLayout
android:id=
"@+id/ad_group_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:background=
"@color/white"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_got"
android:layout_width=
"match_parent"
android:layout_height=
"34dp"
android:layout_marginHorizontal=
"50dp"
android:layout_marginVertical=
"8dp"
android:background=
"@drawable/bg_btn_sure_shape"
android:gravity=
"center"
android:text=
"Got it"
android:textColor=
"@color/white"
android:textSize=
"19sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:ignore=
"HardcodedText"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/
scan_result_delete_group_layout
"
android:id=
"@+id/
ll_button_yn
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"34dp"
android:layout_height=
"34dp"
android:layout_marginTop=
"16dp"
android:layout_marginVertical=
"8dp"
android:layout_marginBottom=
"16dp"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
android:visibility=
"gone"
>
<TextView
<TextView
android:id=
"@+id/
scan_delete_yes
"
android:id=
"@+id/
tv_delete
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
...
@@ -312,7 +322,7 @@
...
@@ -312,7 +322,7 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
<TextView
<TextView
android:id=
"@+id/
scan_delete
_ignore"
android:id=
"@+id/
tv
_ignore"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginStart=
"8dp"
android:layout_marginStart=
"8dp"
...
@@ -328,46 +338,25 @@
...
@@ -328,46 +338,25 @@
</LinearLayout>
</LinearLayout>
<TextView
</LinearLayout>
android:id=
"@+id/scan_result_go_it_text"
android:layout_width=
"match_parent"
android:layout_height=
"34dp"
android:layout_marginStart=
"50dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"50dp"
android:layout_marginBottom=
"16dp"
android:background=
"@drawable/bg_btn_sure_shape"
android:gravity=
"center"
android:text=
"Got it"
android:textColor=
"@color/white"
android:textSize=
"19sp"
android:textStyle=
"bold"
tools:ignore=
"HardcodedText"
/>
<FrameLayout
<FrameLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
>
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"8dp"
android:layout_marginBottom=
"20dp"
android:visibility=
"gone"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ad"
tools:ignore=
"ContentDescription"
/>
</FrameLayout>
</LinearLayout>
<!-- 扫描成功布局 -->
<RelativeLayout
<include
android:id=
"@+id/antivirus_success_view"
android:id=
"@+id/include_virus_finish"
layout=
"@layout/antivirus_success_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:visibility=
"gone"
>
android:visibility=
"gone"
/
>
<include
layout=
"@layout/antivirus_success_layout"
/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
\ No newline at end of file
app/src/main/res/layout/antivirus_success_layout.xml
View file @
d645bfd6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
android:background=
"#F8F8F8"
>
android:background=
"#F8F8F8"
>
<ImageView
<ImageView
android:id=
"@+id/
antivirus_success_quit_btn
"
android:id=
"@+id/
iv_back
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:layout_margin=
"16dp"
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/
antivirus_success_quit_btn
"
android:layout_below=
"@id/
iv_back
"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
tools:ignore=
"HardcodedText,SpUsage"
/>
tools:ignore=
"HardcodedText,SpUsage"
/>
<TextView
<TextView
android:id=
"@+id/
identify_num_text
"
android:id=
"@+id/
tv_identify_num
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_alignParentEnd=
"true"
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
tools:ignore=
"HardcodedText,RtlHardcoded"
/>
tools:ignore=
"HardcodedText,RtlHardcoded"
/>
<TextView
<TextView
android:id=
"@+id/
settle_num_text
"
android:id=
"@+id/
tv_settle_num
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_alignParentEnd=
"true"
...
@@ -140,17 +140,10 @@
...
@@ -140,17 +140,10 @@
<FrameLayout
<FrameLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
>
android:layout_gravity=
"center_horizontal"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ad"
tools:ignore=
"ContentDescription"
/>
</FrameLayout>
</LinearLayout>
</LinearLayout>
...
...
settings.gradle
View file @
d645bfd6
...
@@ -7,15 +7,13 @@ pluginManagement {
...
@@ -7,15 +7,13 @@ pluginManagement {
includeGroupByRegex
(
"androidx.*"
)
includeGroupByRegex
(
"androidx.*"
)
}
}
}
}
flatDir
{
dirs
'libs'
}
google
()
google
()
mavenCentral
()
mavenCentral
()
gradlePluginPortal
()
gradlePluginPortal
()
maven
{
maven
{
url
'https://artifacts.applovin.com/android'
url
'https://artifacts.applovin.com/android'
}
}
maven
{
url
"https://android-sdk.is.com"
}
maven
{
url
"https://artifact.bytedance.com/repository/pangle"
}
maven
{
url
"https://artifact.bytedance.com/repository/pangle"
}
maven
{
url
"https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
}
maven
{
url
"https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
}
}
}
...
@@ -31,6 +29,7 @@ dependencyResolutionManagement {
...
@@ -31,6 +29,7 @@ dependencyResolutionManagement {
maven
{
maven
{
url
'https://artifacts.applovin.com/android'
url
'https://artifacts.applovin.com/android'
}
}
maven
{
url
"https://android-sdk.is.com"
}
maven
{
url
"https://artifact.bytedance.com/repository/pangle"
}
maven
{
url
"https://artifact.bytedance.com/repository/pangle"
}
maven
{
url
"https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
}
maven
{
url
"https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
}
}
}
...
...
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