日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[原]逆向iOS SDK -- _UIImageAtPath 的实现(SDK 5.1)

發(fā)布時間:2025/3/15 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [原]逆向iOS SDK -- _UIImageAtPath 的实现(SDK 5.1) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

注釋過的反匯編代碼:http://pan.baidu.com/share/link?shareid=3491166579&uk=537224442

偽代碼(不精確,僅供參考):

?

?

?

?

NSString* _UICacheNameForImageAtPath(NSString *imageName, NSBundle *bundle);

NSString* ProductSuffix();

UIImage* GetImageAtPath(NSString *imageFilePath, CGFloat scale);

?

NSMutableDictionary *gCacheNameToImageMap = nil;

NSMutableDictionary *gImageToCacheNameMap = nil;

BOOL __prefer2xImages = NO;

?

UIImage *_UIImageAtPath(NSString *imageFileName, NSBundle *mainBundle, BOOL shouldForce1xScale)

{

??? // imageFileName = @"Default.png"

??? if ([imageFileName length] == 0)

??????? returnnil;

???

??? // bundleIdentifier_imageFileName

??? NSString *cacheNameOfImage = _UICacheNameForImageAtPath(imageFileName, mainBundle);

??? UIImage *resultImage = nil;

??? if (gCacheNameToImageMap != nil)

??? {

??????? resultImage = [gCacheNameToImageMapobjectForKey:cacheNameOfImage];

??????? if (resultImage != nil)

??????? {

??????????? if (![resultImage _isCached])

??????????? {

??????????????? [resultImage retain];

??????????? }

???????????

? ??????????[resultImage _setCached:YES];

???????????

??????????? return resultImage;

??????? }

??? }

??? else

??? {

??????? gCacheNameToImageMap = [NSMutableDictionarydictionary];

??????? gImageToCacheNameMap = [NSMutableDictionarydictionary];

??? }

???

??? BOOL force1xScale = NO;

??? if (__prefer2xImages)

??? {

??????? force1xScale = shouldForce1xScale;

??? }

???

??? NSString *imageExt = [imageFileName pathExtension];

??? if ([imageExt length] == 0)

??? {

??????? imageExt = @"png";

??? }

???

??? NSString *bundlePath = nil;

??? if (mainBundle != nil)

??? {

??????? bundlePath = [mainBundle bundlePath];

??? }

???

??? NSString *productSuffix = ProductSuffix();// ~iphone, ~ipad

??? NSString *imageNameWithoutSuffix = [imageFileName stringByReplacingOccurrencesOfString:productSuffix withString:@""];

???

??? // Default

??? NSString *imageNameWithoutSuffixAndExt = [imageNameWithoutSuffix stringByDeletingPathExtension];

??? // Default~iphone

??? NSString *imageNameWithSuffix = [imageNameWithoutSuffixAndExt stringByAppendingString:productSuffix];

??? // Default@1x

??? NSString *imageName1x = [imageNameWithoutSuffixAndExt stringByAppendingString:@"@1x"];

??? // Default@1x~iphone

??? NSString *imageName1xWithSuffix = [imageName1x stringByAppendingString:productSuffix];

??? // Default_1only_

??? NSString *imageName_1only_ = [imageNameWithoutSuffixAndExt stringByAppendingString:@"_1only_"];

??? // Default_1only_~ipnone

??? NSString *imageName_1only_WithSuffix = [imageName_1only_ stringByAppendingString:productSuffix];

???

??? // Default@2x

??? NSString *imageName2x = [imageNameWithoutSuffixAndExt stringByAppendingString:@"@2x"];

??? // Default@2x~iphone

??? NSString *imageName2xWithSuffix = [imageName2x stringByAppendingString:productSuffix];

??? // Default_2only_@2x

??? NSString *imageName_2only_2x = [imageNameWithoutSuffixAndExt stringByAppendingString:@"_2only_@2x"];

??? // Default_2only_@2x~iphone

??? NSString *imageName_2only_2xWithSuffix = [imageName_2only_2x stringByAppendingString:productSuffix];

???

??? NSString *targetFileName = nil;

??? NSString *targetFilePath = nil;

??? if (!force1xScale)

??? {

??????? // Default@2x~iphone.png

??????? targetFileName = [imageName2xWithSuffix stringByAppendingPathExtension:imageExt];

??????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????? resultImage = GetImageAtPath(targetFilePath, 2.0f);

???????

??????? // Default_2only_@2x~iphone.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageName_2only_2xWithSuffix stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 2.0f);

??????? }

???????

??????? // Default@2x.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageName2x stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 2.0f);

??????? }

???????

??????? // Default_2only_@2x.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageName_2only_2x stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 2.0f);

??????? }

??? }

???

??? if (resultImage == nil)

