Overview
Correctness | |
2 | warning PrivateApi: Using Private APIs |
5 | warning GradleDependency: Obsolete Gradle Dependency |
Security | |
4 | warning HardwareIds: Hardware Id Usage |
Performance | |
1 | warning StaticFieldLeak: Static Field Leaks |
Disabled Checks (37) |
Using Private APIs
../../src/main/java/com/donut/plugin/util/EfunboxUtil.java:42:
39 } 40 serial = Build.SERIAL; 41 } else {//8.0- 42 Class<?> c = Class.forName("android.os.SystemProperties"); 43 Method get = c.getMethod("get", String.class); 44 serial = (String) get.invoke(c, "ro.serialno"); 45 }../../src/main/java/com/donut/wxf1a06dafa3350688/PluginManager.kt:45:
42 fun initPluginMethod(data: JSONObject?, callback: (data: Any) -> Unit, activity: Activity) { 43 try { 44 var code = data!!.getString("channelCode"); 45 val clazz = Class.forName("android.app.ActivityThread") 46 val method: Method = clazz.getMethod("currentApplication") 47 BaseConsts.mBaseApplication = method.invoke(null) as Application;
PrivateApi
Correctness
Warning
Priority 6/10
Obsolete Gradle Dependency
../../build.gradle:61:
58 59 60 dependencies { 61 implementation "androidx.exifinterface:exifinterface:1.1.0" 62 63 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"../../build.gradle:66:
63 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 65 66 api "androidx.constraintlayout:constraintlayout:1.1.3" 67 68 api 'com.google.android.material:material:1.0.0'../../build.gradle:68:
65 66 api "androidx.constraintlayout:constraintlayout:1.1.3" 67 68 api 'com.google.android.material:material:1.0.0' 69 70 compileOnly("com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend") {} 71 implementation('io.github.jeremyliao:live-event-bus-x:1.8.0')../../build.gradle:72:
69 70 compileOnly("com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend") {} 71 implementation('io.github.jeremyliao:live-event-bus-x:1.8.0') 72 implementation 'com.umeng.umsdk:common:9.6.3'// 必选 73 implementation 'com.umeng.umsdk:asms:1.8.0'// 必选 74../../build.gradle:73:
70 compileOnly("com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend") {} 71 implementation('io.github.jeremyliao:live-event-bus-x:1.8.0') 72 implementation 'com.umeng.umsdk:common:9.6.3'// 必选 73 implementation 'com.umeng.umsdk:asms:1.8.0'// 必选 74 75 76 }
GradleDependency
Correctness
Warning
Priority 4/10
Hardware Id Usage
../../src/main/java/com/donut/plugin/util/DeviceUuidFactory.java:22:
19 if (uuid == null) { 20 Logger.e(context.getClass().getName()); 21 try { 22 final String androidId = Settings.Secure.getString( 23 context.getContentResolver(), Settings.Secure.ANDROID_ID); 24 if (!"9774d56d682e549c".equals(androidId)) { 25 uuid = UUID.nameUUIDFromBytes(androidId.getBytes("utf8"));../../src/main/java/com/donut/plugin/util/DeviceUuidFactory.java:27:
24 if (!"9774d56d682e549c".equals(androidId)) { 25 uuid = UUID.nameUUIDFromBytes(androidId.getBytes("utf8")); 26 } else { 27 @SuppressLint("MissingPermission") final String deviceId = ((TelephonyManager) context 28 .getSystemService(Context.TELEPHONY_SERVICE)) 29 .getDeviceId(); 30 uuid = deviceId != null ? UUID.nameUUIDFromBytes(deviceId../../src/main/java/com/donut/plugin/util/EfunboxUtil.java:40:
37 if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { 38 return ""; 39 } 40 serial = Build.SERIAL; 41 } else {//8.0- 42 Class<?> c = Class.forName("android.os.SystemProperties"); 43 Method get = c.getMethod("get", String.class);../../src/main/java/com/donut/plugin/util/EfunboxUtil.java:44:
41 } else {//8.0- 42 Class<?> c = Class.forName("android.os.SystemProperties"); 43 Method get = c.getMethod("get", String.class); 44 serial = (String) get.invoke(c, "ro.serialno"); 45 } 46 } catch (Exception e) { 47 e.printStackTrace();
HardwareIds
Security
Warning
Priority 6/10
Static Field Leaks
../../src/main/java/com/donut/plugin/util/BaseConsts.kt:10:
7 companion object { 8 lateinit var mBaseApplication: Application 9 10 lateinit var mTopActivity: Activity 11 12 13 }
StaticFieldLeak
Performance
Warning
Priority 6/10
Disabled Checks
One or more issues were not run by lint, either
because the check is not enabled by default, or because
it was disabled with a command line flag or via one or
more
lint.xml
configuration files in the project directories.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:
1. With a
2. With a
3. With a //noinspection comment in the source code
4. With ignore flags specified in the
5. With a
6. With a
7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
To suppress a lint warning with a comment, add a
To suppress a lint warning in an XML file, add a
To suppress a lint warning in a
Here we specify a comma separated list of issue id's after the disable command. You can also use
To suppress lint warnings with a configuration XML file, create a file named
The format of the
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
For more information, see https://developer.android.com/studio/write/lint.html#config
1. With a
@SuppressLint
annotation in the Java code2. With a
tools:ignore
attribute in the XML file3. With a //noinspection comment in the source code
4. With ignore flags specified in the
build.gradle
file, as explained below5. With a
lint.xml
configuration file in the project6. With a
lint.xml
configuration file passed to lint via the --config flag7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
@SuppressLint("id")
annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources"
or {"UnusedResources","UnusedIds"}
, or it can be "all"
to suppress all lint warnings in the given scope.To suppress a lint warning with a comment, add a
//noinspection id
comment on the line before the statement with the error.To suppress a lint warning in an XML file, add a
tools:ignore="id"
attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android
declaration:xmlns:tools="http://schemas.android.com/tools"
To suppress a lint warning in a
build.gradle
file, add a section like this:android { lintOptions { disable 'TypographyFractions','TypographyQuotes' } }
Here we specify a comma separated list of issue id's after the disable command. You can also use
warning
or error
instead of disable
to change the severity of issues.To suppress lint warnings with a configuration XML file, create a file named
lint.xml
and place it at the root directory of the module in which it applies.The format of the
lint.xml
file is something like the following:<?xml version="1.0" encoding="UTF-8"?> <lint> <!-- Ignore everything in the test source set --> <issue id="all"> <ignore path="\*/test/\*" /> </issue> <!-- Disable this given check in this project --> <issue id="IconMissingDensityFolder" severity="ignore" /> <!-- Ignore the ObsoleteLayoutParam issue in the given files --> <issue id="ObsoleteLayoutParam"> <ignore path="res/layout/activation.xml" /> <ignore path="res/layout-xlarge/activation.xml" /> <ignore regexp="(foo|bar)\.java" /> </issue> <!-- Ignore the UselessLeaf issue in the given file --> <issue id="UselessLeaf"> <ignore path="res/layout/main.xml" /> </issue> <!-- Change the severity of hardcoded strings to "error" --> <issue id="HardcodedText" severity="error" /> </lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
$ lint --ignore UnusedResources,UselessLeaf /my/project/path
For more information, see https://developer.android.com/studio/write/lint.html#config