[aklug] Rooting an Android Motorola Flipside from the Linux command line.

From: WestonandSuzy Howard <westonandsuzyhoward@gmail.com>
Date: Wed Dec 31 2014 - 07:51:21 AKST

Greetings to the AKLUG from the new guy!
 While speaking with my brother about my recent cell phone escapade,
he recommended that I join and pass this along to your group. I can
only imagine the collective level of competence and intelligence here,
so I apologize for cluttering up your in-boxes with my simpleton
thoughts and ways, but here it goes. (Remember, new guy, don't hate,
be nice.)

Exposition:
 So for the entirety of my life as an adult, I've only used dumb cell
phones, as apposed to smart ones. This was not a problem until all of
my friends and most of my relatives started texting. So then I was
forced to get a cell phone with a keyboard so I could respond
intelligently. Recently, I've become fed up with paying for minutes
and data, so I decided to change to a plan that was unlimited, and
also purchased a neat little (okay, really cheap) smart phone, the
Motorola Flipside, unlocked. Don't knock it, I needed a keyboard and
thought I'd try a smart phone, albeit an older one. Did I mention it
was really cheap?
 But alas, while it was great in some ways, it seemed restrictive, as
it would not download and use this particular app that I wanted to put
on it. Thus started my rooting adventure.

Rising Action:
 So I needed a way in. After a little research, I found that I could
use Android Development Bridging Tools (adb) from the command line.
You guys and gals are probably very technical, and way smarter than
me, so please don't laugh too hard, but I will share all the gory
details.
 Using Debian Wheezy, I found that there is no support for adb from
the main repository, so I added Wheezy-Backports to my sources.list
file:

# echo "deb http://ftp.us.debian.org/debian/ wheezy-backports main" >>
/etc/apt/sources.list
# echo "deb-src http://ftp.us.debian.org/debian/ wheezy-backports
main" >> /etc/apt/sources.list

Of course:

# aptitude update
# aptitude search android |grep adb

i android-tools-adb - Android Debug Bridge CLI tool

# aptitude install android-tools-adb

 Now that I had the tools, I went ahead and read the --help, and tried
to use it, after plugging in the USB cable to my phone:

# adb devices
List of devices attached - but it was blank!

 Hmm....

# lsusb
-other stuff-
Bus 001 Device 004: ID 22b8:41da Motorola PCS

 After some research, I realized that I needed some rules for this
device, and found that one guy did something similar for his nook. I
stole what he did, but changed it for my phone.

# touch /etc/udev/rules.d/99-android.rules
 To create the file.
# echo "SUBSYSTEM==usb, ATTR{idVendor}==22b8, MODE=0666, OWNER=user #
motorola" >> /etc/udev/rules.d/99-android.rules
# service udev restart

 Now it shows up:
# adb devices
List of devices attached
040140601001801A device

 Whoo-hoo! I knew I was cooking now!
 I set the phone for debugging with Application > Development > USB
debugging. I read online that this would allow me to use the adb
program to "push" things onto the phone.

Climax:
 I then researched a suitable rooter for my phone. Turns out it was
well supported by Z4Root.apk and all I needed to do was get it onto
the phone. So I downloaded it. Went to that directory and:

# adb install Z4Root.apk
blah-blah KB/s
pkg: /data/local/tmp/Z4Root.apk
Success

 Nice! So, I disconnect the USB cable, and ran z4root by clicking on
the app icon. Ran for about 2 minutes, rebooted, and then said I was
rooted! Very simple, very nice, but then I thought, how do I use it?

Falling action:
 I then used adb to install busybox installer, an app that lets me
choose which version of busybox to install, and as most of you know
(shoot, you guys and gals probably wrote it) allows me to have many
more Linux commands and attributes on my phone.
 Upon first try, I tried the latest and greatest that was available
from the app, 1.22, but it failed to install, so I chose 1.20, and it
installed successfully.
 I also got the Superuser app, I say got, because it simply appeared,
probably comes from the z4root process, which allows me to set su
permissions for apps on the phone.
 I then used the android market app to download terminal app.
 Now, when I open the terminal app, I can type su and it pops up a
dialog stating terminal app has super user permissions. I now have
access to the entire system files and many use full tools and
commands.

Denouement:
 You are very patient for having stuck through this rambling thread so
long, but I promise, it is almost over.
 I then was able to search through the files and found the
/data/data/com.android.providers.settings/databases/settigs.db is a
database file with the settings in it.
# cp /data/data/com.android.providers.settings/databases/settigs.db
/sdcard/settings.db
 To grab the file, then, after moving it to the computer:
# sqlite3 settings.db
.tables
.dump security
update security set value=1 where name='install_non_market_apps';
update security set value=0 where name='force_only_market_apps';
exit

 Viola, then I put it back. Then I had many errors when trying to
download from the internet. Then it would fail when parsing an apk
file.
 Hmm...
 Ah.... Some online searching revealed that I needed to also update
these files in a similar manner (albeit they are plain text, very easy
to edit):
/system/etc/motorola/com.android.providers.settings/system.mkitso
/system/etc/motorola/com.android.providers.settings/secure.mkitso
/system/etc/motorola/com.motorola.android.providers.settings/settings.mkitso

While changing lines like:
install_non_market_apps from 0 to 1
 and
force_only_market_apps from 1 to 0

 And there we have it! Unfortunately, the app I originally wanted to
install was made for a newer build of Android, so it didn't work
anyways, with a code of:

# adb install com.foxfi-APK4Fun.com.apk
2230 KB/s (210759 bytes in 0.092s)
        pkg: /data/local/tmp/com.foxfi-APK4Fun.com.apk
Failure [INSTALL_FAILED_OLDER_SDK]

 But that is an obstacle for another post, another time. That is,
unless you guys and gals boot me off for clogging up your in-boxes.

Happy New Year!
-Weston Howard
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Dec 31 07:51:54 2014

This archive was generated by hypermail 2.1.8 : Wed Dec 31 2014 - 07:51:55 AKST