MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetBundleVersion

Function GetBundleVersion

rEFIt_UEFI/Platform/Settings.cpp:3023–3053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3021}
3022
3023XStringW GetBundleVersion(const XStringW& FullName)
3024{
3025 EFI_STATUS Status;
3026 XStringW CFBundleVersion;
3027 XStringW InfoPlistPath;
3028 CHAR8* InfoPlistPtr = NULL;
3029 TagDict* InfoPlistDict = NULL;
3030 const TagStruct* Prop = NULL;
3031 UINTN Size;
3032 InfoPlistPath = SWPrintf("%ls\\%ls", FullName.wc_str(), L"Contents\\Info.plist");
3033 Status = egLoadFile(SelfRootDir, InfoPlistPath.wc_str(), (UINT8**)&InfoPlistPtr, &Size);
3034 if (EFI_ERROR(Status)) {
3035 InfoPlistPath = SWPrintf("%ls\\%ls", FullName.wc_str(), L"Info.plist");
3036 Status = egLoadFile(SelfRootDir, FullName.wc_str(), (UINT8**)&InfoPlistPtr, &Size);
3037 }
3038 if(!EFI_ERROR(Status)) {
3039 //DBG("about to parse xml file %ls\n", InfoPlistPath.wc_str());
3040 Status = ParseXML(InfoPlistPtr, &InfoPlistDict, Size);
3041 if(!EFI_ERROR(Status) && (InfoPlistDict != nullptr)) {
3042 Prop = InfoPlistDict->propertyForKey("CFBundleVersion");
3043 if (Prop != NULL && Prop->isString() && Prop->getString()->stringValue().notEmpty()) {
3044 CFBundleVersion = SWPrintf("%s", Prop->getString()->stringValue().c_str());
3045 }
3046 }
3047 }
3048 if (InfoPlistPtr) {
3049 FreePool(InfoPlistPtr);
3050 }
3051 if ( InfoPlistDict ) InfoPlistDict->FreeTag();
3052 return CFBundleVersion;
3053}
3054
3055VOID GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath)
3056{

Callers 1

GetListOfInjectKextFunction · 0.85

Calls 11

SWPrintfFunction · 0.85
egLoadFileFunction · 0.85
ParseXMLFunction · 0.85
propertyForKeyMethod · 0.80
FreePoolFunction · 0.50
wc_strMethod · 0.45
isStringMethod · 0.45
notEmptyMethod · 0.45
getStringMethod · 0.45
c_strMethod · 0.45
FreeTagMethod · 0.45

Tested by

no test coverage detected