mirror of
https://github.com/openharmony/security_security_component_manager.git
synced 2026-08-24 22:51:27 -04:00
feat: support transparet for system app
Signed-off-by: Haryslee <lihao189@huawei.com>
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
#include "save_button.h"
|
||||
|
||||
#include <tuple>
|
||||
#include "ipc_skeleton.h"
|
||||
#include "sec_comp_log.h"
|
||||
#include "tokenid_kit.h"
|
||||
#include "ipc_skeleton.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Security {
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
int32_t PreRegisterSecCompProcess();
|
||||
bool IsServiceExist();
|
||||
bool LoadService();
|
||||
bool IsSystemAppCalling();
|
||||
|
||||
void FinishStartSASuccess(const sptr<IRemoteObject>& remoteObject);
|
||||
void FinishStartSAFail();
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
static int32_t PreRegisterSecCompProcess();
|
||||
static bool IsServiceExist();
|
||||
static bool LoadService();
|
||||
static bool IsSystemAppCalling();
|
||||
};
|
||||
} // namespace SecurityComponent
|
||||
} // namespace Security
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
*/
|
||||
#include "sec_comp_client.h"
|
||||
|
||||
#include "ipc_skeleton.h"
|
||||
#include "iservice_registry.h"
|
||||
#include "sec_comp_load_callback.h"
|
||||
#include "sec_comp_log.h"
|
||||
#include "sec_comp_proxy.h"
|
||||
#include "tokenid_kit.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Security {
|
||||
@@ -104,6 +106,12 @@ bool SecCompClient::VerifySavePermission(AccessToken::AccessTokenID tokenId)
|
||||
return proxy->VerifySavePermission(tokenId);
|
||||
}
|
||||
|
||||
bool SecCompClient::IsSystemAppCalling()
|
||||
{
|
||||
auto selfToken = IPCSkeleton::GetSelfTokenID();
|
||||
return Security::AccessToken::TokenIdKit::IsSystemAppByFullTokenID(selfToken);
|
||||
}
|
||||
|
||||
sptr<IRemoteObject> SecCompClient::GetEnhanceRemoteObject(bool doLoadSa)
|
||||
{
|
||||
auto proxy = GetProxy(doLoadSa);
|
||||
|
||||
@@ -159,6 +159,11 @@ bool SecCompKit::LoadService()
|
||||
{
|
||||
return SecCompClient::GetInstance().LoadService();
|
||||
}
|
||||
|
||||
bool SecCompKit::IsSystemAppCalling()
|
||||
{
|
||||
return SecCompClient::GetInstance().IsSystemAppCalling();
|
||||
}
|
||||
} // namespace SecurityComponent
|
||||
} // namespace Security
|
||||
} // namespace OHOS
|
||||
|
||||
Reference in New Issue
Block a user