yashsingh1/xdaforums huggingface dataset:
[Verizon Samsung Galaxy Note II] weedahoe:
Thanks for the reply. I had already booted into recovery and verified that also but wasnt sure if that classified as being unlocked.
[Verizon Samsung Galaxy Note II] tpipher:
Awesome

Thanks guys, worked like a charm! Great work on the project, great info, great tutorial. Heartfelt thanks!
[Verizon Samsung Galaxy Note II] jrloper:
I think he meant the WIP tree for 1.4RC3

https://github.com/Benjamin-Dobell/Heimdall/tree/wip/1.4RC3
[Verizon Samsung Galaxy Note II] soba49:
Yes, the CODE block is the result of trying to make the WIP tree for 1.4RC3. I'm not up for tracking it down. A fair portion of what he's doing in RC3 is trying to get heimdall to compile properly on outdated Mac gcc (very little C++11 support) by circumventing it with clang. Anyway, I got 1.4 RC2 to compile by running it through gcc 4.7 instead. Also, I can say for a fact the the 1.4 RC2 works correctly because I used it successfully with CASUAL (with just a little manual push to do the very last flash) on my 64 bit Mac.

Since I built my heimdall from source, it wasn't installed the same way that CASUAL installs it. If we could figure out the difference, then that bug would be stomped.

Incidentally, I do have Chrome Remote Desktop running on this Mac. If the OP or jrloper are interested in poking around, rebuilding heimdall, or testing on my 64 bit Mac, they're welcome to PM me and I'll set it up.
[Verizon Samsung Galaxy Note II] knr117:
Stuck Install win8

hi all, I'm trying to run casual on a 64 Win8 system and root my wife's note 2.

I removed all drivers under device manger. I uninstalled usb drivers under add remove programs. Windows does pop up a file tree for the phone but casual get stuck in download screen flashing over and over the following error without stopping.

Initialising connection...

Detecting device...

ERROR: Failed to access device. libusb error: -12

Installing drivers

install failed________________________

Can someone point me in a direction to fix this issue. I assume another person has all ready ran into it. If it matters I am having the same problem on a Win7 laptop. Thanks..
[Verizon Samsung Galaxy Note II] jrloper:
I need the log (Ctrl + L)
[Verizon Samsung Galaxy Note II] knr117:
re-running now then will post. Thanks for reply
[Verizon Samsung Galaxy Note II] jrloper:
I'm fine with RC2 if it'll work consistently, is there anyway to enable debug output on Mac? On windows I just build the driver with debug logging. Is there a similar option on Mac?
[Verizon Samsung Galaxy Note II] jrloper:
http://xdaforums.com/showpost.php?p=40343968&postcount=1
[Verizon Samsung Galaxy Note II] Nit3mare:
I'm having a bit of an issue, myself. I'm on the LL4 update, and when I try to run Casual, it gets past the rooting portion, but then gives me an error, calling me a noob, and telling me I have an incorrect bootloader. So I follow the link provided within Casual for the Revision. When I try to flash the PIT and BOOTLOADER files in Odin, it always fails at the sboot.img portion. I'm really at a loss here.
[Verizon Samsung Galaxy Note II] soba49:
Well I had no idea. Looking inside the .kext driver, I was surprised to find that it was just XML inside. Anyway, it turns out theres some reading to be done on how to debug them (link here), but no extra compiler flags, just some runtime arguments in NVRAM, some arguments to gdb, and the use of the kextutil utility.

EDIT: I misread your request to mean you wanted debug build of the driver, not simply the debug output. I looked, but I didn't find any flags to set to enable that.
[Verizon Samsung Galaxy Note II] knr117:
LOG 2

Ok, I followed the link. DL the file. Phone showed in the device list of the extracted EXE. I clicked replaced driver. I then unplugged phone, booted puter and phone. Win load, allowed it to settle, then plugged in phone, puter found the drives on the phone and showed in the WIN file tree, ran casual and same problem.

