From ac6b317ee0201b9e85dbe63481b5e5e8b0d33865 Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Mon, 29 Jul 2013 12:12:38 +0900 Subject: [PATCH] Set packageId for efltpk Change-Id: I79f7bf746a728995b5907256c5d7cb2cb321532c Signed-off-by: Duyoung Jang --- src/app/inc/FAppPkg_PackageParser.h | 1 + src/app/package/FAppPkg_PackageParser.cpp | 35 +++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/app/inc/FAppPkg_PackageParser.h b/src/app/inc/FAppPkg_PackageParser.h index bd7d933..9c13ec0 100644 --- a/src/app/inc/FAppPkg_PackageParser.h +++ b/src/app/inc/FAppPkg_PackageParser.h @@ -153,6 +153,7 @@ private: char* __pDefaultIconType; bool __isDefaultName; + bool __isEflTpk; }; // _PackageParser } } } // Tizen::App::Package diff --git a/src/app/package/FAppPkg_PackageParser.cpp b/src/app/package/FAppPkg_PackageParser.cpp index 6d2e9a5..619f6a7 100755 --- a/src/app/package/FAppPkg_PackageParser.cpp +++ b/src/app/package/FAppPkg_PackageParser.cpp @@ -488,6 +488,7 @@ _PackageParser::_PackageParser(void) ,__pAppInfo(null) ,__pDefaultIconType(null) ,__isDefaultName(false) +,__isEflTpk(false) { } @@ -745,6 +746,22 @@ _PackageParser::OnIdValue(const char* pCharacters) SysLog(NID_APP, "Id = [%s]", pCharacters); __pPackageInfoImpl->SetId(pCharacters); + RegularExpression regularExpression; + String pattern(L"([a-zA-Z0-9]{10})"); + result r = regularExpression.Construct(pattern); + SysTryReturn(NID_APP, !IsFailed(r), false, E_SYSTEM, "regularExpression.Construct() failed."); + + PackageId packageId = pCharacters; + if (regularExpression.Match(packageId, true) == true) + { + AppLog("[%ls] is tizen native application.", packageId.GetPointer()); + } + else + { + AppLog("[%ls] is not tizen native application.", packageId.GetPointer()); + __isEflTpk = true; + } + return true; } @@ -948,7 +965,14 @@ _PackageParser::ParseAppAttribute(_PackageXmlAttribute* pAttr, bool isUiApp) pPackageAppInfoImpl->SetAppName(pName); AppId appId = __pPackageInfoImpl->GetId() + L"." + pName; - pPackageAppInfoImpl->SetAppId(appId); + if (__isEflTpk == false) + { + pPackageAppInfoImpl->SetAppId(appId); + } + else + { + pPackageAppInfoImpl->SetAppId(__pPackageInfoImpl->GetId()); + } char* pMain = pAttr->Find("Main"); if (pMain) @@ -957,7 +981,14 @@ _PackageParser::ParseAppAttribute(_PackageXmlAttribute* pAttr, bool isUiApp) if (strcasecmp(pMain, "True") == 0) { __isDefaultName = true; - __pPackageInfoImpl->SetMainAppId(appId); + if (__isEflTpk == false) + { + __pPackageInfoImpl->SetMainAppId(appId); + } + else + { + __pPackageInfoImpl->SetMainAppId(__pPackageInfoImpl->GetId()); + } pPackageAppInfoImpl->SetMainApp(true); } } -- 2.7.4