28
28
import java .io .IOException ;
29
29
import java .io .InputStream ;
30
30
import java .io .Reader ;
31
+ import java .util .Optional ;
31
32
import java .util .logging .Level ;
32
33
import java .util .logging .Logger ;
33
34
@@ -343,15 +344,19 @@ public String getAttributeName(int index) {
343
344
if (value == null || value .length () == 0 ) {
344
345
try {
345
346
value = mAttrDecoder .decodeManifestAttr (getAttributeNameResource (index ));
346
- if (value == null ) value = "" ;
347
- } catch (AndrolibException e ) {value = "" ;}
347
+ if (value == null ) {
348
+ value = "" ;
349
+ }
350
+ } catch (AndrolibException e ) {
351
+ value = "" ;
352
+ }
348
353
} else if (! namespace .equals (android_ns )) {
349
354
try {
350
355
String obfuscatedName = mAttrDecoder .decodeManifestAttr (getAttributeNameResource (index ));
351
356
if (! (obfuscatedName == null || obfuscatedName .equals (value ))) {
352
357
value = obfuscatedName ;
353
358
}
354
- } catch (AndrolibException e ) {}
359
+ } catch (AndrolibException ignored ) {}
355
360
}
356
361
return value ;
357
362
}
@@ -387,10 +392,9 @@ public String getAttributeValue(int index) {
387
392
388
393
if (mAttrDecoder != null ) {
389
394
try {
390
- String value = valueRaw == -1 ? null : ResXmlEncoders
391
- .escapeXmlChars (m_strings .getString (valueRaw ));
392
- String obfuscatedValue = mAttrDecoder
393
- .decodeManifestAttr (valueData );
395
+ String value = valueRaw == -1 ? null : ResXmlEncoders .escapeXmlChars (m_strings .getString (valueRaw ));
396
+ String obfuscatedValue = mAttrDecoder .decodeManifestAttr (valueData );
397
+
394
398
if (! (value == null || obfuscatedValue == null )) {
395
399
int slashPos = value .lastIndexOf ("/" );
396
400
@@ -404,10 +408,11 @@ public String getAttributeValue(int index) {
404
408
}
405
409
406
410
return mAttrDecoder .decode (
407
- valueType ,
408
- valueData ,
409
- value ,
410
- getAttributeNameResource (index ));
411
+ valueType ,
412
+ valueData ,
413
+ value ,
414
+ getAttributeNameResource (index )
415
+ );
411
416
} catch (AndrolibException ex ) {
412
417
setFirstError (ex );
413
418
LOGGER .log (Level .WARNING , String .format ("Could not decode attr value, using undecoded value "
0 commit comments