@@ -64,11 +64,11 @@ public void decode(ResResource res, Directory inDir, Directory outDir, Map<Strin
64
64
65
65
try {
66
66
if (typeName .equals ("raw" )) {
67
- decode (inDir , inFileName , outDir , outFileName , "raw" );
67
+ decode (inDir , inFilePath , outDir , outFileName , "raw" );
68
68
return ;
69
69
}
70
70
if (typeName .equals ("font" ) && !".xml" .equals (ext )) {
71
- decode (inDir , inFileName , outDir , outFileName , "raw" );
71
+ decode (inDir , inFilePath , outDir , outFileName , "raw" );
72
72
return ;
73
73
}
74
74
if (typeName .equals ("drawable" ) || typeName .equals ("mipmap" )) {
@@ -83,26 +83,24 @@ public void decode(ResResource res, Directory inDir, Directory outDir, Map<Strin
83
83
// check for raw 9patch images
84
84
for (String extension : RAW_9PATCH_IMAGE_EXTENSIONS ) {
85
85
if (inFileName .toLowerCase ().endsWith ("." + extension )) {
86
- copyRaw (inDir , outDir , inFileName , outFileName );
86
+ copyRaw (inDir , outDir , inFilePath , outFileName );
87
87
return ;
88
88
}
89
89
}
90
90
91
91
// check for xml 9 patches which are just xml files
92
92
if (inFileName .toLowerCase ().endsWith (".xml" )) {
93
- decode (inDir , inFileName , outDir , outFileName , "xml" );
93
+ decode (inDir , inFilePath , outDir , outFileName , "xml" );
94
94
return ;
95
95
}
96
96
97
97
try {
98
- decode (inDir , inFileName , outDir , outFileName , "9patch" );
98
+ decode (inDir , inFilePath , outDir , outFileName , "9patch" );
99
99
return ;
100
100
} catch (CantFind9PatchChunkException ex ) {
101
- LOGGER .log (
102
- Level .WARNING ,
103
- String .format (
104
- "Cant find 9patch chunk in file: \" %s\" . Renaming it to *.png." ,
105
- inFileName ), ex );
101
+ LOGGER .log (Level .WARNING , String .format (
102
+ "Cant find 9patch chunk in file: \" %s\" . Renaming it to *.png." , inFileName
103
+ ), ex );
106
104
outDir .removeFile (outFileName );
107
105
outFileName = outResName + ext ;
108
106
}
@@ -111,27 +109,27 @@ public void decode(ResResource res, Directory inDir, Directory outDir, Map<Strin
111
109
// check for raw image
112
110
for (String extension : RAW_IMAGE_EXTENSIONS ) {
113
111
if (inFileName .toLowerCase ().endsWith ("." + extension )) {
114
- copyRaw (inDir , outDir , inFileName , outFileName );
112
+ copyRaw (inDir , outDir , inFilePath , outFileName );
115
113
return ;
116
114
}
117
115
}
118
116
119
117
if (!".xml" .equals (ext )) {
120
- decode (inDir , inFileName , outDir , outFileName , "raw" );
118
+ decode (inDir , inFilePath , outDir , outFileName , "raw" );
121
119
return ;
122
120
}
123
121
}
124
122
125
- decode (inDir , inFileName , outDir , outFileName , "xml" );
123
+ decode (inDir , inFilePath , outDir , outFileName , "xml" );
126
124
} catch (RawXmlEncounteredException ex ) {
127
125
// If we got an error to decode XML, lets assume the file is in raw format.
128
126
// This is a large assumption, that might increase runtime, but will save us for situations where
129
127
// XSD files are AXML`d on aapt1, but left in plaintext in aapt2.
130
- decode (inDir , inFileName , outDir , outFileName , "raw" );
128
+ decode (inDir , inFilePath , outDir , outFileName , "raw" );
131
129
} catch (AndrolibException ex ) {
132
130
LOGGER .log (Level .SEVERE , String .format (
133
- "Could not decode file, replacing by FALSE value: %s" ,
134
- inFileName ), ex );
131
+ "Could not decode file, replacing by FALSE value: %s" ,
132
+ inFileName ), ex );
135
133
res .replace (new ResBoolValue (false , 0 , null ));
136
134
}
137
135
}
0 commit comments