mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Display supported ABIs in APK info panel
This commit is contained in:
@@ -74,6 +74,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="* " />
|
<RowDefinition Height="* " />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="1"
|
<Grid Grid.Row="1"
|
||||||
@@ -160,15 +161,31 @@
|
|||||||
Text="Searching..."
|
Text="Searching..."
|
||||||
TextTrimming="CharacterEllipsis"
|
TextTrimming="CharacterEllipsis"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
<!-- ABIs -->
|
||||||
|
<TextBlock x:Name="abisTitle"
|
||||||
|
Grid.Row="7"
|
||||||
|
Grid.Column="1"
|
||||||
|
Padding="3"
|
||||||
|
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||||
|
Text="ABIs" />
|
||||||
|
<TextBlock x:Name="abis"
|
||||||
|
Grid.Row="7"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
Padding="3"
|
||||||
|
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||||
|
Text="Searching..."
|
||||||
|
TextTrimming="CharacterEllipsis"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
<!-- MinSdkVersion -->
|
<!-- MinSdkVersion -->
|
||||||
<TextBlock x:Name="minSdkVersionTitle"
|
<TextBlock x:Name="minSdkVersionTitle"
|
||||||
Grid.Row="7"
|
Grid.Row="8"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||||
Text="MinSdkVersion" />
|
Text="MinSdkVersion" />
|
||||||
<TextBlock x:Name="minSdkVersion"
|
<TextBlock x:Name="minSdkVersion"
|
||||||
Grid.Row="7"
|
Grid.Row="8"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
@@ -178,13 +195,13 @@
|
|||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<!-- TargetSdkVersion -->
|
<!-- TargetSdkVersion -->
|
||||||
<TextBlock x:Name="targetSdkVersionTitle"
|
<TextBlock x:Name="targetSdkVersionTitle"
|
||||||
Grid.Row="8"
|
Grid.Row="9"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||||
Text="TargetSdkVersion" />
|
Text="TargetSdkVersion" />
|
||||||
<TextBlock x:Name="targetSdkVersion"
|
<TextBlock x:Name="targetSdkVersion"
|
||||||
Grid.Row="8"
|
Grid.Row="9"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
@@ -194,13 +211,13 @@
|
|||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<!-- Total Size -->
|
<!-- Total Size -->
|
||||||
<TextBlock x:Name="totalSizeTitle"
|
<TextBlock x:Name="totalSizeTitle"
|
||||||
Grid.Row="9"
|
Grid.Row="10"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||||
Text="Total Size" />
|
Text="Total Size" />
|
||||||
<TextBlock x:Name="totalSize"
|
<TextBlock x:Name="totalSize"
|
||||||
Grid.Row="9"
|
Grid.Row="10"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
@@ -208,13 +225,13 @@
|
|||||||
Text="Calculating size..." />
|
Text="Calculating size..." />
|
||||||
<!-- Last Modified -->
|
<!-- Last Modified -->
|
||||||
<TextBlock x:Name="modDateTitle"
|
<TextBlock x:Name="modDateTitle"
|
||||||
Grid.Row="10"
|
Grid.Row="11"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
Foreground="{DynamicResource WindowTextForegroundAlternative}"
|
||||||
Text="Last Modified" />
|
Text="Last Modified" />
|
||||||
<TextBlock x:Name="modDate"
|
<TextBlock x:Name="modDate"
|
||||||
Grid.Row="10"
|
Grid.Row="11"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Padding="3"
|
Padding="3"
|
||||||
@@ -223,7 +240,7 @@
|
|||||||
TextTrimming="CharacterEllipsis" />
|
TextTrimming="CharacterEllipsis" />
|
||||||
<!-- Permissions -->
|
<!-- Permissions -->
|
||||||
<GroupBox x:Name="permissionsGroupBox"
|
<GroupBox x:Name="permissionsGroupBox"
|
||||||
Grid.Row="11"
|
Grid.Row="12"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Margin="3,3,16,16"
|
Margin="3,3,16,16"
|
||||||
|
@@ -45,6 +45,7 @@ public partial class ApkInfoPanel : UserControl, IAppInfoPanel
|
|||||||
versionNameTitle.Text = TranslationHelper.Get("APP_VERSION_NAME", translationFile);
|
versionNameTitle.Text = TranslationHelper.Get("APP_VERSION_NAME", translationFile);
|
||||||
versionCodeTitle.Text = TranslationHelper.Get("APP_VERSION_CODE", translationFile);
|
versionCodeTitle.Text = TranslationHelper.Get("APP_VERSION_CODE", translationFile);
|
||||||
packageNameTitle.Text = TranslationHelper.Get("PACKAGE_NAME", translationFile);
|
packageNameTitle.Text = TranslationHelper.Get("PACKAGE_NAME", translationFile);
|
||||||
|
abisTitle.Text = TranslationHelper.Get("ABI", translationFile);
|
||||||
minSdkVersionTitle.Text = TranslationHelper.Get("APP_MIN_SDK_VERSION", translationFile);
|
minSdkVersionTitle.Text = TranslationHelper.Get("APP_MIN_SDK_VERSION", translationFile);
|
||||||
targetSdkVersionTitle.Text = TranslationHelper.Get("APP_TARGET_SDK_VERSION", translationFile);
|
targetSdkVersionTitle.Text = TranslationHelper.Get("APP_TARGET_SDK_VERSION", translationFile);
|
||||||
totalSizeTitle.Text = TranslationHelper.Get("TOTAL_SIZE", translationFile);
|
totalSizeTitle.Text = TranslationHelper.Get("TOTAL_SIZE", translationFile);
|
||||||
@@ -70,6 +71,7 @@ public partial class ApkInfoPanel : UserControl, IAppInfoPanel
|
|||||||
applicationName.Text = apkInfo.Label;
|
applicationName.Text = apkInfo.Label;
|
||||||
versionName.Text = apkInfo.VersionName;
|
versionName.Text = apkInfo.VersionName;
|
||||||
versionCode.Text = apkInfo.VersionCode;
|
versionCode.Text = apkInfo.VersionCode;
|
||||||
|
abis.Text = string.Join(", ", apkInfo.ABIs ?? []);
|
||||||
packageName.Text = apkInfo.PackageName;
|
packageName.Text = apkInfo.PackageName;
|
||||||
minSdkVersion.Text = apkInfo.MinSdkVersion;
|
minSdkVersion.Text = apkInfo.MinSdkVersion;
|
||||||
targetSdkVersion.Text = apkInfo.TargetSdkVersion;
|
targetSdkVersion.Text = apkInfo.TargetSdkVersion;
|
||||||
|
@@ -61,4 +61,6 @@ public class ApkInfo
|
|||||||
public List<string> Densities { get; set; } = [];
|
public List<string> Densities { get; set; } = [];
|
||||||
|
|
||||||
public string LaunchableActivity { get; set; }
|
public string LaunchableActivity { get; set; }
|
||||||
|
|
||||||
|
public string[] ABIs { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,9 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using ICSharpCode.SharpZipLib.Zip;
|
using ICSharpCode.SharpZipLib.Zip;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -24,6 +27,8 @@ namespace QuickLook.Plugin.AppViewer.PackageParsers.Apk;
|
|||||||
public static class ApkParser
|
public static class ApkParser
|
||||||
{
|
{
|
||||||
public static ApkInfo Parse(string path)
|
public static ApkInfo Parse(string path)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
using var zip = new ZipFile(path);
|
using var zip = new ZipFile(path);
|
||||||
|
|
||||||
@@ -52,6 +57,33 @@ public static class ApkParser
|
|||||||
using var s = new BinaryReader(zip.GetInputStream(entry));
|
using var s = new BinaryReader(zip.GetInputStream(entry));
|
||||||
info.Logo = s.ReadBytes((int)entry.Size);
|
info.Logo = s.ReadBytes((int)entry.Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var abiSet = new HashSet<string>();
|
||||||
|
|
||||||
|
foreach (ZipEntry entry in zip)
|
||||||
|
{
|
||||||
|
if (entry.IsFile && entry.Name.StartsWith("lib/"))
|
||||||
|
{
|
||||||
|
var relativePath = entry.Name.Substring("lib/".Length);
|
||||||
|
int slashIndex = relativePath.IndexOf('/');
|
||||||
|
|
||||||
|
if (slashIndex > 0)
|
||||||
|
{
|
||||||
|
string abi = relativePath.Substring(0, slashIndex);
|
||||||
|
abiSet.Add(abi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
info.ABIs = [.. abiSet];
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApkInfo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ public class Plugin : IViewer
|
|||||||
{
|
{
|
||||||
context.PreferredSize = Path.GetExtension(ConfirmPath(path)).ToLower() switch
|
context.PreferredSize = Path.GetExtension(ConfirmPath(path)).ToLower() switch
|
||||||
{
|
{
|
||||||
".apk" => new Size { Width = 560, Height = 505 },
|
".apk" => new Size { Width = 560, Height = 510 },
|
||||||
".ipa" => new Size { Width = 560, Height = 510 },
|
".ipa" => new Size { Width = 560, Height = 510 },
|
||||||
".hap" => new Size { Width = 560, Height = 500 },
|
".hap" => new Size { Width = 560, Height = 500 },
|
||||||
".msi" => new Size { Width = 560, Height = 230 },
|
".msi" => new Size { Width = 560, Height = 230 },
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
<LAST_MODIFIED>Last Modified</LAST_MODIFIED>
|
<LAST_MODIFIED>Last Modified</LAST_MODIFIED>
|
||||||
<PUBLISHER>Publisher</PUBLISHER>
|
<PUBLISHER>Publisher</PUBLISHER>
|
||||||
<CAPABILITIES>Capabilities</CAPABILITIES>
|
<CAPABILITIES>Capabilities</CAPABILITIES>
|
||||||
|
<ABI>ABIs</ABI>
|
||||||
<APP_NAME>Application</APP_NAME>
|
<APP_NAME>Application</APP_NAME>
|
||||||
<APP_VERSION>Version</APP_VERSION>
|
<APP_VERSION>Version</APP_VERSION>
|
||||||
<APP_VERSION_NAME>Version Name</APP_VERSION_NAME>
|
<APP_VERSION_NAME>Version Name</APP_VERSION_NAME>
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
<LAST_MODIFIED>Modificado em</LAST_MODIFIED>
|
<LAST_MODIFIED>Modificado em</LAST_MODIFIED>
|
||||||
<PUBLISHER>Editora</PUBLISHER>
|
<PUBLISHER>Editora</PUBLISHER>
|
||||||
<CAPABILITIES>Recursos</CAPABILITIES>
|
<CAPABILITIES>Recursos</CAPABILITIES>
|
||||||
|
<ABI>ABIs</ABI>
|
||||||
<APP_NAME>Nome do aplicativo</APP_NAME>
|
<APP_NAME>Nome do aplicativo</APP_NAME>
|
||||||
<APP_VERSION>Versão</APP_VERSION>
|
<APP_VERSION>Versão</APP_VERSION>
|
||||||
<APP_VERSION_NAME>Nome da versão</APP_VERSION_NAME>
|
<APP_VERSION_NAME>Nome da versão</APP_VERSION_NAME>
|
||||||
@@ -73,6 +75,7 @@
|
|||||||
<LAST_MODIFIED>修改时间</LAST_MODIFIED>
|
<LAST_MODIFIED>修改时间</LAST_MODIFIED>
|
||||||
<PUBLISHER>发布者</PUBLISHER>
|
<PUBLISHER>发布者</PUBLISHER>
|
||||||
<CAPABILITIES>功能</CAPABILITIES>
|
<CAPABILITIES>功能</CAPABILITIES>
|
||||||
|
<ABI>支持的 ABI</ABI>
|
||||||
<APP_NAME>应用名称</APP_NAME>
|
<APP_NAME>应用名称</APP_NAME>
|
||||||
<APP_VERSION>版本</APP_VERSION>
|
<APP_VERSION>版本</APP_VERSION>
|
||||||
<APP_VERSION_NAME>版本名称</APP_VERSION_NAME>
|
<APP_VERSION_NAME>版本名称</APP_VERSION_NAME>
|
||||||
@@ -105,6 +108,7 @@
|
|||||||
<LAST_MODIFIED>修改時間</LAST_MODIFIED>
|
<LAST_MODIFIED>修改時間</LAST_MODIFIED>
|
||||||
<PUBLISHER>發行者</PUBLISHER>
|
<PUBLISHER>發行者</PUBLISHER>
|
||||||
<CAPABILITIES>功能</CAPABILITIES>
|
<CAPABILITIES>功能</CAPABILITIES>
|
||||||
|
<ABI>支援的 ABI</ABI>
|
||||||
<APP_NAME>程式名稱</APP_NAME>
|
<APP_NAME>程式名稱</APP_NAME>
|
||||||
<APP_VERSION>版本</APP_VERSION>
|
<APP_VERSION>版本</APP_VERSION>
|
||||||
<APP_VERSION_NAME>版本名稱</APP_VERSION_NAME>
|
<APP_VERSION_NAME>版本名稱</APP_VERSION_NAME>
|
||||||
@@ -137,6 +141,7 @@
|
|||||||
<LAST_MODIFIED>更新日時</LAST_MODIFIED>
|
<LAST_MODIFIED>更新日時</LAST_MODIFIED>
|
||||||
<PUBLISHER>発行元</PUBLISHER>
|
<PUBLISHER>発行元</PUBLISHER>
|
||||||
<CAPABILITIES>機能</CAPABILITIES>
|
<CAPABILITIES>機能</CAPABILITIES>
|
||||||
|
<ABI>対応ABI</ABI>
|
||||||
<APP_NAME>アプリケーションネーム</APP_NAME>
|
<APP_NAME>アプリケーションネーム</APP_NAME>
|
||||||
<APP_VERSION>バージョン</APP_VERSION>
|
<APP_VERSION>バージョン</APP_VERSION>
|
||||||
<APP_VERSION_NAME>バージョン名</APP_VERSION_NAME>
|
<APP_VERSION_NAME>バージョン名</APP_VERSION_NAME>
|
||||||
@@ -169,6 +174,7 @@
|
|||||||
<LAST_MODIFIED>Zuletzt geändert</LAST_MODIFIED>
|
<LAST_MODIFIED>Zuletzt geändert</LAST_MODIFIED>
|
||||||
<PUBLISHER>Herausgeber</PUBLISHER>
|
<PUBLISHER>Herausgeber</PUBLISHER>
|
||||||
<CAPABILITIES>Funktionen</CAPABILITIES>
|
<CAPABILITIES>Funktionen</CAPABILITIES>
|
||||||
|
<ABI>Unterstützte ABIs</ABI>
|
||||||
<APP_NAME>Anwendung</APP_NAME>
|
<APP_NAME>Anwendung</APP_NAME>
|
||||||
<APP_VERSION>Version</APP_VERSION>
|
<APP_VERSION>Version</APP_VERSION>
|
||||||
<APP_VERSION_NAME>Bezeichnung der Version</APP_VERSION_NAME>
|
<APP_VERSION_NAME>Bezeichnung der Version</APP_VERSION_NAME>
|
||||||
|
Reference in New Issue
Block a user