diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 5aec200f..57d1d68c 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 001d1fbc..b0a9d4c3 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -25,7 +25,7 @@ set(OPENSSL_INCLUDE_DIR ${CPP_DIR}/include) add_library(openssl_crypto STATIC IMPORTED) -set_target_properties(openssl_crypto PROPERTIES +set_target_properties(openssl_crypto PROPERTIES IMPORTED_LOCATION ${OPENSSL_LIB_DIR}/libcrypto.a ) @@ -38,9 +38,6 @@ include_directories( ${OPENSSL_INCLUDE_DIR} ) -file(GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}") -message(STATUS "LIBRN_DIR: ${LIBRN_DIR}") - add_library( ${PACKAGE_NAME} SHARED @@ -50,27 +47,15 @@ add_library( ../cpp/decryptor.cpp ) +find_package(fbjni REQUIRED CONFIG) find_library( - LOG_LIB - log -) - -find_library( - REACT_NATIVE_JNI_LIB reactnativejni PATHS ${LIBRN_DIR} NO_CMAKE_FIND_ROOT_PATH ) -set_target_properties( - ${PACKAGE_NAME} PROPERTIES - CXX_STANDARD 17 - CXX_EXTENSIONS OFF - POSITION_INDEPENDENT_CODE ON -) - # Include directories cho target -target_include_directories(${PACKAGE_NAME} PRIVATE +target_include_directories(${PACKAGE_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}/openssl ${CPP_DIR} @@ -80,27 +65,9 @@ target_include_directories(${PACKAGE_NAME} PRIVATE target_link_libraries( ${PACKAGE_NAME} - ${LOG_LIB} ReactAndroid::jsi android openssl_crypto - z - dl + ReactAndroid::reactnative + fbjni::fbjni ) - -if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 76) - target_link_libraries( - ${PACKAGE_NAME} - ReactAndroid::reactnative - ) -else() - target_link_libraries( - ${PACKAGE_NAME} - ReactAndroid::reactnativejni - ReactAndroid::react_nativemodule_core - ) -endif() - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384") - diff --git a/android/build.gradle b/android/build.gradle index 6e403223..c94aa021 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,46 +1,44 @@ -import java.nio.file.Paths - buildscript { + ext.Keys = [ + kotlinVersion: "2.0.21", + minSdkVersion: 24, + compileSdkVersion: 36, + targetSdkVersion: 36 + ] + + ext.getExtOrDefault = { prop -> + if (rootProject.ext.has(prop)) { + return rootProject.ext.get(prop) + } + + return Keys[prop] + } + repositories { google() mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:7.2.1" + classpath "com.android.tools.build:gradle:8.7.2" + // noinspection DifferentKotlinGradleVersion + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}" } } -def isNewArchitectureEnabled() { - return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" -} apply plugin: "com.android.library" +apply plugin: "kotlin-android" +apply plugin: "com.facebook.react" -def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') } - -if (isNewArchitectureEnabled()) { - apply plugin: "com.facebook.react" +def reactNativeArchitectures() { + def value = rootProject.getProperties().get("reactNativeArchitectures") + return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } - def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } - -def getExtOrDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Keys_" + name] -} - -def getExtOrIntegerDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Keys_" + name]).toInteger() -} - -def reactNativeArchitectures() { - def value = project.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] -} - def resolveReactNativeDirectory() { def reactNativeLocation = safeExtGet("REACT_NATIVE_NODE_MODULES_DIR", null) if (reactNativeLocation != null) { @@ -66,91 +64,31 @@ def resolveReactNativeDirectory() { ) } -def REACT_NATIVE_DIR = resolveReactNativeDirectory() +def reactNativeRootDir = resolveReactNativeDirectory() def reactProperties = new Properties() -file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } +file("$reactNativeRootDir/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME") def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger() - -def found = false -def basePath = projectDir.toPath().normalize() - -// Find node_modules inside the example project -def nodeModulesDir = Paths.get(basePath.getParent().toString(), "example/node_modules") -def reactNativeDir = Paths.get(nodeModulesDir.toString(), "react-native/android") -if (!reactNativeDir.toFile().exists()) { - reactNativeDir = Paths.get(nodeModulesDir.toString(), "react-native/ReactAndroid") -} -if (nodeModulesDir.toFile().exists() && reactNativeDir.toFile().exists()) { - found = true -} - -if(!found){ - // Node's module resolution algorithm searches up to the root directory, - // after which the base path will be null - while (basePath) { - nodeModulesDir = Paths.get(basePath.toString(), "node_modules") - reactNativeDir = Paths.get(nodeModulesDir.toString(), "react-native/android") - if (nodeModulesDir.toFile().exists() && reactNativeDir.toFile().exists()) { - found = true - break; - } - basePath = basePath.getParent() - } -} - -if(!found) { - throw new GradleException( - "${project.name}: unable to locate React Native android sources. " + - "Ensure you have you installed React Native as a dependency in your project and try again.") -} - -def nodeModulesPath = nodeModulesDir.toString().replace("\\", "/") -def reactNativePath = reactNativeDir.toString().replace("\\", "/") - -def supportsNamespace() { - def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.') - def major = parsed[0].toInteger() - def minor = parsed[1].toInteger() - - // Namespace support was added in 7.3.0 - if (major == 7 && minor >= 3) { - return true - } - - return major >= 8 -} - android { - if (supportsNamespace()) { - namespace "com.reactnativekeysjsi" - } else { - sourceSets { - main { - manifest.srcFile "src/main/AndroidManifestDeprecated.xml" - } - } - } + namespace "com.reactnativekeysjsi" - ndkVersion getExtOrDefault("ndkVersion") - compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") + compileSdkVersion getExtOrDefault("compileSdkVersion") defaultConfig { - minSdkVersion getExtOrIntegerDefault("minSdkVersion") - targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() + minSdkVersion getExtOrDefault("minSdkVersion") + targetSdkVersion getExtOrDefault("targetSdkVersion") + buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true" + externalNativeBuild { cmake { - cppFlags "-fexceptions", "-frtti", "-std=c++1y", "-DONANDROID" + cppFlags "-O3 -frtti -fexceptions -Wall -fstack-protector-all" + arguments "-DANDROID_STL=c++_shared", + "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", + "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" abiFilters (*reactNativeArchitectures()) - arguments '-DANDROID_STL=c++_shared', - "-DNODE_MODULES_DIR=${nodeModulesPath}", - "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", - "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", - "-DANDROID_PAGE_SIZE_16KB=ON" } } } @@ -159,7 +97,6 @@ android { path "CMakeLists.txt" } } - packagingOptions { excludes = [ "**/libc++_shared.so", @@ -173,17 +110,11 @@ android { ] doNotStrip '**/*.so' } + buildFeatures { + buildConfig true + } buildTypes { - debug { - packagingOptions { - doNotStrip '**/*.so' - } - minifyEnabled false - debuggable true - jniDebuggable true - renderscriptDebuggable true - } release { minifyEnabled false } @@ -191,7 +122,7 @@ android { buildFeatures { prefab true } - lintOptions { + lint { disable "GradleCompatible" } @@ -199,36 +130,17 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - sourceSets { main { - if (isNewArchitectureEnabled()) { - java.srcDirs += [ - "src/newarch", - // This is needed to build Kotlin project with NewArch enabled - "${project.buildDir}/generated/source/codegen/java" - ] - } else { - java.srcDirs += ["src/oldarch"] - } + java.srcDirs += [ + // Codegen specs + "generated/java", + "generated/jni" + ] } } } -repositories { - mavenCentral() - google() -} - - dependencies { - implementation "com.facebook.react:react-native:+" -} - -if (isNewArchitectureEnabled()) { - react { - jsRootDir = file("../src/") - libraryName = "Keys" - codegenJavaPackageName = "com.reactnativekeysjsi" - } + implementation "com.facebook.react:react-android" } diff --git a/android/cpp-adapter.cpp b/android/cpp-adapter.cpp index 75cc65ea..1fb12fbb 100644 --- a/android/cpp-adapter.cpp +++ b/android/cpp-adapter.cpp @@ -1,35 +1,28 @@ #include -#include -#include "pthread.h" #include -#include -#include +#include "pthread.h" +#include #include -#include -#include - #include "androidcpp/json.hpp" + using json = nlohmann::json; -using namespace facebook::jsi; +using namespace facebook; +using namespace jsi; using namespace std; -JavaVM *java_vm; -jclass java_class; -jobject java_object; +static JavaVM *java_vm; +static jobject java_object; -std::string jstringToString(JNIEnv *env, jstring jstr) -{ +static string jstringToString(JNIEnv *env, jstring jstr) { const char *cstr = env->GetStringUTFChars(jstr, nullptr); - std::string str(cstr); + string str(cstr); env->ReleaseStringUTFChars(jstr, cstr); return str; } -// Convert Java map object to JSON string -std::string jmapToJsonString(JNIEnv *env, jobject jmap) -{ +static string jmapToJsonString(JNIEnv *env, jobject jmap) { jclass jmapClass = env->GetObjectClass(jmap); jmethodID jmapEntrySetMethod = env->GetMethodID(jmapClass, "entrySet", "()Ljava/util/Set;"); @@ -42,36 +35,28 @@ std::string jmapToJsonString(JNIEnv *env, jobject jmap) jclass jmapEntryClass = env->FindClass("java/util/Map$Entry"); jmethodID jmapEntryGetMethod = env->GetMethodID(jmapEntryClass, "getValue", "()Ljava/lang/Object;"); + jmethodID jmapEntryGetKeyMethod = env->GetMethodID(jmapEntryClass, "getKey", "()Ljava/lang/Object;"); jmethodID jtoStringMethod = env->GetMethodID(env->FindClass("java/lang/Object"), "toString", "()Ljava/lang/String;"); - // Create an empty JSON object - nlohmann::json jsonObj = nlohmann::json::object(); + json jsonObj = json::object(); - // Get the entry set of the Java map object jobject jentrySet = env->CallObjectMethod(jmap, jmapEntrySetMethod); jobject jiterator = env->CallObjectMethod(jentrySet, jsetIteratorMethod); - jmethodID jmapEntryGetKeyMethod = env->GetMethodID(jmapEntryClass, "getKey", "()Ljava/lang/Object;"); - // Iterate over the map entries and add them to the JSON object - while (env->CallBooleanMethod(jiterator, jiteratorHasNextMethod)) - { + while (env->CallBooleanMethod(jiterator, jiteratorHasNextMethod)) { jobject jentry = env->CallObjectMethod(jiterator, jiteratorNextMethod); - // Get the key object and convert it to a string jobject jkey = env->CallObjectMethod(jentry, jmapEntryGetKeyMethod); - jstring jstrKey = (jstring)env->CallObjectMethod(jkey, jtoStringMethod); - std::string strKey = jstringToString(env, jstrKey); + jstring jstrKey = (jstring) env->CallObjectMethod(jkey, jtoStringMethod); + string strKey = jstringToString(env, jstrKey); - // Get the value object and convert it to a string jobject jvalue = env->CallObjectMethod(jentry, jmapEntryGetMethod); - jstring jstrValue = (jstring)env->CallObjectMethod(jvalue, jtoStringMethod); - std::string strValue = jstringToString(env, jstrValue); + jstring jstrValue = (jstring) env->CallObjectMethod(jvalue, jtoStringMethod); + string strValue = jstringToString(env, jstrValue); - // Add the key-value pair to the JSON object jsonObj[strKey] = strValue; - // Release local references env->DeleteLocalRef(jentry); env->DeleteLocalRef(jkey); env->DeleteLocalRef(jvalue); @@ -79,170 +64,101 @@ std::string jmapToJsonString(JNIEnv *env, jobject jmap) env->DeleteLocalRef(jstrValue); } - // Release local references env->DeleteLocalRef(jentrySet); env->DeleteLocalRef(jiterator); - // Return the JSON object as a string return jsonObj.dump(); } -/** - * A simple callback function that allows us to detach current JNI Environment - * when the thread - * See https://stackoverflow.com/a/30026231 for detailed explanation - */ - -void DeferThreadDetach(JNIEnv *env) -{ - static pthread_key_t thread_key; - - // Set up a Thread Specific Data key, and a callback that - // will be executed when a thread is destroyed. - // This is only done once, across all threads, and the value - // associated with the key for any given thread will initially - // be NULL. - static auto run_once = [] - { - const auto err = pthread_key_create(&thread_key, [](void *ts_env) - { - if (ts_env) { - java_vm->DetachCurrentThread(); - } }); - if (err) - { - // Failed to create TSD key. Throw an exception if you want to. - } - return 0; - }(); - - // For the callback to actually be executed when a thread exits - // we need to associate a non-NULL value with the key on that thread. - // We can use the JNIEnv* as that value. - const auto ts_env = pthread_getspecific(thread_key); - if (!ts_env) - { - if (pthread_setspecific(thread_key, env)) - { - // Failed to set thread-specific value for key. Throw an exception if you want to. - } + +static pthread_key_t thread_key; + +static void detachThread(void *ts_env) { + if (ts_env) { + java_vm->DetachCurrentThread(); } } -/** - * Get a JNIEnv* valid for this thread, regardless of whether - * we're on a native thread or a Java thread. - * If the calling thread is not currently attached to the JVM - * it will be attached, and then automatically detached when the - * thread is destroyed. - * - * See https://stackoverflow.com/a/30026231 for detailed explanation - */ -JNIEnv *GetJniEnv() -{ +static pthread_once_t thread_key_once = PTHREAD_ONCE_INIT; + +static JNIEnv *GetJniEnv() { + pthread_once(&thread_key_once, [] { + pthread_key_create(&thread_key, detachThread); + }); + JNIEnv *env = nullptr; - // We still call GetEnv first to detect if the thread already - // is attached. This is done to avoid setting up a DetachCurrentThread - // call on a Java thread. - - // g_vm is a global. - auto get_env_result = java_vm->GetEnv((void **)&env, JNI_VERSION_1_6); - if (get_env_result == JNI_EDETACHED) - { - if (java_vm->AttachCurrentThread(&env, NULL) == JNI_OK) - { - DeferThreadDetach(env); + auto get_env_result = java_vm->GetEnv((void **) &env, JNI_VERSION_1_6); + if (get_env_result == JNI_EDETACHED) { + if (java_vm->AttachCurrentThread(&env, NULL) == JNI_OK) { + if (!pthread_getspecific(thread_key)) { + pthread_setspecific(thread_key, env); + } } - else - { - // Failed to attach thread. Throw an exception if you want to. - } - } - else if (get_env_result == JNI_EVERSION) - { - // Unsupported JNI version. Throw an exception if you want to. } return env; } -static jstring string2jstring(JNIEnv *env, const string &str) -{ - return (*env).NewStringUTF(str.c_str()); +static jstring string2jstring(JNIEnv *env, const string &str) { + return env->NewStringUTF(str.c_str()); } -void install(facebook::jsi::Runtime &jsiRuntime) -{ - auto secureFor = Function::createFromHostFunction(jsiRuntime, - PropNameID::forAscii(jsiRuntime, - "secureFor"), - 1, - [](Runtime &runtime, - const Value &thisValue, - const Value *arguments, - size_t count) -> Value - { - string key = arguments[0].getString( - runtime) - .utf8( - runtime); - - JNIEnv *jniEnv = GetJniEnv(); - - java_class = jniEnv->GetObjectClass( - java_object); - jmethodID jniMethod = jniEnv->GetStaticMethodID(java_class, "getSecureFor", "(Ljava/lang/String;)Ljava/lang/String;"); - - jstring jstr1 = string2jstring(jniEnv, key); - jobject result = jniEnv->CallStaticObjectMethod(java_class, jniMethod, jstr1); - const char* str = jniEnv->GetStringUTFChars((jstring)result, NULL); - - return Value(runtime, - String::createFromUtf8( - runtime, str)); - }); - - jsiRuntime.global().setProperty(jsiRuntime, "secureFor", move(secureFor)); - - auto publicKeys = Function::createFromHostFunction(jsiRuntime, - PropNameID::forAscii(jsiRuntime, - "publicKeys"), - 0, - [](Runtime &runtime, - const Value &thisValue, - const Value *arguments, - size_t count) -> Value - { - JNIEnv *jniEnv = GetJniEnv(); - - java_class = jniEnv->GetObjectClass( - java_object); - jmethodID get = jniEnv->GetMethodID( - java_class, "getPublicKeys", - "()Ljava/util/Map;"); - - jobject map_obj = jniEnv->CallObjectMethod(java_object, get); - - std::string jsonString = jmapToJsonString(jniEnv, map_obj); - - return Value(runtime, - String::createFromUtf8( - runtime, jsonString)); - }); - - jsiRuntime.global().setProperty(jsiRuntime, "publicKeys", move(publicKeys)); +template +static void createFunc(Runtime &jsiRuntime, const char *prop, int paramCount, NativeFunc &&func) { + auto f = Function::createFromHostFunction(jsiRuntime, + PropNameID::forAscii(jsiRuntime, prop), + paramCount, + std::forward(func)); + jsiRuntime.global().setProperty(jsiRuntime, prop, std::move(f)); } -extern "C" JNIEXPORT void JNICALL -Java_com_reactnativekeysjsi_KeysModule_nativeInstall(JNIEnv *env, jobject thiz, jlong jsi) -{ +#define CREATE_FUNCTION(prop, paramCount, block) \ + createFunc(jsiRuntime, prop, paramCount, [](Runtime &runtime, const Value &thisValue, const Value *arguments, size_t count) -> Value { block }) + +void installBindings(Runtime &jsiRuntime) { + CREATE_FUNCTION("publicKeys", 0, { + JNIEnv *jniEnv = GetJniEnv(); + jclass clazz = jniEnv->GetObjectClass(java_object); + jmethodID get = jniEnv->GetMethodID(clazz, "getPublicKeys", "()Ljava/util/Map;"); + jobject map_obj = jniEnv->CallObjectMethod(java_object, get); + std::string jsonString = jmapToJsonString(jniEnv, map_obj); + return Value(runtime, + String::createFromUtf8( + runtime, jsonString)); + }); + + CREATE_FUNCTION("secureFor", 1, { + string key = arguments[0].getString(runtime).utf8(runtime); + JNIEnv *jniEnv = GetJniEnv(); + jclass clazz = jniEnv->GetObjectClass(java_object); + jmethodID jniMethod = jniEnv->GetStaticMethodID(clazz, "getSecureFor", "(Ljava/lang/String;)Ljava/lang/String;"); + jstring jstr1 = string2jstring(jniEnv, key); + jobject result = jniEnv->CallStaticObjectMethod(clazz, jniMethod, jstr1); + const char *str = jniEnv->GetStringUTFChars((jstring) result, NULL); + return Value(runtime, + String::createFromUtf8( + runtime, str)); + }); +} + +struct RNMMKVModule : jni::JavaClass { + static constexpr auto kJavaDescriptor = "Lcom/reactnativekeysjsi/KeysModule;"; - auto runtime = reinterpret_cast(jsi); + static void registerNatives() { + javaClassStatic()->registerNatives({ + makeNativeMethod("nativeInstall", RNMMKVModule::install) + }); + } - if (runtime) - { - // example::install(*runtime); - install(*runtime); +private: + static void install(jni::alias_ref thiz, jlong jsi) { + auto runtime = reinterpret_cast(jsi); + jni::Environment::current()->GetJavaVM(&java_vm); + java_object = jni::Environment::current()->NewGlobalRef(thiz.get()); + if (runtime) { + installBindings(*runtime); + } } +}; - env->GetJavaVM(&java_vm); - java_object = env->NewGlobalRef(thiz); +JNIEXPORT jint JNI_OnLoad(JavaVM *jvm, void *) { + return jni::initialize(java_vm, [] { RNMMKVModule::registerNatives(); }); } diff --git a/android/generated/java/com/reactnativekeysjsi/NativeKeysSpec.java b/android/generated/java/com/reactnativekeysjsi/NativeKeysSpec.java new file mode 100644 index 00000000..7dded5db --- /dev/null +++ b/android/generated/java/com/reactnativekeysjsi/NativeKeysSpec.java @@ -0,0 +1,37 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateModuleJavaSpec.js + * + * @nolint + */ + +package com.reactnativekeysjsi; + +import com.facebook.proguard.annotations.DoNotStrip; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReactContextBaseJavaModule; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.turbomodule.core.interfaces.TurboModule; +import javax.annotation.Nonnull; + +public abstract class NativeKeysSpec extends ReactContextBaseJavaModule implements TurboModule { + public static final String NAME = "Keys"; + + public NativeKeysSpec(ReactApplicationContext reactContext) { + super(reactContext); + } + + @Override + public @Nonnull String getName() { + return NAME; + } + + @ReactMethod(isBlockingSynchronousMethod = true) + @DoNotStrip + public abstract boolean install(); +} diff --git a/android/generated/jni/CMakeLists.txt b/android/generated/jni/CMakeLists.txt new file mode 100644 index 00000000..b86f8ef2 --- /dev/null +++ b/android/generated/jni/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNKeysSpec/*.cpp) + +add_library( + react_codegen_RNKeysSpec + OBJECT + ${react_codegen_SRCS} +) + +target_include_directories(react_codegen_RNKeysSpec PUBLIC . react/renderer/components/RNKeysSpec) + +target_link_libraries( + react_codegen_RNKeysSpec + fbjni + jsi + # We need to link different libraries based on whether we are building rncore or not, that's necessary + # because we want to break a circular dependency between react_codegen_rncore and reactnative + reactnative +) + +target_compile_reactnative_options(react_codegen_RNKeysSpec PRIVATE) diff --git a/android/generated/jni/RNKeysSpec-generated.cpp b/android/generated/jni/RNKeysSpec-generated.cpp new file mode 100644 index 00000000..ea9194aa --- /dev/null +++ b/android/generated/jni/RNKeysSpec-generated.cpp @@ -0,0 +1,32 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateModuleJniCpp.js + */ + +#include "RNKeysSpec.h" + +namespace facebook::react { + +static facebook::jsi::Value __hostFunction_NativeKeysSpecJSI_install(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + static jmethodID cachedMethodId = nullptr; + return static_cast(turboModule).invokeJavaMethod(rt, BooleanKind, "install", "()Z", args, count, cachedMethodId); +} + +NativeKeysSpecJSI::NativeKeysSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { + methodMap_["install"] = MethodMetadata {0, __hostFunction_NativeKeysSpecJSI_install}; +} + +std::shared_ptr RNKeysSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) { + if (moduleName == "Keys") { + return std::make_shared(params); + } + return nullptr; +} + +} // namespace facebook::react diff --git a/android/generated/jni/RNKeysSpec.h b/android/generated/jni/RNKeysSpec.h new file mode 100644 index 00000000..92d0d29a --- /dev/null +++ b/android/generated/jni/RNKeysSpec.h @@ -0,0 +1,31 @@ + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateModuleJniH.js + */ + +#pragma once + +#include +#include +#include + +namespace facebook::react { + +/** + * JNI C++ class for module 'NativeKeys' + */ +class JSI_EXPORT NativeKeysSpecJSI : public JavaTurboModule { +public: + NativeKeysSpecJSI(const JavaTurboModule::InitParams ¶ms); +}; + + +JSI_EXPORT +std::shared_ptr RNKeysSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms); + +} // namespace facebook::react diff --git a/android/generated/jni/react/renderer/components/RNKeysSpec/RNKeysSpecJSI.h b/android/generated/jni/react/renderer/components/RNKeysSpec/RNKeysSpecJSI.h new file mode 100644 index 00000000..fe35e3eb --- /dev/null +++ b/android/generated/jni/react/renderer/components/RNKeysSpec/RNKeysSpecJSI.h @@ -0,0 +1,37 @@ +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateModuleH.js + */ + +#pragma once + +#include +#include + +namespace facebook::react { + + +template +class JSI_EXPORT NativeKeysCxxSpec : public TurboModule { +public: + static constexpr std::string_view kModuleName = "Keys"; + +protected: + NativeKeysCxxSpec(std::shared_ptr jsInvoker) : TurboModule(std::string{NativeKeysCxxSpec::kModuleName}, jsInvoker) { + methodMap_["install"] = MethodMetadata {.argCount = 0, .invoker = __install}; + } + +private: + static jsi::Value __install(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) { + static_assert( + bridging::getParameterCount(&T::install) == 1, + "Expected install(...) to have 1 parameters"); + return bridging::callFromJs(rt, &T::install, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule)); + } +}; + +} // namespace facebook::react diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 382aa86c..00000000 --- a/android/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -Keys_kotlinVersion=1.7.0 -Keys_minSdkVersion=21 -Keys_targetSdkVersion=31 -Keys_compileSdkVersion=31 -Keys_ndkversion=21.4.7075529 diff --git a/android/src/main/AndroidManifestDeprecated.xml b/android/src/main/AndroidManifestDeprecated.xml deleted file mode 100644 index d3db480f..00000000 --- a/android/src/main/AndroidManifestDeprecated.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/android/src/main/java/com/reactnativekeysjsi/KeysModule.java b/android/src/main/java/com/reactnativekeysjsi/KeysModule.java deleted file mode 100644 index 68cca501..00000000 --- a/android/src/main/java/com/reactnativekeysjsi/KeysModule.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.reactnativekeysjsi; - -import android.content.Context; -import android.content.res.Resources; -import android.util.Log; - -import androidx.annotation.NonNull; - -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContextBaseJavaModule; -import com.facebook.react.bridge.ReactMethod; -import com.facebook.react.bridge.JavaScriptContextHolder; - -import org.json.JSONObject; -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; - -public class KeysModule extends KeysSpec { - public static final String NAME = "Keys"; - public static ReactApplicationContext reactContext; - - private native void nativeInstall(long jsiPtr); - - public KeysModule(ReactApplicationContext reactContext) { - super(reactContext); - this.reactContext = reactContext; - } - - @Override - @NonNull - public String getName() { - return NAME; - } - - @ReactMethod(isBlockingSynchronousMethod = true) - public boolean install() { - try { - JavaScriptContextHolder jsContext = this.reactContext.getJavaScriptContextHolder(); - this.nativeInstall(jsContext.get()); - return true; - } catch (Exception exception) { - return false; - } - } - - static { - System.loadLibrary("react-native-keys"); - } - - public static native String getJniJsonStringifyData(String key); - - - public static String getSecureFor(String key) { - JSONObject jniData = null; - try { - if (jniData == null) { - String privateKey = PrivateKey.privatekey; - String jsonString = getJniJsonStringifyData(privateKey); - jniData = new JSONObject(jsonString); - } - if (jniData.has(key)) { - return jniData.getString(key); - } - } catch (Exception ignore) { - return ""; - } - return ""; - } - - public Map getPublicKeys() { - final Map constants = new HashMap<>(); - try { - int resId = this.reactContext.getResources().getIdentifier("build_config_package", "string", this.reactContext.getPackageName()); - - String className; - try { - className = this.reactContext.getString(resId); - } catch (Resources.NotFoundException e) { - className = this.reactContext.getPackageName(); - } - Class clazz = Class.forName(className + ".BuildConfig"); - - Field[] fields = clazz.getDeclaredFields(); - for (Field f : fields) { - try { - constants.put(f.getName(), f.get(null)); - } catch (IllegalAccessException e) { - Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.getName()); - } - } - } catch (ClassNotFoundException e) { - Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class"); - } - - return constants; - } - -} diff --git a/android/src/main/java/com/reactnativekeysjsi/KeysModule.kt b/android/src/main/java/com/reactnativekeysjsi/KeysModule.kt new file mode 100644 index 00000000..34ca66a1 --- /dev/null +++ b/android/src/main/java/com/reactnativekeysjsi/KeysModule.kt @@ -0,0 +1,78 @@ +package com.reactnativekeysjsi + +import android.content.res.Resources +import android.util.Log +import com.facebook.react.bridge.ReactApplicationContext +import org.json.JSONObject +import java.lang.reflect.Field + + +class KeysModule(reactContext: ReactApplicationContext) : + NativeKeysSpec(reactContext) { + private external fun nativeInstall(jsiPtr: Long) + + override fun install(): Boolean { + try { + val jsCallInvokerHolder = + reactApplicationContext.javaScriptContextHolder + this.nativeInstall(jsCallInvokerHolder!!.get()) + return true + } catch (_: Exception) { + return false + } + } + + public fun getPublicKeys(): MutableMap { + val constants: MutableMap = HashMap() + try { + val resId: Int = this.reactApplicationContext.resources + .getIdentifier("build_config_package", "string", this.reactApplicationContext.packageName) + + var className: String? + try { + className = this.reactApplicationContext.getString(resId) + } catch (_: Resources.NotFoundException) { + className = this.reactApplicationContext.packageName + } + val clazz = Class.forName("$className.BuildConfig") + + val fields: Array = clazz.declaredFields + for (f in fields) { + try { + constants.put(f.name, f.get(null)) + } catch (_: IllegalAccessException) { + Log.d("ReactNative", "ReactConfig: Could not access BuildConfig field " + f.name) + } + } + } catch (_: ClassNotFoundException) { + Log.d("ReactNative", "ReactConfig: Could not find BuildConfig class") + } + + return constants + } + companion object { + init { + System.loadLibrary("react-native-keys"); + } + const val NAME = NativeKeysSpec.NAME + + @JvmStatic + external fun getJniJsonStringifyData(key: String): String + + @JvmStatic + fun getSecureFor(key: String): String { + var jniData: JSONObject? = null + try { + val privateKey = PrivateKey.privatekey + val jsonString = getJniJsonStringifyData(privateKey) + jniData = JSONObject(jsonString) + if (jniData.has(key)) { + return jniData.getString(key) + } + } catch (ignore: java.lang.Exception) { + return "" + } + return "" + } + } +} diff --git a/android/src/main/java/com/reactnativekeysjsi/KeysPackage.java b/android/src/main/java/com/reactnativekeysjsi/KeysPackage.java deleted file mode 100644 index e3dc824f..00000000 --- a/android/src/main/java/com/reactnativekeysjsi/KeysPackage.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.reactnativekeysjsi; - -import androidx.annotation.Nullable; - -import com.facebook.react.bridge.NativeModule; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.module.model.ReactModuleInfo; -import com.facebook.react.module.model.ReactModuleInfoProvider; -import com.facebook.react.TurboReactPackage; - -import java.util.HashMap; -import java.util.Map; - -public class KeysPackage extends TurboReactPackage { - - @Nullable - @Override - public NativeModule getModule(String name, ReactApplicationContext reactContext) { - if (name.equals(KeysModule.NAME)) { - return new KeysModule(reactContext); - } else { - return null; - } - } - - @Override - public ReactModuleInfoProvider getReactModuleInfoProvider() { - return () -> { - final Map moduleInfos = new HashMap<>(); - boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - moduleInfos.put( - KeysModule.NAME, - new ReactModuleInfo( - KeysModule.NAME, - KeysModule.NAME, - false, // canOverrideExistingModule - false, // needsEagerInit - true, // hasConstants - false, // isCxxModule - isTurboModule // isTurboModule - )); - return moduleInfos; - }; - } -} diff --git a/android/src/main/java/com/reactnativekeysjsi/KeysPackage.kt b/android/src/main/java/com/reactnativekeysjsi/KeysPackage.kt new file mode 100644 index 00000000..0b69884c --- /dev/null +++ b/android/src/main/java/com/reactnativekeysjsi/KeysPackage.kt @@ -0,0 +1,31 @@ +package com.reactnativekeysjsi + +import com.facebook.react.BaseReactPackage +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.module.model.ReactModuleInfo +import com.facebook.react.module.model.ReactModuleInfoProvider +import java.util.HashMap + +class KeysPackage : BaseReactPackage() { + override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { + return if (name == KeysModule.NAME) { + KeysModule(reactContext) + } else { + null + } + } + + override fun getReactModuleInfoProvider() = ReactModuleInfoProvider { + mapOf( + KeysModule.NAME to ReactModuleInfo( + name = KeysModule.NAME, + className = KeysModule.NAME, + canOverrideExistingModule = false, + needsEagerInit = false, + isCxxModule = false, + isTurboModule = true + ) + ) + } +} diff --git a/android/src/main/java/com/reactnativekeysjsi/PrivateKey.java b/android/src/main/java/com/reactnativekeysjsi/PrivateKey.java deleted file mode 100644 index 2b5e143b..00000000 --- a/android/src/main/java/com/reactnativekeysjsi/PrivateKey.java +++ /dev/null @@ -1,7 +0,0 @@ - -// this is autogenerated, dont change within it -package com.reactnativekeysjsi; - -public class PrivateKey { - public static String privatekey="k0bymYdpGsZVFHIEEZVtzWgvGs0R6xxSgFN7wxkm/50HMLQZFQt55CR4VItVw6nrLfXATPXRxSiLHSDXvsvUupzfYPAodZsxx9VxlWBZ7g=="; -} \ No newline at end of file diff --git a/android/src/main/java/com/reactnativekeysjsi/PrivateKey.kt b/android/src/main/java/com/reactnativekeysjsi/PrivateKey.kt new file mode 100644 index 00000000..c7c52a45 --- /dev/null +++ b/android/src/main/java/com/reactnativekeysjsi/PrivateKey.kt @@ -0,0 +1,7 @@ + +// this is autogenerated, dont change within it +package com.reactnativekeysjsi + +object PrivateKey { + const val privatekey = "mkQSGENA8dOzDZMjvZ3oustFgp7KEui9kQkhYCrYVN5vysn7gAVtpo+dkRbzXVPkFvo5Cqs3p9vEgt7PRGwBdEihgPNahO2QbF4e/hZJyw==" +} \ No newline at end of file diff --git a/android/src/newarch/KeysSpec.java b/android/src/newarch/KeysSpec.java deleted file mode 100644 index f2f7ada8..00000000 --- a/android/src/newarch/KeysSpec.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.reactnativekeysjsi; - -import com.facebook.react.bridge.ReactApplicationContext; - -abstract class KeysSpec extends NativeKeysSpec { - KeysSpec(ReactApplicationContext context) { - super(context); - } -} diff --git a/android/src/oldarch/KeysSpec.java b/android/src/oldarch/KeysSpec.java deleted file mode 100644 index 8b7d9b68..00000000 --- a/android/src/oldarch/KeysSpec.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.reactnativekeysjsi; - -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContextBaseJavaModule; -import com.facebook.react.bridge.Promise; - -abstract class KeysSpec extends ReactContextBaseJavaModule { - KeysSpec(ReactApplicationContext context) { - super(context); - } - public abstract boolean install(); - -} diff --git a/cpp/encrypted_functions.h b/cpp/encrypted_functions.h index 6b8a2a2f..36ffc59d 100644 --- a/cpp/encrypted_functions.h +++ b/cpp/encrypted_functions.h @@ -5,21 +5,21 @@ #include // Auto-generated encrypted message functions with Advanced Hex obfuscation -// Generated at: 2025-07-27T14:06:41.387Z +// Generated at: 2026-04-28T09:15:10.362Z // Encrypted functions: 10 real + 10 dummy + 1 main (FIXED NAME) // Security: Advanced Hex with random indices and garbage bytes // Main function: getEncryptedSecureData // Encrypted part 1 of 10 (REAL) - Advanced Hex -std::string getData4() { - const unsigned char data[45] = { - 0x8E, 0xE1, 0x1A, 0x55, 0x32, 0x70, 0x46, 0x74, 0xFA, 0x73, 0x57, 0x09, 0x8E, 0x50, 0x38, 0x36, 0xFF, 0x64, 0x4D, 0x47, 0xBC, 0x1F, 0x56, 0x9E, 0xAF, 0x8F, 0xBD, 0x04, 0x96, 0xB5, 0x46, 0xC9, 0x58, 0x0C, 0x6B, 0x45, 0xDD, 0xCD, 0x58, 0x8E, 0x13, 0x9D, 0xB7, 0xE2, 0x10 +std::string loadValueZ() { + const unsigned char data[82] = { + 0xB7, 0x1F, 0x24, 0xBD, 0xFD, 0x0C, 0x4E, 0x6A, 0xA4, 0x37, 0x55, 0x32, 0x46, 0x73, 0x37, 0x8D, 0x19, 0x90, 0x64, 0xE0, 0x86, 0x47, 0x0F, 0xAF, 0x56, 0xAD, 0x20, 0x09, 0x9E, 0x45, 0x7A, 0xB1, 0x00, 0x6B, 0x23, 0x58, 0x31, 0x3F, 0x2F, 0xF6, 0x87, 0x0A, 0x7A, 0x10, 0x35, 0x5A, 0x0B, 0x83, 0x18, 0x67, 0x83, 0xB5, 0xAA, 0xE0, 0x2B, 0x34, 0x75, 0x21, 0xCA, 0x3D, 0x30, 0xEE, 0x49, 0x71, 0x51, 0x63, 0x61, 0x9C, 0x4C, 0x63, 0x1A, 0x42, 0x7A, 0x35, 0x65, 0x57, 0x07, 0x24, 0xC5, 0xF5, 0x53, 0x75 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {3, 4, 6, 9, 17, 19, 22, 34, 38}; - const int realCount = 9; + const int realIndices[] = {10, 11, 12, 13, 18, 21, 24, 33, 35, 36, 38, 42, 44, 49, 60, 62, 65, 71, 72, 75, 80, 81}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -29,15 +29,15 @@ std::string getData4() { } // Encrypted part 2 of 10 (REAL) - Advanced Hex -std::string parseElementBeta() { - const unsigned char data[35] = { - 0x31, 0x39, 0x73, 0x07, 0x38, 0x63, 0xB1, 0xB7, 0x6C, 0xE0, 0xDB, 0x68, 0xDF, 0x1B, 0xE1, 0x74, 0xA9, 0x6A, 0x30, 0x9E, 0x86, 0x46, 0x99, 0xA0, 0x42, 0x9C, 0x04, 0x44, 0xC8, 0x53, 0xEB, 0x55, 0xD5, 0x41, 0xC5 +std::string createContentEpsilon() { + const unsigned char data[66] = { + 0x96, 0x38, 0x45, 0xA1, 0xDD, 0x49, 0xFB, 0x72, 0x28, 0x52, 0x66, 0x94, 0x72, 0xAF, 0xA3, 0x74, 0x52, 0x6B, 0x35, 0xF1, 0xFF, 0xC4, 0x47, 0x69, 0x6D, 0x42, 0x55, 0x2B, 0xCD, 0x94, 0x89, 0x4D, 0x77, 0x76, 0x25, 0xCA, 0x44, 0x37, 0xEC, 0x67, 0x3E, 0x75, 0x42, 0x62, 0xCB, 0x51, 0x2D, 0x3A, 0x46, 0x67, 0x6E, 0xEF, 0xA3, 0x53, 0x75, 0xD8, 0x36, 0xD6, 0xED, 0x67, 0x4C, 0x58, 0x48, 0x74, 0xCE, 0x92 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {0, 4, 5, 11, 21, 24, 29, 31, 33}; - const int realCount = 9; + const int realIndices[] = {1, 2, 5, 9, 10, 12, 16, 18, 22, 31, 33, 37, 42, 45, 49, 50, 54, 56, 59, 60, 61, 63}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -47,15 +47,15 @@ std::string parseElementBeta() { } // Encrypted part 3 of 10 (REAL) - Advanced Hex -std::string configContentEpsilon() { - const unsigned char data[45] = { - 0x76, 0x41, 0x95, 0x68, 0xCE, 0xF1, 0xFB, 0x24, 0x23, 0x32, 0xC8, 0xC1, 0x58, 0xD9, 0x42, 0x89, 0x25, 0x72, 0x69, 0x63, 0x5A, 0x01, 0x8C, 0xEA, 0xAF, 0x02, 0xF8, 0x88, 0xE7, 0x4C, 0xED, 0x06, 0x09, 0x57, 0xCB, 0x4E, 0x6E, 0x35, 0x9F, 0x2F, 0x39, 0x44, 0x2A, 0x74, 0x0B +std::string setupBlockBase() { + const unsigned char data[77] = { + 0x59, 0xDE, 0x39, 0x76, 0xE5, 0x22, 0xF3, 0xF6, 0x66, 0x20, 0x57, 0x49, 0x7C, 0xAD, 0x4D, 0xED, 0x6B, 0x33, 0x74, 0x54, 0xE9, 0xD0, 0xC5, 0x40, 0xF0, 0x62, 0x3A, 0x74, 0xCB, 0x46, 0xA3, 0xF0, 0xE0, 0x32, 0xE0, 0x8E, 0x65, 0x61, 0x42, 0x1D, 0x4C, 0x7A, 0xB5, 0x92, 0x2F, 0x10, 0xE0, 0xE4, 0x6D, 0x84, 0xCE, 0x82, 0x69, 0x78, 0x66, 0x44, 0xDC, 0x64, 0x85, 0xAA, 0x5F, 0x48, 0xDC, 0x7E, 0x38, 0x9A, 0x79, 0xC7, 0x8A, 0xA7, 0xAC, 0x47, 0x35, 0x05, 0xAF, 0x5E, 0x4B }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {3, 9, 17, 18, 19, 29, 36, 40, 43}; - const int realCount = 9; + const int realIndices[] = {2, 8, 10, 11, 16, 17, 19, 25, 27, 36, 37, 38, 40, 41, 48, 52, 53, 54, 61, 64, 66, 76}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -65,15 +65,15 @@ std::string configContentEpsilon() { } // Encrypted part 4 of 10 (REAL) - Advanced Hex -std::string initBlockEpsilon() { - const unsigned char data[45] = { - 0xCE, 0x47, 0x8E, 0x43, 0x58, 0xCF, 0x6B, 0x26, 0x66, 0x30, 0x70, 0xA7, 0x92, 0xB3, 0x03, 0x44, 0x34, 0x3C, 0xFA, 0x66, 0xE3, 0x56, 0x2B, 0xFE, 0x9E, 0x75, 0xCF, 0xAD, 0x48, 0x9F, 0x4C, 0x9C, 0x6E, 0x40, 0x08, 0x42, 0x8F, 0x7A, 0x8A, 0x74, 0xE0, 0xAD, 0x5B, 0xDA, 0x5A +std::string extractTextZeta() { + const unsigned char data[76] = { + 0x50, 0x47, 0x59, 0xA5, 0x19, 0x32, 0xCA, 0x57, 0x31, 0x49, 0xDE, 0x11, 0xB6, 0x60, 0x9A, 0x4F, 0x97, 0x36, 0xC3, 0x4D, 0x9E, 0xCD, 0x0B, 0x57, 0xCC, 0x14, 0x34, 0x69, 0x63, 0x42, 0x6A, 0xCE, 0x75, 0xE4, 0xFC, 0xEC, 0xD6, 0x5A, 0x69, 0xA9, 0x2A, 0x17, 0x34, 0xA4, 0x61, 0x9C, 0x4E, 0x4A, 0xF7, 0x2B, 0xEC, 0x35, 0x07, 0x8B, 0x0B, 0x0B, 0x80, 0x46, 0x5E, 0x9B, 0x03, 0xCB, 0x2B, 0x54, 0x52, 0x48, 0x78, 0xB3, 0x40, 0x27, 0xCA, 0x6F, 0x38, 0x69, 0x8A, 0x8B }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {1, 4, 6, 19, 21, 22, 25, 30, 32}; - const int realCount = 9; + const int realIndices[] = {1, 7, 8, 9, 17, 19, 23, 26, 27, 29, 32, 37, 38, 44, 46, 51, 62, 63, 65, 71, 72, 73}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -83,15 +83,15 @@ std::string initBlockEpsilon() { } // Encrypted part 5 of 10 (REAL) - Advanced Hex -std::string setupString3() { - const unsigned char data[40] = { - 0x55, 0x37, 0x8D, 0x04, 0x95, 0x79, 0x86, 0x79, 0xD4, 0x58, 0x0C, 0x49, 0x6E, 0x2F, 0x52, 0xA7, 0x49, 0x63, 0x51, 0x50, 0xD6, 0x38, 0x29, 0xDC, 0x29, 0x43, 0x01, 0x95, 0xE4, 0xB3, 0x19, 0xC8, 0x8C, 0x32, 0x03, 0x72, 0xE5, 0x08, 0x47, 0xB7 +std::string readBlockEpsilon() { + const unsigned char data[77] = { + 0x6E, 0xCB, 0xF0, 0x6B, 0xF4, 0xF2, 0x61, 0x1D, 0x73, 0x27, 0x63, 0x72, 0x41, 0xA6, 0x5D, 0x91, 0x2A, 0x36, 0x44, 0x6A, 0x12, 0xA4, 0x78, 0x4B, 0x34, 0xA1, 0x64, 0x32, 0x9B, 0x65, 0x75, 0x9E, 0x01, 0xAE, 0x48, 0x02, 0xFE, 0xF3, 0x27, 0x59, 0x38, 0x6C, 0xF1, 0x34, 0xF3, 0x90, 0xF2, 0x79, 0xFD, 0x66, 0xD5, 0xF9, 0x04, 0x63, 0xA6, 0x55, 0x88, 0xDC, 0x2E, 0x20, 0x21, 0x4E, 0xDC, 0x12, 0x9D, 0x4C, 0x73, 0x49, 0x7E, 0xDF, 0xFA, 0x6D, 0x32, 0x9A, 0x6B, 0x73, 0xD3 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {0, 5, 13, 16, 17, 19, 25, 33, 35}; - const int realCount = 9; + const int realIndices[] = {0, 3, 8, 10, 12, 17, 18, 19, 22, 26, 27, 30, 34, 39, 41, 43, 47, 49, 65, 66, 71, 74}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -101,15 +101,15 @@ std::string setupString3() { } // Encrypted part 6 of 10 (REAL) - Advanced Hex -std::string loadStringLambda() { - const unsigned char data[38] = { - 0xFD, 0xA8, 0xFA, 0x45, 0x8E, 0x79, 0x70, 0x13, 0x15, 0x4A, 0x9D, 0x47, 0xCE, 0x69, 0xF9, 0x48, 0x74, 0x9E, 0x34, 0xDF, 0x32, 0x44, 0x84, 0xF5, 0x2F, 0x35, 0x64, 0x66, 0x6C, 0x5E, 0x4A, 0xDA, 0xAA, 0x72, 0x46, 0x81, 0xFC, 0x72 +std::string extractStringLambda() { + const unsigned char data[69] = { + 0xD4, 0x51, 0x53, 0x2F, 0x47, 0x1D, 0x45, 0x53, 0xC9, 0xCF, 0x4E, 0x1D, 0x41, 0x38, 0x89, 0x64, 0x61, 0x4F, 0x7A, 0x44, 0xCC, 0x53, 0x87, 0x34, 0x89, 0x5A, 0x78, 0x4D, 0xC0, 0x6A, 0xDF, 0xA1, 0x76, 0x51, 0x5A, 0x8D, 0x1B, 0x34, 0xD4, 0x33, 0x41, 0xA8, 0x68, 0x57, 0xCA, 0xBF, 0x91, 0x6F, 0x68, 0x5F, 0x75, 0xA8, 0x73, 0x45, 0xAD, 0xF8, 0x0A, 0xC0, 0xC9, 0xCA, 0x74, 0x46, 0xBF, 0xD0, 0x84, 0xEA, 0xA0, 0xB4, 0x57 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {3, 6, 9, 11, 18, 24, 30, 34, 37}; - const int realCount = 9; + const int realIndices[] = {1, 2, 4, 6, 10, 12, 13, 15, 17, 18, 19, 25, 27, 29, 32, 34, 39, 47, 50, 52, 60, 61}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -119,15 +119,15 @@ std::string loadStringLambda() { } // Encrypted part 7 of 10 (REAL) - Advanced Hex -std::string getSegmentOmega() { - const unsigned char data[36] = { - 0x6C, 0xAF, 0xE2, 0x40, 0x3B, 0x37, 0xB2, 0x74, 0x06, 0x18, 0x7A, 0x8E, 0x90, 0x61, 0x41, 0x32, 0x02, 0x65, 0x32, 0x67, 0x99, 0x23, 0xF4, 0x95, 0x97, 0x46, 0x6E, 0x36, 0xA4, 0x76, 0xE7, 0x88, 0x47, 0x7D, 0xEB, 0xF2 +std::string processContentOmega() { + const unsigned char data[77] = { + 0x67, 0xEC, 0x4F, 0x46, 0x97, 0x70, 0xC4, 0x80, 0x4F, 0x37, 0xE4, 0x77, 0xA6, 0x14, 0x7E, 0x09, 0x8F, 0x0A, 0x5D, 0x4B, 0x59, 0x29, 0x26, 0x6C, 0xD0, 0xF3, 0x45, 0x37, 0x06, 0xC1, 0xAB, 0x35, 0xD2, 0x75, 0xD9, 0xEE, 0x76, 0x69, 0x39, 0x6B, 0x51, 0xD8, 0x6B, 0x3C, 0x0B, 0x68, 0xA5, 0x59, 0x1E, 0xA5, 0x89, 0x7F, 0x43, 0x72, 0x59, 0xCB, 0x56, 0x4E, 0x35, 0x55, 0x53, 0xD2, 0x41, 0x0D, 0x76, 0x49, 0x72, 0x57, 0x79, 0xAD, 0x8C, 0xD0, 0x81, 0x9A, 0x7F, 0xA8, 0x73 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {0, 10, 15, 17, 18, 25, 26, 29, 32}; - const int realCount = 9; + const int realIndices[] = {0, 5, 9, 19, 26, 33, 37, 38, 39, 40, 42, 45, 47, 52, 53, 54, 56, 57, 58, 64, 68, 76}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -137,15 +137,15 @@ std::string getSegmentOmega() { } // Encrypted part 8 of 10 (REAL) - Advanced Hex -std::string loadKeyGamma() { - const unsigned char data[43] = { - 0x4B, 0xD4, 0x34, 0xCB, 0x67, 0x50, 0x16, 0x01, 0x6C, 0x68, 0xBA, 0x39, 0xE6, 0x6B, 0xE4, 0x44, 0xF2, 0x41, 0x0D, 0x6E, 0xB4, 0x2E, 0xA6, 0xB4, 0xF9, 0xCF, 0x02, 0x06, 0xB1, 0xE7, 0xD1, 0x39, 0x6F, 0xD6, 0x6A, 0xA2, 0x7A, 0x1D, 0xD1, 0x4D, 0xA3, 0xF1, 0xC6 +std::string processData1() { + const unsigned char data[73] = { + 0xB8, 0x70, 0x6E, 0x69, 0xDE, 0x37, 0x37, 0x67, 0x34, 0x41, 0xA3, 0xE6, 0x56, 0x35, 0x74, 0x95, 0x1A, 0xB0, 0x70, 0x6F, 0x2B, 0xEB, 0x64, 0xF0, 0x2A, 0x1F, 0x25, 0xE0, 0x6B, 0x07, 0xC0, 0x59, 0x1D, 0x07, 0x52, 0xC2, 0x62, 0x3D, 0x7A, 0x58, 0xB6, 0x8C, 0x77, 0xD6, 0x72, 0xBA, 0x72, 0x54, 0xBA, 0xC6, 0xAA, 0x56, 0x50, 0xE3, 0x6D, 0xF1, 0x4A, 0x6B, 0x69, 0x46, 0xA2, 0x76, 0x81, 0x2D, 0xF2, 0x63, 0x6F, 0x6C, 0x95, 0x02, 0x04, 0x35, 0xD5 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {0, 11, 13, 15, 19, 31, 32, 34, 36}; - const int realCount = 9; + const int realIndices[] = {2, 6, 7, 9, 12, 14, 18, 19, 20, 22, 28, 34, 36, 38, 39, 51, 52, 57, 59, 61, 66, 71}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -155,15 +155,15 @@ std::string loadKeyGamma() { } // Encrypted part 9 of 10 (REAL) - Advanced Hex -std::string createPiece4() { - const unsigned char data[43] = { - 0x7D, 0x36, 0xC6, 0x01, 0x80, 0x9F, 0x33, 0x6D, 0x4E, 0x69, 0x74, 0xB1, 0x15, 0x42, 0x2F, 0x7A, 0x52, 0x73, 0x2F, 0x0E, 0xDA, 0x73, 0xB3, 0xE4, 0x67, 0x13, 0xD6, 0x70, 0x77, 0x6E, 0x30, 0x35, 0x08, 0x4E, 0x5F, 0xA1, 0xF9, 0xCE, 0x67, 0xB2, 0x45, 0x6E, 0x6E +std::string makeElement1() { + const unsigned char data[71] = { + 0xF5, 0xE7, 0x28, 0x0A, 0xBD, 0x43, 0x71, 0x11, 0x0C, 0x21, 0x92, 0x73, 0x33, 0x70, 0xF4, 0xB1, 0x35, 0x4F, 0x39, 0xF4, 0xC6, 0xE3, 0x76, 0x6B, 0x90, 0x45, 0x67, 0xF3, 0xB7, 0xAF, 0x74, 0x37, 0x50, 0x52, 0xD7, 0x47, 0xCD, 0xBA, 0x77, 0xC6, 0xE7, 0xB3, 0x74, 0xF5, 0x42, 0x9E, 0x64, 0x06, 0x45, 0x02, 0x87, 0x1E, 0x9E, 0x69, 0x8D, 0xB5, 0x3F, 0x56, 0x68, 0x7B, 0x4E, 0xF1, 0x67, 0x54, 0xEB, 0x1D, 0x32, 0x4A, 0xDD, 0xD6, 0x50 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {6, 7, 8, 14, 15, 33, 38, 40, 42}; - const int realCount = 9; + const int realIndices[] = {5, 6, 11, 12, 13, 18, 22, 25, 26, 30, 31, 32, 33, 35, 38, 44, 46, 48, 53, 58, 62, 70}; + const int realCount = 22; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -173,15 +173,15 @@ std::string createPiece4() { } // Encrypted part 10 of 10 (REAL) - Advanced Hex -std::string decodeTokenBase() { - const unsigned char data[40] = { - 0xCA, 0x51, 0x87, 0x60, 0x4C, 0x72, 0x71, 0xC2, 0xD6, 0x3C, 0x49, 0x99, 0x4A, 0x65, 0x79, 0x1F, 0x23, 0xE4, 0x37, 0xE6, 0xA4, 0xF3, 0xE9, 0x58, 0x58, 0x58, 0xF7, 0x4C, 0xEF, 0xBE, 0x35, 0x51, 0x3D, 0x3D, 0x85, 0xC0, 0xBF, 0x55, 0x9A, 0x93 +std::string configBuffer4() { + const unsigned char data[69] = { + 0x1B, 0x59, 0x82, 0xF3, 0x4E, 0x60, 0x04, 0x75, 0xF1, 0x16, 0x61, 0x68, 0x78, 0x9B, 0xEB, 0xDA, 0x2E, 0xCB, 0x4F, 0x89, 0x22, 0xC0, 0x59, 0x94, 0xA3, 0x32, 0xCC, 0x33, 0xE5, 0xD5, 0x94, 0xFB, 0x66, 0xDF, 0xA6, 0xF2, 0x51, 0x62, 0x46, 0x8B, 0x6D, 0x26, 0xF6, 0x34, 0x7B, 0x65, 0x2F, 0x7F, 0x68, 0x5A, 0x62, 0xB8, 0x83, 0xDA, 0x4A, 0x1C, 0xD9, 0x79, 0x83, 0x6B, 0x77, 0x3D, 0x3D, 0x12, 0x21, 0x76, 0xD3, 0x57, 0x92 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {10, 13, 18, 27, 31, 32, 33}; - const int realCount = 7; + const int realIndices[] = {4, 10, 11, 18, 25, 36, 37, 38, 43, 45, 46, 48, 49, 54, 57, 60, 61, 62}; + const int realCount = 18; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); @@ -191,86 +191,86 @@ std::string decodeTokenBase() { } // Dummy encrypted function 1 (DECOY) - Advanced Hex -std::string processChunkPrime() { - const unsigned char data[108] = { - 0x5B, 0xB4, 0x8A, 0x24, 0x9E, 0x3A, 0x7B, 0x42, 0x92, 0x55, 0x8B, 0x32, 0xD8, 0x6F, 0x55, 0xE9, 0x46, 0x79, 0x6B, 0xC0, 0x73, 0xD3, 0x94, 0x64, 0x28, 0xAE, 0xC4, 0x64, 0x65, 0x47, 0x52, 0xDA, 0x56, 0x4B, 0x9A, 0x6B, 0x58, 0xA0, 0x31, 0x14, 0x32, 0xDA, 0x95, 0x3C, 0x66, 0x36, 0x0D, 0x61, 0x24, 0x47, 0x50, 0x70, 0x32, 0x6C, 0xFB, 0x73, 0x6F, 0x14, 0xD1, 0x65, 0x7E, 0x52, 0x19, 0x6D, 0xDA, 0x27, 0x34, 0x35, 0x72, 0x1A, 0xF7, 0x34, 0x36, 0x74, 0x0D, 0x37, 0x38, 0x39, 0x2C, 0x99, 0x83, 0xD4, 0x61, 0x80, 0xCE, 0x27, 0x62, 0x63, 0x64, 0x07, 0x6A, 0x71, 0x13, 0x65, 0x38, 0x66, 0xB0, 0xE1, 0xB3, 0xB8, 0x31, 0xE1, 0xB5, 0xB7, 0x32, 0x11, 0x29, 0x33 +std::string extractKeyY() { + const unsigned char data[96] = { + 0x55, 0x17, 0x0D, 0xF3, 0x5A, 0x0B, 0x79, 0x32, 0x46, 0x73, 0x82, 0xC1, 0x64, 0x68, 0x47, 0x56, 0x9F, 0xDE, 0xF4, 0x89, 0x2B, 0xD9, 0x02, 0xEA, 0x24, 0x6B, 0xA6, 0x58, 0xC4, 0x31, 0x14, 0xAF, 0x2D, 0x35, 0x1F, 0x73, 0x4B, 0x61, 0x2B, 0xAC, 0xAE, 0xC2, 0xB3, 0x59, 0x6D, 0x70, 0x3B, 0x6C, 0x65, 0xB1, 0x34, 0x35, 0xAD, 0x4E, 0xD3, 0xA7, 0x36, 0x37, 0x03, 0xB6, 0x1E, 0x05, 0xF6, 0xC6, 0xFE, 0xA9, 0x04, 0x38, 0x27, 0xA5, 0x39, 0xEF, 0xE4, 0xCB, 0x9E, 0x61, 0x66, 0x62, 0xF2, 0x84, 0x88, 0x63, 0x64, 0x65, 0x5F, 0x0A, 0x50, 0x05, 0xB3, 0xAE, 0x66, 0xAA, 0x9C, 0x31, 0x8F, 0x32 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {9, 11, 16, 20, 23, 29, 32, 35, 36, 38, 40, 44, 47, 53, 55, 59, 66, 67, 72, 75, 76, 77, 82, 86, 87, 88, 93, 95, 100, 104, 107}; + const int realIndices[] = {0, 7, 8, 9, 12, 14, 15, 25, 27, 29, 33, 35, 37, 44, 45, 47, 48, 50, 51, 56, 57, 67, 70, 75, 77, 81, 82, 83, 90, 93, 95}; const int realCount = 31; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX12false456789abcdef123" + return result; // Dummy: "U2FsdGVkX15sample456789abcdef12" } // Dummy encrypted function 2 (DECOY) - Advanced Hex -std::string parseInfoX() { - const unsigned char data[98] = { - 0xD1, 0xD0, 0x4C, 0x7C, 0x6B, 0x55, 0x32, 0x46, 0x73, 0x64, 0x47, 0x56, 0xF2, 0x6B, 0x6B, 0x58, 0xB3, 0x31, 0x22, 0x35, 0xEA, 0x24, 0xE8, 0xBA, 0xD8, 0x32, 0x79, 0x66, 0x61, 0x62, 0xC9, 0xCC, 0x4E, 0x62, 0x58, 0xAA, 0x98, 0x38, 0xEF, 0xBF, 0xE4, 0x6C, 0x73, 0x20, 0x96, 0xA8, 0x65, 0xEA, 0x18, 0x93, 0x06, 0x34, 0x8A, 0x24, 0xE7, 0x35, 0x05, 0x46, 0x96, 0xB3, 0x36, 0xC8, 0xBA, 0x7D, 0x37, 0x4B, 0xF1, 0xC7, 0x38, 0x39, 0x61, 0x33, 0xE1, 0x62, 0x7E, 0x63, 0x64, 0xDB, 0x0E, 0x15, 0x65, 0xD1, 0x66, 0x33, 0x4D, 0x62, 0xB2, 0x26, 0x44, 0xD1, 0x86, 0x7F, 0x31, 0xA5, 0x32, 0x9F, 0x8F, 0x33 +std::string obtainItem4() { + const unsigned char data[95] = { + 0x5D, 0x32, 0x55, 0x32, 0xB7, 0xC6, 0x46, 0x36, 0x73, 0xDF, 0x64, 0x47, 0xD4, 0xE4, 0x57, 0xA2, 0x56, 0x23, 0xA3, 0x1E, 0x6B, 0x0E, 0xF2, 0x58, 0x31, 0xAF, 0x3B, 0xFD, 0xA3, 0xF8, 0xD1, 0x30, 0xE5, 0xD7, 0x64, 0x0E, 0x75, 0x6D, 0x6D, 0xE8, 0x56, 0xEA, 0xB3, 0x79, 0x6E, 0xB3, 0x31, 0x32, 0x27, 0x33, 0x37, 0xD5, 0xE8, 0x34, 0x74, 0x35, 0x58, 0x36, 0x37, 0x1D, 0x38, 0xF0, 0xC1, 0x1F, 0x24, 0x7E, 0x39, 0xEF, 0x14, 0x61, 0x0E, 0x9C, 0x2D, 0x33, 0x95, 0x00, 0x04, 0x62, 0x2E, 0x63, 0x45, 0xAA, 0x63, 0x75, 0x64, 0xDD, 0xBD, 0x04, 0xF5, 0xE8, 0x16, 0x33, 0x04, 0x65, 0x00 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 25, 27, 28, 41, 42, 46, 51, 55, 60, 64, 68, 69, 70, 73, 75, 76, 80, 82, 92, 94, 97}; - const int realCount = 31; + const int realIndices[] = {2, 3, 6, 8, 10, 11, 16, 20, 23, 24, 31, 34, 36, 37, 38, 43, 46, 47, 49, 53, 55, 57, 58, 60, 66, 69, 77, 82, 84, 93}; + const int realCount = 30; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX12false456789abcdef123" + return result; // Dummy: "U2FsdGVkX10dummy123456789abcde" } // Dummy encrypted function 3 (DECOY) - Advanced Hex -std::string getBlockOmega() { - const unsigned char data[102] = { - 0x06, 0xB8, 0x40, 0x55, 0x22, 0x32, 0x46, 0x82, 0xF0, 0xA9, 0x4A, 0x7F, 0x73, 0x26, 0xB3, 0xFA, 0x05, 0x3D, 0xD3, 0x64, 0x47, 0xFE, 0x34, 0x5D, 0xAE, 0xA3, 0x66, 0x83, 0x56, 0x63, 0x6B, 0x58, 0x25, 0xB9, 0x31, 0xDF, 0x72, 0x34, 0x6E, 0x67, 0xAA, 0x6F, 0x69, 0x46, 0xB9, 0x30, 0x3F, 0x73, 0x65, 0x6C, 0xAA, 0x37, 0x97, 0x60, 0x38, 0x97, 0xCA, 0x05, 0x39, 0x12, 0x5C, 0x0A, 0x09, 0x9F, 0x07, 0x4D, 0x58, 0x39, 0x56, 0x5E, 0x30, 0x61, 0x62, 0x63, 0x64, 0xF7, 0x65, 0x29, 0xBE, 0x11, 0x66, 0x80, 0x97, 0x4A, 0xEF, 0x31, 0x32, 0x85, 0x33, 0x34, 0x5E, 0x35, 0x2D, 0x0D, 0x04, 0x19, 0x41, 0xC2, 0xFC, 0x9F, 0x36, 0x81 +std::string parseValueDelta() { + const unsigned char data[95] = { + 0x03, 0x18, 0xAA, 0x55, 0x32, 0xCA, 0xAA, 0x46, 0x5D, 0x64, 0x43, 0x6D, 0x73, 0x40, 0x64, 0x50, 0x47, 0x76, 0x56, 0x24, 0x46, 0xBC, 0x6B, 0x3A, 0x58, 0x31, 0x13, 0x81, 0xEC, 0x39, 0x66, 0x2F, 0x6D, 0x61, 0x8B, 0x71, 0x81, 0xE0, 0xE1, 0x89, 0x6B, 0xB1, 0xC9, 0x65, 0x4E, 0xE5, 0x9F, 0x0B, 0xC8, 0x5E, 0xAA, 0xE8, 0x68, 0xA7, 0x31, 0x7C, 0x03, 0x4C, 0x32, 0x33, 0x34, 0x34, 0xC2, 0x35, 0x70, 0xFE, 0x1D, 0x06, 0x06, 0x37, 0x36, 0x74, 0x37, 0xBA, 0x38, 0xAA, 0x19, 0x39, 0x41, 0x63, 0x30, 0x7C, 0x61, 0xC7, 0x62, 0x63, 0x18, 0x64, 0x65, 0x7C, 0x8A, 0x81, 0x66, 0x6A, 0xF1 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {3, 5, 6, 12, 19, 20, 28, 30, 31, 34, 37, 38, 41, 42, 47, 48, 51, 54, 58, 71, 72, 73, 74, 76, 80, 85, 86, 88, 89, 91, 100}; + const int realIndices[] = {3, 4, 7, 12, 14, 16, 18, 22, 24, 25, 29, 30, 33, 40, 43, 54, 58, 59, 60, 63, 70, 72, 74, 77, 80, 82, 84, 85, 87, 88, 92}; const int realCount = 31; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX14noise789abcdef123456" + return result; // Dummy: "U2FsdGVkX19fake1234567890abcdef" } // Dummy encrypted function 4 (DECOY) - Advanced Hex -std::string makeElementY() { - const unsigned char data[102] = { - 0x12, 0x0F, 0x22, 0x55, 0xAA, 0x23, 0x32, 0xEB, 0xC3, 0x14, 0x24, 0xC6, 0x78, 0xDF, 0x46, 0x2C, 0x73, 0x64, 0x47, 0x56, 0x84, 0x6B, 0x58, 0x29, 0x85, 0x1E, 0x31, 0x98, 0xAC, 0x03, 0x06, 0x30, 0x64, 0x1F, 0x66, 0xE7, 0xFF, 0x44, 0x75, 0x6D, 0x66, 0x5F, 0x98, 0x21, 0x65, 0xEC, 0x53, 0x6D, 0x6B, 0x3D, 0x29, 0x65, 0xED, 0x1E, 0x41, 0x81, 0x71, 0xCA, 0xA9, 0x79, 0xC8, 0x1E, 0x31, 0x9A, 0x7F, 0x1A, 0x26, 0x32, 0x6B, 0x54, 0x33, 0x9D, 0x34, 0xF1, 0x35, 0x3F, 0x1C, 0xCE, 0x8A, 0x36, 0xD8, 0x37, 0x3F, 0x38, 0x35, 0x49, 0xA8, 0x1D, 0x2A, 0x5E, 0x11, 0x58, 0x39, 0x61, 0x62, 0x37, 0x63, 0x8F, 0x72, 0x64, 0x9F, 0x65 +std::string readInfoC() { + const unsigned char data[93] = { + 0x55, 0xCE, 0x32, 0x46, 0x6F, 0x73, 0x6F, 0x6A, 0x50, 0x64, 0x9A, 0x42, 0x4C, 0x38, 0x47, 0x7A, 0x4A, 0x35, 0x56, 0x56, 0x6B, 0x5E, 0x7C, 0x4D, 0x3D, 0x42, 0xFA, 0xAE, 0x6A, 0x58, 0xBF, 0x31, 0x07, 0x38, 0xA7, 0x55, 0x37, 0x74, 0x65, 0x9B, 0x73, 0x31, 0x9E, 0xCD, 0x74, 0x38, 0x39, 0xBC, 0x30, 0x61, 0xD5, 0xE7, 0xAD, 0x1A, 0x97, 0x13, 0xC9, 0x62, 0x72, 0x02, 0x63, 0x9B, 0x64, 0x4C, 0xEA, 0x64, 0xA7, 0x59, 0xB7, 0x99, 0xD8, 0xCA, 0x81, 0x65, 0x66, 0x66, 0x24, 0x31, 0xB3, 0x87, 0x32, 0x47, 0x98, 0x33, 0x64, 0xC9, 0x49, 0x58, 0x34, 0xC8, 0x35, 0xA7, 0x36 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {3, 6, 14, 16, 17, 18, 19, 21, 22, 26, 31, 32, 38, 39, 47, 59, 62, 67, 70, 72, 74, 79, 81, 83, 92, 93, 94, 96, 99, 101}; + const int realIndices[] = {0, 2, 3, 5, 9, 14, 19, 20, 29, 31, 36, 37, 38, 40, 44, 45, 46, 48, 49, 57, 60, 65, 73, 74, 77, 80, 83, 88, 90, 92}; const int realCount = 30; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX10dummy123456789abcde" + return result; // Dummy: "U2FsdGVkX17test890abcdef123456" } // Dummy encrypted function 5 (DECOY) - Advanced Hex -std::string processSegmentB() { - const unsigned char data[101] = { - 0x55, 0xF1, 0xF9, 0x8E, 0x60, 0x6F, 0x4E, 0x84, 0xE8, 0xA3, 0x9E, 0x32, 0x36, 0xCC, 0x46, 0x73, 0x99, 0x77, 0x08, 0x44, 0x64, 0x49, 0x6A, 0x60, 0x88, 0x47, 0x4C, 0x55, 0x56, 0x6B, 0x46, 0xFB, 0x58, 0x58, 0xB7, 0x31, 0x35, 0xCC, 0x09, 0x0A, 0xE4, 0xBA, 0x3A, 0xA0, 0x73, 0x35, 0x5F, 0x61, 0xDF, 0x6D, 0x70, 0x6C, 0xE6, 0xE4, 0xC9, 0x65, 0x45, 0x0C, 0x8C, 0x34, 0x36, 0x35, 0x36, 0xB6, 0x37, 0xE2, 0xEB, 0x5D, 0xA0, 0x68, 0x5B, 0xEC, 0x38, 0x3F, 0x39, 0x75, 0x61, 0x25, 0xBC, 0xC6, 0x81, 0xD6, 0x62, 0x5D, 0x0B, 0x39, 0x8F, 0xA4, 0x99, 0x63, 0xA4, 0x64, 0xD6, 0x65, 0x66, 0x30, 0x00, 0x31, 0xBE, 0x85, 0x32 +std::string accessChunkBeta() { + const unsigned char data[97] = { + 0xE7, 0x16, 0x55, 0xF9, 0xF4, 0x32, 0xA8, 0x93, 0xA0, 0x46, 0x73, 0x64, 0x47, 0x56, 0x55, 0x41, 0x4F, 0x8E, 0x98, 0x6B, 0x63, 0xF5, 0x07, 0x1E, 0x58, 0x16, 0x31, 0x23, 0xB5, 0x35, 0x73, 0x8A, 0x5B, 0x4D, 0x62, 0x3B, 0x61, 0x4A, 0xDA, 0xD0, 0xBA, 0x01, 0xE1, 0xA4, 0x6D, 0x70, 0xAA, 0x6C, 0x6C, 0x65, 0xD3, 0x01, 0x0F, 0xA4, 0xCB, 0x3E, 0xE6, 0x49, 0xE8, 0xFE, 0x3D, 0x94, 0xDB, 0x34, 0x35, 0x6D, 0x26, 0x42, 0x36, 0x37, 0x18, 0x38, 0x7B, 0xF4, 0x39, 0x61, 0x47, 0x62, 0x63, 0x79, 0xCA, 0x42, 0xD6, 0x8A, 0x41, 0xE2, 0x6B, 0x64, 0xF6, 0xDF, 0xF4, 0x65, 0x2B, 0x7E, 0x66, 0x31, 0x32 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {0, 11, 14, 15, 20, 25, 28, 29, 32, 35, 36, 44, 47, 49, 50, 51, 55, 59, 61, 62, 64, 72, 74, 76, 82, 89, 91, 93, 94, 97, 100}; + const int realIndices[] = {2, 5, 9, 10, 11, 12, 13, 19, 24, 26, 29, 30, 36, 44, 45, 48, 49, 63, 64, 68, 69, 71, 74, 75, 77, 78, 87, 91, 94, 95, 96}; const int realCount = 31; for (int i = 0; i < realCount; i++) { @@ -281,50 +281,50 @@ std::string processSegmentB() { } // Dummy encrypted function 6 (DECOY) - Advanced Hex -std::string pullSegment3() { - const unsigned char data[91] = { - 0x5F, 0x1B, 0x55, 0x47, 0xD4, 0x12, 0x48, 0x6E, 0xE9, 0x32, 0x48, 0x89, 0xC3, 0x46, 0x54, 0x7E, 0xD4, 0x73, 0x64, 0xBA, 0x76, 0xC2, 0x4B, 0x1D, 0xCC, 0xA2, 0x6F, 0x47, 0xD4, 0x56, 0x35, 0x6B, 0x58, 0x74, 0x31, 0xC1, 0x33, 0x64, 0x65, 0x43, 0x63, 0x6F, 0x75, 0xF6, 0xC3, 0xC1, 0x79, 0xC8, 0x31, 0x32, 0x33, 0x04, 0x29, 0x34, 0xFF, 0x35, 0x9E, 0xA3, 0x77, 0x70, 0xB9, 0x36, 0x70, 0x37, 0x92, 0xB0, 0x1E, 0x38, 0x39, 0x7F, 0xA2, 0xFC, 0x3E, 0x57, 0xBD, 0x61, 0x3F, 0xCC, 0x62, 0x0C, 0x63, 0x0C, 0x64, 0xF5, 0x40, 0xB4, 0x65, 0x38, 0x6A, 0x24, 0xB8 +std::string retrieveNodeDelta() { + const unsigned char data[97] = { + 0x55, 0x20, 0x32, 0x53, 0x71, 0x29, 0xD0, 0x46, 0x7C, 0x73, 0xD8, 0x95, 0x71, 0x64, 0x47, 0xE7, 0xD9, 0x74, 0x56, 0x6B, 0x7A, 0x58, 0x26, 0xED, 0x31, 0x38, 0x20, 0x64, 0x14, 0x81, 0x73, 0x83, 0x61, 0x75, 0x52, 0x6D, 0xEC, 0x28, 0x1A, 0x47, 0x6D, 0x79, 0x35, 0x36, 0xDD, 0x8D, 0x37, 0x0F, 0x38, 0x21, 0xDA, 0x39, 0xD8, 0x14, 0x20, 0xCD, 0x30, 0x61, 0x62, 0x92, 0x62, 0x0D, 0xEE, 0xC0, 0x55, 0x63, 0xD4, 0x29, 0x73, 0xE4, 0x0F, 0xAB, 0xC9, 0x5F, 0x64, 0x00, 0x0D, 0xC8, 0x84, 0xBF, 0x65, 0x61, 0x70, 0x72, 0xA9, 0x1A, 0x66, 0xC4, 0x31, 0x32, 0x8A, 0xB7, 0x33, 0x70, 0x77, 0x08, 0x63 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {2, 9, 13, 17, 18, 27, 29, 31, 32, 34, 36, 37, 38, 40, 41, 46, 48, 49, 50, 53, 55, 61, 63, 67, 68, 75, 78, 80, 82, 86}; - const int realCount = 30; + const int realIndices[] = {0, 2, 7, 9, 13, 14, 18, 19, 21, 24, 25, 27, 33, 35, 40, 41, 42, 43, 46, 48, 51, 56, 57, 60, 65, 74, 80, 86, 88, 89, 92}; + const int realCount = 31; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX13decoy123456789abcde" + return result; // Dummy: "U2FsdGVkX18dummy567890abcdef123" } // Dummy encrypted function 7 (DECOY) - Advanced Hex -std::string grabValueOmega() { - const unsigned char data[107] = { - 0x2F, 0xEC, 0x43, 0x4B, 0xE7, 0x55, 0x32, 0x91, 0x46, 0x4D, 0xF9, 0x73, 0x64, 0xD1, 0x0B, 0x47, 0x56, 0x6B, 0x81, 0xA0, 0x58, 0x4B, 0xCB, 0x31, 0x27, 0x0C, 0x3F, 0x67, 0x60, 0x3C, 0x50, 0xB2, 0x9C, 0x84, 0xD6, 0xE1, 0x50, 0x35, 0xEF, 0x2C, 0x6C, 0x6C, 0x4C, 0x76, 0xF8, 0x73, 0x6C, 0x7E, 0x61, 0xE0, 0x0F, 0x44, 0xDD, 0x6D, 0x70, 0xF3, 0x5E, 0x4B, 0x6C, 0xE5, 0x49, 0x21, 0x6F, 0x03, 0x7A, 0x8B, 0xF6, 0xB2, 0x68, 0x65, 0x34, 0x48, 0x6E, 0x5F, 0xEE, 0x35, 0x12, 0xF3, 0x36, 0x82, 0x07, 0x42, 0x29, 0x37, 0x38, 0x39, 0x9C, 0xF2, 0x01, 0x61, 0x62, 0xAF, 0x78, 0x63, 0x64, 0xF9, 0xB8, 0x6F, 0x2B, 0x3D, 0x1C, 0x91, 0x65, 0x66, 0x31, 0x2E, 0x32 +std::string accessStringX() { + const unsigned char data[104] = { + 0x8F, 0x55, 0xE9, 0x32, 0x30, 0x51, 0x50, 0x91, 0x12, 0x98, 0x39, 0x46, 0x73, 0xE3, 0x93, 0xE1, 0x21, 0x64, 0x3A, 0x8E, 0x44, 0x47, 0x74, 0x90, 0xF4, 0x35, 0x56, 0xAC, 0x2A, 0x48, 0x7A, 0x33, 0x1A, 0xA7, 0xD2, 0x6B, 0x58, 0x4E, 0x2F, 0x01, 0x31, 0xCE, 0x32, 0x5A, 0xED, 0x72, 0x66, 0x61, 0xE8, 0x46, 0x65, 0xEA, 0x84, 0x60, 0x6C, 0xFE, 0x73, 0x81, 0x02, 0x53, 0x65, 0xD2, 0xBB, 0x34, 0xFB, 0x35, 0x5E, 0x36, 0x0A, 0x5A, 0x5C, 0x5D, 0xB3, 0x7A, 0x17, 0xFF, 0x37, 0x38, 0x39, 0x24, 0x61, 0x72, 0xEB, 0x62, 0x63, 0x2F, 0xD0, 0x53, 0x23, 0xE6, 0x4D, 0x03, 0x26, 0x64, 0xBE, 0x65, 0x66, 0xAB, 0x2A, 0xEC, 0x31, 0x32, 0x0F, 0x33 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {5, 6, 8, 11, 12, 15, 16, 17, 20, 23, 37, 45, 48, 53, 54, 58, 69, 70, 75, 78, 83, 84, 85, 89, 90, 93, 94, 102, 103, 104, 106}; + const int realIndices[] = {1, 3, 11, 12, 17, 21, 26, 35, 36, 40, 42, 46, 47, 54, 56, 60, 63, 65, 67, 76, 77, 78, 80, 83, 84, 93, 95, 96, 100, 101, 103}; const int realCount = 31; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX15sample456789abcdef12" + return result; // Dummy: "U2FsdGVkX12false456789abcdef123" } // Dummy encrypted function 8 (DECOY) - Advanced Hex -std::string accessSegment2() { - const unsigned char data[107] = { - 0x93, 0x55, 0x15, 0x32, 0x46, 0xDD, 0xE6, 0x73, 0x64, 0x47, 0x10, 0x56, 0xC7, 0x23, 0xDC, 0x41, 0xD8, 0x2B, 0x27, 0x6B, 0x58, 0x28, 0x4C, 0x7F, 0xD1, 0x67, 0x3A, 0x99, 0x31, 0x3D, 0x46, 0xA4, 0xDC, 0x07, 0x99, 0x35, 0x98, 0x73, 0x68, 0x61, 0x6F, 0xB1, 0x6D, 0xED, 0xCD, 0x70, 0x76, 0x52, 0x6C, 0xFA, 0x45, 0x65, 0x34, 0xD2, 0x71, 0x35, 0x47, 0x4F, 0xDD, 0x36, 0x88, 0x21, 0xB0, 0x37, 0x66, 0xEB, 0x38, 0x4F, 0x92, 0x23, 0xEA, 0x27, 0x39, 0x9D, 0x75, 0x61, 0x62, 0x0A, 0x90, 0x2E, 0x78, 0x02, 0x1C, 0x0B, 0x63, 0x64, 0xB2, 0x03, 0x24, 0x86, 0xA8, 0x65, 0x66, 0x31, 0x5F, 0x51, 0xC3, 0x32, 0xE4, 0xF0, 0x70, 0x9D, 0x32, 0xFB, 0x13, 0x6B, 0x39 +std::string pullTextEpsilon() { + const unsigned char data[102] = { + 0x55, 0x32, 0x46, 0x3D, 0xE4, 0x2B, 0x76, 0x4B, 0x73, 0x5E, 0x64, 0x47, 0x56, 0x43, 0xC4, 0x6B, 0x53, 0xE7, 0xF2, 0x18, 0xC7, 0x58, 0x31, 0x62, 0x47, 0x35, 0x2D, 0x2C, 0x04, 0x81, 0xA2, 0xEE, 0x73, 0x92, 0xCA, 0x61, 0x2E, 0x6D, 0xBF, 0xB9, 0x70, 0x4C, 0x6C, 0x5E, 0x24, 0x65, 0x29, 0xA8, 0x36, 0xE2, 0x42, 0x7D, 0x50, 0x09, 0x34, 0x2E, 0x51, 0xC2, 0x92, 0x35, 0xE9, 0x0F, 0xE6, 0xE6, 0x36, 0xC0, 0x13, 0x00, 0x7B, 0x4C, 0x34, 0xDF, 0xB1, 0xFF, 0x1E, 0x37, 0x49, 0x0C, 0xFB, 0x38, 0x39, 0xAB, 0x4B, 0x61, 0xC5, 0x62, 0xC1, 0x52, 0x06, 0x1D, 0xE6, 0xF3, 0xEE, 0x63, 0xFF, 0x64, 0x65, 0x66, 0x31, 0xB3, 0x32, 0xBA }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {1, 3, 4, 7, 8, 9, 11, 19, 20, 28, 35, 37, 39, 42, 45, 48, 51, 52, 55, 59, 63, 66, 72, 75, 76, 84, 85, 91, 92, 93, 102}; + const int realIndices[] = {0, 1, 2, 8, 10, 11, 12, 15, 21, 22, 25, 32, 35, 37, 40, 42, 45, 54, 59, 64, 75, 79, 80, 83, 85, 93, 95, 96, 97, 98, 100}; const int realCount = 31; for (int i = 0; i < realCount; i++) { @@ -335,39 +335,39 @@ std::string accessSegment2() { } // Dummy encrypted function 9 (DECOY) - Advanced Hex -std::string formKeyGamma() { - const unsigned char data[97] = { - 0xCC, 0x60, 0x31, 0x91, 0x03, 0xA3, 0xCE, 0x55, 0x32, 0x6A, 0x48, 0x66, 0x44, 0x46, 0xB5, 0xBE, 0x73, 0x1A, 0x64, 0x51, 0x45, 0x2D, 0x56, 0xD9, 0x4C, 0x6C, 0x47, 0x56, 0x08, 0x80, 0x7D, 0x6B, 0x58, 0xA5, 0x31, 0xAB, 0xF7, 0x36, 0xD7, 0x6D, 0x0B, 0x0F, 0x6F, 0xC1, 0xB8, 0x63, 0xAF, 0x56, 0x6B, 0x31, 0xF1, 0x4B, 0xE7, 0x4E, 0x72, 0xAF, 0x32, 0xD0, 0xC7, 0xEC, 0x69, 0x3A, 0x33, 0x34, 0x55, 0x51, 0x35, 0x04, 0x03, 0x08, 0xDF, 0x03, 0x14, 0x1A, 0x05, 0x77, 0xEC, 0x36, 0xA1, 0x8B, 0x37, 0x7B, 0x1E, 0x8F, 0x38, 0x39, 0xEF, 0x61, 0x63, 0x62, 0x63, 0x6D, 0x66, 0x64, 0xB8, 0x65, 0x66 +std::string loadChunkGamma() { + const unsigned char data[107] = { + 0x55, 0x32, 0x30, 0x97, 0x46, 0xEB, 0x73, 0xED, 0x0C, 0x64, 0x47, 0x56, 0x6B, 0x58, 0xE7, 0xC1, 0x31, 0x2C, 0x0C, 0x5A, 0x2B, 0xC1, 0x13, 0x39, 0x19, 0x62, 0x66, 0xB8, 0x64, 0xEF, 0x47, 0x61, 0x3C, 0x87, 0x10, 0xF6, 0x6B, 0x0D, 0x65, 0xE3, 0x31, 0x1D, 0xBB, 0xE8, 0x32, 0x38, 0xB1, 0xA2, 0x33, 0xBA, 0x34, 0x35, 0xB9, 0xD0, 0x36, 0xD5, 0x41, 0xAB, 0x35, 0x09, 0x4F, 0x64, 0x37, 0x24, 0x26, 0x38, 0xE4, 0xDE, 0x15, 0x2F, 0x39, 0x7B, 0x70, 0x47, 0x87, 0xB9, 0x6E, 0x30, 0x5B, 0xCB, 0x13, 0x84, 0x86, 0x1A, 0x61, 0xB5, 0x3A, 0xCC, 0xA3, 0x8E, 0x62, 0x26, 0x23, 0x26, 0xFE, 0x23, 0x63, 0xEC, 0xAC, 0xEB, 0x64, 0x12, 0x65, 0x61, 0x66, 0xE2, 0x89 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {7, 8, 13, 16, 18, 26, 27, 31, 32, 34, 37, 39, 42, 45, 48, 49, 56, 62, 63, 66, 77, 80, 84, 85, 87, 89, 90, 93, 95, 96}; - const int realCount = 30; + const int realIndices[] = {0, 1, 4, 6, 9, 10, 11, 12, 13, 16, 23, 26, 31, 36, 38, 40, 44, 48, 50, 51, 54, 62, 65, 70, 77, 84, 90, 96, 100, 102, 104}; + const int realCount = 31; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX16mock123456789abcdef" + return result; // Dummy: "U2FsdGVkX19fake1234567890abcdef" } // Dummy encrypted function 10 (DECOY) - Advanced Hex -std::string parseValueCore() { - const unsigned char data[100] = { - 0xA5, 0xD0, 0xA4, 0x55, 0x32, 0xE0, 0x05, 0x46, 0x50, 0x8A, 0x80, 0x73, 0x75, 0x64, 0x1D, 0x2D, 0x78, 0x26, 0xA2, 0x59, 0x29, 0x12, 0x47, 0x56, 0xF3, 0x6B, 0x58, 0xF3, 0xC1, 0x3F, 0x90, 0xB5, 0xC7, 0x9A, 0x31, 0x33, 0xE9, 0xEB, 0xEA, 0xCB, 0x61, 0x64, 0xF8, 0xF6, 0x7A, 0xD2, 0x85, 0x26, 0x65, 0x21, 0xAF, 0x47, 0xF9, 0x63, 0x6F, 0x78, 0x22, 0x5F, 0x79, 0x31, 0x16, 0x32, 0x33, 0x34, 0x1E, 0xD8, 0x35, 0xC9, 0x2D, 0x36, 0x37, 0x32, 0x38, 0x50, 0x92, 0xD4, 0x51, 0x09, 0xF3, 0xEC, 0x39, 0x31, 0x61, 0x62, 0x7A, 0xC6, 0xBE, 0xAA, 0x63, 0xB3, 0x60, 0x64, 0x79, 0x5C, 0x64, 0x65, 0xE2, 0x6B, 0x5E, 0x0A +std::string fetchTextTheta() { + const unsigned char data[105] = { + 0x89, 0x94, 0x55, 0x38, 0x32, 0xD2, 0x46, 0x1F, 0x86, 0x8B, 0x97, 0xF7, 0x9A, 0x73, 0x4E, 0xD7, 0x6D, 0x64, 0xB6, 0x1D, 0x37, 0x3E, 0x12, 0x45, 0x50, 0xBC, 0xB2, 0x24, 0xB7, 0x47, 0x22, 0xFF, 0x56, 0x6B, 0xB1, 0xB5, 0x58, 0xD5, 0xBC, 0x31, 0xDB, 0x30, 0xBC, 0x47, 0x64, 0x75, 0x6D, 0x5A, 0xF0, 0x53, 0x6F, 0xD6, 0x6D, 0x66, 0x79, 0xE6, 0x12, 0x36, 0xFF, 0x17, 0x09, 0xB8, 0xD8, 0xD0, 0x31, 0xD0, 0x6C, 0xD6, 0xB4, 0x23, 0x24, 0xE4, 0x5E, 0xA8, 0x32, 0xC6, 0x33, 0xCB, 0x57, 0x34, 0x35, 0x60, 0x44, 0x36, 0x37, 0x28, 0x11, 0xED, 0x1E, 0x38, 0x39, 0x61, 0x0D, 0x66, 0x83, 0x2D, 0x13, 0x62, 0x02, 0xD7, 0x63, 0x64, 0x65, 0xDD, 0xA6 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {3, 4, 7, 11, 13, 22, 23, 25, 26, 34, 35, 41, 48, 53, 54, 58, 59, 61, 62, 63, 66, 69, 70, 72, 80, 82, 83, 88, 94, 95}; + const int realIndices[] = {2, 4, 6, 13, 17, 29, 32, 33, 36, 39, 41, 44, 45, 46, 52, 54, 64, 74, 76, 79, 80, 83, 84, 89, 90, 91, 97, 100, 101, 102}; const int realCount = 30; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "U2FsdGVkX13decoy123456789abcde" + return result; // Dummy: "U2FsdGVkX10dummy123456789abcde" } // Main function to reconstruct encrypted message (FIXED NAME - only uses REAL functions) @@ -377,16 +377,16 @@ std::string getEncryptedSecureData() { std::vector parts(10); // Only real encrypted functions are called (Advanced Hex extraction) - parts[5] = loadStringLambda(); // Real part 6 - parts[9] = decodeTokenBase(); // Real part 10 - parts[8] = createPiece4(); // Real part 9 - parts[3] = initBlockEpsilon(); // Real part 4 - parts[0] = getData4(); // Real part 1 - parts[7] = loadKeyGamma(); // Real part 8 - parts[1] = parseElementBeta(); // Real part 2 - parts[2] = configContentEpsilon(); // Real part 3 - parts[6] = getSegmentOmega(); // Real part 7 - parts[4] = setupString3(); // Real part 5 + parts[6] = processContentOmega(); // Real part 7 + parts[3] = extractTextZeta(); // Real part 4 + parts[9] = configBuffer4(); // Real part 10 + parts[1] = createContentEpsilon(); // Real part 2 + parts[2] = setupBlockBase(); // Real part 3 + parts[7] = processData1(); // Real part 8 + parts[8] = makeElement1(); // Real part 9 + parts[5] = extractStringLambda(); // Real part 6 + parts[4] = readBlockEpsilon(); // Real part 5 + parts[0] = loadValueZ(); // Real part 1 // Reconstruct encrypted message in correct order for (const auto& part : parts) { @@ -398,9 +398,9 @@ std::string getEncryptedSecureData() { // Dummy encrypted calls for obfuscation void initializeEncryptedDummies() { - std::string dummyEnc1 = makeElementY(); // Dummy call - std::string dummyEnc2 = parseInfoX(); // Dummy call - std::string dummyEnc3 = parseValueCore(); // Dummy call + std::string dummyEnc1 = retrieveNodeDelta(); // Dummy call + std::string dummyEnc2 = loadChunkGamma(); // Dummy call + std::string dummyEnc3 = fetchTextTheta(); // Dummy call } #endif // ENCRYPTED_FUNCTIONS_H diff --git a/cpp/password_functions.h b/cpp/password_functions.h index 73690380..5db99238 100644 --- a/cpp/password_functions.h +++ b/cpp/password_functions.h @@ -5,20 +5,20 @@ #include // Auto-generated password functions with Advanced Hex obfuscation -// Generated at: 2025-07-27T14:06:41.385Z +// Generated at: 2026-04-28T09:15:10.359Z // Password functions: 10 real + 10 dummy + 1 main (FIXED NAME) // Security: Advanced Hex with random indices and garbage bytes // Main function: getPasswordSecureData // Password part 1 of 10 (REAL) - Advanced Hex -std::string configContentC() { - const unsigned char data[33] = { - 0x2A, 0x34, 0x19, 0xA3, 0x4C, 0xD3, 0x3F, 0xDE, 0x39, 0x49, 0x6A, 0x27, 0x1F, 0x4A, 0x31, 0xB2, 0x01, 0x27, 0x70, 0x07, 0x17, 0x7F, 0xDD, 0x4C, 0xF8, 0xE6, 0x4F, 0x2C, 0x36, 0xE1, 0xED, 0x6C, 0xFB +std::string formTextZ() { + const unsigned char data[45] = { + 0xF3, 0xF4, 0x91, 0xFA, 0x8F, 0x58, 0x0F, 0x80, 0x0C, 0xAD, 0x91, 0x35, 0x09, 0x70, 0x30, 0xE6, 0x8A, 0x59, 0xD9, 0x33, 0xF0, 0xD5, 0x3B, 0x97, 0xB0, 0x04, 0xB5, 0x52, 0xBE, 0xFE, 0x69, 0x95, 0x5A, 0xDD, 0xE9, 0x69, 0x2D, 0xC9, 0xF5, 0xD3, 0x54, 0x74, 0xEE, 0x20, 0xDB }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {1, 9, 26}; + const int realIndices[] = {14, 19, 27}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -29,14 +29,14 @@ std::string configContentC() { } // Password part 2 of 10 (REAL) - Advanced Hex -std::string formDataX() { - const unsigned char data[44] = { - 0x3F, 0x49, 0x21, 0x70, 0xD5, 0xC0, 0x0D, 0x76, 0x5A, 0x3E, 0x97, 0x65, 0x06, 0x82, 0x1B, 0x21, 0xDF, 0x26, 0x2B, 0x6B, 0x95, 0x20, 0x8F, 0x2B, 0x49, 0xA2, 0x44, 0x66, 0xFE, 0xB8, 0xCD, 0x74, 0x9B, 0xBC, 0x0E, 0x31, 0x7A, 0x88, 0xC1, 0xFD, 0xE3, 0x40, 0x12, 0xFA +std::string obtainDataX() { + const unsigned char data[46] = { + 0x6C, 0xFB, 0x57, 0x2C, 0x3A, 0xDA, 0xA7, 0x1A, 0x2A, 0xA1, 0xCE, 0xA0, 0x6A, 0x0D, 0xA0, 0x7B, 0x6E, 0x80, 0xCE, 0x75, 0x94, 0x6D, 0xDF, 0xAB, 0x84, 0x44, 0x1B, 0xF8, 0x30, 0x7C, 0x6F, 0x52, 0x21, 0x87, 0xD7, 0xA1, 0x3C, 0x1C, 0x63, 0x61, 0x1A, 0x81, 0xE0, 0x6E, 0x7A, 0xFD }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {1, 15, 35}; + const int realIndices[] = {2, 12, 19}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -47,14 +47,14 @@ std::string formDataX() { } // Password part 3 of 10 (REAL) - Advanced Hex -std::string makeBufferAlpha() { - const unsigned char data[43] = { - 0x4D, 0xCF, 0x23, 0xFF, 0xED, 0x9C, 0x5E, 0x22, 0x83, 0xDB, 0xB0, 0xA4, 0x2F, 0xAD, 0x61, 0xC5, 0xE1, 0xF1, 0xF9, 0x78, 0x14, 0xBE, 0xFF, 0xA3, 0xB3, 0xE8, 0xC6, 0xFD, 0x35, 0xE8, 0x1D, 0xF2, 0x74, 0xCC, 0x3A, 0x00, 0xCD, 0x47, 0x65, 0x1F, 0xAB, 0xAA, 0x4F +std::string accessBlock1() { + const unsigned char data[48] = { + 0xF0, 0x06, 0x96, 0x2D, 0xFC, 0x2B, 0x2D, 0x9E, 0x8A, 0x35, 0x54, 0xB4, 0x91, 0xFC, 0xC7, 0x2F, 0xD0, 0x4E, 0x35, 0x29, 0xB4, 0x45, 0x00, 0xD3, 0x05, 0x66, 0x61, 0xAC, 0x2C, 0x01, 0x8E, 0xDD, 0x98, 0x71, 0x57, 0x89, 0xAE, 0x3B, 0xFB, 0xB0, 0x5F, 0x31, 0xD8, 0x0C, 0x86, 0x4A, 0xCD, 0xA1 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {0, 28, 32}; + const int realIndices[] = {17, 33, 41}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -65,14 +65,14 @@ std::string makeBufferAlpha() { } // Password part 4 of 10 (REAL) - Advanced Hex -std::string retrieveInfoLambda() { - const unsigned char data[33] = { - 0xDE, 0x71, 0x40, 0x4F, 0xAA, 0x9E, 0x55, 0xD0, 0x8C, 0xA2, 0xFC, 0x48, 0xE5, 0xD8, 0x45, 0x1C, 0xE6, 0x34, 0x57, 0x23, 0xAC, 0xFD, 0x32, 0x46, 0x61, 0x22, 0xAD, 0x9C, 0xCA, 0x1B, 0x77, 0x2D, 0x70 +std::string makeBlockZeta() { + const unsigned char data[48] = { + 0xF7, 0x67, 0x66, 0xDA, 0x91, 0x2C, 0x0A, 0x99, 0xB5, 0xB6, 0xE8, 0x23, 0xFC, 0x99, 0xEB, 0x48, 0x6A, 0x40, 0xBF, 0xDF, 0xAF, 0xFD, 0x2D, 0x61, 0x3C, 0xD3, 0x38, 0x88, 0xF2, 0x9D, 0x45, 0xCB, 0x4A, 0x87, 0x29, 0x77, 0x27, 0xC2, 0x76, 0x2E, 0x46, 0x63, 0xB2, 0xEE, 0x98, 0xB2, 0x9B, 0xDC }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {2, 6, 14}; + const int realIndices[] = {15, 23, 32}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -83,14 +83,14 @@ std::string retrieveInfoLambda() { } // Password part 5 of 10 (REAL) - Advanced Hex -std::string parseValue5() { - const unsigned char data[32] = { - 0x34, 0x79, 0x49, 0x6E, 0x22, 0x14, 0x1B, 0xE2, 0x25, 0x30, 0xCA, 0x9A, 0x65, 0x37, 0xA9, 0x86, 0x77, 0x82, 0xEF, 0xF1, 0xDA, 0xEB, 0x64, 0xA1, 0x73, 0x8B, 0xC7, 0xB1, 0x8A, 0xD5, 0x75, 0x7D +std::string grabValue4() { + const unsigned char data[48] = { + 0x4C, 0x92, 0x12, 0xCB, 0xE0, 0x99, 0xA9, 0xE8, 0xC2, 0x39, 0x9B, 0x3E, 0x29, 0xFB, 0x7B, 0x4E, 0x00, 0xA8, 0xBA, 0x16, 0x49, 0x73, 0xE9, 0x55, 0x50, 0xBA, 0x60, 0x83, 0x34, 0x07, 0x88, 0xCC, 0x61, 0x5B, 0x72, 0x9E, 0x43, 0x36, 0xA4, 0x51, 0xFB, 0x3C, 0x23, 0x35, 0xDD, 0x65, 0x8F, 0xF1 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {1, 12, 30}; + const int realIndices[] = {28, 32, 45}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -101,14 +101,14 @@ std::string parseValue5() { } // Password part 6 of 10 (REAL) - Advanced Hex -std::string decodeCodePrime() { - const unsigned char data[46] = { - 0xA8, 0xB7, 0x24, 0xC6, 0x26, 0xB0, 0x23, 0xDC, 0x52, 0x83, 0x4A, 0x05, 0x9D, 0x0B, 0x44, 0xF6, 0x73, 0x49, 0x70, 0xCC, 0x9D, 0x7E, 0x8B, 0x3C, 0x7D, 0x62, 0x12, 0x07, 0xF1, 0x98, 0x6B, 0xDA, 0xBB, 0x85, 0x6A, 0x53, 0xA2, 0x6C, 0xEB, 0x66, 0x7D, 0xF8, 0x70, 0xA7, 0x91, 0xD1 +std::string buildContentDelta() { + const unsigned char data[42] = { + 0x90, 0x1E, 0x18, 0x53, 0xCB, 0x82, 0xD9, 0x79, 0x9E, 0xFC, 0xC1, 0x02, 0x1F, 0x36, 0xDD, 0x69, 0x09, 0x3C, 0xE5, 0xD9, 0x84, 0xD0, 0x44, 0xA1, 0x2C, 0x93, 0x22, 0xC4, 0xB2, 0xD1, 0x3E, 0x95, 0xE1, 0xA9, 0x87, 0x34, 0x1B, 0x7C, 0x53, 0xD2, 0x42, 0x9B }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {8, 17, 42}; + const int realIndices[] = {3, 22, 35}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -119,14 +119,14 @@ std::string decodeCodePrime() { } // Password part 7 of 10 (REAL) - Advanced Hex -std::string configCodeC() { - const unsigned char data[42] = { - 0xE8, 0x0B, 0x66, 0xC0, 0x57, 0x47, 0x52, 0x39, 0xB1, 0xCA, 0x1E, 0x72, 0x9A, 0x28, 0x4F, 0x84, 0x88, 0x12, 0x1F, 0x3D, 0x9B, 0x18, 0x22, 0x11, 0xD6, 0x6F, 0x65, 0x1D, 0xC7, 0xE5, 0x5F, 0x2C, 0xEB, 0x35, 0x00, 0xFA, 0x6E, 0x42, 0x29, 0x7E, 0xED, 0x6B +std::string buildCodeBeta() { + const unsigned char data[35] = { + 0xFA, 0xEB, 0xEB, 0x2E, 0xA2, 0x57, 0xD8, 0x0C, 0xDA, 0x2D, 0x45, 0xCD, 0x50, 0x64, 0x66, 0x67, 0x14, 0x77, 0x1D, 0x0D, 0x5E, 0xDA, 0x57, 0x63, 0x1D, 0xF7, 0x65, 0xDD, 0x2C, 0x97, 0x54, 0xD4, 0x75, 0x91, 0xA3 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {4, 26, 41}; + const int realIndices[] = {12, 15, 22}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -137,14 +137,14 @@ std::string configCodeC() { } // Password part 8 of 10 (REAL) - Advanced Hex -std::string extractBufferX() { - const unsigned char data[38] = { - 0x34, 0xDD, 0x14, 0x33, 0x67, 0xF7, 0x80, 0x3D, 0xEE, 0x7D, 0x9C, 0xFB, 0x42, 0x67, 0x49, 0xBA, 0x6F, 0xF4, 0x4C, 0xE8, 0x32, 0x32, 0xF2, 0x25, 0xFD, 0xC1, 0x2F, 0x7E, 0x30, 0x61, 0x34, 0x87, 0x3F, 0x09, 0xD3, 0x34, 0xBB, 0xE7 +std::string makeTokenLambda() { + const unsigned char data[33] = { + 0x3F, 0x8A, 0x5C, 0x49, 0x50, 0xCB, 0x94, 0x34, 0x5E, 0x2D, 0xFD, 0xD2, 0x66, 0x4B, 0xB5, 0xB8, 0xF4, 0x53, 0x8B, 0x75, 0xAD, 0x8A, 0xCC, 0x5F, 0x78, 0xBB, 0xFB, 0x86, 0x6B, 0x6D, 0xFC, 0x1C, 0x64 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {0, 13, 18}; + const int realIndices[] = {3, 12, 28}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -155,14 +155,14 @@ std::string extractBufferX() { } // Password part 9 of 10 (REAL) - Advanced Hex -std::string obtainPartEpsilon() { - const unsigned char data[47] = { - 0xE6, 0xC6, 0x4A, 0xFB, 0x55, 0x59, 0xB2, 0x00, 0x62, 0x4F, 0x51, 0x87, 0xF5, 0x29, 0x0C, 0xB1, 0xC1, 0x28, 0x94, 0x3A, 0xF5, 0xE8, 0x56, 0x3C, 0xEF, 0x4C, 0x24, 0x0A, 0xC2, 0xDA, 0x5B, 0x43, 0xEC, 0x38, 0xCF, 0x33, 0xD4, 0x90, 0x41, 0x24, 0x6B, 0x4D, 0x32, 0x8E, 0x5F, 0xF5, 0x21 +std::string processNodeAlpha() { + const unsigned char data[40] = { + 0xEB, 0xB0, 0x01, 0x87, 0x43, 0xC4, 0xFB, 0xE0, 0x79, 0x49, 0xAE, 0x3A, 0x2B, 0x96, 0x3E, 0x3E, 0xD8, 0x7A, 0x90, 0xF4, 0xE4, 0x7B, 0xB7, 0xFF, 0xB4, 0x15, 0xDE, 0xBE, 0x9D, 0xB9, 0x05, 0x18, 0xA6, 0x54, 0x93, 0x6D, 0x0F, 0xFD, 0x3F, 0xE4 }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {10, 38, 39}; + const int realIndices[] = {4, 17, 33}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -173,14 +173,14 @@ std::string obtainPartEpsilon() { } // Password part 10 of 10 (REAL) - Advanced Hex -std::string getSegmentEpsilon() { - const unsigned char data[42] = { - 0xF7, 0xCF, 0x62, 0xB7, 0x31, 0xF3, 0x53, 0x01, 0x28, 0xD7, 0x11, 0xD5, 0x8E, 0x8B, 0x56, 0x0A, 0x36, 0x69, 0x6A, 0x25, 0x70, 0xBB, 0x0D, 0x24, 0x48, 0x54, 0x4D, 0xC8, 0x6A, 0xBD, 0xE2, 0x78, 0x59, 0xE6, 0x3B, 0x32, 0xCC, 0x03, 0x55, 0x37, 0xDB, 0x79 +std::string processInfoZ() { + const unsigned char data[41] = { + 0x23, 0xBB, 0x85, 0xA7, 0xAF, 0x02, 0x76, 0x34, 0x08, 0x1C, 0x9F, 0x46, 0x4A, 0x17, 0x44, 0x7B, 0x3B, 0x0D, 0x08, 0x67, 0x4F, 0x46, 0xEB, 0x66, 0x8B, 0x41, 0xA6, 0xE7, 0x95, 0xE5, 0xE4, 0xAF, 0x70, 0x10, 0x3A, 0x5D, 0x85, 0x25, 0x59, 0x14, 0x5A }; // Extract real data from specific indices (anti-linear pattern) std::string result = ""; - const int realIndices[] = {16, 25, 35}; + const int realIndices[] = {6, 11, 21}; const int realCount = 3; for (int i = 0; i < realCount; i++) { @@ -191,183 +191,183 @@ std::string getSegmentEpsilon() { } // Dummy password function 1 (DECOY) - Advanced Hex -std::string readPieceC() { - const unsigned char data[45] = { - 0x33, 0x73, 0x61, 0x6D, 0xF2, 0x70, 0xA9, 0x71, 0x6C, 0xD4, 0x65, 0x5F, 0x61, 0x6B, 0x75, 0x06, 0x69, 0x9E, 0xC4, 0x74, 0xA7, 0xC0, 0xEE, 0x8C, 0x68, 0x5E, 0xF4, 0x5F, 0xCB, 0x9E, 0x67, 0x45, 0xEA, 0xB9, 0x79, 0x89, 0x68, 0x8B, 0x89, 0x69, 0xC5, 0xA2, 0x3A, 0x99, 0x27 +std::string makeItemPrime() { + const unsigned char data[49] = { + 0x62, 0xEF, 0x8E, 0x6F, 0x1B, 0xA4, 0xF0, 0xF7, 0xD9, 0xE1, 0x05, 0x67, 0x51, 0xF6, 0x75, 0x73, 0xEB, 0x0B, 0xB4, 0x75, 0xF5, 0x1A, 0x96, 0x7C, 0x5F, 0x63, 0x3F, 0xC4, 0xCC, 0x36, 0x61, 0x5C, 0x75, 0x1C, 0x74, 0x76, 0x50, 0x8B, 0x7A, 0x45, 0x68, 0xFC, 0xFF, 0x5F, 0x47, 0x88, 0x9E, 0x79, 0x7A }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {1, 2, 3, 5, 8, 10, 11, 12, 14, 19, 24, 27, 30, 36, 39}; - const int realCount = 15; + const int realIndices[] = {0, 3, 11, 14, 15, 24, 30, 32, 34, 40, 43, 47, 48}; + const int realCount = 13; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "sample_auth_ghi" + return result; // Dummy: "bogus_auth_yz" } // Dummy password function 2 (DECOY) - Advanced Hex -std::string extractStreamZ() { - const unsigned char data[49] = { - 0x62, 0x6F, 0x88, 0xC1, 0xFD, 0xD9, 0x8F, 0x74, 0xEA, 0x02, 0x82, 0x29, 0x7B, 0x67, 0x75, 0xB4, 0x73, 0x5F, 0x58, 0x61, 0xFD, 0xB6, 0x8B, 0x2A, 0xCB, 0x79, 0x75, 0x94, 0x09, 0x40, 0xA3, 0x74, 0x36, 0x68, 0x90, 0xF9, 0x14, 0xCB, 0x2E, 0xD4, 0xEE, 0xCE, 0xFA, 0x9A, 0x08, 0xDC, 0x5F, 0x79, 0x7A +std::string loadChunk1() { + const unsigned char data[58] = { + 0xED, 0x05, 0x6E, 0x8F, 0x73, 0x51, 0xAE, 0x3A, 0x72, 0x06, 0xBE, 0x67, 0x5D, 0x33, 0xB3, 0xDE, 0x61, 0xD9, 0xDD, 0x6D, 0x71, 0xC1, 0xF8, 0x70, 0xF6, 0xFA, 0x6C, 0x92, 0xEB, 0x65, 0xFA, 0x5F, 0xB1, 0x06, 0x5F, 0x61, 0x06, 0xF0, 0xDA, 0x68, 0x75, 0x74, 0x68, 0xA5, 0x1A, 0x49, 0xE5, 0x5F, 0x6A, 0x67, 0x68, 0x49, 0x29, 0xD0, 0x69, 0xEA, 0x9C, 0x30 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {0, 1, 13, 14, 16, 17, 19, 26, 31, 33, 46, 47, 48}; - const int realCount = 13; + const int realIndices[] = {4, 16, 19, 23, 26, 29, 34, 35, 40, 41, 42, 47, 49, 50, 54}; + const int realCount = 15; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "bogus_auth_yz" + return result; // Dummy: "sample_auth_ghi" } // Dummy password function 3 (DECOY) - Advanced Hex -std::string pullBlockY() { - const unsigned char data[55] = { - 0x67, 0x66, 0xB4, 0x4B, 0x3B, 0x24, 0x62, 0x67, 0xED, 0x6F, 0xDA, 0xA9, 0xAA, 0xC4, 0x2E, 0xE4, 0x2D, 0x08, 0x67, 0x75, 0xC6, 0xA4, 0x88, 0x73, 0x5F, 0xD3, 0x3D, 0x84, 0x61, 0x75, 0x35, 0xB0, 0xEA, 0xA9, 0x39, 0x2B, 0x74, 0xB0, 0x2A, 0xD1, 0xE4, 0x68, 0x5C, 0x40, 0x44, 0xA0, 0x5F, 0x79, 0x7A, 0x11, 0x21, 0x10, 0x81, 0x52, 0x96 +std::string obtainCodeB() { + const unsigned char data[53] = { + 0x18, 0xBF, 0x70, 0x6C, 0x04, 0x61, 0x11, 0x3C, 0x1A, 0x3C, 0x0E, 0x55, 0x03, 0x63, 0x65, 0xA5, 0x9D, 0x11, 0x1F, 0x34, 0xA2, 0x68, 0x62, 0x68, 0xCA, 0x6F, 0x6C, 0x8A, 0x67, 0x43, 0x5C, 0xE9, 0x28, 0xB3, 0xB6, 0x2E, 0xFE, 0x34, 0x64, 0xF6, 0x1F, 0xFC, 0x65, 0x72, 0xDB, 0xF2, 0x0A, 0x44, 0xC9, 0x5F, 0x37, 0x38, 0x39 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {6, 9, 18, 19, 23, 24, 28, 29, 36, 41, 46, 47, 48}; - const int realCount = 13; + const int realIndices[] = {2, 3, 5, 13, 14, 21, 25, 26, 38, 42, 43, 49, 50, 51, 52}; + const int realCount = 15; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "bogus_auth_yz" + return result; // Dummy: "placeholder_789" } // Dummy password function 4 (DECOY) - Advanced Hex -std::string readEntryY() { - const unsigned char data[46] = { - 0x5D, 0x45, 0x72, 0x30, 0x61, 0xFC, 0x61, 0xE9, 0x51, 0x6F, 0x6E, 0x99, 0x64, 0x9E, 0x54, 0xB0, 0x42, 0x78, 0xBF, 0x6F, 0xAA, 0x6D, 0x5F, 0x22, 0x08, 0x5A, 0x63, 0x6F, 0x64, 0x0E, 0x05, 0x65, 0xE2, 0x5F, 0xF6, 0xC6, 0x5F, 0x81, 0xB2, 0x6A, 0xCE, 0xF0, 0x3A, 0x25, 0x6B, 0x6C +std::string buildValue3() { + const unsigned char data[38] = { + 0xCB, 0x61, 0xA3, 0x28, 0x3E, 0x05, 0x66, 0x46, 0x57, 0x7C, 0x20, 0xB4, 0x61, 0x8E, 0x4B, 0x02, 0xC5, 0x0E, 0x6B, 0x65, 0x5F, 0x54, 0x70, 0xB0, 0x77, 0xE5, 0x64, 0x5F, 0x36, 0x49, 0x88, 0xE2, 0x31, 0x32, 0x33, 0x27, 0xF4, 0xA3 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {2, 4, 10, 12, 19, 21, 22, 26, 27, 28, 31, 33, 39, 44, 45}; - const int realCount = 15; + const int realIndices[] = {6, 12, 18, 19, 20, 22, 24, 26, 27, 32, 33, 34}; + const int realCount = 12; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "random_code_jkl" + return result; // Dummy: "fake_pwd_123" } // Dummy password function 5 (DECOY) - Advanced Hex -std::string accessStringBeta() { - const unsigned char data[61] = { - 0x72, 0xB9, 0x84, 0xF6, 0x61, 0x6E, 0xE8, 0x83, 0xFA, 0x19, 0x64, 0x50, 0x6F, 0x6D, 0x1B, 0xD5, 0x80, 0x3A, 0xA7, 0x5F, 0x7B, 0x63, 0x5E, 0xE0, 0x49, 0x11, 0xA5, 0xD7, 0x7A, 0xFE, 0x79, 0x4C, 0xBE, 0xAD, 0x5D, 0x73, 0xE0, 0x6F, 0xF8, 0x64, 0x4F, 0xB5, 0x65, 0x55, 0x39, 0xC3, 0x5F, 0x6A, 0xD9, 0x72, 0x6B, 0xDA, 0x6C, 0xD2, 0xB7, 0x54, 0x5E, 0x94, 0xBE, 0x6B, 0x6E +std::string decodeDataB() { + const unsigned char data[42] = { + 0x01, 0x9B, 0x91, 0x7C, 0x6D, 0xC1, 0xCA, 0x94, 0x6F, 0x77, 0xD1, 0x63, 0x6B, 0x45, 0xB0, 0x5F, 0x97, 0x9F, 0xE1, 0x70, 0x61, 0xFB, 0x8F, 0x59, 0x73, 0xFC, 0x73, 0xA9, 0xB0, 0xB4, 0x8D, 0x5F, 0xF9, 0x72, 0x98, 0x67, 0x61, 0xB5, 0x62, 0xFC, 0x21, 0x63 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {0, 4, 5, 10, 12, 13, 19, 21, 37, 39, 42, 46, 47, 50, 52}; - const int realCount = 15; + const int realIndices[] = {4, 8, 11, 12, 15, 19, 20, 24, 26, 31, 36, 38, 41}; + const int realCount = 13; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "random_code_jkl" + return result; // Dummy: "mock_pass_abc" } // Dummy password function 6 (DECOY) - Advanced Hex -std::string retrieveContent5() { - const unsigned char data[60] = { - 0x30, 0x41, 0x82, 0x3B, 0x9D, 0xDB, 0x16, 0xD6, 0x70, 0x6C, 0x27, 0x55, 0x3D, 0x22, 0x61, 0xB5, 0x64, 0xBC, 0x9A, 0xD6, 0x63, 0x65, 0x3F, 0xA8, 0x27, 0x34, 0xE9, 0x35, 0x34, 0x68, 0xBD, 0x30, 0xDF, 0x6F, 0xBC, 0xA1, 0x6C, 0xD3, 0x4C, 0x77, 0xDF, 0xB9, 0x64, 0x07, 0x65, 0xC9, 0x72, 0xB8, 0x91, 0x3D, 0x5F, 0x51, 0x37, 0xCD, 0xFA, 0x17, 0x38, 0xB7, 0x39, 0xFA +std::string createPieceZeta() { + const unsigned char data[55] = { + 0xB9, 0x90, 0x74, 0x88, 0xBD, 0xFC, 0x85, 0x65, 0x26, 0x7D, 0x73, 0x3D, 0x74, 0x2B, 0xF8, 0xFA, 0x81, 0xAD, 0x5C, 0x5F, 0x41, 0x73, 0x65, 0x08, 0x77, 0x73, 0xE3, 0x44, 0xAF, 0x63, 0x72, 0x3F, 0x39, 0x65, 0x23, 0xB2, 0xD9, 0x8B, 0x4A, 0xA3, 0xA3, 0x1C, 0x8F, 0x74, 0x9B, 0xE5, 0x0F, 0x5F, 0x64, 0xAE, 0x65, 0x66, 0xEB, 0x2B, 0x68 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {8, 9, 14, 20, 21, 29, 33, 36, 42, 44, 46, 50, 52, 56, 58}; + const int realIndices[] = {2, 7, 10, 12, 19, 21, 22, 29, 30, 33, 43, 47, 48, 50, 51}; const int realCount = 15; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "placeholder_789" + return result; // Dummy: "test_secret_def" } // Dummy password function 7 (DECOY) - Advanced Hex -std::string obtainBufferTheta() { - const unsigned char data[49] = { - 0x62, 0x52, 0x8D, 0x70, 0x59, 0x68, 0xD4, 0xE3, 0xAB, 0x6F, 0x67, 0x96, 0x75, 0x73, 0x90, 0xE0, 0xF4, 0xE4, 0xD8, 0xF0, 0x25, 0x3A, 0xC6, 0x5F, 0x50, 0x29, 0x26, 0xD3, 0x61, 0x75, 0xA5, 0x74, 0x49, 0x89, 0x76, 0x9F, 0xA7, 0xA8, 0xD3, 0x9B, 0x68, 0x5F, 0x79, 0x4D, 0x69, 0xA6, 0x7A, 0xF6, 0x5E +std::string initTokenTheta() { + const unsigned char data[57] = { + 0xDE, 0x6C, 0x5E, 0x3D, 0xA3, 0xBF, 0xF6, 0xF6, 0x3F, 0x5A, 0x6D, 0xFB, 0x24, 0xE4, 0x69, 0x1A, 0x73, 0x41, 0xCC, 0x06, 0x3A, 0x6C, 0x65, 0xD5, 0xAF, 0x19, 0x78, 0x61, 0x95, 0x64, 0x40, 0xB9, 0x5F, 0x70, 0x23, 0x61, 0x73, 0x7F, 0x73, 0x5F, 0xB5, 0x76, 0x8F, 0x60, 0xDF, 0xD4, 0x35, 0xDB, 0x77, 0x78, 0x6D, 0x8B, 0xFA, 0xDB, 0xB4, 0xDD, 0x4F }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {0, 9, 10, 12, 13, 23, 28, 29, 31, 40, 41, 42, 46}; - const int realCount = 13; + const int realIndices[] = {10, 14, 16, 21, 22, 27, 29, 32, 33, 35, 36, 38, 39, 41, 48, 49}; + const int realCount = 16; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "bogus_auth_yz" + return result; // Dummy: "mislead_pass_vwx" } // Dummy password function 8 (DECOY) - Advanced Hex -std::string readSegmentDelta() { - const unsigned char data[42] = { - 0x39, 0x6A, 0xD4, 0xB7, 0x64, 0x09, 0x83, 0x88, 0x75, 0xE5, 0x6D, 0xE0, 0xF7, 0x01, 0x6D, 0x8D, 0x4D, 0xF3, 0x79, 0x54, 0x5F, 0x30, 0x10, 0x4A, 0x0F, 0x6B, 0x70, 0x65, 0x11, 0x79, 0x94, 0x5F, 0x5F, 0x9D, 0x34, 0x35, 0xBF, 0x1D, 0x36, 0xBE, 0x08, 0xD7 +std::string processBufferSigma() { + const unsigned char data[55] = { + 0xC6, 0x74, 0x17, 0x06, 0xC2, 0x69, 0xE2, 0x65, 0x9C, 0x73, 0x74, 0x5F, 0x21, 0x20, 0x09, 0x73, 0x47, 0x65, 0x31, 0x3B, 0x63, 0x9D, 0x2D, 0xE5, 0xE5, 0x4B, 0x25, 0xBD, 0xCE, 0x99, 0xB0, 0x04, 0x7F, 0x72, 0xFF, 0xF7, 0x65, 0xF9, 0x9E, 0xB5, 0x3D, 0x74, 0x5F, 0x64, 0x8A, 0x4A, 0x70, 0xB1, 0xC3, 0xB7, 0xB8, 0xCC, 0x65, 0x66, 0xA6 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {4, 8, 10, 14, 18, 20, 25, 27, 29, 32, 34, 35, 38}; - const int realCount = 13; + const int realIndices[] = {1, 7, 9, 10, 11, 15, 17, 20, 33, 36, 41, 42, 43, 52, 53}; + const int realCount = 15; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "dummy_key_456" + return result; // Dummy: "test_secret_def" } // Dummy password function 9 (DECOY) - Advanced Hex -std::string decodeCode1() { - const unsigned char data[53] = { - 0x6D, 0xBF, 0x27, 0x69, 0x49, 0x28, 0xA5, 0xAC, 0x73, 0x6C, 0x11, 0x02, 0xF4, 0x65, 0x17, 0xC8, 0x56, 0x61, 0x12, 0x64, 0x5F, 0x70, 0xB7, 0x54, 0x46, 0x7C, 0xBF, 0xC3, 0x3A, 0x52, 0x60, 0x61, 0x5E, 0x73, 0x73, 0x13, 0x5E, 0xDF, 0x70, 0x4B, 0x5F, 0x76, 0x41, 0xB9, 0xBA, 0x21, 0x59, 0xDE, 0xB5, 0x77, 0xB4, 0x78, 0x14 +std::string createSegmentB() { + const unsigned char data[55] = { + 0x74, 0x65, 0x73, 0xDD, 0xC9, 0x93, 0x4D, 0xAF, 0x12, 0xF3, 0x74, 0x58, 0x27, 0x9E, 0x7B, 0x96, 0xA5, 0x5F, 0x3D, 0x85, 0x73, 0x65, 0x27, 0x7E, 0xC6, 0x2C, 0xB8, 0x76, 0x11, 0xB6, 0xF9, 0x63, 0x72, 0x65, 0x32, 0xE7, 0xC8, 0xF9, 0x29, 0xAA, 0xDB, 0xE7, 0x74, 0x2E, 0xDF, 0x5F, 0x23, 0x64, 0x9D, 0x20, 0xCD, 0xA3, 0x65, 0x1A, 0x66 }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {0, 3, 8, 9, 13, 17, 19, 20, 21, 31, 33, 34, 40, 41, 49, 51}; - const int realCount = 16; + const int realIndices[] = {0, 1, 2, 10, 17, 20, 21, 31, 32, 33, 42, 45, 47, 52, 54}; + const int realCount = 15; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "mislead_pass_vwx" + return result; // Dummy: "test_secret_def" } // Dummy password function 10 (DECOY) - Advanced Hex -std::string pullSegmentOmega() { - const unsigned char data[50] = { - 0xC8, 0x05, 0x93, 0x0F, 0x41, 0xA5, 0x73, 0x61, 0x6D, 0x70, 0x10, 0x37, 0x6C, 0x65, 0x9B, 0x86, 0x4F, 0x5F, 0x18, 0x0C, 0x6F, 0x61, 0x6B, 0x75, 0xB3, 0x0E, 0x4B, 0x3F, 0x3E, 0x63, 0xAB, 0x83, 0x74, 0xF6, 0x80, 0x5E, 0x19, 0x22, 0x36, 0x68, 0x69, 0x43, 0x5F, 0x67, 0x41, 0x68, 0x69, 0x57, 0x9B, 0x61 +std::string retrieveStreamOmega() { + const unsigned char data[45] = { + 0xAF, 0x62, 0x6F, 0xEA, 0xA5, 0x5C, 0x67, 0x56, 0x45, 0xD0, 0xF3, 0x75, 0x61, 0xD4, 0xAC, 0x1B, 0x73, 0x1E, 0xE7, 0x71, 0xD8, 0xDB, 0x5F, 0xB5, 0x6F, 0x03, 0x50, 0x61, 0x47, 0x75, 0xD8, 0x71, 0x94, 0xC5, 0x50, 0x7C, 0x3C, 0x74, 0x74, 0x68, 0x5F, 0x79, 0x2D, 0x7A, 0x3C }; // Extract dummy data from specific indices std::string result = ""; - const int realIndices[] = {6, 7, 8, 9, 12, 13, 17, 21, 23, 32, 39, 42, 43, 45, 46}; - const int realCount = 15; + const int realIndices[] = {1, 2, 6, 11, 16, 22, 27, 29, 37, 39, 40, 41, 43}; + const int realCount = 13; for (int i = 0; i < realCount; i++) { result += static_cast(data[realIndices[i]]); } - return result; // Dummy: "sample_auth_ghi" + return result; // Dummy: "bogus_auth_yz" } // Main function to reconstruct password (FIXED NAME - only uses REAL functions) @@ -377,16 +377,16 @@ std::string getPasswordSecureData() { std::vector parts(10); // Only real password functions are called (Advanced Hex extraction) - parts[4] = parseValue5(); // Real part 5 - parts[2] = makeBufferAlpha(); // Real part 3 - parts[8] = obtainPartEpsilon(); // Real part 9 - parts[1] = formDataX(); // Real part 2 - parts[5] = decodeCodePrime(); // Real part 6 - parts[6] = configCodeC(); // Real part 7 - parts[9] = getSegmentEpsilon(); // Real part 10 - parts[3] = retrieveInfoLambda(); // Real part 4 - parts[0] = configContentC(); // Real part 1 - parts[7] = extractBufferX(); // Real part 8 + parts[8] = processNodeAlpha(); // Real part 9 + parts[4] = grabValue4(); // Real part 5 + parts[1] = obtainDataX(); // Real part 2 + parts[2] = accessBlock1(); // Real part 3 + parts[5] = buildContentDelta(); // Real part 6 + parts[0] = formTextZ(); // Real part 1 + parts[9] = processInfoZ(); // Real part 10 + parts[6] = buildCodeBeta(); // Real part 7 + parts[3] = makeBlockZeta(); // Real part 4 + parts[7] = makeTokenLambda(); // Real part 8 // Reconstruct password in correct order for (const auto& part : parts) { @@ -398,8 +398,9 @@ std::string getPasswordSecureData() { // Dummy password calls for obfuscation void initializePasswordDummies() { - std::string dummyPwd1 = readPieceC(); // Dummy call - std::string dummyPwd2 = decodeCode1(); // Dummy call + std::string dummyPwd1 = processBufferSigma(); // Dummy call + std::string dummyPwd2 = decodeDataB(); // Dummy call + std::string dummyPwd3 = buildValue3(); // Dummy call } #endif // PASSWORD_FUNCTIONS_H diff --git a/example/.yarn/install-state.gz b/example/.yarn/install-state.gz index 1b42c654..ef8e37ab 100644 Binary files a/example/.yarn/install-state.gz and b/example/.yarn/install-state.gz differ diff --git a/example/.yarnrc.yml b/example/.yarnrc.yml deleted file mode 100644 index 3186f3f0..00000000 --- a/example/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -nodeLinker: node-modules diff --git a/example/Gemfile b/example/Gemfile index 36563993..51515233 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -3,9 +3,10 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -gem 'cocoapods', '>= 1.16' +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' -gem 'xcodeproj', '<= 1.27.0' +gem 'xcodeproj', '< 1.26.0' gem 'concurrent-ruby', '< 1.3.4' # Ruby 3.4.0 has removed some libraries from the standard library. @@ -13,3 +14,4 @@ gem 'bigdecimal' gem 'logger' gem 'benchmark' gem 'mutex_m' +gem 'nkf' diff --git a/example/README.md b/example/README.md index 1002ec20..3e2c3f85 100644 --- a/example/README.md +++ b/example/README.md @@ -1,47 +1,97 @@ -## Get started +This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). -To try the playground out for yourself, run the following commands: +# Getting Started + +> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding. + +## Step 1: Start Metro + +First, you will need to run **Metro**, the JavaScript build tool for React Native. + +To start the Metro dev server, run the following command from the root of your React Native project: ```sh -git clone -cd example -yarn +# Using npm +npm start + +# OR using Yarn +yarn start ``` -### iOS +## Step 2: Build and run your app -1. Open the example/ios/KeysExample.xcworkspace file with Xcode -2. Change signing configuration to your developer account -3. Select your device in the devices drop-down -4. Hit run +With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app: ### Android -1. Open the example/android/ folder with Android Studio -2. Select your device in the devices drop-down -3. Hit run +```sh +# Using npm +npm run android + +# OR using Yarn +yarn android +``` -### Enable New Arch +### iOS -#### Android +For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps). -You will only need to update your android/gradle.properties file as follows: +The first time you create a new project, run the Ruby bundler to install CocoaPods itself: -```diff -# Use this property to enable support to the new architecture. -# This will allow you to use TurboModules and the Fabric render in -# your application. You should enable this flag either if you want -# to write custom TurboModules/Fabric components OR use libraries that -# are providing them. -- newArchEnabled=false -+ newArchEnabled=true +```sh +bundle install ``` -#### IOS +Then, and every time you update your native dependencies, run: + +```sh +bundle exec pod install +``` -You will only need to reinstall your pods by running pod install with the right flag: +For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html). ```sh -# Run pod install with the flag: -RCT_NEW_ARCH_ENABLED=1 bundle exec pod install +# Using npm +npm run ios + +# OR using Yarn +yarn ios ``` + +If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device. + +This is one way to run your app — you can also build it directly from Android Studio or Xcode. + +## Step 3: Modify your app + +Now that you have successfully run the app, let's make changes! + +Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh). + +When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload: + +- **Android**: Press the R key twice or select **"Reload"** from the **Dev Menu**, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS). +- **iOS**: Press R in iOS Simulator. + +## Congratulations! :tada: + +You've successfully run and modified your React Native App. :partying_face: + +### Now what? + +- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). +- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started). + +# Troubleshooting + +If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. + +# Learn More + +To learn more about React Native, take a look at the following resources: + +- [React Native Website](https://reactnative.dev) - learn more about React Native. +- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. +- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. +- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. +- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 2726f722..239ba9f6 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: "com.android.application" +apply plugin: "org.jetbrains.kotlin.android" apply plugin: "com.facebook.react" project.ext.IS_EXAMPLE = true; project.ext.keyFiles = [ @@ -8,27 +9,26 @@ project.ext.keyFiles = [ ] apply from: project(':react-native-keys').projectDir.getPath() + "/RNKeys.gradle" - /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. */ react { /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to - // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // skip the bundling of the JS bundle and the assets. Default is "debug", "debugOptimized". // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. - // debuggableVariants = ["liteDebug", "prodDebug"] + // debuggableVariants = ["liteDebug", "liteDebugOptimized", "prodDebug", "prodDebugOptimized"] /* Bundling */ // A list containing the node command and its flags. Default is just 'node'. @@ -56,6 +56,9 @@ react { // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() } /** @@ -67,30 +70,22 @@ def enableProguardInReleaseBuilds = false * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: - * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` + * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ -def jscFlavor = 'org.webkit:android-jsc:+' +def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' android { ndkVersion rootProject.ext.ndkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + compileSdk rootProject.ext.compileSdkVersion - compileSdkVersion rootProject.ext.compileSdkVersion - - namespace "com.keysexample" - defaultConfig { - resValue "string", "build_config_package", "com.keysexample" - applicationId "com.keysexample" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" - } - flavorDimensions "default" + namespace "rnkeys.example" + flavorDimensions "default" productFlavors { development { applicationIdSuffix ".dev" @@ -102,12 +97,13 @@ android { applicationIdSuffix "" } } - packagingOptions { - pickFirst 'lib/x86/libcrypto.so' - pickFirst 'lib/x86_64/libcrypto.so' - pickFirst 'lib/armeabi-v7a/libcrypto.so' - pickFirst 'lib/arm64-v8a/libcrypto.so' - } + defaultConfig { + applicationId "rnkeys.example" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 1 + versionName "1.0" + } signingConfigs { debug { storeFile file('debug.keystore') @@ -134,17 +130,9 @@ dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") - debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { - exclude group:'com.squareup.okhttp3', module:'okhttp' - } - - debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor } } - -apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 4b185bc1..00000000 --- a/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/example/android/app/src/debug/java/com/keysexample/ReactNativeFlipper.java b/example/android/app/src/debug/java/com/keysexample/ReactNativeFlipper.java deleted file mode 100644 index 354160d4..00000000 --- a/example/android/app/src/debug/java/com/keysexample/ReactNativeFlipper.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - *

This source code is licensed under the MIT license found in the LICENSE file in the root - * directory of this source tree. - */ -package com.keysexample; - -import android.content.Context; -import com.facebook.flipper.android.AndroidFlipperClient; -import com.facebook.flipper.android.utils.FlipperUtils; -import com.facebook.flipper.core.FlipperClient; -import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; -import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; -import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; -import com.facebook.flipper.plugins.inspector.DescriptorMapping; -import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; -import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; -import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; -import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; -import com.facebook.react.ReactInstanceEventListener; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.modules.network.NetworkingModule; -import okhttp3.OkHttpClient; - -/** - * Class responsible of loading Flipper inside your React Native application. This is the debug - * flavor of it. Here you can add your own plugins and customize the Flipper setup. - */ -public class ReactNativeFlipper { - public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { - if (FlipperUtils.shouldEnableFlipper(context)) { - final FlipperClient client = AndroidFlipperClient.getInstance(context); - - client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); - client.addPlugin(new DatabasesFlipperPlugin(context)); - client.addPlugin(new SharedPreferencesFlipperPlugin(context)); - client.addPlugin(CrashReporterPlugin.getInstance()); - - NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); - NetworkingModule.setCustomClientBuilder( - new NetworkingModule.CustomClientBuilder() { - @Override - public void apply(OkHttpClient.Builder builder) { - builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); - } - }); - client.addPlugin(networkFlipperPlugin); - client.start(); - - // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized - // Hence we run if after all native modules have been initialized - ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); - if (reactContext == null) { - reactInstanceManager.addReactInstanceEventListener( - new ReactInstanceEventListener() { - @Override - public void onReactContextInitialized(ReactContext reactContext) { - reactInstanceManager.removeReactInstanceEventListener(this); - reactContext.runOnNativeModulesQueueThread( - new Runnable() { - @Override - public void run() { - client.addPlugin(new FrescoFlipperPlugin()); - } - }); - } - }); - } else { - client.addPlugin(new FrescoFlipperPlugin()); - } - } - } -} diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 4122f36a..fb78f397 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,9 @@ android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:usesCleartextTraffic="${usesCleartextTraffic}" + android:supportsRtl="true"> getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @Override - protected boolean isNewArchEnabled() { - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - - @Override - protected Boolean isHermesEnabled() { - return BuildConfig.IS_HERMES_ENABLED; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - DefaultNewArchitectureEntryPoint.load(); - } - String secureValue = getSecureFor("secure3"); - String publicValue = BuildConfig.APP_NAME; - Log.d("secure(JNI)", "this value is from secure: " + secureValue); - Log.d("secure(JNI)", "this value is from public: " + publicValue); - ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } -} diff --git a/example/android/app/src/main/java/rnkeys/example/MainActivity.kt b/example/android/app/src/main/java/rnkeys/example/MainActivity.kt new file mode 100644 index 00000000..3107d8e6 --- /dev/null +++ b/example/android/app/src/main/java/rnkeys/example/MainActivity.kt @@ -0,0 +1,28 @@ +package rnkeys.example + +import com.facebook.react.ReactActivity +import com.facebook.react.ReactActivityDelegate +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled +import com.facebook.react.defaults.DefaultReactActivityDelegate + +class MainActivity : ReactActivity() { + + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "RnkeysExample" + override fun onWindowFocusChanged(hasFocus: Boolean) { + try { + super.onWindowFocusChanged(hasFocus) + } catch (e: Exception) { + // This is to prevent a crash when the window focus changes before the React context is ready. + } + } + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = + DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) +} diff --git a/example/android/app/src/main/java/rnkeys/example/MainApplication.kt b/example/android/app/src/main/java/rnkeys/example/MainApplication.kt new file mode 100644 index 00000000..95b3dddf --- /dev/null +++ b/example/android/app/src/main/java/rnkeys/example/MainApplication.kt @@ -0,0 +1,27 @@ +package rnkeys.example + +import android.app.Application +import com.facebook.react.PackageList +import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost +import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost + +class MainApplication : Application(), ReactApplication { + + override val reactHost: ReactHost by lazy { + getDefaultReactHost( + context = applicationContext, + packageList = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + }, + ) + } + + override fun onCreate() { + super.onCreate() + loadReactNative(this) + } +} diff --git a/example/android/app/src/main/res/drawable/rn_edit_text_material.xml b/example/android/app/src/main/res/drawable/rn_edit_text_material.xml index 73b37e4d..5c25e728 100644 --- a/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +++ b/example/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -17,7 +17,8 @@ android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material" android:insetRight="@dimen/abc_edit_text_inset_horizontal_material" android:insetTop="@dimen/abc_edit_text_inset_top_material" - android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"> + android:insetBottom="@dimen/abc_edit_text_inset_bottom_material" + >