Commit 2149a77f authored by wanglei's avatar wanglei

同步代码

parent c884d79b
......@@ -5,6 +5,7 @@ import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.os.Process
import android.text.TextUtils
import android.util.Log
import com.google.android.gms.ads.MobileAds
import com.google.firebase.FirebaseApp
......@@ -16,8 +17,10 @@ import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.InstallHelps
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.utils.ActivityManagerUtils
import com.test.easy.easycleanerjunk.utils.SPUtils
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import java.util.UUID
class MyApplication : BaseApplication() {
......@@ -25,10 +28,20 @@ class MyApplication : BaseApplication() {
var PAUSED_VALUE = 0
}
var uuid = ""
override fun init() {
initUUid()
initApp()
}
private fun initUUid() {
uuid = SPUtils.getInstance().getString("uuid", "")
if (TextUtils.isEmpty(uuid)) {
uuid = UUID.randomUUID().toString() + System.currentTimeMillis()
SPUtils.getInstance().put("uuid", uuid)
}
}
fun initApp() {
if (ConfigHelper.ifAgreePrivacy) {
initNotificationWork()
......
......@@ -294,7 +294,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
if (parentType.expanded) {
viewHolder.binding.idXiala.setImageResource(R.mipmap.shouqi)
} else {
viewHolder.binding.idXiala.setImageResource(R.mipmap.xiala)
viewHolder.binding.idXiala.setImageResource(R.mipmap.zhankai)
}
if (parentType.isfinish) {
viewHolder.binding.idImgLoad.isVisible = false
......
......@@ -167,6 +167,8 @@ class LargeFileCleanActivity : BaseActivity<ActivityLayoutLargeFileBinding>() {
binding.tvDelete.background = ContextCompat.getDrawable(this, R.drawable.bg_corners_bfbfbf_26)
binding.tvDelete.isEnabled = false
binding.tvDelete.text = "DELETE"
binding.llEmpty.isVisible = adapter.isEmpty()
}
}
......@@ -205,6 +207,8 @@ class LargeFileCleanActivity : BaseActivity<ActivityLayoutLargeFileBinding>() {
binding.progressbar.visibility = View.GONE
adapter.setData(largeFileList)
binding.llEmpty.isVisible = largeFileList.isEmpty()
if (!binding.llType.isEnabled) {
binding.llType.isEnabled = true
binding.llSize.isEnabled = true
......
......@@ -2,6 +2,7 @@ package com.test.easy.easycleanerjunk.activity.home
import android.graphics.Color
import android.graphics.Typeface
import android.os.Environment
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.viewpager2.adapter.FragmentStateAdapter
......@@ -10,6 +11,7 @@ import com.test.easy.easycleanerjunk.databinding.ActivityMainBinding
import com.test.easy.easycleanerjunk.fragment.HomeFragment
import com.test.easy.easycleanerjunk.fragment.ToolsFragment
import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.MediaStoreUtils
import com.test.easy.easycleanerjunk.utils.BarUtils
import com.test.easy.easycleanerjunk.view.RateStarPop
import kotlinx.coroutines.Dispatchers
......@@ -62,6 +64,11 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
binding.idBottom2.setOnClickListener {
binding.idVp.currentItem = 1
}
MediaStoreUtils.updateMediaStore(
this,
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).listFiles()?.map { it.absolutePath }
?.toTypedArray()
)
}
private fun setPage(p: Int) {
......@@ -70,10 +77,11 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
binding.idTvHome.typeface = Typeface.DEFAULT
binding.idTvTools.typeface = Typeface.DEFAULT
when (p) {
0 ->{
0 -> {
binding.idBottom1.isSelected = true
binding.idTvHome.typeface = Typeface.DEFAULT_BOLD
}
1 -> {
binding.idBottom2.isSelected = true
binding.idTvTools.typeface = Typeface.DEFAULT_BOLD
......@@ -85,6 +93,7 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
super.onDestroy()
RateStarPop.dismiss(this)
}
override fun onResume() {
super.onResume()
lifecycleScope.launch(Dispatchers.Main) {
......
......@@ -10,6 +10,7 @@ import com.test.easy.easycleanerjunk.activity.NetWorkActivity
import com.test.easy.easycleanerjunk.activity.RecentAppActivity
import com.test.easy.easycleanerjunk.activity.RepeatPhotoActivity
import com.test.easy.easycleanerjunk.activity.ScanJunkActivity
import com.test.easy.easycleanerjunk.activity.ScreenShotActivity
import com.test.easy.easycleanerjunk.activity.home.NewMainActivity
import com.test.easy.easycleanerjunk.activity.photocompress.photo.StartCompressionPhotoActivity
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_APP_MANAGER
......@@ -19,6 +20,7 @@ import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_LARGE_FILE_PUS
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_NETWORK_TRAFFIC
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_PHOTO_COMPRESS
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_RECENT_USE_APP
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_SCREENSHOT_CLEAN
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.EventHelper
......@@ -72,6 +74,10 @@ object SplashJumpUtils {
context.startActivity(Intent(context, RepeatPhotoActivity::class.java))
}
ID_SCREENSHOT_CLEAN -> {
context.startActivity(Intent(context, ScreenShotActivity::class.java))
}
//================================被动广播=========================================
else -> {
......@@ -80,9 +86,9 @@ object SplashJumpUtils {
if (!ConfigHelper.ifGuest) {
context.startActivity(Intent(context, DeviceScanActivity::class.java))
} else {
if(!ConfigHelper.ifGuestFirstClean){
if (!ConfigHelper.ifGuestFirstClean) {
context.startActivity(Intent(context, CleanGuestActivity::class.java))
}else{
} else {
context.startActivity(Intent(context, NewMainActivity::class.java))
}
}
......
......@@ -117,4 +117,8 @@ class LargeFileAdapter(
files.removeAll(deleteList.toSet())
notifyDataSetChanged()
}
fun isEmpty(): Boolean {
return files.isEmpty()
}
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ data class ConfigBean(
val push_interval_11015: Int = 0,
val push_interval_11016: Int = 0,
val push_interval_11017: Int = 0,
val push_interval_12000: Int = 0,
val push_interval_22001: Int = 0,
val push_interval_22002: Int = 0,
val push_interval_22003: Int = 0,
......@@ -38,13 +39,9 @@ data class ConfigBean(
companion object {
//功能触发push actionId 主动发送
const val ID_JUNK_CLEAN_PUSH = 11001 //清理垃圾
const val ID_BOOST_PUSH = 11002 //性能优化
const val ID_BATTERY_PUSH = 11004// 电量信息
const val ID_COOL_PUSH = 11005//手机降温
const val ID_LARGE_FILE_PUSH = 11006// 大文件清理
const val ID_DUPLICATE_FILE_PUSH = 11007//文件备份,重复文件,相似文件
const val ID_VIDEO_CLEAN_PUSH = 11008//清理视频缓存
const val ID_PHOTO_CLEAN_PUSH = 11009//清理相册
const val ID_PHOTO_COMPRESS = 11010//照片压缩
const val ID_APP_MANAGER = 11011//应用管理
......@@ -52,17 +49,15 @@ data class ConfigBean(
const val ID_CLEAN_NOTIFICATION = 11013//清理通知栏
const val ID_RECENT_USE_APP = 11014//最近使用APP
const val ID_SIMILAR_IMAGE = 11015//清理相似图片
const val ID_SCREENSHOT_CLEAN = 12000//截图清理
fun ConfigBean.getActionPushInterval(actionId: Int): Int {
val interval = when (actionId) {
ID_JUNK_CLEAN_PUSH -> push_interval_11001
ID_BOOST_PUSH -> push_interval_11002
ID_BATTERY_PUSH -> push_interval_11004
ID_COOL_PUSH -> push_interval_11005
ID_LARGE_FILE_PUSH -> push_interval_11006
ID_DUPLICATE_FILE_PUSH -> push_interval_11007
ID_VIDEO_CLEAN_PUSH -> push_interval_11008
ID_PHOTO_CLEAN_PUSH -> push_interval_11009
ID_PHOTO_COMPRESS -> push_interval_11010
ID_APP_MANAGER -> push_interval_11011
......@@ -70,6 +65,7 @@ data class ConfigBean(
ID_CLEAN_NOTIFICATION -> push_interval_11013
ID_RECENT_USE_APP -> push_interval_11014
ID_SIMILAR_IMAGE -> push_interval_11015
ID_SCREENSHOT_CLEAN -> push_interval_12000
else -> 0
}
return interval
......
......@@ -24,6 +24,7 @@ import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_LARGE_FILE_PUS
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_NETWORK_TRAFFIC
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_PHOTO_COMPRESS
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_RECENT_USE_APP
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_SCREENSHOT_CLEAN
import com.test.easy.easycleanerjunk.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import com.test.easy.easycleanerjunk.helps.BaseApplication
import com.test.easy.easycleanerjunk.helps.ComUtils
......@@ -167,6 +168,11 @@ object NotificationHelper {
remoteViews.setTextViewText(R.id.tv_btn, "Clean up")
}
ID_SCREENSHOT_CLEAN -> {
remoteViews.setImageViewResource(R.id.iv_icon, R.mipmap.screenshot)
remoteViews.setTextViewText(R.id.tv_desc, "Detected lots of screenshots? Free up your storage space now!")
remoteViews.setTextViewText(R.id.tv_btn, "Clean up")
}
//==================================下面是被动推送的情况===============================================
else -> {
return
......
......@@ -24,8 +24,12 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
return
}
if (NotificationService.isRunning) {
return
}
startNotification()
}
private fun startNotification() {
val intent = Intent(this, NotificationService::class.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
......
......@@ -18,7 +18,7 @@ object ComUtils {
private val TAG = "ComUtils"
val localConfig =
"7xPswMs/ODHNJKw+NlQ2quKKGTtkqYozAjxm5g8kls990/tCQROxbWLbLfBMbohMariNGRydMlNs77gZPUH/Gf1rFoB3fMY5ZjncjUqvZtzqkSP5i5YSoSqUZUnhPR0bcThqUr2R1G+QUfG512ZhRQZ/mbs+YLBMlvRfiJ4jbfD2COvHm1cYXu5S+M6VcmkHixh8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ueQF2gqV9r8VoYsc9mGmPE06PfD7DAcgG5W46DqSmdyU9WnQsWnfGv94Hhg1TvE7iLFFMoETrHwifJM9kER14rY2J81abPkfFiFKrp5nTgZduDikSO1/Ac8mlSPOsXDglRZBA2wVisKBE9X5wDEDMY66fFK347/3tPfGasnTGKl5KB/HfldzDXNmY27YZO4Let0Jz4shtFzq96J3O2fZ9PMBiX3VDUiHhvZ2nmDj9+HqmvGtTD29ocYGxrtO+qq7nCn2HzOkUEOmNEgGVXJm4a9hqAWRtQZWuVDpLKR0GBh6N+OVyv5TSFmQ5xXVqt9Je17NWKEsdgVGtvLgAShfEv6Ec0PdfUMprkYDgpgL4YKVbjKDX/LMBceC11Zv2W1iHJnAuV3Jdq6pRfB3IVu3e"
var configSp = ""
get() {
return SPUtils.getInstance().getString("configSp", field)
......
......@@ -19,7 +19,7 @@ object EventHelper {
private val TAG = "EventHelper"
private val url by lazy {
val pkg = BaseApplication.context.packageName
val pkg = ConfigHelper.packageName
val url = StringBuilder(
"${ConfigHelper.eventUrl}/${
pkg.filter { it.isLowerCase() }.substring(4, 9)
......@@ -35,33 +35,45 @@ object EventHelper {
ext: JSONObject? = null,
isSingleEvent: Boolean = false
) {
if (!ifAgreePrivacy) {
Log.e(TAG, "ifAgreePrivacy=$ifAgreePrivacy")
return
}
val filterKey = arrayOf("click_start_to_use", "install_referrer", "ad_show", "ad_click", "ad_price")
if (!filterKey.contains(key)) {
return
}
if (isSingleEvent) {
val stringSet = SPUtils.getInstance().getStringSet("singleEvent")
if (stringSet.contains(key)) {
return
}
}
val pkg = BaseApplication.context.packageName
// if (!ifAgreePrivacy) {
// Log.e(TAG, "ifAgreePrivacy=$ifAgreePrivacy")
// return
// }
//
// val filterKey = arrayOf(
// "click_start_to_use",
// "install_referrer",
// "ad_show",
// "ad_click",
// "ad_price",
// "fcm_receiver",
// "fcm_message_received"
// )
// if (!filterKey.contains(key)) {
// return
// }
//
// if (isSingleEvent) {
// val stringSet = SPUtils.getInstance().getStringSet("singleEvent")
// if (stringSet.contains(key)) {
// return
// }
// }
val pkg = ConfigHelper.packageName
val s = JSONObject()
.put("action", key)
.put("value", value)
.put("ext", ext)
val s2 = JSONObject()
.put("${pkg}_3", SPUtils.getInstance().getString("Equipment"))
.put("${pkg}_4", SPUtils.getInstance().getString("Manufacturer"))
.put("${pkg}_5", SPUtils.getInstance().getString("svn"))
.put("${pkg}_9", SPUtils.getInstance().getString("uuid"))
.put("${pkg}_10", SPUtils.getInstance().getString("gid"))
.put("${pkg}_13", "android")
.put("${pkg}_15", "google")
.put("${pkg}_14", BuildConfig.VERSION_CODE)
.put("${pkg}_8", BuildConfig.VERSION_NAME)
.put("${pkg}_24", BuildConfig.BUILD_TYPE)
val data = JSONObject()
.put("data", s)
......
......@@ -174,14 +174,32 @@
android:layout_gravity="center"
android:indeterminateTint="#0066FD" />
<ImageView
android:id="@+id/iv_empty"
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/wr_79"
android:orientation="vertical"
android:visibility="gone"
tools:ignore="ContentDescription" />
tools:ignore="ContentDescription,UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@mipmap/wr_79" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="Large Files Not Found"
android:textColor="@color/black"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</FrameLayout>
......
......@@ -24,7 +24,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
android:src="@mipmap/xiala" />
android:src="@mipmap/shouqi" />
<TextView
android:id="@+id/id_type_name"
......
app/src/main/res/mipmap-xxhdpi/shouqi.png

987 Bytes | W: | H:

app/src/main/res/mipmap-xxhdpi/shouqi.png

515 Bytes | W: | H:

app/src/main/res/mipmap-xxhdpi/shouqi.png
app/src/main/res/mipmap-xxhdpi/shouqi.png
app/src/main/res/mipmap-xxhdpi/shouqi.png
app/src/main/res/mipmap-xxhdpi/shouqi.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment