oh my gotto no mor outputto
This commit is contained in:
parent
4d5371be5e
commit
1e8f8d6dc9
4 changed files with 30 additions and 3 deletions
19
MetaforceInstaller.Core/Services/ApkScrapper.cs
Normal file
19
MetaforceInstaller.Core/Services/ApkScrapper.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using AlphaOmega.Debug;
|
||||
using MetaforceInstaller.Core.Models;
|
||||
|
||||
namespace MetaforceInstaller.Core.Services;
|
||||
|
||||
public static class ApkScrapper
|
||||
{
|
||||
public static ApkInfo GetApkInfo(string apkPath)
|
||||
{
|
||||
using var apk = new ApkFile(apkPath);
|
||||
if (apk is { IsValid: true, AndroidManifest: not null })
|
||||
{
|
||||
return new ApkInfo(apk.AndroidManifest.Package, apk.AndroidManifest.VersionName,
|
||||
apk.AndroidManifest.VersionCode);
|
||||
}
|
||||
|
||||
throw new Exception("Invalid APK file");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue