File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ class ApkReader extends IsolateRunner<String, APK_READER_FLAGS> {
9292 /// Returns the gradient as an aapt xml element
9393 static Future <String > getGradient (String gradientId) async {
9494 Resource ? gradientRes = await getResources (gradientId);
95- if (gradientRes == null || ! gradientRes.values.first.endsWith (".xml" )) return "" ;
95+ if (gradientRes == null ) return "" ;
96+ String resValue = gradientRes.values.first;
97+ // TODO this is a dirty hack because I did not foresee the 'type1' resource to refer to plain color resources and not just gradients
98+ if (! resValue.endsWith (".xml" )) return gradientRes.type == ResType .COLOR ?
99+ '<aapt:attr name="android:fillColor"><gradient android:type="linear" android:startX="0" android:startY="0" android:endX="1" android:endY="1"><item android:color="#$resValue " android:offset="0"/></gradient></aapt:attr>' : '' ;
96100 Archive apkFile = await _apkArchive;
97101 ArchiveFile ? gradientFile = apkFile.findFile (gradientRes.values.first);
98102 if (gradientFile == null ) return "" ;
@@ -185,7 +189,7 @@ class ApkReader extends IsolateRunner<String, APK_READER_FLAGS> {
185189
186190 String backXmlData = isBackXml && backXml != null ? await backXml : "" ;
187191 String foreXmlData = isForeXml ? await foreXml! : "" ;
188-
192+
189193 if (isBackColor) {
190194 final color = Color (int .parse (background! .values.first, radix: 16 ));
191195 updateState (()=> GState .apkBackgroundColor, color);
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ class Constants {
200200
201201void main (List <String > arguments) async {
202202 //int prevTime = DateTime.now().millisecondsSinceEpoch;
203- //arguments = [r'C:\Users\Alex\Downloads\AuroraStore_4.1.1 .apk'];
203+ //arguments = [r'C:\Users\Alex\Downloads\caab_585 .apk'];
204204 //arguments = [r'C:\Users\Alex\Downloads\Chrome.xapk'];
205205
206206
You can’t perform that action at this time.
0 commit comments