blob: f29964838ead864bf96cac34da626593552b6e75 [file] [log] [blame]
Dario Freniaeb233c2018-08-28 12:48:42 +01001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_APEXD_APEX_MANIFEST_H_
18#define ANDROID_APEXD_APEX_MANIFEST_H_
19
Mohammad Samiul Islambd6ab0f2019-06-20 15:55:27 +010020#include <android-base/result.h>
21
Abhijeet Kaur216e36c2019-01-04 10:15:01 +000022#include "apex_manifest.pb.h"
Dario Freniaeb233c2018-08-28 12:48:42 +010023
Jiyong Park69c0f112018-11-22 20:38:05 +090024#include <string>
Andreas Gampeeae47842018-10-19 11:53:48 -070025
Abhijeet Kaur216e36c2019-01-04 10:15:01 +000026using ::apex::proto::ApexManifest;
27
Dario Freniaeb233c2018-08-28 12:48:42 +010028namespace android {
29namespace apex {
Abhijeet Kaur216e36c2019-01-04 10:15:01 +000030// Parses and validates APEX manifest.
Mohammad Samiul Islambd6ab0f2019-06-20 15:55:27 +010031android::base::Result<ApexManifest> ParseManifest(const std::string& content);
Abhijeet Kaur216e36c2019-01-04 10:15:01 +000032// Returns package id of an ApexManifest
33std::string GetPackageId(const ApexManifest& apex_manifest);
Nikita Ioffe264c4212019-09-13 16:30:17 +010034// Reads and parses APEX manifest from the file on disk.
35android::base::Result<ApexManifest> ReadManifest(const std::string& path);
Dario Freniaeb233c2018-08-28 12:48:42 +010036} // namespace apex
37} // namespace android
38
39#endif // ANDROID_APEXD_APEX_MANIFEST_H_