1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_ANDROID_BUNDLE_UTILS_H_
6 #define BASE_ANDROID_BUNDLE_UTILS_H_
10 #include "base/base_export.h"
15 // Utils to help working with android app bundles.
16 class BASE_EXPORT BundleUtils {
18 // Returns true if the current build is a bundle.
19 static bool IsBundle();
21 // Helper function asking Java to resolve a library path. This is required for
22 // resolving a module library made available via SplitCompat, rather than in
23 // its eventual fully-installed state.
24 static std::string ResolveLibraryPath(const std::string& library_name,
25 const std::string& split_name);
27 // dlopen wrapper that works for partitioned native libraries in dynamic
28 // feature modules. This routine looks up the partition's address space in a
29 // table of main library symbols, and uses it when loading the feature
30 // library. It requires |library_name| (eg. chrome_foo) to resolve the file
31 // path (which may be in an interesting location due to SplitCompat) and
32 // |partition_name| to look up the load parameters in the main library. These
33 // two values may be identical, but since the partition name is set at compile
34 // time, and the code is linked into multiple libraries (eg. Chrome vs
35 // Monochrome), they may not be.
36 static void* DlOpenModuleLibraryPartition(const std::string& library_name,
37 const std::string& partition,
38 const std::string& split_name);
41 } // namespace android
44 #endif // BASE_ANDROID_BUNDLE_UTILS_H_