multiple fixes

This commit is contained in:
particle-box
2026-02-24 12:51:25 +05:30
parent 05c71c7ef4
commit 4aba9c815f
4 changed files with 45 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-bin.zip
distributionSha256Sum=371cb9fbebbe9880d147f59bab36d61eee122854ef8c9ee1ecf12b82368bcf10
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
distributionSha256Sum=8fad3d78296ca518113f3d29016617c7f9367dc005f932bd9d93bf45ba46072b
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@@ -88,16 +88,20 @@ ensure_omvll_bundle() {
local archive_url="${OMVLL_ARCHIVE_URL:-https://github.com/open-obfuscator/o-mvll/releases/download/${OMVLL_VERSION}/${OMVLL_LINUX_ASSET}}"
OMVLL_CACHE_DIR="$SCRIPT_DIR/.omvll/$OMVLL_VERSION"
OMVLL_PLUGIN_PATH="$OMVLL_CACHE_DIR/omvll-ndk.so"
local tmp_tar=""
if [ ! -f "$OMVLL_PLUGIN_PATH" ]; then
echo "Downloading O-MVLL bundle from $archive_url"
download_omvll_bundle() {
rm -rf "$OMVLL_CACHE_DIR"
mkdir -p "$OMVLL_CACHE_DIR"
local tmp_tar
tmp_tar=$(mktemp)
curl -fL "$archive_url" -o "$tmp_tar"
tar -xzf "$tmp_tar" -C "$OMVLL_CACHE_DIR"
rm -f "$tmp_tar"
}
if [ ! -f "$OMVLL_PLUGIN_PATH" ]; then
echo "Downloading O-MVLL bundle from $archive_url"
download_omvll_bundle
fi
if [ ! -f "$OMVLL_PLUGIN_PATH" ]; then
@@ -117,11 +121,16 @@ ensure_omvll_bundle() {
local py_root
py_root=$(find "$OMVLL_CACHE_DIR" -maxdepth 1 -type d -name 'Python-*' | head -n1 || true)
if [ -z "$py_root" ] || [ ! -d "$py_root/Lib" ]; then
echo "Unable to determine Python stdlib directory inside the O-MVLL bundle" >&2
echo "OMVLL_CACHE_DIR: $OMVLL_CACHE_DIR" >&2
echo "Contents:" >&2
ls -la "$OMVLL_CACHE_DIR" >&2 || true
exit 1
echo "OMVLL cache is incomplete. Re-downloading bundle..." >&2
download_omvll_bundle
py_root=$(find "$OMVLL_CACHE_DIR" -maxdepth 1 -type d -name 'Python-*' | head -n1 || true)
if [ -z "$py_root" ] || [ ! -d "$py_root/Lib" ]; then
echo "Unable to determine Python stdlib directory inside the O-MVLL bundle" >&2
echo "OMVLL_CACHE_DIR: $OMVLL_CACHE_DIR" >&2
echo "Contents:" >&2
ls -la "$OMVLL_CACHE_DIR" >&2 || true
exit 1
fi
fi
export OMVLL_PYTHONPATH="$py_root/Lib"
fi

View File

@@ -252,28 +252,39 @@ val syncTasks = cargoTargets.mapIndexed { index, target ->
omvllArchiveUrl?.let { environment("OMVLL_ARCHIVE_URL", it) }
}
tasks.register<Sync>("syncNative${target.taskSuffix}") {
tasks.register("syncNative${target.taskSuffix}") {
dependsOn(cargoTask)
val outputLibName = nativeLibFileName
inputs.property("outputLibName", outputLibName)
val wslCandidate = File(wslStagingDir, "native/rust/target/${target.triple}/release/libpurrfectsnap.so")
val localCandidate = layout.projectDirectory.file("rust/target/${target.triple}/release/libpurrfectsnap.so").asFile
val sourceLibs = files(wslCandidate, localCandidate)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceLibs) {
rename { outputLibName }
}
from(sourceLibs) {
rename { "libpurrfectsnap.so" }
}
into(layout.buildDirectory.dir("rustJniLibs/android/${target.abi}"))
inputs.files(sourceLibs)
val outputDir = layout.buildDirectory.dir("rustJniLibs/android/${target.abi}")
inputs.property("outputLibName", outputLibName)
inputs.files(wslCandidate, localCandidate)
outputs.dir(outputDir)
outputs.upToDateWhen { false }
val checksumsDir = layout.buildDirectory.dir("checksums")
doLast {
val file = File(destinationDir, outputLibName)
if (!file.exists()) {
error("Native library not found for ${target.abi}. Expected ${file.absolutePath}")
val sourceFile = listOf(wslCandidate, localCandidate).firstOrNull { it.exists() }
?: error(
"Native library not found for ${target.abi}. Looked in: " +
"${wslCandidate.absolutePath}, ${localCandidate.absolutePath}"
)
val abiDir = outputDir.get().asFile
abiDir.mkdirs()
project.copy {
from(sourceFile)
into(abiDir)
rename { outputLibName }
}
project.copy {
from(sourceFile)
into(abiDir)
rename { "libpurrfectsnap.so" }
}
val file = File(abiDir, outputLibName)
val crc = CRC32()
crc.update(file.readBytes())
val checksumsDirFile = checksumsDir.get().asFile