資源簡介
C#解析ipa,讀取App名稱、版本信息、開發者賬號等
完整demo,可直接運行。
C#解析ios安裝包。C#解析ios安裝包。C#解析ios安裝包。
代碼片段和文件信息
using?ICSharpCode.SharpZipLib.Zip;
using?PList;
using?System;
using?System.Collections.Generic;
using?System.IO;
using?System.Linq;
using?System.Text;
using?System.Web;
namespace?ReadIpa
{
????public?static?class?Common
????{
????????///?
????????///?解壓ipa文件提取出plist返回plist地址
????????///?
????????///?ipa文件
????????///?解壓文件位置??/upload/zipplist/???appname/Info.plist
????????///?
????????public?static?string?unzipFileIOS(String?filePath?string?JyPath)
????????{
????????????string?copyPlistPath?=?““;
????????????//?判斷文件是否是ipa文件
????????????if?(Path.GetExtension(filePath).Equals(“.ipa“))
????????????{
????????????????//?獲取文件名
????????????????String?appName?=?Path.GetFileNameWithoutExtension(filePath);
????????????????//?設置解壓的文件夾目錄
????????????????JyPath?=?JyPath?+?appName;
????????????????try
????????????????{
????????????????????//?獲取輸入流(ipa文件)
????????????????????ZipInputStream?s?=?new?ZipInputStream(File.OpenRead(filePath));
????????????????????//?zip實體
????????????????????ZipEntry?theEntry;
????????????????????String?infoPlistName?=?“Info.plist“;
????????????????????bool?found?=?false;
????????????????????while?((theEntry?=?s.GetNextEntry())?!=?null)
????????????????????{
????????????????????????Console.WriteLine(theEntry.Name);
????????????????????????//?文件名稱
????????????????????????//string?fileName?=?Path.GetFileName(theEntry.Name);
????????????????????????//?尋找Info.plist文件
????????????????????????if?(infoPlistName?!=?null)
????????????????????????{
????????????????????????????if?(theEntry.Name.IndexOf(“.app/Info.plist“)?>?1)
????????????????????????????{
????????????????????????????????found?=?true;
????????????????????????????????//?創建輸出目錄
????????????????????????????????if?(JyPath.Length?>?0)
????????????????????????????????{
????????????????????????????????????if?(!Directory.Exists(JyPath))
????????????????????????????????????????Directory.CreateDirectory(JyPath);
????????????????????????????????}
????????????????????????????????copyPlistPath?=?JyPath?+?“/Info.plist“;
????????????????????????????????//?文件寫入操作
????????????????????????????????using?(FileStream?streamWriter?=?File.Create(copyPlistPath))
????????????????????????????????{
????????????????????????????????????int?size?=?2048;
????????????????????????????????????byte[]?data?=?new?byte[2048];
????????????????????????????????????while?(true)
????????????????????????????????????{
????????????????????????????????????????size?=?s.Read(data?0?data.Length);
????????????????????????????????????????if?(size?>?0)
????????????????????????????????????????{
????????????????????????????????????????????streamWriter.Write(data?0?size);
????????????????????????????????????????}
????????????????????????????????????????else
????????????????????????????????????????{
????????????????????????????????????????????break;
??????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????85876??2017-09-11?09:51??ReadIpa\.vs\config\applicationhost.config
????..A..H.?????88576??2017-09-11?10:22??ReadIpa\.vs\ReadIpa\v14\.suo
?????文件?????156920??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\net40\Microsoft.ApplicationInsights.dll
?????文件?????173089??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\net40\Microsoft.ApplicationInsights.xm
?????文件?????188664??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll
?????文件?????172325??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.xm
?????文件?????154872??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\net46\Microsoft.ApplicationInsights.dll
?????文件?????170450??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\net46\Microsoft.ApplicationInsights.xm
?????文件?????148728??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\netstandard1.5\Microsoft.ApplicationInsights.dll
?????文件?????154486??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\netstandard1.5\Microsoft.ApplicationInsights.xm
?????文件?????145656??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\portable-win81+wpa81\Microsoft.ApplicationInsights.dll
?????文件?????145656??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\uap10.0\Microsoft.ApplicationInsights.dll
?????文件?????144624??2016-12-06?15:09??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\lib\wp8\Microsoft.ApplicationInsights.dll
?????文件?????535983??2017-09-11?09:52??ReadIpa\packages\Microsoft.ApplicationInsights.2.2.0\Microsoft.ApplicationInsights.2.2.0.nupkg
?????文件????1977592??2016-11-30?16:07??ReadIpa\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\lib\net40\Microsoft.AI.Agent.Intercept.dll
?????文件????1976568??2016-11-30?16:07??ReadIpa\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\lib\net45\Microsoft.AI.Agent.Intercept.dll
?????文件????1578828??2017-09-11?09:52??ReadIpa\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6.nupkg
?????文件????????746??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\content\ApplicationInsights.config.install.xdt
?????文件????????162??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\content\ApplicationInsights.config.transform
?????文件????????833??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\content\ApplicationInsights.config.uninstall.xdt
?????文件??????63240??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net40\Microsoft.AI.DependencyCollector.dll
?????文件??????49443??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net40\Microsoft.AI.DependencyCollector.xm
?????文件??????65792??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net45\Microsoft.AI.DependencyCollector.dll
?????文件??????57209??2016-12-07?11:45??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net45\Microsoft.AI.DependencyCollector.xm
?????文件??????72970??2017-09-11?09:52??ReadIpa\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\Microsoft.ApplicationInsights.DependencyCollector.2.2.0.nupkg
?????文件???????3498??2016-12-07?11:50??ReadIpa\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\content\ApplicationInsights.config.install.xdt
?????文件????????162??2016-12-07?11:50??ReadIpa\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\content\ApplicationInsights.config.transform
?????文件???????1059??2016-12-07?11:50??ReadIpa\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\content\ApplicationInsights.config.uninstall.xdt
?????文件?????132360??2016-12-07?11:50??ReadIpa\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\lib\net40\Microsoft.AI.PerfCounterCollector.dll
?????文件?????130312??2016-12-07?11:50??ReadIpa\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\lib\net45\Microsoft.AI.PerfCounterCollector.dll
............此處省略301個文件信息
評論
共有 條評論