Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae8223b3 authored by Victor Hsieh's avatar Victor Hsieh Committed by android-build-merger
Browse files

Merge "Installd: new interface to enable apk verity" am: 33f00971 am: 4105db66

am: cc1c081d

Change-Id: Iea8daf7c546b4a8bbbbd28fb7b95f1ff1756b23b
parents c4257d27 cc1c081d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@ static constexpr const char *kIdMapPath = "/system/bin/idmap";
static constexpr const char* IDMAP_PREFIX = "/data/resource-cache/";
static constexpr const char* IDMAP_SUFFIX = "@idmap";

static constexpr const char* kPropApkVerityMode = "ro.apk_verity.mode";

// NOTE: keep in sync with Installer
static constexpr int FLAG_CLEAR_CACHE_ONLY = 1 << 8;
static constexpr int FLAG_CLEAR_CODE_CACHE_ONLY = 1 << 9;
@@ -2356,6 +2358,17 @@ binder::Status InstalldNativeService::deleteOdex(const std::string& apkPath,
    return res ? ok() : error();
}

binder::Status InstalldNativeService::installApkVerity(const std::string& /*filePath*/,
        const ::android::base::unique_fd& /*verityInput*/) {
    ENFORCE_UID(AID_SYSTEM);
    if (!android::base::GetBoolProperty(kPropApkVerityMode, false)) {
        return ok();
    }
    // TODO: Append verity to filePath then issue ioctl to enable
    // it and hide the tree.  See b/30972906.
    return error("not implemented yet");
}

binder::Status InstalldNativeService::reconcileSecondaryDexFile(
        const std::string& dexPath, const std::string& packageName, int32_t uid,
        const std::vector<std::string>& isas, const std::unique_ptr<std::string>& volumeUuid,
+2 −0
Original line number Diff line number Diff line
@@ -117,6 +117,8 @@ public:
            const std::string& outputPath);
    binder::Status deleteOdex(const std::string& apkPath, const std::string& instructionSet,
            const std::unique_ptr<std::string>& outputPath);
    binder::Status installApkVerity(const std::string& filePath,
            const ::android::base::unique_fd& verityInput);
    binder::Status reconcileSecondaryDexFile(const std::string& dexPath,
        const std::string& packageName, int32_t uid, const std::vector<std::string>& isa,
        const std::unique_ptr<std::string>& volumeUuid, int32_t storage_flag, bool* _aidl_return);
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ interface IInstalld {
            @utf8InCpp String outputPath);
    void deleteOdex(@utf8InCpp String apkPath, @utf8InCpp String instructionSet,
            @nullable @utf8InCpp String outputPath);
    void installApkVerity(@utf8InCpp String filePath, in FileDescriptor verityInput);

    boolean reconcileSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName,
        int uid, in @utf8InCpp String[] isas, @nullable @utf8InCpp String volume_uuid,