Below is a copy of the link to the post I DL from in case another XDA member needs the info.

Here is the log file from last attempt

Could this be due to \AppData\Local\Temp\ some how locked down for some reason? Keep in mind I'm an idiot with this stuff but if the system can't write to the file then the install stops.

Also how to I post this log in a scrollable box so it don't take up the whole dam page?
[Verizon Samsung Galaxy Note II] jrloper:
Why would %user%\Appdata\Local\Temp be locked? CASUAL extract's ADB and Heimdall there. So it's not locked.

You placed your phone in Download mode and ran Zadig following the instructions?

Error -12 is caused by the driver not being installed on the device. So this isn't making sense.
[Verizon Samsung Galaxy Note II] streetfoldsfive:
I see you were able to root and unlock with your 64bit mac. I was trying last week and could not get it done. Casual kept failing even after having the drivers and such and with assistants of other members here. WOuld you be able to help me out??
[Verizon Samsung Galaxy Note II] knr117:
It don't make sence because I missed the above part. Trying again now. This is where the stuff I'm sure drive DEV's nuts. Yea, I'm a noob.

Will post back after

Thanks...
[Verizon Samsung Galaxy Note II] jrloper:
Try:

http://xdaforums.com/showthread.php?t=2040264
[Verizon Samsung Galaxy Note II] knr117:
Ok now it is stuck at the following displaying in casual

___________________________________________________

Your device should be rebooting into Android now.

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

error: protocol fault (no status)

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

mkdir failed for /data/local/tmp, File exists

Pushing dependencies

Pushing su binary...

adb server is out of date. killing...

* daemon started successfully *

5282 KB/s (91980 bytes in 0.017s)

_____________________________________________________________

Going to go back threw this thread and see if anyone else ran into this and what they did. I think from now on I'm sticking with HTC.
[Verizon Samsung Galaxy Note II] soba49:
I can't do much. If you got heimdall and adb working, I could possibly guide you through a manual root based on CASUAL's scripts. However, if you had adb and CASUAL working properly, then CASUAL would work. No help, unfortunately, except to say it's technically possible and there must be some minor little bug in the process somewhere.

