IL2CPP: Add statusCallback to LoadFromPackage and LoadFromFile
This commit is contained in:
@@ -522,18 +522,18 @@ namespace Il2CppInspector
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load from an AAB, 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, LoadOptions loadOptions = null, bool silent = false) {
|
public static List<Il2CppInspector> LoadFromPackage(IEnumerable<string> packageFiles, LoadOptions loadOptions = null, EventHandler<string> statusCallback = null, bool silent = false) {
|
||||||
var streams = GetStreamsFromPackage(packageFiles, silent);
|
var streams = GetStreamsFromPackage(packageFiles, silent);
|
||||||
if (!streams.HasValue)
|
if (!streams.HasValue)
|
||||||
return null;
|
return null;
|
||||||
return LoadFromStream(streams.Value.Binary, streams.Value.Metadata, loadOptions, silent: silent);
|
return LoadFromStream(streams.Value.Binary, streams.Value.Metadata, loadOptions, statusCallback, silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load from a binary file and metadata file
|
// Load from a binary file and metadata file
|
||||||
public static List<Il2CppInspector> LoadFromFile(string binaryFile, string metadataFile, LoadOptions loadOptions = null, bool silent = false)
|
public static List<Il2CppInspector> LoadFromFile(string binaryFile, string metadataFile, LoadOptions loadOptions = null, EventHandler<string> statusCallback = null, bool silent = false)
|
||||||
=> LoadFromStream(new FileStream(binaryFile, FileMode.Open, FileAccess.Read, FileShare.Read),
|
=> LoadFromStream(new FileStream(binaryFile, FileMode.Open, FileAccess.Read, FileShare.Read),
|
||||||
new MemoryStream(File.ReadAllBytes(metadataFile)),
|
new MemoryStream(File.ReadAllBytes(metadataFile)),
|
||||||
loadOptions, silent: silent);
|
loadOptions, statusCallback, silent);
|
||||||
|
|
||||||
// Load from a binary stream and metadata stream
|
// Load from a binary stream and metadata stream
|
||||||
// Must be a seekable stream otherwise we catch a System.IO.NotSupportedException
|
// Must be a seekable stream otherwise we catch a System.IO.NotSupportedException
|
||||||
|
|||||||
Reference in New Issue
Block a user