Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
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
wanglei
swiftcleanerphonehelper
Commits
68c89ab7
Commit
68c89ab7
authored
Dec 20, 2024
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7fdf81bb
Pipeline
#1419
canceled with stages
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
146 additions
and
95 deletions
+146
-95
MainActivity.java
.../main/java/com/swiftcleaner/chovey/view/MainActivity.java
+20
-15
BatteryInfoActivity.java
...wiftcleaner/chovey/view/activity/BatteryInfoActivity.java
+49
-34
CleanJunkActivity.java
.../swiftcleaner/chovey/view/activity/CleanJunkActivity.java
+5
-2
EndCleanJunkActivity.java
...iftcleaner/chovey/view/activity/EndCleanJunkActivity.java
+19
-19
LargeFileActivity.java
.../swiftcleaner/chovey/view/activity/LargeFileActivity.java
+22
-20
AdmobHelper.kt
app/src/main/java/com/zxdemo/admob/AdmobHelper.kt
+4
-3
ReportAdUtils.kt
app/src/main/java/com/zxdemo/admob/ReportAdUtils.kt
+7
-1
DeviceUtils.kt
app/src/main/java/com/zxdemo/utils/DeviceUtils.kt
+6
-1
activity_battery_info.xml
app/src/main/res/layout/activity_battery_info.xml
+12
-0
activity_end_clean_junk.xml
app/src/main/res/layout/activity_end_clean_junk.xml
+1
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-0
No files found.
app/src/main/java/com/swiftcleaner/chovey/view/MainActivity.java
View file @
68c89ab7
...
...
@@ -118,7 +118,12 @@ public class MainActivity extends AppCompatActivity {
return
null
;
},
()
->
{
startActivity
(
new
Intent
(
this
,
BatteryInfoActivity
.
class
));
binding
.
appProcess
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
startActivity
(
new
Intent
(
getApplicationContext
(),
BatteryInfoActivity
.
class
));
}
},
200
);
return
null
;
});
...
...
@@ -192,20 +197,20 @@ public class MainActivity extends AppCompatActivity {
return
null
;
});
});
binding
.
similarPhotos
.
setOnClickListener
(
v
->
{
AdmobHelper
.
INSTANCE
.
showInterstitialAd
(
this
,
()
->
{
startActivity
(
new
Intent
(
this
,
SimilarPhotosActivity
.
class
));
return
null
;
},
()
->
{
return
null
;
},
()
->
{
startActivity
(
new
Intent
(
this
,
SimilarPhotosActivity
.
class
));
return
null
;
});
});
//
binding.similarPhotos.setOnClickListener(v -> {
//
AdmobHelper.INSTANCE.showInterstitialAd(this, () -> {
//
startActivity(new Intent(this, SimilarPhotosActivity.class));
//
return null;
//
},
//
() -> {
//
return null;
//
},
//
() -> {
//
startActivity(new Intent(this, SimilarPhotosActivity.class));
//
return null;
//
});
//
//
});
}
private
void
checkAndRequestPermissions
()
{
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/BatteryInfoActivity.java
View file @
68c89ab7
...
...
@@ -42,43 +42,58 @@ public class BatteryInfoActivity extends AppCompatActivity {
}
private
void
initShow
()
{
binding
.
idActivityAppmanagerLoading
.
setVisibility
(
View
.
VISIBLE
);
PackageManager
packageManager
=
getPackageManager
();
List
<
ApplicationInfo
>
installedApps
=
packageManager
.
getInstalledApplications
(
0
);
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
PackageManager
packageManager
=
getPackageManager
();
List
<
ApplicationInfo
>
installedApps
=
packageManager
.
getInstalledApplications
(
0
);
// 过滤掉系统应用
List
<
ApplicationInfo
>
nonSystemApps
=
new
ArrayList
<>();
for
(
ApplicationInfo
appInfo
:
installedApps
)
{
if
((
appInfo
.
flags
&
ApplicationInfo
.
FLAG_SYSTEM
)
==
0
)
{
nonSystemApps
.
add
(
appInfo
);
}
}
// 过滤掉当前应用
List
<
ApplicationInfo
>
nonSystemAppsFiltered
=
new
ArrayList
<>();
String
currentPackageName
=
getPackageName
();
for
(
ApplicationInfo
appInfo
:
nonSystemApps
)
{
if
(!
currentPackageName
.
equals
(
appInfo
.
packageName
))
{
nonSystemAppsFiltered
.
add
(
appInfo
);
}
}
// 将ApplicationInfo对象转换为AppInfoBean对象
List
<
AppInfoBean
>
apps
=
new
ArrayList
<>();
for
(
ApplicationInfo
packageInfo
:
nonSystemAppsFiltered
)
{
String
appName
=
packageManager
.
getApplicationLabel
(
packageInfo
).
toString
();
Drawable
appIcon
=
packageInfo
.
loadIcon
(
packageManager
);
AppInfoBean
appInfoBean
=
new
AppInfoBean
(
appName
,
appIcon
,
packageInfo
.
packageName
);
apps
.
add
(
appInfoBean
);
}
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
binding
.
tvBatteryInfoNum
.
setText
(
"("
+
apps
.
size
()
+
" in total)"
);
binding
.
batteryRecy
.
setLayoutManager
(
new
LinearLayoutManager
(
getApplicationContext
()));
adapter
=
new
AppInfoAdapter
(
apps
,
getApplicationContext
());
binding
.
batteryRecy
.
setAdapter
(
adapter
);
binding
.
ivReturn
.
setOnClickListener
(
v
->
{
initCustDialog
();
});
binding
.
idActivityAppmanagerLoading
.
setVisibility
(
View
.
GONE
);
}
});
// 过滤掉系统应用
List
<
ApplicationInfo
>
nonSystemApps
=
new
ArrayList
<>();
for
(
ApplicationInfo
appInfo
:
installedApps
)
{
if
((
appInfo
.
flags
&
ApplicationInfo
.
FLAG_SYSTEM
)
==
0
)
{
nonSystemApps
.
add
(
appInfo
);
}
}
// 过滤掉当前应用
List
<
ApplicationInfo
>
nonSystemAppsFiltered
=
new
ArrayList
<>();
String
currentPackageName
=
getPackageName
();
for
(
ApplicationInfo
appInfo
:
nonSystemApps
)
{
if
(!
currentPackageName
.
equals
(
appInfo
.
packageName
))
{
nonSystemAppsFiltered
.
add
(
appInfo
);
}
}
// 将ApplicationInfo对象转换为AppInfoBean对象
List
<
AppInfoBean
>
apps
=
new
ArrayList
<>();
for
(
ApplicationInfo
packageInfo
:
nonSystemAppsFiltered
)
{
String
appName
=
packageManager
.
getApplicationLabel
(
packageInfo
).
toString
();
Drawable
appIcon
=
packageInfo
.
loadIcon
(
packageManager
);
AppInfoBean
appInfoBean
=
new
AppInfoBean
(
appName
,
appIcon
,
packageInfo
.
packageName
);
apps
.
add
(
appInfoBean
);
}
binding
.
tvBatteryInfoNum
.
setText
(
"("
+
apps
.
size
()
+
" in total)"
);
binding
.
batteryRecy
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
adapter
=
new
AppInfoAdapter
(
apps
,
this
);
binding
.
batteryRecy
.
setAdapter
(
adapter
);
binding
.
ivReturn
.
setOnClickListener
(
v
->
{
initCustDialog
();
});
}).
start
();
}
private
void
initBar
()
{
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/CleanJunkActivity.java
View file @
68c89ab7
...
...
@@ -354,11 +354,14 @@ public class CleanJunkActivity extends AppCompatActivity {
List
<
CleanFileBean
>
apkSelectedFiles
=
apkCleanAdapter
.
getSelectedFiles
();
List
<
CleanFileBean
>
tempSelectedFiles
=
tempCleanAdapter
.
getSelectedFiles
();
List
<
CleanFileBean
>
logsSelectedFiles
=
logsCleanAdapter
.
getSelectedFiles
();
List
<
CleanFileBean
>
emptySelectedFiles
=
emptyCleanAdapter
.
getSelectedFiles
()
;
List
<
CleanFileBean
>
emptySelectedFiles
;
apkCleanFiles
(
apkSelectedFiles
);
tempCleanFiles
(
tempSelectedFiles
);
logsCleanFiles
(
logsSelectedFiles
);
emptyCleanFiles
(
emptySelectedFiles
);
if
(
emptyCleanAdapter
!=
null
){
emptySelectedFiles
=
emptyCleanAdapter
.
getSelectedFiles
();
emptyCleanFiles
(
emptySelectedFiles
);
}
selectedSize
=
0
;
updateButtonStatus
();
initAnimation
(
formatFileSize
(
selectedSize
));
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/EndCleanJunkActivity.java
View file @
68c89ab7
...
...
@@ -146,25 +146,25 @@ public class EndCleanJunkActivity extends AppCompatActivity {
);
});
binding
.
buttonSimilarPhotos
.
setOnClickListener
(
v
->{
AdmobHelper
.
INSTANCE
.
showInterstitialAd
(
this
,
()
->
{
startActivity
(
new
Intent
(
this
,
SimilarPhotosActivity
.
class
));
finish
();
return
null
;
},
()
->
{
return
null
;
},
()
->
{
startActivity
(
new
Intent
(
this
,
SimilarPhotosActivity
.
class
));
finish
();
return
null
;
}
);
});
//
binding.buttonSimilarPhotos.setOnClickListener(v->{
//
AdmobHelper.INSTANCE.showInterstitialAd(this,
//
() -> {
//
startActivity(new Intent(this, SimilarPhotosActivity.class));
//
finish();
//
return null;
//
},
//
() -> {
//
//
return null;
//
},
//
() -> {
//
startActivity(new Intent(this, SimilarPhotosActivity.class));
//
finish();
//
return null;
//
}
//
);
//
//
});
binding
.
buttonScreenshot
.
setOnClickListener
(
v
->{
AdmobHelper
.
INSTANCE
.
showInterstitialAd
(
this
,
()
->
{
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/LargeFileActivity.java
View file @
68c89ab7
...
...
@@ -268,27 +268,29 @@ public class LargeFileActivity extends AppCompatActivity {
binding
.
radarview
.
setSearching
(
true
);
handler
=
new
Handler
();
Intent
intent
=
new
Intent
(
this
,
EndCleanJunkActivity
.
class
);
AdmobHelper
.
INSTANCE
.
showAppOpenAd
(
this
,
()
->
{
binding
.
radarview
.
setSearching
(
false
);
intent
.
putExtra
(
"cleanstr"
,
str
);
startActivity
(
intent
);
finish
();
return
null
;
},
()
->
{
return
null
;
},
()
->
{
binding
.
radarview
.
setSearching
(
false
);
intent
.
putExtra
(
"cleanstr"
,
str
);
startActivity
(
intent
);
finish
();
return
null
;
}
);
handler
.
postDelayed
(()
->
{
AdmobHelper
.
INSTANCE
.
showInterstitialAd
(
this
,
()
->
{
binding
.
radarview
.
setSearching
(
false
);
intent
.
putExtra
(
"cleanstr"
,
str
);
startActivity
(
intent
);
finish
();
return
null
;
},
()
->
{
return
null
;
},
()
->
{
binding
.
radarview
.
setSearching
(
false
);
intent
.
putExtra
(
"cleanstr"
,
str
);
startActivity
(
intent
);
finish
();
return
null
;
}
);
},
3000
);
// handler.postDelayed(() -> {
// binding.radarview.setSearching(false);
// intent.putExtra("cleanstr", str);
...
...
app/src/main/java/com/zxdemo/admob/AdmobHelper.kt
View file @
68c89ab7
...
...
@@ -186,9 +186,10 @@ object AdmobHelper {
appOpenAd
=
ad
appOpenAdLoadTime
=
System
.
currentTimeMillis
()
loaded
?.
invoke
()
calculate
(
KEY_REQUEST_NUMBER
)
ReportAdUtils
.
pullAd
(
ad
.
responseInfo
,
APP_OPEN_AD_UNIT
,
reqId
=
reqId
)
ad
.
onPaidEventListener
=
ReportAdUtils
.
EventOnPaidEventListener
(
ad
)
ad
.
onPaidEventListener
=
ReportAdUtils
.
EventOnPaidEventListener
(
ad
,
APP_OPEN_AD_UNIT
)
isLoadingAppOpenAd
=
false
}
})
...
...
@@ -278,7 +279,7 @@ object AdmobHelper {
loaded
?.
invoke
()
calculate
(
KEY_REQUEST_NUMBER
)
ReportAdUtils
.
pullAd
(
ad
.
responseInfo
,
INTERSTITIAL_AD_UNIT
,
reqId
=
reqId
)
ad
.
onPaidEventListener
=
ReportAdUtils
.
EventOnPaidEventListener
(
ad
)
ad
.
onPaidEventListener
=
ReportAdUtils
.
EventOnPaidEventListener
(
ad
,
INTERSTITIAL_AD_UNIT
)
isLoadingInterstitialAd
=
false
}
})
...
...
@@ -558,7 +559,7 @@ object AdmobHelper {
.
forNativeAd
{
ad
:
NativeAd
->
Log
.
e
(
TAG
,
"forNativeAd"
)
ReportAdUtils
.
showAd
(
ad
.
responseInfo
,
NATIVE_AD_UNIT
,
activity
)
ad
.
setOnPaidEventListener
(
ReportAdUtils
.
EventOnPaidEventListener
(
ad
))
ad
.
setOnPaidEventListener
(
ReportAdUtils
.
EventOnPaidEventListener
(
ad
,
NATIVE_AD_UNIT
))
nativeAd
=
ad
completed
?.
invoke
(
ad
)
}
...
...
app/src/main/java/com/zxdemo/admob/ReportAdUtils.kt
View file @
68c89ab7
...
...
@@ -72,7 +72,7 @@ object ReportAdUtils {
taichiPref
.
edit
()
}
class
EventOnPaidEventListener
(
private
val
ad
:
Any
?)
:
OnPaidEventListener
{
class
EventOnPaidEventListener
(
private
val
ad
:
Any
?
,
private
val
mAd_unit
:
String
)
:
OnPaidEventListener
{
override
fun
onPaidEvent
(
adValue
:
AdValue
)
{
val
valueMicros
=
adValue
.
valueMicros
val
currencyCode
=
adValue
.
currencyCode
...
...
@@ -136,6 +136,7 @@ object ReportAdUtils {
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"ad_unit"
,
mAd_unit
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
...
...
@@ -167,6 +168,8 @@ object ReportAdUtils {
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
obj
.
put
(
"ad_unit"
,
mAd_unit
)
}
is
RewardedAd
->
{
...
...
@@ -188,6 +191,8 @@ object ReportAdUtils {
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
obj
.
put
(
"ad_unit"
,
mAd_unit
)
}
is
NativeAd
->
{
...
...
@@ -209,6 +214,7 @@ object ReportAdUtils {
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
obj
.
put
(
"ad_unit"
,
mAd_unit
)
}
}
ZxHttp
.
getHttpReportInterface
(
"ad_price"
,
""
,
ext
=
obj
)
...
...
app/src/main/java/com/zxdemo/utils/DeviceUtils.kt
View file @
68c89ab7
...
...
@@ -10,6 +10,7 @@ import kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.launch
import
org.json.JSONObject
import
java.util.UUID
import
kotlin.math.log
object
DeviceUtils
{
fun
getScreenHeight
():
Int
{
...
...
@@ -76,7 +77,7 @@ object DeviceUtils {
}
fun
getConfigParms
():
JSONObject
{
var
packname
=
"com.
a.xxxxxx.m.storage.zxcv
"
var
packname
=
"com.
swiftcleaner.chovey
"
var
jsonObject
=
JSONObject
()
jsonObject
.
put
(
"${packname}_1"
,
getScreenHeight
())
//高度
jsonObject
.
put
(
"${packname}_2"
,
getScreenWidth
())
//宽度
...
...
@@ -92,6 +93,10 @@ object DeviceUtils {
jsonObject
.
put
(
"${packname}_14"
,
getAndroidVersionCode
())
//android版本,如:13
// jsonObject.put("${packname}_23","en")//语言
// jsonObject.put("${packname}_24", BuildConfig.BUILD_TYPE)//环境
Log
.
d
(
"glc"
,
"GID:"
+
ZxApplication
.
GID
)
Log
.
d
(
"glc"
,
"getAndroidID:"
+
getAndroidID
())
return
jsonObject
}
}
\ No newline at end of file
app/src/main/res/layout/activity_battery_info.xml
View file @
68c89ab7
...
...
@@ -69,6 +69,8 @@
app:layout_constraintStart_toEndOf=
"@id/tv_battery_info_text"
app:layout_constraintTop_toBottomOf=
"@id/battery_cl1"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/battery_recy"
android:layout_width=
"match_parent"
...
...
@@ -80,4 +82,14 @@
app:layout_constraintStart_toStartOf=
"parent"
android:overScrollMode=
"never"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/id_activity_appmanager_loading"
android:layout_width=
"wrap_content"
android:text=
"loading..."
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_height=
"wrap_content"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_end_clean_junk.xml
View file @
68c89ab7
...
...
@@ -469,6 +469,7 @@
android:layout_height=
"155dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"12dp"
android:visibility=
"gone"
android:background=
"@drawable/shape_radio_10dp_white"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
app/src/main/res/layout/activity_main.xml
View file @
68c89ab7
...
...
@@ -416,6 +416,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"72dp"
android:layout_marginTop=
"12dp"
android:visibility=
"gone"
android:background=
"@drawable/shape_radio_20dp_white"
app:layout_constraintEnd_toEndOf=
"@id/cl4"
app:layout_constraintStart_toStartOf=
"@id/cl4"
...
...
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