I used a much older version of CASUAL, some time ago (link is here, post #535 & #538).

CASUAL got through the major phases, flashing boot.img to PID 8, pushing and running exynos & the root script, installing Superuser.apk etc., injecting the exploit, and finally rebooting into download mode. It's all in my log.

All it needed at that time was to flash two more partitions with heimdall, which I described doing manually three posts later. It turned out later that it was a minor bug related to a goto statement in the script. That was the real tragedy, because it was SOOO close. Once ADB and heimdall are installed, everything that needs to happen to finish the process on any platform is on page 54, Feb. 18.

CASUAL has changed, evolved, improved a lot since then. Heimdall had to be installed separately. Now, it goes through the trouble to do all the necessary downloads, and install all the necessary drivers and libraries. Once that last obnoxious little bit is nailed down for all platforms, it'll just work.
[Verizon Samsung Galaxy Note II] jrloper:
I can't say for sure without the log, looks like ADB might have lost connection.

Other than using fastboot where Samsung uses Odin/Heimdall, you're not looking at much difference (HTC vs Samsung)

---------- Post added at 10:46 PM ---------- Previous post was at 10:41 PM ----------

I need to get OSX x86 booting on my Windows PC. Having to patch the kernel, just to get it to start booting...ugh and then it locks up. I hate Apple.
[Verizon Samsung Galaxy Note II] jrloper:
Other than the connection hiccup, CASUAL was working properly. You may want to try a different USB cable as it was probably just a loose connection.
[Verizon Samsung Galaxy Note II] soba49:
Don't do it to yourself. That's pure hell. Life is too short!
[Verizon Samsung Galaxy Note II] shassouneh:
Had me going in circles for a while

Had to manually force Windows 8 to use the "composite" driver as opposed to "SAMSUNG Android". It was having all sorts of problems with ADB with the "Samsung Android" driver.

Hope that helps someone out there.

THANX ADAM!
[Verizon Samsung Galaxy Note II] AdamOutler:
Hey mac users! I've updated Heimdall 32 and 64 with CASUAL R450 commit. This change will automatically reflect in all previous versions of CASUAL.

Still having problems? do this:

sudo rm `which heimdall`

and continue to do that until you see an error message.

Heimdall will run from the first location which is seen from terminal command `which heimdall`. Some previous packages have installed in /bin or /usr/bin. This particular package should be in /usr/local/bin. If you have Heimdall on your system, remove it before running CASUAL and installing this version.
[Verizon Samsung Galaxy Note II] Nit3mare:
Alright, followed the steps there. Attempted the first restore for ****s and giggles, failed at sboot.bin. So I flashed the alternate restore which doesn't flash the sboot.bin. Brought me back to stock. Tried casual at this point, roots my phone just fine, but calls me a noob again regarding the incorrect bootloader issue. Feel like I'm going in circles.
[Verizon Samsung Galaxy Note II] Nit3mare:
Nevermind this post.
[Verizon Samsung Galaxy Note II] N_Jones:
Thanks for this. I had trouble first time through but after switching USB cables everything ran perfect......

Thanks again
[Verizon Samsung Galaxy Note II] riassan:
Got it working now?
[Verizon Samsung Galaxy Note II] streetfoldsfive:
SO the error is fixed???
[Verizon Samsung Galaxy Note II] Nit3mare:
No, it's still not working. Flashed the stock odin file again, because the baseband was still showing LL4 and now the baseband is LJB. But now Casual won't get past the root portion:

mkdir failed for /data/local/tmp, File exists

Pushing dependencies

Pushing su binary...3592 KB/s (91980 bytes in 0.025s)

Pushing SuperSU app...4818 KB/s (996704 bytes in 0.202s)

Pushing Exynos-Abuse exploit4489 KB/s (64373 bytes in 0.014s)

Pushing root script176 KB/s (361 bytes in 0.002s)

Pushing Busybox4736 KB/s (1867568 bytes in 0.385s)

Pushing viewmem1763 KB/s (5417 bytes in 0.003s)

Pushing raw exploit code27 KB/s (56 bytes in 0.002s)

Setting Permissions....

Executing Exploit[*] s_show->seq_printf format string found at: 0xC086C348

[*] sys_setresuid found at 0xC00967C4

[*] patching sys_setresuid at 0xC0096808

[!] set user root failed: Operation not permitted
[Verizon Samsung Galaxy Note II] streetfoldsfive:
I still get the same claiming interface on my mac :(
[Verizon Samsung Galaxy Note II] AdamOutler:
I cant confirm anything in a 64 bit environment I need someone else to test.
[Verizon Samsung Galaxy Note II] streetfoldsfive:
I have a 64 bit but it seems i get the same claiming interface fail I got last week.
[Verizon Samsung Galaxy Note II] jbeitel:
so i got a replacement phone from asurion today, i downloaded the jar twice but when i ran either of them it told me the jar file was corrupt? Am I missing something?
[Verizon Samsung Galaxy Note II] jrloper:
Nope, make sure you are using Java 7 JRE
[Verizon Samsung Galaxy Note II] jbeitel:
well, i got rid of java 6 and put in java 7 and i still get invalid or corrupt jar file.
[Verizon Samsung Galaxy Note II] jrloper:
Launch it from a command/terminal window.

java -jar CASUAL.jar

If that doesn't work, you're getting an incomplete/corrupted download; redownload and retry.

---------- Post added at 04:18 PM ---------- Previous post was at 04:05 PM ----------

You're running Windows? Something doesn't add up. Can you pastebin the entire log for me
[Verizon Samsung Galaxy Note II] streetfoldsfive:
Wait now that it has been updated maybe Im just using the old Hiemdal instead of the updated one and thats why it is interface failing? Any ideas?

---------- Post added at 10:33 PM ---------- Previous post was at 09:57 PM ----------

When I click do it the 32 bit installer comes up. Is this right if im trying to do on the new 64 bit update?
[Verizon Samsung Galaxy Note II] AdamOutler:
What is the output of the terminal command "arch" on your computer?
[Verizon Samsung Galaxy Note II] soba49:
I can't believe nobody bothered to answer this guy. Posted a log and everything. Shame!

Clearly you already have something in /data/local/tmp. Either the Odin didn't quite wipe it, or more likely you've run CASUAL twice. Still I don't see why that alone would cause an issue. (adb shell "rm -rf /data/local/tmp")

That's not where you're failing though. The last line CASUAL makes it to is the temporary root attempt. So the next thing to check is to run

adb shell

#once logged into your phone's shell, run these commands

/data/local/tmp/rootGN.sh

/data/local/tmp/exynos-abuse

See what happens from there.

Also. Did you manage to flash boot.img or not? You make not mention of it in your log.
[Verizon Samsung Galaxy Note II] streetfoldsfive:
i386
[Verizon Samsung Galaxy Note II] soba49:
i386

(the expected answer is x86_64)

Ok, well that is odd then isn't it? If arch is to be trusted, the computer I bought this November may have a 64 bit CPU, yet is still running a 32 bit architecture.

However.

uname -m

x86_64

According to the reading I did, Mac OSX ships with the boot options set to 32 bit mode, so unless someone goes through the trouble to modify that, that's how the kernel runs, regardless of the CPU. It seems odd though, since at first glance arch and uname give conflicting information.

Model Name:	MacBook Air
Model Identifier:	MacBookAir5,2
Processor Name:	Intel Core i5
Processor Speed:	1.8 GHz[B]64[/B]
Number of Processors:	1
Total Number of Cores:	2
L2 Cache (per Core):	256 KB
L3 Cache:	3 MB
Memory:	4 GB
Boot ROM Version:	MBA51.00EF.B02
SMC Version (system):	2.5f7
Software OS X 10.8.3 (12D78)

Anyway, that casts suspicion on the 64 bit binary I thought I provided. I could make certain that I'm running in 64 bit mode by adding a boot-time flag. However, if running querying "arch" gives the authoritative answer, then his issue isn't related to a 64 bit vs. 32 bit binary for heimdall itself.
[Verizon Samsung Galaxy Note II] streetfoldsfive:
My Imac is the late 2012 model if that adds any input at all :angel:
[Verizon Samsung Galaxy Note II] AdamOutler:
Yeah man... run the command "file heimdall". Its 32 bit. Is it possible Macs are really just mainly 32 bit? File `which ls` shows two archetectures. Maybe theres a way to compile both?
[Verizon Samsung Galaxy Note II] AdamOutler:
Well, if it's determined that there is a better way to handle Mac 32/64 bit determination, I can easily rewrite this https://code.google.com/p/android-casual/source/browse/trunk/GUI/src/CASUAL/Statics.java#285

Currently it's determined like this:

public static boolean is64bitSystem() {
if (isWindows()) {
return isWindows64Arch();
} else {
return isMacLinux64Arch();
}
}

private static boolean isWindows64Arch() {
return (System.getenv("ProgramFiles(x86)") != null);
}

private static boolean isMacLinux64Arch() {
String[] CommandArch = {"arch"};
return new Shell().silentShellCommand(CommandArch).contains("64");
}

I can easily split mac into a separate command.
[Verizon Samsung Galaxy Note II] soba49:
Well I just have to laugh at this point.

My Mac is full of conflicting information. The document I read said expect all macs to ship as 32 bit. Arch says 32, uname says it's a 64 bit kernel. I checked the flag, it is not set to boot 64.

But get this, the binary I built does show as a 64 bit build:

file heimdall
heimdall: Mach-O 64-bit executable x86_64
file `which which`
/usr/bin/which: Mach-O 64-bit executable x86_64
file `which ls`
/bin/ls: Mach-O 64-bit executable x86_64

And yes, there is a way to build universal mac binaries, with 32, 64, even PPC. It'd take some modification to the makefile.

It'd be something along the lines of changing CXXFLAGS in the Makefile to

-O2 -Wall -force_cpusubtype_ALL -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc

I tried this, but of course it isn't that easy. Two problems crop up.

* You MUST use mac gcc to use these flags. And then the complaint: Unrecognized command line option "-std=c++0x"

So then you must remove that flag too. However, if that flag is removed, no compile problem - so either they've managed to fit enough C++11 into mac gcc to handle the code, the flag was superfluous, or there's something weird in there and the compiler didn't catch it, but hopefully that part is fine.

* the multiple -arch flags are incompatible with several M flags (-MT source/Arguments.o -MD -MP -MF $depbase.Tpo). These appear to be driver related flags. I don't want to say that this would prevent us from building a universal binary, but you can appreciate that there could be some stumbling blocks, not to mention putting me outside my experience so far.

>>>>>>

Actually, I recalled there's a tool for combining binaries called lipo (http://cocoadev.com/wiki/UniversalBinariesAndJaguar).

So unless those incompatible flags are there for a very good reason, maybe you can streamline your distribution by combining the binaries with it.

REQUEST:If you remind me how to grab "Heimdall_1.4RC3_mac32.pkg" from your subversion repo (It's complaining the web interface supports plain text only) I'd be happy to do it. If not I'll grab it with SVN later.
[Verizon Samsung Galaxy Note II] Nit3mare:
Lol, I'm not a guy, but thanks for reaching out! Haven't been able to get to my personal laptop in the last day, but once I can, I'll get into the shell like you instructed and report back. And yes, boot.img flashed just fine, it was sboot.bin Odin was failing at.
[Verizon Samsung Galaxy Note II] fluidj:
what do you do after it boots into TWIN Recovery Project??? Kinda left us hanging here
[Verizon Samsung Galaxy Note II] thepolishguy:
Make a backup and reboot.

The OP figured if you were doing this then you would know that.
[Verizon Samsung Galaxy Note II] soba49:
How do you feel about this?

private static String OS = System.getProperty("os.name").toUpperCase();
private static String ARCH = System.getProperty("os.arch");

private static boolean is64JRE() {
return ARCH.contains("64");
}
public static boolean isMac() {
return OS.contains("MAC");
}
public static boolean isWindows() {
return OS.startsWith("WINDOWS");
}
private static boolean isNix() {
return !(isMac() || isWindows());
}
public static boolean isLinux() {
return isNix();
}
public static boolean is64bitSystem() {
// you could do multiple tests here, to cover your bases:
// boolean winTest =	(System.getenv("ProgramFiles(x86)") != null);
// boolean macTest = Shell().silentShellCommand({"arch"}).contains("64");
// boolean linuxTest = false;
// return is64JRE() || winTest || macTest || linuxTest;
return is64JRE();
}

private static boolean isWindows64Arch() {
return ( isWindows() && is64bitSystem() );
}

private static boolean isMacLinux64Arch() {
if( !is64bitSystem() ) {
return false;
}
if( isMac() || isLinux() ) {
return true;
}
return false;
}

isMac() and is64JRE() both yield "true" on this Mac.

---------- Post added at 09:38 AM ---------- Previous post was at 09:34 AM ----------

You do a little dance.

(The end result is flashing a custom recovery, TWRP, that you can use to flash any ROM. This is what's supposed to happen. If you don't want to do a backup, you can just reboot from TWRP and go back to life as usual.)
[Verizon Samsung Galaxy Note II] AdamOutler:
Well, I already have all of that written in the class I linked. But, you cant rely on Java to get the system arch. Java only knows the java arch. Sometimes a 64 bit system has 32 bit java on it. You have to go to the system to get the system arch.
[Verizon Samsung Galaxy Note II] AdamOutler:
Continue on to any of the development forum threads :). You're unlocked and ready to roll.
[Verizon Samsung Galaxy Note II] soba49:
That's true, but is there a practical difference for this case?

1. If your system is running a 64 bit build of JRE, it must be running on a 64 bit architecture (I could be missing the point here, perhaps os.arch really gives absolutely no information about the system architecture).

2. If you're running a 32 bit JRE, you could be running it under a 64 bit architecture depending on your OS. As far as I'm aware, this issue is only coming up right now for the Mac platform. Oracle does not support 32 bit Java 7 on Macs, so the only scenario where a Mac is running 32 bit JRE is if it's still running Java 6. CASUAL only supports Java 7 and above.. By that logic, the fact that CASUAL even runs on a Mac is a sufficient test that it has a 64 bit architecture, since it would not be able to run Java 7 otherwise.

However, I don't see how 1 & 2 can both be correct at the same time*

*: given that the 32 bit binaries must be working for some people, or at least must have come from somewhere, therefore testing for 64 bit matters.
[Verizon Samsung Galaxy Note II] AdamOutler:
Apple supports 32 bit java. I'm still getting updates for it on my 32 bit mac. But honestly, Mac is the smallest user base. Most mac users use iPhone, so whenever possible i merge Linux and Mac together for simplicity. As far as CASUAL is concerned, the only adaptations it makes for Mac is to replace "Linux" with "Mac" when selecting a binary to be deployed.

It's just bad practice to get arch from Java. It does not represent the machine arch, but only the Java arch. I stand firm on this because I've had several problems in the past and we are making system calls, not java calls for deployed binaries.
[Verizon Samsung Galaxy Note II] soba49:
Actually, academic discussion aside, how about this for quick and dirty?

private static boolean isMacLinux64Arch() {
boolean 32bit;
String[] CommandArch = {"file `which ls`"};
String archStr = new Shell().silentShellCommand(CommandArch);
32bit = archStr.contains("32") || archStr.contains("i386");

return !32bit;
}

As I mentioned, "file `which ls`" gives me "/bin/ls: Mach-O 64-bit executable x86_64".

---------- Post added at 10:54 AM ---------- Previous post was at 10:43 AM ----------

Fair enough. If you do decide to break out a separate 64 bit check for Mac, please use

uname -m

If you don't, I'd recommend constructing a universal binary with lipo if you can get that to go. That would clean up your repo, and save stress in the future.

If not, perhaps just testing output of `file` is sufficient, but for whatever reason, 'arch' is feeding me bad results Mac-side.

....

Apple supports 32 bit java, but NOT 32 bit java 7. You need to go Oracle, and 64 bit for that. Casual only supports Java 7 (or 1.7 if you like)
[Verizon Samsung Galaxy Note II] AdamOutler:
If uname works, I can use that. It will be a bit more difficult to parse but it can be used for the ARMV6L for raspberry pi as well as future versions. Can you verify uname -a works and I will add it to my todo?
[Verizon Samsung Galaxy Note II] soba49:
$ uname -a
Darwin Ainsleys-MacBook-Air.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

uname -m is easier parsing

$ uname -m
x86_64

$ uname -s
Darwin

$ uname -p
i386

---------- Post added at 11:59 AM ---------- Previous post was at 11:15 AM ----------

Unfortunately I'd need several sample strings to make valid patterns, but here's how java.util.regex works in case anyone is interested.

private static String uname() {
String s1 = "Darwin foo-MacBook-Air.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64$";
String pMac64 = "(\\w+).+(64)$";

if(s1.matches(pMac64))
return s1.replaceAll(pMac64, "Mac($1) $2bit");
return "UNKNOWN";
}

Output:
Mac(Darwin) 64bit
[Verizon Samsung Galaxy Note II] stkiswr:
I ran into an error when I first tried the program. It recognized the device but would run half way thru the program and get stuck.

It was my fault and I had a major driver issues.

I manually deleted all drivers and it fixed everything.

Program works perfect. Big thanks