??? {

??????? // Default~iphone.png

??????? targetFileName = [imageNameWithSuffix stringByAppendingPathExtension:imageExt];

??????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

???????

??????? // Default.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageNameWithoutSuffixAndExt stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default@1x~iphone.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageName1xWithSuffix stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default_1only_~ipnone.png

??????? if (resultImage == nil)

??????? {

? ??????????targetFileName = [imageName_1only_WithSuffix stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default@1x.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageName1x stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default_1only.png

??????? if (resultImage == nil)

??????? {

??????????? targetFileName = [imageName_1only_ stringByAppendingPathExtension:imageExt];

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:targetFileName];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default~iphone

??????? if (resultImage == nil)

??????? {

?????????? ?targetFilePath = [bundlePath stringByAppendingPathComponent:imageNameWithSuffix];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default

??????? if (resultImage == nil)

??????? {

??????????? targetFilePath = [bundlePath stringByAppendingPathComponent:imageNameWithoutSuffixAndExt];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

??? }

???

??? if (resultImage == nil)

??? {

??????? if (!force1xScale)

??????? {

??????????? // Default@2x.png

??????????? targetFilePath = [mainBundle pathForResource:imageName2x ofType:imageExt];

??????????? resultImage = GetImageAtPath(targetFilePath, 2.0f);

???????????

??????????? // Default_2only_@2x.png

??????????? if (resultImage == nil)

??????????? {

??????????????? targetFilePath = [mainBundle pathForResource:imageName_2only_2x ofType:imageExt];

??????????????? resultImage = GetImageAtPath(targetFilePath, 2.0f);

??????????? }

??????? }

???????

??????? // Default.png

??????? if (resultImage == nil)

??????? {

??????????? targetFilePath = [mainBundle pathForResource:imageNameWithoutSuffixAndExt ofType:imageExt];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default@1x.png

??????? if (resultImage == nil)

??????? {

??????????? targetFilePath = [mainBundle pathForResource:imageName1x ofType:imageExt];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

???????

??????? // Default_1only_.png

??????? if (resultImage == nil)

??????? {

??????????? targetFilePath = [mainBundle pathForResource:imageName_1only_ ofType:imageExt];

??????????? resultImage = GetImageAtPath(targetFilePath, 1.0f);

??????? }

??? }

???

??? if (resultImage != nil)

??? {

??????? [gCacheNameToImageMapsetValue:resultImage forKey:cacheNameOfImage];

??????? [gImageToCacheNameMapsetValue:cacheNameOfImage forKey:resultImage];

??????? [resultImage _setNamed:YES];

??????? [resultImage _setCached:YES];

??? }

???

??? return resultImage;

}

?

?

轉(zhuǎn)載于:https://www.cnblogs.com/Proteas/p/3213487.html

總結(jié)

以上是生活随笔為你收集整理的[原]逆向iOS SDK -- _UIImageAtPath 的实现(SDK 5.1)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 中文精品在线 | 西西人体www大胆高清 | 欧美巨大荫蒂茸毛毛人妖 | 精品国产欧美一区二区三区成人 | 日韩中文字幕一区二区三区 | 亚洲hh| 中文字幕日韩一区二区三区 | 亚洲自拍三区 | 岛国精品视频 | 黄色短视频在线观看 | 夜夜摸视频网 | 国产精品二区一区二区aⅴ污介绍 | 欧美乱妇日本无乱码特黄大片 | 91精品久久久久久久久久 | 成人在线视频网站 | 女人色极品影院 | 欧美成人性生活片 | 经典一区二区 | 国产免费黄色片 | 久久国产精品久久国产精品 | 久久久久噜噜噜亚洲熟女综合 | www.波多野结衣.com | 调教一区二区三区 | 99热精品在线播放 | 国产专区在线 | 久久精品免费在线观看 | 国产第5页 | 国产黄色网 | 丰满少妇熟乱xxxxx视频 | 丰满女人又爽又紧又丰满 | 自拍偷拍99| 91系列在线观看 | 亚洲精品一二三四 | 天天视频黄| 91香蕉嫩草| 国产精品久久久久久久免费大片 | 久久精品无码专区 | 国产精品爽爽久久 | 亚洲欧美日韩网站 | 成年人爱爱视频 | 欧美三级一级片 | 中文字幕激情小说 | 一区二区精品在线 | 一级片在线免费 | 日韩精品1区2区3区 欧美一本 | 国产免费黄色网址 | 在线视频1卡二卡三卡 | 色爱综合 | 91在线| 国产一区二区中文字幕 | 新超碰在线 | 姐姐你真棒插曲快来救救我电影 | 久久作爱视频 | jizz国产免费 | 巨乳美女被爆操 | 国产精品视频一区在线观看 | 狠狠爱免费视频 | 亚洲天堂一区在线观看 | 18av在线视频 | 久久精品夜色噜噜亚洲a∨ 中文字幕av网 | 久久成人视屏 | 懂色av一区二区三区免费 | 亚洲涩视频| 国产在线精品自拍 | 久久综合亚洲色hezyo国产 | 国产一区精品久久 | 就去吻综合 | 国产字幕在线观看 | 亚洲裸体视频 | 成人欧美一区二区三区白人 | 在线免费你懂的 | 日韩精品一区二区三区不卡在线 | 91精品视频免费看 | 亚洲天堂第一页 | 亚洲日本在线观看 | 久久精品国产亚洲AV成人雅虎 | 精品无码久久久久久久久久 | 欧美老女人xx | 深夜福利91 | 日韩五月天 | xxx性视频 | 欧美精品一卡二卡 | 超碰在线中文 | 精品国产乱码久久久久久预案 | 丁香一区二区 | 亚洲一区二区三区 | 日韩一级理论片 | 国产精品免费一区二区三区都可以 | 成人乱人乱一区二区三区一级视频 | 黄色肉肉视频 | 日韩av一区二区三区四区 | 激情综合丁香五月 | 国内精品一区二区三区 | 亚洲天堂视频在线 | 欧美黑人一区二区三区 | 99精品网 | 免费黄色三级网站 | 国产精品秘入口18禁麻豆免会员 | 黑人一级大毛片 |