* Java->C++ entry point for getting all hashes of loaded modules. * * Parameters: * - clazz: The Java class reference (unused). * - runtimeHandle: The java handle to the runtime. * * Returns: * - A jobject representing a Java array of bundle names and their corresponding hash. * * Notes: * - Iterates over all loaded bundle names and retrieves their hash. * - The result is converted to a
| 1687 | * - The result is converted to a jobject. As a double nested array [[bundleName, hash]]. |
| 1688 | */ |
| 1689 | jobject ValdiAndroid::NativeBridge::getAllModuleHashes( // NOLINT |
| 1690 | fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT |
| 1691 | jlong runtimeHandle) { |
| 1692 | Valdi::Ref<Valdi::ValueArray> retval; |
| 1693 | |
| 1694 | auto runtime = getRuntime(runtimeHandle); |
| 1695 | if (runtime != nullptr) { |
| 1696 | auto bundles = runtime->getResourceManager().getAllInitializedBundles(); |
| 1697 | Valdi::ValueArrayBuilder builder; |
| 1698 | for (const auto& [bundleName, bundle] : bundles) { |
| 1699 | auto hash = bundle->getHash(); |
| 1700 | if (hash) { |
| 1701 | auto bundleNameAndHash = Valdi::ValueArray::make(2); |
| 1702 | bundleNameAndHash->emplace(0, Valdi::Value(bundleName)); |
| 1703 | bundleNameAndHash->emplace(1, Valdi::Value(hash.moveValue())); |
| 1704 | builder.append(Valdi::Value(bundleNameAndHash)); |
| 1705 | } |
| 1706 | } |
| 1707 | retval = builder.build(); |
| 1708 | } |
| 1709 | return ValdiAndroid::toJavaObject(ValdiAndroid::JavaEnv(), retval).releaseObject(); |
| 1710 | } |
| 1711 | |
| 1712 | jobject ValdiAndroid::NativeBridge::dumpMemoryStatistics( // NOLINT |
| 1713 | fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT |
nothing calls this directly
no test coverage detected