10: Update UsesSdkPlugin to check maxSdkVersion definition

This commit is contained in:
Bartłomiej Pluta
2019-04-05 23:18:16 +02:00
parent 11609c693f
commit 7936684520
2 changed files with 10 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ public class UsesSdkPlugin extends AndroidManifestPlugin {
if(usesSdkNode.getAttributes().getNamedItem("android:minSdkVersion") == null) {
addIssue(Severity.ERROR, ".USES_SDK.NO_MIN_SDK_VERSION", null, null);
}
Optional.ofNullable(usesSdkNode.getAttributes().getNamedItem("android:maxSdkVersion")).ifPresent(maxSdkVersion ->
addIssue(Severity.ERROR, ".USES_SDK.MAX_SDK_VERSION", null, maxSdkVersion.toString())
);
}, () -> addIssue(Severity.ERROR, ".NO_USES_SDK", null, null));
}
}

View File

@@ -65,6 +65,12 @@ com.bartek.esa.core.plugin.UsesSdkPlugin.USES_SDK.NO_MIN_SDK_VERSION=There is no
In order to use this tool, minimal SDK version should be provided as the attribute of <uses-sdk> element.\n\
For example: <uses-sdk android:minSdkVersion="23">
com.bartek.esa.core.plugin.UsesSdkPlugin.USES_SDK.MAX_SDK_VERSION=Application defines an upper limit for API version.\n\
The android:maxSdkVersion is defined in AndroidManifest.xml.\n\
There is no need to limit available platforms for application.\n\
Furthermore it can cause unexpected application uninstall\n\
on upgrading Android version (along with API which can exceed defined maximal API version).
com.bartek.esa.core.plugin.CipherInstancePlugin=Not fully-qualified algorithm name provided in Cipher.getInstance() method.\n\
Passing a shortcut instead of fully-qualified algorithm name in Cipher.getInstance() method is not portable across providers\n\
and can impact the system low secure than intended to be.\n\