CLI/GUI: Support AAB files
This commit is contained in:
@@ -20,10 +20,10 @@ namespace Il2CppInspector.CLI
|
||||
{
|
||||
private class Options
|
||||
{
|
||||
[Option('i', "bin", Required = false, Separator = ',', HelpText = "IL2CPP binary, APK or IPA input file(s) (single file or comma-separated list for split APKs)", Default = new[] { "libil2cpp.so" })]
|
||||
[Option('i', "bin", Required = false, Separator = ',', HelpText = "IL2CPP binary, APK, AAB or IPA input file(s) (single file or comma-separated list for split APKs)", Default = new[] { "libil2cpp.so" })]
|
||||
public IEnumerable<string> BinaryFiles { get; set; }
|
||||
|
||||
[Option('m', "metadata", Required = false, HelpText = "IL2CPP metadata file input (ignored for APK/IPA)", Default = "global-metadata.dat")]
|
||||
[Option('m', "metadata", Required = false, HelpText = "IL2CPP metadata file input (ignored for APK/AAB/IPA)", Default = "global-metadata.dat")]
|
||||
public string MetadataFile { get; set; }
|
||||
|
||||
[Option('c', "cs-out", Required = false, HelpText = "C# output file (when using single-file layout) or path (when using per namespace, assembly or class layout)", Default = "types.cs")]
|
||||
|
||||
@@ -381,7 +381,7 @@ namespace Il2CppInspector
|
||||
}
|
||||
|
||||
#region Loaders
|
||||
// Finds and extracts the metadata and IL2CPP binary from one or more APK files, or one IPA file into MemoryStreams
|
||||
// Finds and extracts the metadata and IL2CPP binary from one or more APK files, or one AAB or IPA file into MemoryStreams
|
||||
// Returns null if package not recognized or does not contain an IL2CPP application
|
||||
public static (MemoryStream Metadata, MemoryStream Binary)? GetStreamsFromPackage(IEnumerable<string> packageFiles, bool silent = false) {
|
||||
try {
|
||||
@@ -401,8 +401,8 @@ namespace Il2CppInspector
|
||||
// There are three possibilities:
|
||||
// - A single IPA file containing global-metadata.dat and a single binary supporting one or more architectures
|
||||
// (we return the binary inside the IPA to be loaded by MachOReader for single arch or UBReader for multi arch)
|
||||
// - A single APK file containing global-metadata.dat and one or more binaries (one per architecture)
|
||||
// (we return the entire APK to be loaded by APKReader)
|
||||
// - A single APK or AAB file containing global-metadata.dat and one or more binaries (one per architecture)
|
||||
// (we return the entire APK or AAB to be loaded by APKReader or AABReader)
|
||||
// - Multiple APK files, one of which contains global-metadadata.dat and the others contain one binary each
|
||||
// (we return all of the binaries re-packed in memory to a new Zip file, to be loaded by APKReader)
|
||||
foreach (var file in packageFiles) {
|
||||
@@ -492,7 +492,7 @@ namespace Il2CppInspector
|
||||
}
|
||||
}
|
||||
|
||||
// Load from an IPA or one or more APK files
|
||||
// Load from an AAB, IPA or one or more APK files
|
||||
public static List<Il2CppInspector> LoadFromPackage(IEnumerable<string> packageFiles, bool silent = false) {
|
||||
var streams = GetStreamsFromPackage(packageFiles, silent);
|
||||
if (!streams.HasValue)
|
||||
|
||||
@@ -451,7 +451,7 @@
|
||||
<TextBlock TextAlignment="Center">
|
||||
<TextBlock FontSize="22">Option 2</TextBlock>
|
||||
<LineBreak/>
|
||||
<TextBlock>Select or drag & drop one or more APK files or an IPA file</TextBlock>
|
||||
<TextBlock>Select or drag & drop one or more APK files, an AAB or IPA file</TextBlock>
|
||||
<LineBreak/>
|
||||
<TextBlock FontSize="16">Encrypted IPA files are not supported</TextBlock>
|
||||
</TextBlock>
|
||||
|
||||
@@ -137,11 +137,11 @@ namespace Il2CppInspectorGUI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Select APK or IPA package files
|
||||
/// Select APK, AAB or IPA package files
|
||||
/// </summary>
|
||||
private async void BtnSelectPackageFile_OnClick(object sender, RoutedEventArgs e) {
|
||||
var openFileDialog = new OpenFileDialog {
|
||||
Filter = "Android/iOS Application Package (*.apk;*.ipa;*.zip)|*.apk;*.ipa;*.zip|All files (*.*)|*.*",
|
||||
Filter = "Android/iOS Application Package (*.apk;*.aab;*.ipa;*.zip)|*.apk;*.aab;*.ipa;*.zip|All files (*.*)|*.*",
|
||||
CheckFileExists = true,
|
||||
Multiselect = true
|
||||
};
|
||||
@@ -545,14 +545,14 @@ namespace Il2CppInspectorGUI
|
||||
string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
|
||||
|
||||
if (grdFirstPage.Visibility == Visibility.Visible) {
|
||||
// Metadata or APK/IPA
|
||||
// Metadata or APK/AAB/IPA
|
||||
if (files.Length == 1) {
|
||||
switch (files[0].ToLower()) {
|
||||
case var s when s.EndsWith(".dat"):
|
||||
await LoadMetadataAsync(s);
|
||||
break;
|
||||
|
||||
case var s when s.EndsWith(".apk") || s.EndsWith(".ipa") || s.EndsWith(".zip"):
|
||||
case var s when s.EndsWith(".apk") || s.EndsWith(".aab") || s.EndsWith(".ipa") || s.EndsWith(".zip"):
|
||||
await LoadPackageAsync(s);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ You can read more about IL2CPP in my series [IL2CPP Reverse Engineering](https:/
|
||||
File format and architecture support:
|
||||
|
||||
* Supports ELF (Android .so), PE (Windows .exe), Mach-O (Apple iOS/Mac), Universal Binary (Fat Mach-O) and FSELF (PlayStation 4 .prx/.sprx) file formats
|
||||
* Also supports single and split APK (Android) and decrypted IPA (iOS) application package files as input
|
||||
* Also supports single and split APK (Android), AAB (Android App Bundle) and decrypted IPA (iOS) application package files as input
|
||||
* 32-bit and 64-bit support for all file formats
|
||||
* Supports ARMv7, Thumb-2, ARMv8 (A64), x86 and x64 architectures regardless of file format
|
||||
* Supports applications created with Unity 5.3.0 onwards (full IL2CPP version table below)
|
||||
@@ -109,9 +109,9 @@ Run `Il2CppInspector.exe` at the command prompt.
|
||||
File format and architecture are automatically detected.
|
||||
|
||||
```
|
||||
-i, --bin (Default: libil2cpp.so) IL2CPP binary, APK or IPA input file(s) (single file or comma-separated list for split APKs)
|
||||
-i, --bin (Default: libil2cpp.so) IL2CPP binary, APK, AAB or IPA input file(s) (single file or comma-separated list for split APKs)
|
||||
|
||||
-m, --metadata (Default: global-metadata.dat) IL2CPP metadata file input (ignored for APK/IPA)
|
||||
-m, --metadata (Default: global-metadata.dat) IL2CPP metadata file input (ignored for APK/AAB/IPA)
|
||||
|
||||
-c, --cs-out (Default: types.cs) C# output file (when using single-file layout) or path (when using per namespace, assembly or class layout)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user