Skip to content

Commit

Permalink
Update to 0.11.0 beta checkra1n. Add 32bit arm support.
Browse files Browse the repository at this point in the history
  • Loading branch information
downthecrop committed Oct 9, 2020
1 parent 5d4a58c commit 0803e85
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class HomeFragment : Fragment() {
val cacheDir = requireContext().cacheDir
val localZipDir = "/data/checkra1n"
val localRecoveryDir = "/cache/recovery"
val archArray = arrayOf("aarch64","armv4","armv4t","armv5t","armv5te","armv5tej","armv6","armv7")
var archIndex = -1;


fun addToLog(message: String){
Expand All @@ -50,15 +52,22 @@ class HomeFragment : Fragment() {
}

fun arch(): Boolean {
if (System.getProperty("os.arch") == "aarch64")
return true
return false
archIndex = archArray.indexOf(System.getProperty("os.arch")); //Set index for printing
return archArray.contains(System.getProperty("os.arch")) //True or false return for support arch
}

fun archName(): String {
return System.getProperty("os.arch");
}

fun binaryPlatform(): String {
if (archIndex > 0)
return "Using checkra1n-arm (32bit)"
else
return "Using checkra1n-arm64 (64bit)"
}


fun setButtonText(message: String) {
startButton.text = "$message"
}
Expand All @@ -79,12 +88,12 @@ class HomeFragment : Fragment() {
homeViewModel.button.observe(viewLifecycleOwner, Observer {

addToLog("Info: checkra1n Android<br>" +
"Bundled binary version: 0.10.2 arm64 Linux <br>"+
"os.arch: "+archName())
"binary version: 0.11.0 arm64 & arm32<br>"+
"os.arch: "+archName()+"<br>"+
"binary: "+binaryPlatform())
if (!arch()){
addToLog("Only ARM64 Devices are supported at this time.",0)
addToLog("Unsupported architecture. Only ARM and ARM64 CPU's supported",0)
}

val checkRoot = shellExec("su -c echo su")

if (checkRoot == "su" && arch()){
Expand All @@ -104,7 +113,13 @@ class HomeFragment : Fragment() {

setButtonText("Run checkra1n (Reboot Recovery)")

copyToCache(R.raw.checkra1n, "checkra1n.zip");
var rawZipFile = R.raw.checkra1n_arm64

if (archIndex > 0){
var rawZipFile = R.raw.checkra1n_arm
}

copyToCache(rawZipFile, "checkra1n.zip");
copyToCache(R.raw.bootcommand, "command");

val cacheZip = File("$cacheDir/checkra1n.zip")
Expand Down

This file was deleted.

Binary file removed app/src/main/res/checkra1n-raw/checkra1n/checkra1n
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# s1guza Dylan Laws jndok Jonathan Seals xerub Steve PsychoTea Simone Ferrini
# ihackbanme iH8sn0w Ori Kadosh Rony Kelner Ayden Panhuyzen
#
# checkra1n version 0.10.2 beta arm64
# SHA256 32cc7d1bd687800d1b5bc5cfc4f4ca15f393dada7570e78742eab068b1f2a3e2
#
# checkra1n version 0.11.0 beta arm64 & arm32
# SHA256 ARM64: b48774e5d240ce192016a3fa97df7ef855220576f0704c83ed627d092cb2e224
# SHA256 ARM32: d751f4b245bd4071c571654607ca4058e9e7dc4a5fa30639024b6067eebf5c3b

export RA1NZIP="$3"
export OUTFD="/proc/self/fd/$2"
Expand All @@ -25,7 +25,6 @@ ui_print() {
LogMsg() {

ENDTEXT="[*]: All Done"

while read text;
do
ui_print "$text";
Expand All @@ -45,8 +44,6 @@ for f in checkra1n; do
chmod +x "$TMP/$f"
done

setenforce 0

./tmp/checkra1n -c 2>&1 | LogMsg

ui_print "Checkra1n - Done"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# use update-binary
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/sbin/sh
#
# Script created by @downthecrop
#
# checkra1n credits
#
# argp axi0mX Dany Lisiansky Jaywalker Adam Demasi h0m3us3r littlelailo
# Longhorn nitoTV Jamie Bishop pimskeks qwertyoruiopz Sam Bingner Rick Mark
# s1guza Dylan Laws jndok Jonathan Seals xerub Steve PsychoTea Simone Ferrini
# ihackbanme iH8sn0w Ori Kadosh Rony Kelner Ayden Panhuyzen
#
# checkra1n version 0.11.0 beta arm64 & arm32
# SHA256 ARM64: b48774e5d240ce192016a3fa97df7ef855220576f0704c83ed627d092cb2e224
# SHA256 ARM32: d751f4b245bd4071c571654607ca4058e9e7dc4a5fa30639024b6067eebf5c3b

export RA1NZIP="$3"
export OUTFD="/proc/self/fd/$2"
export TMP="/tmp"

ui_print() {
echo "ui_print $1
ui_print" >> $OUTFD
}

LogMsg() {

ENDTEXT="[*]: All Done"
while read text;
do
ui_print "$text";
if [[ "$text" == *"$ENDTEXT"* ]]; then
reboot system
fi
done
}

setenforce 0

for f in checkra1n; do
unzip -o "$RA1NZIP" "$f" -d "$TMP"
done

for f in checkra1n; do
chmod +x "$TMP/$f"
done

./tmp/checkra1n -c 2>&1 | LogMsg

ui_print "Checkra1n - Done"
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# use update-binary
Binary file not shown.
Binary file added app/src/main/res/raw/checkra1n_arm.zip
Binary file not shown.
Binary file added app/src/main/res/raw/checkra1n_arm64.zip
Binary file not shown.

0 comments on commit 0803e85

Please sign in to comment.