Fix Android API level mapping name

This commit is contained in:
ema
2025-06-25 02:21:37 +08:00
parent 3fff4c1b2b
commit b96619c244

View File

@@ -1,4 +1,21 @@
using System.Collections.Generic; // Copyright © 2017-2025 QL-Win Contributors
//
// This file is part of QuickLook program.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.Collections.Generic;
namespace QuickLook.Plugin.AppViewer.PackageParsers.Apk; namespace QuickLook.Plugin.AppViewer.PackageParsers.Apk;
@@ -14,6 +31,11 @@ public class ApiLevel
public override string ToString() public override string ToString()
{ {
if (AndroidVersion == null || Codename == null || Release == null)
{
return $"API Level {APILevel}";
}
return $"API Level {APILevel} ({AndroidVersion} {Codename} {Release})"; return $"API Level {APILevel} ({AndroidVersion} {Codename} {Release})";
} }
@@ -27,9 +49,9 @@ public class ApiLevel
return new ApiLevel return new ApiLevel
{ {
APILevel = apiLevel, APILevel = apiLevel,
AndroidVersion = $"API Level {apiLevel}", AndroidVersion = null,
Codename = "Unknown", Codename = null,
Release = "Unknown" Release = null,
}; };
} }
@@ -40,7 +62,7 @@ public class ApiLevel
APILevel = "35", APILevel = "35",
AndroidVersion = "Android 15", AndroidVersion = "Android 15",
Codename = "VanillaIceCream", Codename = "VanillaIceCream",
Release = "开发中(2025" Release = "2025"
}, },
["34"] = new ApiLevel ["34"] = new ApiLevel
{ {