1 /* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "accesstoken_kit.h" 17 #include "tokenid_kit.h" 18 19 namespace OHOS::Security::AccessToken { GetTokenType(AccessTokenID tokenID)20ATokenTypeEnum AccessTokenKit::GetTokenType(AccessTokenID tokenID) 21 { 22 return TOKEN_HAP; 23 } 24 GetHapTokenInfo(AccessTokenID callerToken,HapTokenInfo & hapTokenInfoRes)25int AccessTokenKit::GetHapTokenInfo(AccessTokenID callerToken, HapTokenInfo &hapTokenInfoRes) 26 { 27 hapTokenInfoRes.bundleName = "com.example.app2backup"; 28 return 0; 29 } 30 VerifyAccessToken(AccessTokenID tokenID,const std::string & permissionName)31int AccessTokenKit::VerifyAccessToken(AccessTokenID tokenID, const std::string &permissionName) 32 { 33 return 0; 34 } 35 IsSystemAppByFullTokenID(uint64_t tokenId)36bool TokenIdKit::IsSystemAppByFullTokenID(uint64_t tokenId) 37 { 38 return true; 39 } 40 } // namespace OHOS::Security::AccessToken 41