123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Lint Report</title>
- <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
- <link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.blue-indigo.min.css" />
- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
- <script defer src="https://code.getmdl.io/1.2.0/material.min.js"></script>
- <style>
- section.section--center {
- max-width: 860px;
- }
- .mdl-card__supporting-text + .mdl-card__actions {
- border-top: 1px solid rgba(0, 0, 0, 0.12);
- }
- main > .mdl-layout__tab-panel {
- padding: 8px;
- padding-top: 48px;
- }
- .mdl-card__actions {
- margin: 0;
- padding: 4px 40px;
- color: inherit;
- }
- .mdl-card > * {
- height: auto;
- }
- .mdl-card__actions a {
- color: #00BCD4;
- margin: 0;
- }
- .error-icon {
- color: #bb7777;
- vertical-align: bottom;
- }
- .warning-icon {
- vertical-align: bottom;
- }
- .mdl-layout__content section:not(:last-of-type) {
- position: relative;
- margin-bottom: 48px;
- }
- .mdl-card .mdl-card__supporting-text {
- margin: 40px;
- -webkit-flex-grow: 1;
- -ms-flex-positive: 1;
- flex-grow: 1;
- padding: 0;
- color: inherit;
- width: calc(100% - 80px);
- }
- div.mdl-layout__drawer-button .material-icons {
- line-height: 48px;
- }
- .mdl-card .mdl-card__supporting-text {
- margin-top: 0px;
- }
- .chips {
- float: right;
- vertical-align: middle;
- }
- pre.errorlines {
- background-color: white;
- font-family: monospace;
- border: 1px solid #e0e0e0;
- line-height: 0.9rem;
- font-size: 0.9rem; padding: 1px 0px 1px; 1px;
- overflow: scroll;
- }
- .prefix {
- color: #660e7a;
- font-weight: bold;
- }
- .attribute {
- color: #0000ff;
- font-weight: bold;
- }
- .value {
- color: #008000;
- font-weight: bold;
- }
- .tag {
- color: #000080;
- font-weight: bold;
- }
- .comment {
- color: #808080;
- font-style: italic;
- }
- .javadoc {
- color: #808080;
- font-style: italic;
- }
- .annotation {
- color: #808000;
- }
- .string {
- color: #008000;
- font-weight: bold;
- }
- .number {
- color: #0000ff;
- }
- .keyword {
- color: #000080;
- font-weight: bold;
- }
- .caretline {
- background-color: #fffae3;
- }
- .lineno {
- color: #999999;
- background-color: #f0f0f0;
- }
- .error {
- display: inline-block;
- position:relative;
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AwCFR4T/3uLMgAAADxJREFUCNdNyLERQEAABMCjL4lQwIzcjErpguAL+C9AvgKJDbeD/PRpLdm35Hm+MU+cB+tCKaJW4L4YBy+CAiLJrFs9mgAAAABJRU5ErkJggg==) bottom repeat-x;
- }
- .warning {
- text-decoration: none;
- background-color: #f6ebbc;
- }
- .overview {
- padding: 10pt;
- width: 100%;
- overflow: auto;
- border-collapse:collapse;
- }
- .overview tr {
- border-bottom: solid 1px #eeeeee;
- }
- .categoryColumn a {
- text-decoration: none;
- color: inherit;
- }
- .countColumn {
- text-align: right;
- padding-right: 20px;
- width: 50px;
- }
- .issueColumn {
- padding-left: 16px;
- }
- .categoryColumn {
- position: relative;
- left: -50px;
- padding-top: 20px;
- padding-bottom: 5px;
- }
- </style>
- <script language="javascript" type="text/javascript">
- <!--
- function reveal(id) {
- if (document.getElementById) {
- document.getElementById(id).style.display = 'block';
- document.getElementById(id+'Link').style.display = 'none';
- }
- }
- function hideid(id) {
- if (document.getElementById) {
- document.getElementById(id).style.display = 'none';
- }
- }
- //-->
- </script>
- </head>
- <body class="mdl-color--grey-100 mdl-color-text--grey-700 mdl-base">
- <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
- <header class="mdl-layout__header">
- <div class="mdl-layout__header-row">
- <span class="mdl-layout-title">Lint Report: 12 warnings</span>
- <div class="mdl-layout-spacer"></div>
- <nav class="mdl-navigation mdl-layout--large-screen-only">
- Check performed at Thu Apr 18 14:40:18 CST 2024 </nav>
- </div>
- </header>
- <div class="mdl-layout__drawer">
- <span class="mdl-layout-title">Issue Types</span>
- <nav class="mdl-navigation">
- <a class="mdl-navigation__link" href="#overview"><i class="material-icons">dashboard</i>Overview</a>
- <a class="mdl-navigation__link" href="#PrivateApi"><i class="material-icons warning-icon">warning</i>Using Private APIs (2)</a>
- <a class="mdl-navigation__link" href="#GradleDependency"><i class="material-icons warning-icon">warning</i>Obsolete Gradle Dependency (5)</a>
- <a class="mdl-navigation__link" href="#HardwareIds"><i class="material-icons warning-icon">warning</i>Hardware Id Usage (4)</a>
- <a class="mdl-navigation__link" href="#StaticFieldLeak"><i class="material-icons warning-icon">warning</i>Static Field Leaks (1)</a>
- </nav>
- </div>
- <main class="mdl-layout__content">
- <div class="mdl-layout__tab-panel is-active">
- <a name="overview"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="OverviewCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Overview</h2>
- </div>
- <div class="mdl-card__supporting-text">
- <table class="overview">
- <tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Correctness">Correctness</a>
- </td></tr>
- <tr>
- <td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
- <a href="#PrivateApi">PrivateApi</a>: Using Private APIs</td></tr>
- <tr>
- <td class="countColumn">5</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
- <a href="#GradleDependency">GradleDependency</a>: Obsolete Gradle Dependency</td></tr>
- <tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Security">Security</a>
- </td></tr>
- <tr>
- <td class="countColumn">4</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
- <a href="#HardwareIds">HardwareIds</a>: Hardware Id Usage</td></tr>
- <tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Performance">Performance</a>
- </td></tr>
- <tr>
- <td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
- <a href="#StaticFieldLeak">StaticFieldLeak</a>: Static Field Leaks</td></tr>
- <tr><td></td><td class="categoryColumn"><a href="#MissingIssues">Disabled Checks (37)</a>
- </td></tr></table>
- <br/> </div>
- <div class="mdl-card__actions mdl-card--border">
- <button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="OverviewCardLink" onclick="hideid('OverviewCard');">
- Dismiss</button> </div>
- </div>
- </section>
- <a name="Correctness"></a>
- <a name="PrivateApi"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="PrivateApiCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Using Private APIs</h2>
- </div>
- <div class="mdl-card__supporting-text">
- <div class="issue">
- <div class="warningslist">
- <span class="location"><a href="../../src/main/java/com/donut/plugin/util/EfunboxUtil.java">../../src/main/java/com/donut/plugin/util/EfunboxUtil.java</a>:42</span>: <span class="message">Accessing internal APIs via reflection is not supported and may not work on all devices or in the future</span><br /><pre class="errorlines">
- <span class="lineno"> 39 </span> }
- <span class="lineno"> 40 </span> serial = Build.SERIAL;
- <span class="lineno"> 41 </span> } <span class="keyword">else</span> {<span class="comment">//8.0-</span>
- <span class="caretline"><span class="lineno"> 42 </span> Class<?> c = <span class="warning">Class.forName(<span class="string">"android.os.SystemProperties"</span>)</span>; </span>
- <span class="lineno"> 43 </span> Method get = c.getMethod(<span class="string">"get"</span>, String.<span class="keyword">class</span>);
- <span class="lineno"> 44 </span> serial = (String) get.invoke(c, <span class="string">"ro.serialno"</span>);
- <span class="lineno"> 45 </span> }
- </pre>
- <span class="location"><a href="../../src/main/java/com/donut/wxf1a06dafa3350688/PluginManager.kt">../../src/main/java/com/donut/wxf1a06dafa3350688/PluginManager.kt</a>:45</span>: <span class="message">Accessing internal APIs via reflection is not supported and may not work on all devices or in the future</span><br /><pre class="errorlines">
- <span class="lineno"> 42 </span> <span class="keyword">fun</span> initPluginMethod(data: JSONObject?, callback: (data: Any) -> Unit, activity: Activity) {
- <span class="lineno"> 43 </span> <span class="keyword">try</span> {
- <span class="lineno"> 44 </span> <span class="keyword">var</span> code = data!!.getString(<span class="string">"channelCode"</span>);
- <span class="caretline"><span class="lineno"> 45 </span> <span class="keyword">val</span> clazz = <span class="warning">Class.forName(<span class="string">"android.app.ActivityThread"</span>)</span> </span>
- <span class="lineno"> 46 </span> <span class="keyword">val</span> method: Method = clazz.getMethod(<span class="string">"currentApplication"</span>)
- <span class="lineno"> 47 </span> BaseConsts.mBaseApplication = method.invoke(<span class="keyword">null</span>) <span class="keyword">as</span> Application;
- </pre>
- </div>
- <div class="metadata"><div class="explanation" id="explanationPrivateApi" style="display: none;">
- Using reflection to access hidden/private Android APIs is not safe; it will often not work on devices from other vendors, and it may suddenly stop working (if the API is removed) or crash spectacularly (if the API behavior changes, since there are no guarantees for compatibility).<br/><div class="moreinfo">More info: <a href="https://developer.android.com/preview/restrictions-non-sdk-interfaces">https://developer.android.com/preview/restrictions-non-sdk-interfaces</a>
- </div>To suppress this error, use the issue id "PrivateApi" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="chips">
- <span class="mdl-chip">
- <span class="mdl-chip__text">PrivateApi</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Correctness</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Warning</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Priority 6/10</span>
- </span>
- </div>
- </div>
- <div class="mdl-card__actions mdl-card--border">
- <button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationPrivateApiLink" onclick="reveal('explanationPrivateApi');">
- Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="PrivateApiCardLink" onclick="hideid('PrivateApiCard');">
- Dismiss</button> </div>
- </div>
- </section><a name="GradleDependency"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="GradleDependencyCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Obsolete Gradle Dependency</h2>
- </div>
- <div class="mdl-card__supporting-text">
- <div class="issue">
- <div class="warningslist">
- <span class="location"><a href="../../build.gradle">../../build.gradle</a>:61</span>: <span class="message">A newer version of androidx.exifinterface:exifinterface than 1.1.0 is available: 1.2.0</span><br /><pre class="errorlines">
- <span class="lineno"> 58 </span>
- <span class="lineno"> 59 </span>
- <span class="lineno"> 60 </span> dependencies {
- <span class="caretline"><span class="lineno"> 61 </span> <span class="warning">implementation <span class="string">"androidx.exifinterface:exifinterface:1.1.0"</span></span> </span>
- <span class="lineno"> 62 </span>
- <span class="lineno"> 63 </span> implementation <span class="string">"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"</span>
- <span class="lineno"> 64 </span> implementation <span class="string">"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"</span></pre>
- <span class="location"><a href="../../build.gradle">../../build.gradle</a>:66</span>: <span class="message">A newer version of androidx.constraintlayout:constraintlayout than 1.1.3 is available: 2.0.4</span><br /><pre class="errorlines">
- <span class="lineno"> 63 </span> implementation <span class="string">"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"</span>
- <span class="lineno"> 64 </span> implementation <span class="string">"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"</span>
- <span class="lineno"> 65 </span>
- <span class="caretline"><span class="lineno"> 66 </span> <span class="warning">api <span class="string">"androidx.constraintlayout:constraintlayout:1.1.3"</span></span> </span>
- <span class="lineno"> 67 </span>
- <span class="lineno"> 68 </span> api <span class="string">'com.google.android.material:material:1.0.0'</span>
- </pre>
- <span class="location"><a href="../../build.gradle">../../build.gradle</a>:68</span>: <span class="message">A newer version of com.google.android.material:material than 1.0.0 is available: 1.4.0</span><br /><pre class="errorlines">
- <span class="lineno"> 65 </span>
- <span class="lineno"> 66 </span> api <span class="string">"androidx.constraintlayout:constraintlayout:1.1.3"</span>
- <span class="lineno"> 67 </span>
- <span class="caretline"><span class="lineno"> 68 </span> <span class="warning">api <span class="string">'com.google.android.material:material:1.0.0'</span></span> </span>
- <span class="lineno"> 69 </span>
- <span class="lineno"> 70 </span> compileOnly(<span class="string">"com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend"</span>) {}
- <span class="lineno"> 71 </span> implementation(<span class="string">'io.github.jeremyliao:live-event-bus-x:1.8.0'</span>)
- </pre>
- <span class="location"><a href="../../build.gradle">../../build.gradle</a>:72</span>: <span class="message">A newer version of com.umeng.umsdk:common than 9.6.3 is available: 9.6.7</span><br /><pre class="errorlines">
- <span class="lineno"> 69 </span>
- <span class="lineno"> 70 </span> compileOnly(<span class="string">"com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend"</span>) {}
- <span class="lineno"> 71 </span> implementation(<span class="string">'io.github.jeremyliao:live-event-bus-x:1.8.0'</span>)
- <span class="caretline"><span class="lineno"> 72 </span> <span class="warning">implementation <span class="string">'com.umeng.umsdk:common:9.6.3'</span><span class="comment">// 必选</span></span> </span>
- <span class="lineno"> 73 </span> implementation <span class="string">'com.umeng.umsdk:asms:1.8.0'</span><span class="comment">// 必选</span>
- <span class="lineno"> 74 </span></pre>
- <span class="location"><a href="../../build.gradle">../../build.gradle</a>:73</span>: <span class="message">A newer version of com.umeng.umsdk:asms than 1.8.0 is available: 1.8.2</span><br /><pre class="errorlines">
- <span class="lineno"> 70 </span> compileOnly(<span class="string">"com.tencent.luggage:wxa-standalone-open-runtime-SaaA-plugin-sdk:$saaaSDKVersionDepend"</span>) {}
- <span class="lineno"> 71 </span> implementation(<span class="string">'io.github.jeremyliao:live-event-bus-x:1.8.0'</span>)
- <span class="lineno"> 72 </span> implementation <span class="string">'com.umeng.umsdk:common:9.6.3'</span><span class="comment">// 必选</span>
- <span class="caretline"><span class="lineno"> 73 </span> <span class="warning">implementation <span class="string">'com.umeng.umsdk:asms:1.8.0'</span><span class="comment">// 必选</span></span> </span>
- <span class="lineno"> 74 </span><span class="lineno"> 75 </span>
- <span class="lineno"> 76 </span> }
- </pre>
- </div>
- <div class="metadata"><div class="explanation" id="explanationGradleDependency" style="display: none;">
- This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "GradleDependency" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="chips">
- <span class="mdl-chip">
- <span class="mdl-chip__text">GradleDependency</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Correctness</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Warning</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Priority 4/10</span>
- </span>
- </div>
- </div>
- <div class="mdl-card__actions mdl-card--border">
- <button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationGradleDependencyLink" onclick="reveal('explanationGradleDependency');">
- Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="GradleDependencyCardLink" onclick="hideid('GradleDependencyCard');">
- Dismiss</button> </div>
- </div>
- </section>
- <a name="Security"></a>
- <a name="HardwareIds"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="HardwareIdsCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Hardware Id Usage</h2>
- </div>
- <div class="mdl-card__supporting-text">
- <div class="issue">
- <div class="warningslist">
- <span class="location"><a href="../../src/main/java/com/donut/plugin/util/DeviceUuidFactory.java">../../src/main/java/com/donut/plugin/util/DeviceUuidFactory.java</a>:22</span>: <span class="message">Using <code>getString</code> to get device identifiers is not recommended</span><br /><pre class="errorlines">
- <span class="lineno"> 19 </span> <span class="keyword">if</span> (uuid == <span class="keyword">null</span>) {
- <span class="lineno"> 20 </span> Logger.e(context.getClass().getName());
- <span class="lineno"> 21 </span> <span class="keyword">try</span> {
- <span class="caretline"><span class="lineno"> 22 </span> <span class="keyword">final</span> String androidId = <span class="warning">Settings.Secure.getString(</span> </span>
- <span class="lineno"> 23 </span> context.getContentResolver(), Settings.Secure.ANDROID_ID);
- <span class="lineno"> 24 </span> <span class="keyword">if</span> (!<span class="string">"9774d56d682e549c"</span>.equals(androidId)) {
- <span class="lineno"> 25 </span> uuid = UUID.nameUUIDFromBytes(androidId.getBytes(<span class="string">"utf8"</span>));
- </pre>
- <span class="location"><a href="../../src/main/java/com/donut/plugin/util/DeviceUuidFactory.java">../../src/main/java/com/donut/plugin/util/DeviceUuidFactory.java</a>:27</span>: <span class="message">Using <code>getDeviceId</code> to get device identifiers is not recommended</span><br /><pre class="errorlines">
- <span class="lineno"> 24 </span> <span class="keyword">if</span> (!<span class="string">"9774d56d682e549c"</span>.equals(androidId)) {
- <span class="lineno"> 25 </span> uuid = UUID.nameUUIDFromBytes(androidId.getBytes(<span class="string">"utf8"</span>));
- <span class="lineno"> 26 </span> } <span class="keyword">else</span> {
- <span class="caretline"><span class="lineno"> 27 </span> <span class="annotation">@SuppressLint</span>(<span class="string">"MissingPermission"</span>) <span class="keyword">final</span> String deviceId = <span class="warning">((TelephonyManager) context</span></span>
- <span class="lineno"> 28 </span> .getSystemService(Context.TELEPHONY_SERVICE))
- <span class="lineno"> 29 </span> .getDeviceId();
- <span class="lineno"> 30 </span> uuid = deviceId != <span class="keyword">null</span> ? UUID.nameUUIDFromBytes(deviceId
- </pre>
- <span class="location"><a href="../../src/main/java/com/donut/plugin/util/EfunboxUtil.java">../../src/main/java/com/donut/plugin/util/EfunboxUtil.java</a>:40</span>: <span class="message">Using <code>SERIAL</code> to get device identifiers is not recommended</span><br /><pre class="errorlines">
- <span class="lineno"> 37 </span> <span class="keyword">if</span> (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
- <span class="lineno"> 38 </span> <span class="keyword">return</span> <span class="string">""</span>;
- <span class="lineno"> 39 </span> }
- <span class="caretline"><span class="lineno"> 40 </span> serial = Build.<span class="warning">SERIAL</span>; </span>
- <span class="lineno"> 41 </span> } <span class="keyword">else</span> {<span class="comment">//8.0-</span>
- <span class="lineno"> 42 </span> Class<?> c = Class.forName(<span class="string">"android.os.SystemProperties"</span>);
- <span class="lineno"> 43 </span> Method get = c.getMethod(<span class="string">"get"</span>, String.<span class="keyword">class</span>);
- </pre>
- <span class="location"><a href="../../src/main/java/com/donut/plugin/util/EfunboxUtil.java">../../src/main/java/com/donut/plugin/util/EfunboxUtil.java</a>:44</span>: <span class="message">Using <code>ro.serialno</code> to get device identifiers is not recommended</span><br /><pre class="errorlines">
- <span class="lineno"> 41 </span> } <span class="keyword">else</span> {<span class="comment">//8.0-</span>
- <span class="lineno"> 42 </span> Class<?> c = Class.forName(<span class="string">"android.os.SystemProperties"</span>);
- <span class="lineno"> 43 </span> Method get = c.getMethod(<span class="string">"get"</span>, String.<span class="keyword">class</span>);
- <span class="caretline"><span class="lineno"> 44 </span> serial = (String) get.invoke(c, <span class="warning"><span class="string">"ro.serialno"</span></span>); </span>
- <span class="lineno"> 45 </span> }
- <span class="lineno"> 46 </span> } <span class="keyword">catch</span> (Exception e) {
- <span class="lineno"> 47 </span> e.printStackTrace();
- </pre>
- </div>
- <div class="metadata"><div class="explanation" id="explanationHardwareIds" style="display: none;">
- Using these device identifiers is not recommended other than for high value fraud prevention and advanced telephony use-cases. For advertising use-cases, use <code>AdvertisingIdClient$Info#getId</code> and for analytics, use <code>InstanceId#getId</code>.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/training/articles/user-data-ids.html">https://developer.android.com/training/articles/user-data-ids.html</a>
- </div>To suppress this error, use the issue id "HardwareIds" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="chips">
- <span class="mdl-chip">
- <span class="mdl-chip__text">HardwareIds</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Security</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Warning</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Priority 6/10</span>
- </span>
- </div>
- </div>
- <div class="mdl-card__actions mdl-card--border">
- <button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationHardwareIdsLink" onclick="reveal('explanationHardwareIds');">
- Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="HardwareIdsCardLink" onclick="hideid('HardwareIdsCard');">
- Dismiss</button> </div>
- </div>
- </section>
- <a name="Performance"></a>
- <a name="StaticFieldLeak"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="StaticFieldLeakCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Static Field Leaks</h2>
- </div>
- <div class="mdl-card__supporting-text">
- <div class="issue">
- <div class="warningslist">
- <span class="location"><a href="../../src/main/java/com/donut/plugin/util/BaseConsts.kt">../../src/main/java/com/donut/plugin/util/BaseConsts.kt</a>:10</span>: <span class="message">Do not place Android context classes in static fields; this is a memory leak</span><br /><pre class="errorlines">
- <span class="lineno"> 7 </span> companion <span class="keyword">object</span> {
- <span class="lineno"> 8 </span> lateinit <span class="keyword">var</span> mBaseApplication: Application
- <span class="lineno"> 9 </span>
- <span class="caretline"><span class="lineno"> 10 </span> <span class="warning">lateinit <span class="keyword">var</span> mTopActivity: Activity</span> </span>
- <span class="lineno"> 11 </span>
- <span class="lineno"> 12 </span>
- <span class="lineno"> 13 </span> }
- </pre>
- </div>
- <div class="metadata"><div class="explanation" id="explanationStaticFieldLeak" style="display: none;">
- A static field will leak contexts.<br/>
- <br/>
- Non-static inner classes have an implicit reference to their outer class. If that outer class is for example a <code>Fragment</code> or <code>Activity</code>, then this reference means that the long-running handler/loader/task will hold a reference to the activity which prevents it from getting garbage collected.<br/>
- <br/>
- Similarly, direct field references to activities and fragments from these longer running instances can cause leaks.<br/>
- <br/>
- ViewModel classes should never point to Views or non-application Contexts.<br/>To suppress this error, use the issue id "StaticFieldLeak" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="chips">
- <span class="mdl-chip">
- <span class="mdl-chip__text">StaticFieldLeak</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Performance</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Warning</span>
- </span>
- <span class="mdl-chip">
- <span class="mdl-chip__text">Priority 6/10</span>
- </span>
- </div>
- </div>
- <div class="mdl-card__actions mdl-card--border">
- <button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationStaticFieldLeakLink" onclick="reveal('explanationStaticFieldLeak');">
- Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="StaticFieldLeakCardLink" onclick="hideid('StaticFieldLeakCard');">
- Dismiss</button> </div>
- </div>
- </section>
- <a name="MissingIssues"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="MissingIssuesCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Disabled Checks</h2>
- </div>
- <div class="mdl-card__supporting-text">
- 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 <code>lint.xml</code> configuration files in the project directories.
- <div id="SuppressedIssues" style="display: none;"><br/><br/><div class="issue">
- <div class="id">AppLinksAutoVerifyError<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Ensures that app links are correctly set and associated with website.<br/><div class="moreinfo">More info: <a href="https://g.co/appindexing/applinks">https://g.co/appindexing/applinks</a>
- </div>To suppress this error, use the issue id "AppLinksAutoVerifyError" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">AppLinksAutoVerifyWarning<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Ensures that app links are correctly set and associated with website.<br/><div class="moreinfo">More info: <a href="https://g.co/appindexing/applinks">https://g.co/appindexing/applinks</a>
- </div>To suppress this error, use the issue id "AppLinksAutoVerifyWarning" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">BackButton<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- According to the Android Design Guide,<br/>
- <br/>
- "Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."<br/>
- This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.<br/><div class="moreinfo">More info: <a href="https://material.io/design/">https://material.io/design/</a>
- </div>To suppress this error, use the issue id "BackButton" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">ConvertToWebp<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- The WebP format is typically more compact than PNG and JPEG. As of Android 4.2.1 it supports transparency and lossless conversion as well. Note that there is a quickfix in the IDE which lets you perform conversion.<br/>
- <br/>
- Launcher icons must be in the PNG format.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "ConvertToWebp" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">DalvikOverride<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- The Dalvik virtual machine will treat a package private method in one class as overriding a package private method in its super class, even if they are in separate packages.<br/>
- <br/>
- If you really did intend for this method to override the other, make the method <code>protected</code> instead.<br/>
- <br/>
- If you did <b>not</b> intend the override, consider making the method private, or changing its name or signature.<br/>
- <br/>
- Note that this check is disabled be default, because ART (the successor to Dalvik) no longer has this behavior.<br/>To suppress this error, use the issue id "DalvikOverride" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">DuplicateStrings<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Duplicate strings can make applications larger unnecessarily.<br/>
- <br/>
- This lint check looks for duplicate strings, including differences for strings where the only difference is in capitalization. Title casing and all uppercase can all be adjusted in the layout or in code.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType">https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType</a>
- </div>To suppress this error, use the issue id "DuplicateStrings" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">EasterEgg<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.<br/>To suppress this error, use the issue id "EasterEgg" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">ExpensiveAssertion<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- In Kotlin, assertions are not handled the same way as from the Java programming language. In particular, they're just implemented as a library call, and inside the library call the error is only thrown if assertions are enabled.<br/>
- <br/>
- This means that the arguments to the <code>assert</code> call will <b>always</b> be evaluated. If you're doing any computation in the expression being asserted, that computation will unconditionally be performed whether or not assertions are turned on. This typically turns into wasted work in release builds.<br/>
- <br/>
- This check looks for cases where the assertion condition is nontrivial, e.g. it is performing method calls or doing more work than simple comparisons on local variables or fields.<br/>
- <br/>
- You can work around this by writing your own inline assert method instead:<br/>
- <pre>
- @Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
- inline fun assert(condition: () -> Boolean) {
- if (_Assertions.ENABLED && !condition()) {
- throw AssertionError()
- }
- }
- </pre>
- <br/>
- In Android, because assertions are not enforced at runtime, instead use this:<br/>
- <pre>
- inline fun assert(condition: () -> Boolean) {
- if (BuildConfig.DEBUG && !condition()) {
- throw AssertionError()
- }
- }
- </pre>
- <br/>To suppress this error, use the issue id "ExpensiveAssertion" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">FieldGetter<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.<br/>
- <br/>
- <b>NOTE</b>: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/training/articles/perf-tips#internal_get_set">https://developer.android.com/training/articles/perf-tips#internal_get_set</a>
- </div>To suppress this error, use the issue id "FieldGetter" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">GoogleAppIndexingApiWarning<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.<br/><div class="moreinfo">More info: <a href="https://g.co/AppIndexing/AndroidStudio">https://g.co/AppIndexing/AndroidStudio</a>
- </div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "GoogleAppIndexingApiWarning" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">GoogleAppIndexingWarning<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.<br/><div class="moreinfo">More info: <a href="https://g.co/AppIndexing/AndroidStudio">https://g.co/AppIndexing/AndroidStudio</a>
- </div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "GoogleAppIndexingWarning" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">IconExpectedSize<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.<br/><div class="moreinfo">More info: <a href="https://material.io/design/iconography/">https://material.io/design/iconography/</a>
- </div>To suppress this error, use the issue id "IconExpectedSize" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">ImplicitSamInstance<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Kotlin's support for SAM (single accessor method) interfaces lets you pass a lambda to the interface. This will create a new instance on the fly even though there is no explicit constructor call. If you pass one of these lambdas or method references into a method which (for example) stores or compares the object identity, unexpected results may happen.<br/>To suppress this error, use the issue id "ImplicitSamInstance" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">InvalidPackage<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- This check scans through libraries looking for calls to APIs that are not included in Android.<br/>
- <br/>
- When you create Android projects, the classpath is set up such that you can only access classes in the API packages that are included in Android. However, if you add other projects to your libs/ folder, there is no guarantee that those .jar files were built with an Android specific classpath, and in particular, they could be accessing unsupported APIs such as java.applet.<br/>
- <br/>
- This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.<br/>To suppress this error, use the issue id "InvalidPackage" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">KotlinPropertyAccess<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- For a method to be represented as a property in Kotlin, strict “bean”-style prefixing must be used.<br/>
- <br/>
- Accessor methods require a ‘get’ prefix or for boolean-returning methods an ‘is’ prefix can be used.<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#property-prefixes">https://android.github.io/kotlin-guides/interop.html#property-prefixes</a>
- </div>To suppress this error, use the issue id "KotlinPropertyAccess" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">LambdaLast<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- To improve calling this code from Kotlin,<br/>
- parameter types eligible for SAM conversion should be last.<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#lambda-parameters-last">https://android.github.io/kotlin-guides/interop.html#lambda-parameters-last</a>
- </div>To suppress this error, use the issue id "LambdaLast" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">LintImplPsiEquals<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- You should never compare two PSI elements for equality with <code>equals</code>;<br/>
- use <code>isEquivalentTo(PsiElement)</code> instead.<br/>To suppress this error, use the issue id "LintImplPsiEquals" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">LintImplUnexpectedDomain<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- This checks flags URLs to domains that have not been explicitly whitelisted for use as a documentation source.<br/>To suppress this error, use the issue id "LintImplUnexpectedDomain" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">LogConditional<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- The <code>BuildConfig</code> class provides a constant, <code>DEBUG</code>, which indicates whether the code is being built in release mode or in debug mode. In release mode, you typically want to strip out all the logging calls. Since the compiler will automatically remove all code which is inside a <code>if (false)</code> check, surrounding your logging calls with a check for <code>BuildConfig.DEBUG</code> is a good idea.<br/>
- <br/>
- If you <b>really</b> intend for the logging to be present in release mode, you can suppress this warning with a <code>@SuppressLint</code> annotation for the intentional logging calls.<br/>To suppress this error, use the issue id "LogConditional" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">MangledCRLF<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- On Windows, line endings are typically recorded as carriage return plus newline: \r\n.<br/>
- <br/>
- This detector looks for invalid line endings with repeated carriage return characters (without newlines). Previous versions of the ADT plugin could accidentally introduce these into the file, and when editing the file, the editor could produce confusing visual artifacts.<br/><div class="moreinfo">More info: <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421">https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421</a>
- </div>To suppress this error, use the issue id "MangledCRLF" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">MinSdkTooLow<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- The value of the <code>minSdkVersion</code> property is too low and can be incremented without noticeably reducing the number of supported devices.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "MinSdkTooLow" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">NegativeMargin<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Margin values should be positive. Negative values are generally a sign that you are making assumptions about views surrounding the current one, or may be tempted to turn off child clipping to allow a view to escape its parent. Turning off child clipping to do this not only leads to poor graphical performance, it also results in wrong touch event handling since touch events are based strictly on a chain of parent-rect hit tests. Finally, making assumptions about the size of strings can lead to localization problems.<br/>To suppress this error, use the issue id "NegativeMargin" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">NewerVersionAvailable<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- This detector checks with a central repository to see if there are newer versions available for the dependencies used by this project. This is similar to the <code>GradleDependency</code> check, which checks for newer versions available in the Android SDK tools and libraries, but this works with any MavenCentral dependency, and connects to the library every time, which makes it more flexible but also <b>much</b> slower.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "NewerVersionAvailable" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">NoHardKeywords<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Do not use Kotlin’s hard keywords as the name of methods or fields.<br/>
- These require the use of backticks to escape when calling from Kotlin.<br/>
- Soft keywords, modifier keywords, and special identifiers are allowed.<br/>
- <br/>
- For example, Mockito’s <code>when</code> function requires backticks when used from Kotlin:<br/>
- <br/>
- val callable = Mockito.mock(Callable::class.java)<br/>
- Mockito.`when`(callable.call()).thenReturn(/* … */)<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#no-hard-keywords">https://android.github.io/kotlin-guides/interop.html#no-hard-keywords</a>
- </div>To suppress this error, use the issue id "NoHardKeywords" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">PermissionImpliesUnsupportedChromeOsHardware<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- The <code><uses-permission></code> element should not require a permission that implies an unsupported Chrome OS hardware feature. Google Play assumes that certain hardware related permissions indicate that the underlying hardware features are required by default. To fix the issue, consider declaring the corresponding uses-feature element with <code>required="false"</code> attribute.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/topic/arc/manifest.html#implied-features">https://developer.android.com/topic/arc/manifest.html#implied-features</a>
- </div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "PermissionImpliesUnsupportedChromeOsHardware" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">Registered<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Activities, services and content providers should be registered in the <code>AndroidManifest.xml</code> file using <code><activity></code>, <code><service></code> and <code><provider></code> tags.<br/>
- <br/>
- If your activity is simply a parent class intended to be subclassed by other "real" activities, make it an abstract class.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/guide/topics/manifest/manifest-intro.html">https://developer.android.com/guide/topics/manifest/manifest-intro.html</a>
- </div>To suppress this error, use the issue id "Registered" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">RequiredSize<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- All views must specify an explicit <code>layout_width</code> and <code>layout_height</code> attribute. There is a runtime check for this, so if you fail to specify a size, an exception is thrown at runtime.<br/>
- <br/>
- It's possible to specify these widths via styles as well. GridLayout, as a special case, does not require you to specify a size.<br/>To suppress this error, use the issue id "RequiredSize" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">SelectableText<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- If a <code><TextView></code> is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the <code><TextView></code> should specify <code>android:textIsSelectable="true"</code>.<br/>
- <br/>
- This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your <code>minSdkVersion</code>.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "SelectableText" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">StopShip<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Using the comment <code>// STOPSHIP</code> can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these. In Gradle projects, this is only checked for non-debug (release) builds.<br/>
- <br/>
- In Kotlin, the <code>TODO()</code> method is also treated as a stop ship marker; you can use it to make incomplete code compile, but it will throw an exception at runtime and therefore should be fixed before shipping releases.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "StopShip" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">SyntheticAccessor<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- A private inner class which is accessed from the outer class will force the compiler to insert a synthetic accessor; this means that you are causing extra overhead. This is not important in small projects, but is important for large apps running up against the 64K method handle limit, and especially for <b>libraries</b> where you want to make sure your library is as small as possible for the cases where your library is used in an app running up against the 64K limit.<br/>To suppress this error, use the issue id "SyntheticAccessor" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">TypographyQuotes<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.<br/>
- <br/>
- Note that you should never use grave accents and apostrophes to quote, `like this'.<br/>
- <br/>
- (Also note that you should not use curvy quotes for code fragments.)<br/><div class="moreinfo">More info: <a href="https://en.wikipedia.org/wiki/Quotation_mark">https://en.wikipedia.org/wiki/Quotation_mark</a>
- </div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "TypographyQuotes" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">UnknownNullness<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- To improve referencing this code from Kotlin, consider adding<br/>
- explicit nullness information here with either <code>@NonNull</code> or <code>@Nullable</code>.<br/>
- <br/>
- You can set the environment variable<br/>
- <code>ANDROID_LINT_NULLNESS_IGNORE_DEPRECATED=true</code><br/>
- if you want lint to ignore classes and members that have been annotated with<br/>
- <code>@Deprecated</code>.<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#nullability-annotations">https://android.github.io/kotlin-guides/interop.html#nullability-annotations</a>
- </div>To suppress this error, use the issue id "UnknownNullness" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">UnpackedNativeCode<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- This app loads native libraries using <code>System.loadLibrary()</code>.<br/>
- <br/>
- Consider adding <code>android:extractNativeLibs="false"</code> to the <code><application></code> tag in AndroidManifest.xml. Starting with Android 6.0, this will make installation faster, the app will take up less space on the device and updates will have smaller download sizes.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "UnpackedNativeCode" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">UnsupportedChromeOsHardware<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- The <code><uses-feature></code> element should not require this unsupported Chrome OS hardware feature. Any uses-feature not explicitly marked with <code>required="false"</code> is necessary on the device to be installed on. Ensure that any features that might prevent it from being installed on a Chrome OS device are reviewed and marked as not required in the manifest.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/topic/arc/manifest.html#incompat-entries">https://developer.android.com/topic/arc/manifest.html#incompat-entries</a>
- </div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "UnsupportedChromeOsHardware" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">UnusedIds<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.<br/>
- <br/>
- The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.<br/>
- <br/>
- You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests=true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests=true.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
- To suppress this error, use the issue id "UnusedIds" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">ValidActionsXml<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Ensures that an actions XML file is properly formed<br/>To suppress this error, use the issue id "ValidActionsXml" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- <div class="issue">
- <div class="id">WrongThreadInterprocedural<div class="issueSeparator"></div>
- </div>
- <div class="metadata">Disabled By: Default<br/>
- <div class="explanation">
- Searches for interprocedural call paths that violate thread annotations in the program. Tracks the flow of instantiated types and lambda expressions to increase accuracy across method boundaries.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/guide/components/processes-and-threads.html#Threads">https://developer.android.com/guide/components/processes-and-threads.html#Threads</a>
- </div>To suppress this error, use the issue id "WrongThreadInterprocedural" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
- <br/></div>
- </div>
- </div>
- </div> </div>
- <div class="mdl-card__actions mdl-card--border">
- <button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="SuppressedIssuesLink" onclick="reveal('SuppressedIssues');">
- List Missing Issues</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="MissingIssuesCardLink" onclick="hideid('MissingIssuesCard');">
- Dismiss</button> </div>
- </div>
- </section>
- <a name="SuppressInfo"></a>
- <section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="SuppressCard" style="display: block;">
- <div class="mdl-card mdl-cell mdl-cell--12-col">
- <div class="mdl-card__title">
- <h2 class="mdl-card__title-text">Suppressing Warnings and Errors</h2>
- </div>
- <div class="mdl-card__supporting-text">
- Lint errors can be suppressed in a variety of ways:<br/>
- <br/>
- 1. With a <code>@SuppressLint</code> annotation in the Java code<br/>
- 2. With a <code>tools:ignore</code> attribute in the XML file<br/>
- 3. With a //noinspection comment in the source code<br/>
- 4. With ignore flags specified in the <code>build.gradle</code> file, as explained below<br/>
- 5. With a <code>lint.xml</code> configuration file in the project<br/>
- 6. With a <code>lint.xml</code> configuration file passed to lint via the --config flag<br/>
- 7. With the --ignore flag passed to lint.<br/>
- <br/>
- To suppress a lint warning with an annotation, add a <code>@SuppressLint("id")</code> 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 <code>"UnusedResources"</code> or <code>{"UnusedResources","UnusedIds"}</code>, or it can be <code>"all"</code> to suppress all lint warnings in the given scope.<br/>
- <br/>
- To suppress a lint warning with a comment, add a <code>//noinspection id</code> comment on the line before the statement with the error.<br/>
- <br/>
- To suppress a lint warning in an XML file, add a <code>tools:ignore="id"</code> 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 <code>xmlns:android</code> declaration:<br/>
- <code>xmlns:tools="http://schemas.android.com/tools"</code><br/>
- <br/>
- To suppress a lint warning in a <code>build.gradle</code> file, add a section like this:<br/>
- <pre>
- android {
- lintOptions {
- disable 'TypographyFractions','TypographyQuotes'
- }
- }
- </pre>
- <br/>
- Here we specify a comma separated list of issue id's after the disable command. You can also use <code>warning</code> or <code>error</code> instead of <code>disable</code> to change the severity of issues.<br/>
- <br/>
- To suppress lint warnings with a configuration XML file, create a file named <code>lint.xml</code> and place it at the root directory of the module in which it applies.<br/>
- <br/>
- The format of the <code>lint.xml</code> file is something like the following:<br/>
- <pre>
- <?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>
- </pre>
- <br/>
- To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:<br/>
- <code>$ lint --ignore UnusedResources,UselessLeaf /my/project/path</code><br/>
- <br/>
- For more information, see <a href="https://developer.android.com/studio/write/lint.html#config">https://developer.android.com/studio/write/lint.html#config</a><br/>
- </div>
- </div>
- </section> </div>
- </main>
- </div>
- </body>
- </html>
|