Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit 638ec9a

Browse files
committed
Fix icon rendering when adaptive icon is used
1 parent acadd73 commit 638ec9a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

QuickLookAPK/HZAndroidPackage.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@
161161
NSData *dataFromZipPath(NSString *zipFile, NSString *pathInZip)
162162
{
163163
NSTask *task = [[NSTask alloc] init];
164+
165+
if ([pathInZip hasSuffix:@".xml"]) {
166+
NSRange extension = [pathInZip rangeOfString:@"xml" options:NSBackwardsSearch];
167+
pathInZip = [pathInZip stringByReplacingCharactersInRange:extension withString:@"png"];
168+
pathInZip = [pathInZip stringByReplacingOccurrencesOfString:@"anydpi-v26" withString:@"xxxhdpi-v4"];
169+
pathInZip = [pathInZip stringByReplacingOccurrencesOfString:@"anydpi-v24" withString:@"xxxhdpi-v4"];
170+
}
171+
164172
[task setLaunchPath:@"/usr/bin/unzip"];
165173
[task setArguments:[NSArray arrayWithObjects:@"-p", zipFile, pathInZip, nil]];
166174

0 commit comments

Comments
 (0)