Skip to content

Reset To normal #468

Closed
minimino1 wants to merge 4 commits intokavishdevar:mainfrom
minimino1:main
Closed

Reset To normal #468
minimino1 wants to merge 4 commits intokavishdevar:mainfrom
minimino1:main

Conversation

@minimino1
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings March 1, 2026 12:12
@minimino1 minimino1 closed this Mar 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates where the Radare2 toolchain is extracted on-device, changing the extraction root and adjusting the derived Radare2/busybox paths accordingly in RadareOffsetFinder.

Changes:

  • Switches extraction directory from the prior root-based location to sdcard/radare_data.
  • Updates Radare2 bin/lib and busybox paths to match the new extraction root.
  • Updates extraction/existence checks and cleanup commands to operate on the new directory.
Comments suppressed due to low confidence (1)

android/app/src/main/java/me/kavishdevar/librepods/utils/RadareOffsetFinder.kt:703

  • The cleanup log message still references the old extraction path ($EXTRACT_DIR/data/local/tmp/aln_unzip), but cleanup now removes $EXTRACT_DIR directly. Update the log string to reflect the new directory so troubleshooting output is accurate.
            Runtime.getRuntime().exec(arrayOf("su", "-c", "rm -rf $EXTRACT_DIR")).waitFor()
            Log.d(TAG, "Cleaned up extracted files at $EXTRACT_DIR/data/local/tmp/aln_unzip")

Comment on lines +49 to +53
private const val EXTRACT_DIR = "sdcard/radare_data"

private const val RADARE2_BIN_PATH = "$EXTRACT_DIR/data/local/tmp/aln_unzip/org.radare.radare2installer/radare2/bin"
private const val RADARE2_LIB_PATH = "$EXTRACT_DIR/data/local/tmp/aln_unzip/org.radare.radare2installer/radare2/lib"
private const val BUSYBOX_PATH = "$EXTRACT_DIR/data/local/tmp/aln_unzip/busybox"
private const val RADARE2_BIN_PATH = "$EXTRACT_DIR/org.radare.radare2installer/radare2/bin"
private const val RADARE2_LIB_PATH = "$EXTRACT_DIR/org.radare.radare2installer/radare2/lib"
private const val BUSYBOX_PATH = "$EXTRACT_DIR/busybox"
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXTRACT_DIR is set to a relative path ("sdcard/radare_data"), but it’s interpolated into su -c shell commands and into absolute executable paths (e.g., $RADARE2_BIN_PATH/rabin2). Without a leading '/', these paths depend on the shell’s working directory and can fail to resolve. Use an absolute path (e.g., under /sdcard or /data/local/tmp) to make the behavior deterministic.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +53
private const val EXTRACT_DIR = "sdcard/radare_data"

private const val RADARE2_BIN_PATH = "$EXTRACT_DIR/data/local/tmp/aln_unzip/org.radare.radare2installer/radare2/bin"
private const val RADARE2_LIB_PATH = "$EXTRACT_DIR/data/local/tmp/aln_unzip/org.radare.radare2installer/radare2/lib"
private const val BUSYBOX_PATH = "$EXTRACT_DIR/data/local/tmp/aln_unzip/busybox"
private const val RADARE2_BIN_PATH = "$EXTRACT_DIR/org.radare.radare2installer/radare2/bin"
private const val RADARE2_LIB_PATH = "$EXTRACT_DIR/org.radare.radare2installer/radare2/lib"
private const val BUSYBOX_PATH = "$EXTRACT_DIR/busybox"
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing extracted executables/libraries under shared external storage (sdcard) and then executing them via su makes the toolchain potentially tamperable by other actors with access to that storage, which can turn into root code execution. Prefer extracting into a root-owned, non-world-writable location (e.g., /data/local/tmp or an app-private directory) and ensure permissions/ownership prevent modification before execution.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants