Saturday, 11 January 2014

Samsung SGH-S730M - Thou shall not be rooted - Part 1

As with any steps like this if you choose to try rooting your phone or installing custom Roms etc then this is your own choice and no one but yourself is to blame if it all goes wrong.

I was given one of these phones which is carrier locked to Telus in Canada.

It's not much different to any small Android phone but I was interested if I can 1) Root it and 2) Unlock the Carrier.

I suppose the easiest way to unlock the SIM is just purchase an unlock code but I did find some info on actually editing an XML file to remove carrier lock.

The first issue seems to be root and looking everywhere you then find the usual sites that direct you to pop up city with thousands of pop ups and "this can only be done using a Windows PC " etc.

One program was unlockfree which I installed on my daughters Windows machine (just before I wiped it and rebuilt it), this installed all sorts of junk on the machine as expected and was clearly just a way of infecting the machine with downloaders etc.

I also tried Root_with_Restore_by_Bin4ry which went through the stages but wouldn't root the phone - fortunately with this program I could run it through Linux with my existing adb set up.

Rummaging through adb web site itself I noticed Samsung_Quick_Root but this had possible issues and looked like it needed a Windows program first.

I then stumbled across Poot- http://forum.xda-developers.com/showthread.php?t=2204259

You download the APK, I then used ES File Explorer to install this onto the machine, it installs Ministro Library (which appears to be a way of Poot accessing some external files ?).

Anyway, I followed the instructions and rebooted - SU check confirms I have root.

I did install Rom Manager and SU checker earlier and these all said root was not running, now they both say root is OK.

It appears the phone has CWM installed as when I ran Rom Manager it asks me to set up recovery options, the first one says the phones not supported so I chose the 2nd one, I chose the option to say my phone wasn't on the list and it asked me to chose CWM 2.x or 3.x so I picked 3.x. It then refreshed to show the current recovery option is ClockworkMod 5.X.X (right hand image) so I assume this means there is a newer version already installed in the phone ?


         

Poot shows Root access, as does Root checker (Right hand image)

         

 So at the moment I have root access and CWM so I can take a full backup in case I mess things up.

Some key presses that were handy, power down the phone then hold Volume +, Home and Power - the phone will buzz and you see the Samsung name appear, release the keys.

This takes you into a menu where you can factory erase the phone if you need.



Acer Iconia A500, Dead ... or is it ?

My Daughter has one of the A500 tablets, it's been a great tablet - although it's dual core and nothing special compared to the current market it's always been nice and nippy, has front and rear cameras, 16GB of storage, a nice solid build and up to now .. reliable.

We turned it on to find it stuck at the Acer logo, nothing would shift it and it was clear something was wrong.


A quick whizz around the web and some suggestions, one is to go into a recovery mode that clears the cache and restores the system.


To do this you make sure the screen orientation switch is off (to the right) , hold Volume + and Power, when it buzzes, release Power but keep holding the Volume button, quickly switch the screen orientation switch.


A message pops up on the top left saying it is erasing cache, release the buttons and after clearing the cache it reboots.


In this case it didn't, still stuck at the Acer logo.


There are suggestions that it's either 


1) A corrupt loader or Operating system

2) A hardware fault.

One solution is to go on the web and get some OS roms, you rename the rom to update.zip (it must be lower case and that file name), pop it on an SD card and then boot into a different recovery option.


To do this you hold Volume - and power, when it buzzes release power, it tries to load recovery from SD card.


I get an android chappie with a rotating logo then one on his back with a red triangle - things are clearly not good.


In addition, some roms are encrypted so you need the Acer decrypt program, I ran this in Wine (windows emulator) and it decrypted them fine, if you can double click the update.zip and it opens, revealing the files inside then it's not encrypted.

I tried several roms (perhaps 10) and some seemed to get a little further than others.

There is a third mode, the unit can go into a loader mode (APX) which puts it in a position it can accept a full update.


To do this I need my CPU ID, the only problem, I can't power up to get it.


The device isn't seen in lsusb so I make a quick amendment to /etc/dev/rules.d/51-android.rules

Adding two lines of code

SUBSYSTEM=="usb", ATTR{idVendor}=="0502",ATTR{idProduct}=="3325",  MODE="0666", SYMLINK+="a500"

SUBSYSTEM=="usb", ATTR{idVendor}=="0955",ATTR{idProduct}=="7820",  MODE="0666" 

Re-start udev and I can see the device now reporting as an Nvidia device.


lsusb
Bus 002 Device 024: ID 0955:7820 NVidia Corp.

I found a great guide on running a simple script, it then reveals your CPUID - here.

In my case I'm running a 32 bit OS (I should really upgrade to 64 bit but it never crashes and I've never needed to reload my server OS EVER).

so in my case I replace a printf command with one for 32 bit OS.

My file looks like this, I created a file called cpuid.sh

pasted this code in

#include 
#include 
#include 

