Commit cc54439f authored by 周文华's avatar 周文华

【新增】新增迁移病毒扫描功能(有些待兼容调整)

parent eb5910dd
...@@ -66,7 +66,15 @@ gradle.taskGraph.whenReady { ...@@ -66,7 +66,15 @@ gradle.taskGraph.whenReady {
} }
dependencies { dependencies {
implementation(
fileTree(
mapOf(
"dir" to "libs",
"include" to listOf("*.aar", "*.jar"),
"exclude" to emptyList<String>()
)
)
)
implementation(libs.androidx.core.ktx) implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat) implementation(libs.androidx.appcompat)
implementation(libs.material) implementation(libs.material)
......
...@@ -19,3 +19,8 @@ ...@@ -19,3 +19,8 @@
# If you keep the line number information, uncomment this to # If you keep the line number information, uncomment this to
# hide the original source file name. # hide the original source file name.
#-renamesourcefileattribute SourceFile #-renamesourcefileattribute SourceFile
#病毒扫描
-keep class com.trustlook.** {
*;
}
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> <!-- 三星和 LG 厂商通知角标权限 --> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> <!-- 三星和 LG 厂商通知角标权限 -->
<uses-permission android:name="com.sec.android.provider.badge.permission.READ" /> <uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" /> <uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<queries> <queries>
<intent> <intent>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.SwiftCleanerPhoneHelper" android:theme="@style/Theme.SwiftCleanerPhoneHelper"
tools:targetApi="31"> tools:targetApi="31">
<activity
android:name=".view.activity.MalwareCleanActivity"
android:exported="false"
android:launchMode="singleTop" />
<activity <activity
android:name=".view.function.weather.WeatherInterface" android:name=".view.function.weather.WeatherInterface"
android:exported="false" /> android:exported="false" />
...@@ -200,6 +204,10 @@ ...@@ -200,6 +204,10 @@
<meta-data <meta-data
android:name="com.facebook.sdk.ApplicationId" android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" /> android:value="@string/facebook_app_id" />
<meta-data
android:value="cedfde13feb689ade7154c6322525c2d9fc10397fac1d4da5580542e"
android:name="com.trustlook.ApiKey" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
package com.swiftcleaner.chovey.model.bean; package com.swiftcleaner.chovey.model.bean;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
...@@ -8,12 +9,28 @@ public class AppInfoBean { ...@@ -8,12 +9,28 @@ public class AppInfoBean {
private Drawable appIcon; private Drawable appIcon;
private String packageName; private String packageName;
public Boolean isSelected = false;
public Boolean isInstall = null;
public Integer score = null;
public String apkPath = null;
public AppInfoBean(String appName, Drawable appIcon, String packageName) { public AppInfoBean(String appName, Drawable appIcon, String packageName) {
this.appName = appName; this.appName = appName;
this.appIcon = appIcon; this.appIcon = appIcon;
this.packageName = packageName; this.packageName = packageName;
} }
public AppInfoBean(String appName, Drawable appIcon, String packageName, Boolean isSelected, Boolean isInstall, Integer score, String apkPath) {
this.appName = appName;
this.appIcon = appIcon;
this.packageName = packageName;
this.isSelected = isSelected;
this.isInstall = isInstall;
this.score = score;
this.apkPath = apkPath;
}
// Getters and setters // Getters and setters
public String getAppName() { public String getAppName() {
return appName; return appName;
......
package com.swiftcleaner.chovey.util
import com.swiftcleaner.chovey.CleanApplication
import com.trustlook.sdk.cloudscan.CloudScanClient
import com.trustlook.sdk.data.Region
/**
*Create by SleepDog on 2025-01-24
*/
object CloudScan {
val scanClient by lazy(LazyThreadSafetyMode.NONE) {
CloudScanClient.Builder(CleanApplication.context)
// 设置服务地区,
// 海外地区设置:Region.INTL,百度用户设置:Region.BAIDU
.setRegion(Region.INTL)
// 设置连接超时时长,单位为毫秒
.setConnectionTimeout(30000)
//设置传输超时时长,单位为毫秒
.setSocketTimeout(30000)
.build()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/color_181b1f"
android:endColor="@color/color_f7fafa"
android:angle="0"
android:centerX="0.5"
android:centerY="0.5" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f7fafa">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_left_right_blue"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="6dp"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/fl_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:importantForAccessibility="no"
android:padding="4dp"
android:src="@mipmap/fanhui"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/malware_scan"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/fl_back"
app:layout_constraintStart_toEndOf="@id/fl_back"
app:layout_constraintTop_toTopOf="@id/fl_back" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.swiftcleaner.chovey.business.admob.NativeView
android:id="@+id/ad_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_top" />
<ImageView
android:id="@+id/iv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:importantForAccessibility="no"
android:src="@mipmap/img_antivirus_scan"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ad_native" />
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#F8461A"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_unit"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_unit"
app:layout_constraintTop_toTopOf="@id/tv_unit"
tools:text="3 issue" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text=" found"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="@id/tv_count"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_logo" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/img_antivirus_scan_kong"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_malware"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="12dp"
android:background="@color/white"
android:paddingVertical="6dp"
android:scrollbars="none"
app:layout_constraintBottom_toTopOf="@id/tv_delete"
app:layout_constraintTop_toBottomOf="@id/tv_unit" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_delete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:layout_marginBottom="40dp"
android:background="@drawable/shape_clean_up"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:text="@string/uninstall"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" />
<!--动画-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_radarview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_blue"
>
<com.swiftcleaner.chovey.model.tool.RadarView
android:id="@+id/radarview"
android:layout_width="262dp"
android:layout_height="262dp"
android:layout_marginTop="109dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitCenter"
android:src="@mipmap/dx_clean"
app:layout_constraintBottom_toBottomOf="@id/radarview"
app:layout_constraintEnd_toEndOf="@id/radarview"
app:layout_constraintStart_toStartOf="@id/radarview"
app:layout_constraintTop_toTopOf="@id/radarview" />
<ImageView
android:layout_width="match_parent"
android:layout_height="34dp"
android:scaleType="fitXY"
android:src="@mipmap/bottom_img"
app:layout_constraintBottom_toBottomOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/scanning"
android:textColor="@color/white"
android:textSize="22sp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/radarview" />
<TextView
android:id="@+id/tv_recommend"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="22dp"
android:layout_marginBottom="40dp"
android:gravity="center"
android:text="@string/malware_recommended"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@id/tv_hint"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:text="@string/powered_by_trustlook"
android:textColor="#CEE3FF"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/fl_ad_donghua"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<com.swiftcleaner.chovey.business.admob.NativeView
android:id="@+id/fl_ad_donghua"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_exit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_radio_20dp_white"
android:paddingBottom="24dp"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="30dp"
android:includeFontPadding="false"
android:lineSpacingExtra="4dp"
android:text="Antivirus Scan error occurred,please try again"
android:textAlignment="center"
android:textColor="#1a1a1a"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_sure"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="36dp"
android:layout_marginTop="16dp"
android:background="@drawable/shape_clean_up"
android:paddingVertical="10dp"
android:text="Sure"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.swiftcleaner.chovey.business.admob.NativeView
android:id="@+id/ad_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="@drawable/shape_radio_20dp_white"
android:padding="12dp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/cl_exit" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="15dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="12dp"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_select"
app:layout_constraintStart_toEndOf="@id/iv_icon"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_name"
android:textColor="@color/color_181b1f"
android:textSize="16sp" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:background="@drawable/gradient_4"
android:backgroundTint="#FFFCF4DE"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:textColor="#FFC337"
android:textSize="12sp"
tools:text="Risk" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/antivirus_delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="12dp"
android:background="@color/color_ebebeb"
app:layout_constraintTop_toBottomOf="@id/ll_content" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -4,4 +4,7 @@ ...@@ -4,4 +4,7 @@
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="red">#FF5722</color> <color name="red">#FF5722</color>
<color name="theme_color">#50B3FA</color> <color name="theme_color">#50B3FA</color>
<color name="color_f7fafa">#F7FAFA</color>
<color name="color_181b1f">#181B1F</color>
<color name="color_ebebeb">#EBEBEB</color>
</resources> </resources>
\ No newline at end of file
...@@ -34,4 +34,9 @@ ...@@ -34,4 +34,9 @@
<string name="fragment_gudie_three_text">Clean photos,videos,and audio files to save space and keep your phone tidy.</string> <string name="fragment_gudie_three_text">Clean photos,videos,and audio files to save space and keep your phone tidy.</string>
<string name="fragment_gudie_end_text">Maximize your storage and enjoy a clutter- free phone experience</string> <string name="fragment_gudie_end_text">Maximize your storage and enjoy a clutter- free phone experience</string>
<string name="scan_text">Attention To find junk files completely, the first scan may take a little time</string> <string name="scan_text">Attention To find junk files completely, the first scan may take a little time</string>
<string name="malware_scan">Antivirus Scan</string>
<string name="uninstall">Uninstall</string>
<string name="powered_by_trustlook">Powered by Trustlook</string>
<string name="scanning">Scanning…</string>
<string name="malware_recommended">It is recommended to turn on the network connection for more accurate results</string>
</resources> </resources>
\ No newline at end of file
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