int main(void)
{
    unsigned char data[64];
    int received_length;
    int r = 1;
    libusb_context* ctx = NULL;
    libusb_device_handle* dev_handle = NULL;

    libusb_init(&ctx);
    dev_handle = libusb_open_device_with_vid_pid(ctx, 0x0955, 0x7820);
    if(dev_handle)
    {
        r = libusb_bulk_transfer(dev_handle, 0x81, data, sizeof(data), &received_length, 10000);
        if (r == 0)
        {
            if(received_length == 8)
            {
                printf("uid: %#016lx\n", *(uint64_t*)data);
            }
            else
            {
                r = 1;
                printf("Error: We got %d bytes of data instead of the 8 bytes we expected...\n", received_length);
            }
        }
        else
        {
            printf("Error: USB read failed!\n");
        }
        libusb_release_interface(dev_handle, 0);
    }
    else
    {
        printf("Error: Failed to open device!\n");
    }
    libusb_exit(ctx);
    return r;
}

Then you chmod +x the file so you can run it i.e

sudo chmod +x cpuid.sh

Before I can run it I need to put the A500 into APX mode, to do this power down (hold the power button), then put a paper clip in the reset hole, press and hold, press and hold power for 3 seconds, release power (keep the reset button pressed), hold reset for 1 more second then release.

It sound complex but it's easy to do, it's just holding reset for 1 second longer than power.
Now I can run the cpuid script to see if I can extract this out.

Run it with administrator permissions (./ means run it HERE i.e this directory)

sudo ./cpuid.sh

It creates a file called apx.c

run that by just typing 

./apx
 And you see your CPUID (you see here the command being run at the end of my directory location)

kevin@server:~/Desktop/A500/A500_fw$ ./apx
uid: 0x037C61C141C00257

So now I have a CPU ID, this means I can use a full restore option - this needs a CPU ID to lock the build to the system and is unique.

I then looked at using nvflash with bootloader_v9.bin, I saw issues in that it formats the memory in the tablet - partition 4 then puts the bootloader in but I had errors when I tried to format, clearly the machine was trying but things were going to be difficult.

Looking around there are many solutions to this, it's quite difficult to find what boot loader options you need and matching this to roms etc. so I found one solution that offered perhaps the simplest, it puts the machine back to Android 3 then you can perform standard upgrades to return to Jelly Bean.

This solution runs in windows and runs quite a simple process.

This is an Euu package requiring APX mode - you must have your CPUID to be able to use these.
The package I got was EUUs_SBK_Acer_A500_1.016.05_COM_GEN1
Just ignore the other roms (which I tried anyway), if you have CPUID and can get into APX mode then scroll down to locate the EUU roms and get that one.

Basically you launch the program (I just clicked the DotnetDetector and this launched it), DON'T plug the tablet in yet.

It would normally locate the firmware you are on then find the latest firmware but without a tablet connected it then goes into a fall back mode, offering to update a non functional tablet.

At this stage you click OK then put the tablet in APX mode and connect USB.

You need to supply CPUID and it's not 100% clear in what format, I found it does NOT need the 0x at the beginning so paste the CPUID without.

I also found if you make an error and it fails to close the program and reboot the tablet, it seems to fail always if the first entry is wrong.

The updater advises this will take about 10 minutes, you see the tablet soft boot into APX loader mode and the files downloaded.

At the end just reset the tablet - I popped a paper clip into the reset hole.

The tablet booted into native Android 3.xx, I connected on Wi-Fi and checked for updates, I think it total I had 4 updates.

The tablet is now up and running, fingers crossed it was just a combination of the unit having low power and my Daughter writing files to it that corrupted it.

Great respect to the people who published the web sites, they explained a great deal but putting my experience down here cuts down about 40 hours of messing about, you can do this now in about 2 hours, even less if you have your CPUID.

One word of advice, if you get your CPUID - PUT IT SOMEWHERE SAFE then you can skip right to the end and reload in 10 minutes.

Update : I didn't realize until an hour or two later that it only updated within Android 3.xx , to go up to Ice Cream Sandwich log into the Play store and look for ICONIA TAB UPDATE ENHANCEMENT, install this then when you check for Android updates (settings, About phone) you get a prompt to upgrade to ICS.





Thursday, 7 November 2013

HP N54L Microserver and Ubuntu - Part four

The Microserver is running great, one thing I noticed was it came with a single 2GB piece of memory, with a slot spare.

It's more efficient running two DIMM modules (dual channel) so I waited until the server was bedded in and no issues and found a brand new module on Ebay for £10.

Installing it was so quick I forgot to take some photos, there are a few guides on the web showing how to slide the system board forwards.

It now powers up with 4GB and the memory usage shows at 9%.

If there was an issue I noticed the current Firefox build seems to suffer memory leaks, I might have my cache set very high as well but I noticed with 2GB of RAM that every now and then when I'm running multiple windows I see a lot of memory used.

If Firefox was closed and memory monitored it didn't always release all the memory, I'll monitor it now I've got more and see what happens.

It might be I need to set the Cache at a sensible level, I often have them set quite high.

At the moment I'm still running 32 bit Ubuntu on the server, there was no need to format and rebuild the system - I've got a hard drive bay empty so might invest in another SSD (the same as my laptop) and install an SSD in for the OS, at that point I might switch to 64 bit.

My Samsung 128gb Pro is running great, although expensive the laptop runs quickly and file movement is lightning fast, if I see an offer on one of these drives I might snap it up and rebuild the server OS, boot up times should be insane.