58
1 Hacking with Linux on Android devices AndroidタブレットでLinuxを色々と遊んでみよう 1、Self introduction 自己紹介 2、Hacking Android 紹介、全体像 3、Android app and Server 4、Linux distributions on Android ・Debian noroot and chroot Linux ・x86 PC Emulations on Android ・Hacking some device(KindleFireTV) ・Recently ARM devices 5、Ubuntu on Windows10 Tablet 6、Nexus7 OS Hacking ・Android own build MultiROM、TWRP ・Custom ROMs 7、Android own build 8、MultiROM hacking 講演:Kenji Shimono 台湾MOPCON2016/10/30 13:00PlaceInternational Convention Center Kaohsiung 高雄國際會議中心 Yancheng, Kaohsiung, Taiwan This Presentation: Slideshare & PDF files publication of my HP http://kapper1224.sakura.ne.jp

Hacking with Linux on Android devices #MOCPON

Embed Size (px)

Citation preview

Page 1: Hacking with Linux on Android devices    #MOCPON

1Hacking with Linux on Android devicesAndroidタブレットでLinuxを色々と遊んでみよう

1、Self introduction 自己紹介2、Hacking Android 紹介、全体像3、Android app and Server4、Linux distributions on Android ・Debian noroot and chroot Linux ・x86 PC Emulations on Android ・Hacking some device(KindleFireTV) ・Recently ARM devices5、Ubuntu on Windows10 Tablet 6、Nexus7 OS Hacking ・Android own build MultiROM、TWRP ・Custom ROMs7、Android own build8、MultiROM hacking

講演:Kenji Shimono

台湾MOPCON2016/10/30 13:00~ Place:International Convention CenterKaohsiung 高雄國際會議中心Yancheng, Kaohsiung, Taiwan 

This Presentation:Slideshare & PDF filespublication of my HPhttp://kapper1224.sakura.ne.jp

Page 2: Hacking with Linux on Android devices    #MOCPON

2

自己紹介 Self Introduction● My pen name: Kapper( Kenji Shimono)

● Twitter account:@kapper1224

● HP:http://kapper1224.sakura.ne.jp

● Slideshare: http://www.slideshare.net/kapper1224

● ニコナレ: http://niconare.nicovideo.jp/users/59379263

● My Hobby:Linux、*BSD、and Mobile ARM Devices

● My favorite words:Record than experiment important

● Test Model:Netwalker(PC-Z1,T1)、Nokia N900、DynabookAZ、RaspberryPi      Nexus7(2012、2013)、Hercules eCAFE EX HD、Jetson TK-1、      OpenPandora、ARM Chromebook、ZTE OPEN C(FirefoxOS)      台湾Android電子辞書 無敵CD-920、CD-928 and more.

● Recent Activity: Hacking Linux on Windows10 Tablet (Intel Atom base).

 I have been active in the Tokaido Linux User Group.

 Hacking of Android Nexus7.

 I have recently often use the ARM Chromebook.

 

Page 3: Hacking with Linux on Android devices    #MOCPON

3Recently my activity1.Linux distributions on Android 2. Electronic Circuit on ARM

3. Ubuntu on Windows10 Tablet 4. Plesentations in Asia(Singapore,Taiwan) Opensouce Conference

RaspberryPiを使ってLチカ昔に戻って、電子回路工作を楽しんでます

Page 4: Hacking with Linux on Android devices    #MOCPON

4Tokaido Linux Uses Group( in Japan)

●Koedo Linux User Group(Tokyo)●Tokaido Linux User Group(Yokohama-Nagoya-Osaka)●LILO Kansai(Osaka)●Kagoshima Linux User Group(Kagoshima)There are some Aria in Japan, and one of the Largest Linux community in Japan.

●Our DeveloperOpencocon,Debian,OpenSuse,Mint,LibreOffice,mobileOS, Embedded Linux,Android,SailfishOS,Python,Eject,Opcocon,Japanese Inpud Method,Electronic circuit Hack~

Page 5: Hacking with Linux on Android devices    #MOCPON

5My Activity OpenSourceConference in Japanand Tokaido Linux Uses GroupOnce it is held in one month

SapporoHokkaido

TokyoHamamatu

NagoyaKyoto

Osaka(KOF)

Shimane

Hiroshima

Oita

Okinawa

Kawagoe(Tokyo)

HakataTokushima

Niigata

Page 6: Hacking with Linux on Android devices    #MOCPON

6

Today Session今回のテーマ● Hacking Linux on Android devices. ● Introduce sever and some Android application. ● Add Hacking Linux on Windows Tablet.● This is English and Japanese presentations Multi-

langugae.

Page 7: Hacking with Linux on Android devices    #MOCPON

7Today Session

BootloaderKernelSoC

OS replaceRoot

MultiROMPkgsrcNetBSD

LinuxDistributions

chroot(root)

MikutterRemoteDesktopDebian Noroot

OpenCocon

EasyApplication

onlyDifficult

Desktop,server

Office

Haking DeveloperDistributer

「End of Life」extended

Target UsersMikutter app

x86 emuWindows app

Limited ImportantHacking

ElectronicCircuts

Page 8: Hacking with Linux on Android devices    #MOCPON

8Hacking Android easy history

Android ~4.xMany Chinese Tablet

Many Rooted app↓

Only install applications

Android~4.2Nexus7 comming

Bootloader is easy tounlocked

↓Easy to Root

Android~2.3No root devices

Webkit had security bug Rooted

↓hacking

DifficultEasy to root

everyone Install app only

Page 9: Hacking with Linux on Android devices    #MOCPON

9PC market and Android

ChineseTablet

SmartWatch

Android Smart Phone

AndroidWindows

Tablet

WindowsNote PC

iPad

Chromebook

Macbook

RaspberryPi

Android Stick1Board PC

WindowsPC

GoogleGlass

Mobile PCDesktop PC

iPhone

0 inch 6 inch 10 inch

$200

$100

$500

$1000

MacPC

Screen size

ChromeBox

$179~$350

AppleWatch

Page 10: Hacking with Linux on Android devices    #MOCPON

10Hacking Inexpensive PC Classification

Android can operate any Linux distributions too.Kapper’s Internet search

My point of view Machine OS Root Replace OS Cost

(US$)Comment

Chinese TabletChinese SmartphoneNetbook

AndroidFirefoxOS(ARM、MIPS)

◯ CyanogenMod他Ubuntu、Debian、Arch他

$40~$300

Low costLow spec Low battery

Android SticksAndroid Box

Android(ARM)

◯ CyanogenMod他PicUntu他

$30~$200

Low costHigh spec

ChromebookChromebox

ChromeOS(ARM、x86)

◯ Ubuntu、Debian他 $90~$300

High spec

ATOM WindowsTablet

WindowsAndroid(x86)

△ Ubuntu他、Bash、Cygwin

$80~$300

High specUEFI32bit

Windows Stick Windows(x86)Ubuntu

△ Ubuntu他、Bash、Cygwin $70~$200

High specUEFI32bit

1 Board PC Linux(ARM) ◯ Debian、Ubuntu、NetBSDFreeBSD他

$10~$200

RaspberryPiBootloader unlock

AndroidSmartwatch

Android(ARM、MIPS)

△ AsteroidOS他 $60~$200

New

Android wearSmartwatch

Android Wear(ARM)

△ AsteroidOS他 $100~$300

NewHigh cost

Android Car Navi Android(ARM,MIPS)

△ After this $200〜$500

High Cost

Page 11: Hacking with Linux on Android devices    #MOCPON

11

AndroidをLinux端末として遊んでみる

● What do you want to hacking in Android devices?

1、Office and Editor (using keyboard)2、Windows and x86 emulations on Android.3、Mikutter、LibreOffice and desktop application4、Server application5、Remote desktop,TeamViewer with RaspberryPi6、FlashPlayer 7、Electronic circuits and Arduino8、Re-use Old Android devices9、FirefoxOS、UbuntuTouch and Moblie OS

Page 12: Hacking with Linux on Android devices    #MOCPON

12Remote monitor instead in VNC and RDP viewer

● Use the first basic monitor Instead, remote control● Use RaspberryPi and Windows VNC terminal● It is not limited to Android, but let's use if I left

over the model

BlackberryQ5

Chinese Smartwatch

Nexus7+Bluetooth keyboard

Page 13: Hacking with Linux on Android devices    #MOCPON

13Re-use for server terminal● Android have some server applications. Old Android devices

can re-use LAMP and some portable machine.

Page 14: Hacking with Linux on Android devices    #MOCPON

14Stroage problem in old Android devices● Old Android devices are too small stroage problem.

● About /mnt/sdcard is FAT32 format, because Windows can read it.

● In Linux devices, can’t make symbolick link on /mnt/sdcard and MicroSD FAT32. If you want to use symbo-lick link, format Ext or NTFS, and loopbackdisk.

● In Android application have Link2SD andAndroid Partition Tool,but they are rooted applications

rm -rf /storage/sdcard0/<directory>mkdir /storage/sdcard0/<directory>mount -o bind /storage/sdcard1/<directory> /storage/sdcard0/<directory>

sumount -o remount,rw /cp -pr /mnt/sdcard/<directory> /data/sdext2/<directory>rm -r /mnt/sdcard/<directory>ln -s /data/sdext2/<directory> /mnt/sdcard/<directory>busybox ln -s /data/sdext2/<directory> /mnt/sdcard/<directory>

or

Source:Not possible to create a symlink in /mnt/sdcard?

Page 15: Hacking with Linux on Android devices    #MOCPON

15

Hacking Android

Install Linux Distributionson Chroot application

Page 16: Hacking with Linux on Android devices    #MOCPON

16Install ARM Linux on Chroot● Chroot is other Linux distribution on Linux

● In Android,Only use Chroot application

● Can’t access to the outside Chroot.Mount folder only access it.mount -o bind <directory1> <directory2>

● Chroot use only Root user, Nomal user use Fakechroot command,(Debian Noroot is used)

● Kernel is Android based kernel.Driver and kernel modules based Android.

AndroidLinux Device

UbuntuDebianAnd

other Linux

UbuntuDebianAnd

other Linux

Page 17: Hacking with Linux on Android devices    #MOCPON

17Debian Noroot on Android● Debian Noroot can be installed in a chroot without taking

root privileges Android apps Debian

● You can use a Bluetooth keyboard, like a notebook PC

● Contents to build a chroot environment in the normal user privileges use the fakechroot, are viewing the Xorg in Xserver-SDL

● There are challenges to capacity because storage is based on the premise visceral / sdcard

● Recent Ver corresponding with Android4.0 later

● Difficulties in compatibility that does not move Xserver-SDL with the old OS

Taiwan Electronic Dictionary 無敵CD-920

Page 18: Hacking with Linux on Android devices    #MOCPON

18Desktop applications on Android

Blender on Android Scratch on Android

Debian jessie package over 43,000 desktop app on AndroidHardware driver is difficult on chroot Linux,but can use on Android.

Mikutter about Twitter app LibreOffice on Android

Page 19: Hacking with Linux on Android devices    #MOCPON

19

List of Chroot applications on Android

Chroot Applications Androidversion

CUI or GUI Linux distributions Root comment

Debian Noroot(Gimp他)

4.3~ Full AutoXserverSDL

Debian No Install and XseverUse much disk

Complete Linux 2.2~ Terminal Debian、Ubuntu、Fedora、Arch、OpenSuse

Root Many DistributionGUI installer

Debian Kit 4.1~ Terminal Debian Root DebootstrapLinux Deploy 2.1~ Terminal Debian、Ubuntu、Fe

dora、Arch、OpenSuse

Root most supportCentOS

GnuRoot 1.6~ Terminal Debian No Any Android devicesold

GnuRoot debian,Fedora, Gentoo

1.6~ Terminal Debian,Fedora,Gentoo

No On GNURootold

GnuRoot Wheezy X 1.6~ Xserver Debian No On GNURootold

AndroLinux 3.0~ Terminal Fedora,CentOS ? CentOSAPKLinux 4.0.3~ Terminal Bare-Bone Root Own packagesLil' Debi 2.1~ Terminal Debian Root Debootstrap

Chroot applications are different OS and Android version.Terminal base chroot application is small size on stroage.GUI is Xserver-SDL and VNC.

Android can operate any Linux distributions too.Kapper’s Internet search

Page 20: Hacking with Linux on Android devices    #MOCPON

20Rooting Android● In rooted Android, many applications and OS can

operate.But no warranty for manufacturing. ● Rooted Android

1、Connect USB and rooting applications on Windows2、Unlock Android bootloader3、Use rooting application on Android

● Why wouldn’t you root?

1、OS Replace、chroot、symbolick link2、Chenge security,internal access、terminal3、OverClock4、Move app in SDCard、Delete app

Page 21: Hacking with Linux on Android devices    #MOCPON

Nexus Root Toolkit● Windows GUI application for Nexus7

easy Unlock and rooted

1、Nexus Root toolkit app download2、Google USB driver install in Windows3、Connect USB to Nexus74、Only click, Unlock and rooted

Nexus Root Toolkit

Page 22: Hacking with Linux on Android devices    #MOCPON

Rooting applicaions ● Recently Rooting app in GooglePlay and so on.● For example, Kingo Android Root.

Many devices and manufacture supported.There are windows and android applications.Use at your own risk.

Supported Manufacture

Page 23: Hacking with Linux on Android devices    #MOCPON

23Android Terminal and Busybox● Linux basic command can use Terminal

Emulator and Busybox in Andoid.● Busybox is basic CUI tool set,command can

control Android system (cp,wget,w3m~)● If you want to change system,you need

rooted devices.

Android Terminal Busybox

Page 24: Hacking with Linux on Android devices    #MOCPON

24Debian Kit and Complete Linux● App to put the package to build a chroot environment on

Android with apt-get. Debian reduction can be.

● I can server of the Android simple. and those that do not need as there are root of.

● Debian Kit because it is a mechanism that can be used is apt-get at the root environment of the parent process of Android, has a high degree of freedom (high risk?)

● Also old environment for the Debian Noroot can not be put

Complete Linux

Page 25: Hacking with Linux on Android devices    #MOCPON

25TightVNCserver and VNCviewer● Alternate of the easiest X server VNCserver

● If you invoke the TightVNCserver in a chroot environment and easily launched the X environment on Android.Localhost:8080 (127.0.0.1)

● Of course, it is also possible to use by remote control.

Complete LinuxVNC Viewer

Page 26: Hacking with Linux on Android devices    #MOCPON

26Use Xserver-SDL alone on Android● It can also be used alone Xserver-SDL, which is

also used Debian noroot as an alternative to the Xserver.

● From how to use activates the Xserver-SDL, from the terminal in Chroot environment,env DISPLAY=xxx.xxx.xxx.xxx:0 lxsession &The activated Show Xserver-SDL again on Android

Complete LinuxXserver-SDL

Page 27: Hacking with Linux on Android devices    #MOCPON

27

Hacking Android

x86 Windows emulations

Page 28: Hacking with Linux on Android devices    #MOCPON

28

Play PC Emulation on Android● Windows and applications play PC emulations

on Android,but too slow (=first pentium)● PC: Bochs,Qemu,DOSBox,Limbo(Qemu)

MAC:vMacMini、Basillisk2● On Qemu,Windows and NetBSD can

operate(after Qemu ver1.5 on ARMdevices)NetBSD Live images

Windows9x、2000

Page 29: Hacking with Linux on Android devices    #MOCPON

29x86 Emulations on ARM DevicesEmulation OS Root

DeviceEmulated OS Spec Comment

Qemu LinuxAndroidRaspberryPi

No WindowsMacOSX?Linux,*BSD

Slow Tegra K-1⇒Pen 266MHzⅡVer1.5〜(ARM GUI)

Qemu+Wine LinuxAndroidRaspberryPi

Required +Windows APP Slow Difficultkernel 3G/1G onlychroot environment

Exagear-Desktop LinuxRaspberryPi

Required Ubuntu,Debian Fast Tegra K-1⇒Pen4 1.8GHz

Exagear-Desktop+Wine

LinuxRaspberryPi

Required Ubuntu+WineWindows APP

Fast Tegra K-1⇒Pen4 1.8GHz

DOSBox LinuxAndroidRaspberryPiiOS,DS,PSP

No DOS,WIndows9x(i386〜i586)

Slow Tegra K-1⇒Pen 266MHzⅡNEON SupportsVoodoo1+Glide

Bochs LinuxAndroidRaspberryPiiOS,PSP

No Windows〜XP(i386〜x86-64)Linux,*BSD

Slow Tegra K-1⇒Pen 266MHzⅡ

XNP2(PC-98 Emulation)

LinuxAndroidRaspberryPiiOS

No DOS、Windows95?

Slow Tegra K-1⇒?

Internet dogmatic investigation of Kapper (if I wrong it, I'm sorry. )

VMWare and Virtualbox are not working on ARM devices.(Only x86)

Page 30: Hacking with Linux on Android devices    #MOCPON

30Windows game with ExaGear Mobile on Android● Exagear Mobile(RPG、Strategy)is Android applications

x86+Wine emulations.

● Play some Windows app and game (about Diablo1,2)

● Copy Windows PC’s (C/:Program files/〜) in Android

Page 31: Hacking with Linux on Android devices    #MOCPON

31

Play Windows95 on DOSBox● DOSBox can operate Windows9x on any devices● Android,iOS,RaspberryPi,3DS,XBOX,PS3・・・● Play old game, Cad, language and office.● My slideshare「beginner for DOSBox」

Please read it!

Windows95

Page 32: Hacking with Linux on Android devices    #MOCPON

32

Old Mac emulateion on BasiliskⅡ● Old 68K MacOS emulation on BasiliskⅡ.● Some game,office and so on. ● Let’s play Old MacOS on Android.

Basilisk2 on Old MacOS

Page 33: Hacking with Linux on Android devices    #MOCPON

33

Recently my Hacking( today side story)

Page 34: Hacking with Linux on Android devices    #MOCPON

34Hacking Android devices and OS1.Kindle fire TV、Kindle Fire5

2. Chromecast

3. IS01, Dynabook AZ(AC100) 4. HMDI stick type PC, ChromebitThey use Allwinner,Rockchip CPU. Ubuntu can install.Chroot Debian,Ubuntu.They have not some devices,But they are easy to Hacking Linux!

Install ES File Explorer, Kindle can install APK filebased Android application, DebianNoroot too.Rooted Kindle can install GooglePlay. And supported CyanogenModinstall Kindle,like Android.

Chromecast is Android Core. So Chromecast canInstall custom ROM「rCast」「PwndCast」,Stand-alone movie, audio, and so on.

Old Rooted Android devices can install CyanogenMod,And to use Chroot Debian,Ubuntu.Old Android devices Hacking is very interesting.

Page 35: Hacking with Linux on Android devices    #MOCPON

35

Unix on Windows Tablet● Cygwin and Emulation Unix onWindows Tablet

1.Bash on Windows( Ubuntu base)2.Cygwin3.Emulation(qemu,virtualbox,VMware他)4.Legasy,UEFI 64bit BOIS dualboot Linux device driver is not still supported.

QemuCygwin

Page 36: Hacking with Linux on Android devices    #MOCPON

36

Recently my HackingHacking Linux on x86 Windows Tablet

( today side story)

Page 37: Hacking with Linux on Android devices    #MOCPON

37Test Model PC● ICONIA W500S(AMD C-50) 2011/4 Legacy BIOS

● ONKYO TW317A5(Oak-Trail)2010/9 LegacyBIOS

● Acer W3-810(Clover-Trail)2013/7 UEFI 32bit

● Asus T100TA-DK32(Bay-Trail)2013/10 UEFI32bit

● PC-TW708/CAS(Bay-Trail) 2015/10 UEFI 32bit

● WIN-70B(Bay-Trail) 2015/6 UEFI 32bit

● Chui VI8 Plus(Cherry-Trail) 2016/1 UEFI 64bit

Page 38: Hacking with Linux on Android devices    #MOCPON

38 Recently PC’s boot process for Windows and Linux

● Ubuntu official ISO is not supported to both 32bit and 64bit.

LegacyBIOS

LegacyBIOS(USB, ISO)

Grub2(32,64bit)

Install ISOUbuntu

(32,64bit)

LegacyBIOS(Wubi)

UEFI32bit(USB, ISO)

UEFI32bit(Wubi)

Hard(32,64bit)

Grub2Wubi

(32,64bit)auto

Install WubiUbuntu

(32,64bit)

UEFI

(32bit)Grub2(64bit)32bit

Install ISOUbuntu(64bit)

Hard(64bit)

Grub2Wubi

(32,64bit)auto

Install WubiUbuntu(64bit)

Fix

NotProblem

NotProblem

Afterinstallgrub2 32bit

Fix installwubi forUbuntu16.04rev3112016/8/2!

Only32bit

SurfaceNotebookUEFI64bit

UEFI(64bit)

Grub2(64bit)

Install ISOUbuntu(64bit)

Hard(64bit)

NotProblem

Page 39: Hacking with Linux on Android devices    #MOCPON

39Install ISO for Ubuntu 16.04 ● Required

1.Windows Tablets2. USB Memory(>2GB) install Ubuntu16.04 ISO3. USB-MicroUSB OTG cable4. USB hub5. USB keyboard6. USB mouse7. USB Wifi adapter

Page 40: Hacking with Linux on Android devices    #MOCPON

40Install ISO for Ubuntu 16.04 ● Install USB memory Ubuntu16.04 in Windows Tablet.

● Grub2-efi-ia32 can’t install amd64 Ubuntu 16.04.So you can’t boot Grub2 32bit. Reboot and install 「apt-get」

Over 8GBUbuntu16.04

Install Error grub-efi-ia32

Installer crash and reboot

Page 41: Hacking with Linux on Android devices    #MOCPON

41

Android(Nexus7)OS replace

Page 42: Hacking with Linux on Android devices    #MOCPON

42Install Linux distributions on Android(Nexus7)

● About 5 type install

1、chroot install Linux distributions2、Launcher type virtualization OS3、Emulations OS4、Install MultiROM and custom ZIP ROM images5、Install firmware,bootloader and OS(dual boot)

Page 43: Hacking with Linux on Android devices    #MOCPON

43Android-own build status

Internet dogmatic investigation of Kapper (if I wrong I'm sorry. Correct)◎:Official Support、◯:Official reports、△:Users reports

Distributions Version Installer Multirom Root Compatible devices

Factoryimg ~5.1.1~6.0.4 ◎ ○ △ Nexus(google)

CynanogenMOD ~6.0.x ◎ ○ ○ many

AOKP ◎ ○ ○ many

ParanoidAndroid ○ ○ ○ many

ClockworkMOD ○ ○ ○ many

Debian GNU Linux 〜8.x ○ ○ ○ MultiROM移植

Ubuntu Linux ○ ○ ○ MultiROM移植

FirefoxOS ○ ○ △ Own buildAOKP,CyanogenMOD

Based kernel

Ubuntu TouchUbuntu Phone ◎ ○ ○ Nexus7(2013)

4、5、10、6

Tizen △ △ △ ?SalfishOS ~2.0 △ △ △ Nexus5

Page 44: Hacking with Linux on Android devices    #MOCPON

44FirefoxOS2.5 Launcher● FirefoxOS2.5 Launcher is Android Home app that can use

FirefoxOS and app. Install apk file on Android.

● English only. Difficult use the other languages.

● Test FirefoxOS if you want to use Other OS on Android.

FirefoxOS2.5LauncherFirfoxOS HP http://www.mozilla.org/en-US/firefox/os/

Page 45: Hacking with Linux on Android devices    #MOCPON

MultiROMとTWRP● MultiROM can select and boot some OS image ROM when boot devices.

Need Rooted and Unlock bootloader.

● TWRP is custom recovery 「TWRP」,when 「TWRP」install you can use many OS multi-boot and backup. NexusRootToolkit can easy install it.

Page 46: Hacking with Linux on Android devices    #MOCPON

CyanobenMod● CyanogenMod Inc. and Android4.x to the various devices in one of their own

build a number of Android that are customized are developing.

● Include the formal and informal support, corresponding to 220 devices

● Development from the firmware (boot loader) to the OS image.If a device that is official support, it can be installed with one click without taking root.

● Installation has a difficult but also many operations reported to the local device,It has contributed to the aftermarket of older models.

● Since correspond to the regular even Nexus7, it is easy to install.

CyanobenMod9

Page 47: Hacking with Linux on Android devices    #MOCPON

FirefoxOS● You can install and use FirefoxOS in Nexus7.● Custom ROM required Since then replacement

of FirefoxOS ROM.(supported device)

FirefoxOS SimulatorFirefoxOS

Page 48: Hacking with Linux on Android devices    #MOCPON

Ubuntu Touch● Nexus7 2013 is Ubuntu Touch supported now.● Installer and boot loader set● The use of Ubuntu touch is Nexus series only.

Ubuntu TouchUbuntu Touch

Page 49: Hacking with Linux on Android devices    #MOCPON

49

Nexus7 on Ubuntu13.04● In2013 ,Ubuntu 13.04 Desktop can install in

Nexus7 2012.● UbuntuTouch had been supported Nexus7, but

「End of Life」now. Few people use Ubuntu 13.04 and Ubuntu Touch on Nexus7 2012 now.

Ubuntu13.04 Nexus7 Ubuntu13.04 Nexus7

Page 50: Hacking with Linux on Android devices    #MOCPON

50MultiROM support Debian、Ubuntu、Arch● In 2015/8, MultiRom supported Debian and the

others, Debian can install and dualboot MulitROM

Page 51: Hacking with Linux on Android devices    #MOCPON

51

CyanogenMod own build

*)To Linux developerIf you want to make own Android

Page 52: Hacking with Linux on Android devices    #MOCPON

52CyanogenMod build● Android is opensource project,you can make and

build own Android (FirefoxOS too)● Build PC specs

OS:Ubuntu(on VirtualBox)CPU:Corei5~7 memory:4GB~HDD:100GB~Build time:8〜24Hr

● Build guide in OfficialCyanogenMod HP.Copy and paste.

● First,Let’s Install official Image.

Officially-Supported CyanogenMod

Page 53: Hacking with Linux on Android devices    #MOCPON

53Hacking Android devices and OS2.Customize file and data

3. Build sourcecode 4. Kernel build(if kernel customized)

1. Download sourcecode

This is digest version.Let’s see CyanogenMOD

Website!

1. Research Android devices name2.Download sourcecode vender3.Directory setthings

3.Directory setthings4.Files customized

5.make test recovery Image 6.build CyanogenMod

7.add XML overilay 8.build Linux kernel and kernel module

Page 54: Hacking with Linux on Android devices    #MOCPON

54Mechanism of the bootloader on ARM devicesand compare x86 devices.

Devices ROM RAM MBR(Disk)

Kernel init Login Features

x86~Linux

BIOS &DISKbootloader

ARMAndroid

Bootloader unlock is important

x86-Chromebook

After the bootloader in common

ARMLinuxDistributionChromebook

After the bootloader in common with x86

BIOS,UEFIDevice

Bootdisk

GRUBLILO

KernelDriver

Daemonand also

Initializationdriver

RAMtransfer

Kerneltransfer

Kernelrootfs

loading

CUI

Xorg

Kerneldriverrootfs

DevicesDaemonContext managerZygote

Initializationdriver

RAMtransfer

Bootloader(U-boot)

Kerneltransfer

Kernelrootfs

loading

KernelDriver

Daemonand also

CUI

Xorg

Dalvik VMAndroid

GUI

In the case of ARM, it transfers the bootloader from FlashROM in RAM, and is configured to read the Kernel and rootfs.Bootloader that is being written to ROM is so called "firmware". In the case of Android, it is required Unlock “firmware”.

Android Bootloader(ROM)MLO

MLO

Initializationdriver

RAMtrasfer

Kerneltransfer

KernelRootfsloading

Bootloader(U-boot)MLO

KernelDriver

DaemonAnd also

CUI

Xorg

Page 55: Hacking with Linux on Android devices    #MOCPON

55Ubuntu installer SourceCode in Android● Only download Wget OS-image and install fastboot command.

● Connect USB cable Windows(Linux) to Android devices.set -eecho "$COUNTER" echo "# Begining Ubuntu Core Nexus7 installation"; sleep 2COUNTER=$((COUNTER+20))echo "$COUNTER" echo "# Erasing boot partition"sudo -Sp '' -- fastboot erase boot <<<"${SPW}"COUNTER=$((COUNTER+20)) echo "$COUNTER"echo "# Flashing boot partition"sudo -Sp '' -- fastboot flash boot ./"${IMAGES[0]}" <<<"${SPW}"COUNTER=$((COUNTER+20))echo "$COUNTER"echo "# Erasing userdata partition"sudo -Sp '' -- fastboot erase userdata <<<"${SPW}"COUNTER=$((COUNTER+20))echo "$COUNTER" echo "# Flashing Ubuntu Core root file system"sudo -Sp '' -- fastboot flash userdata ./"${IMAGES[1]%.*}" <<<"${SPW}"COUNTER=$((COUNTER+20))echo "$COUNTER"echo "# Rebooting device"; sleep 2sudo -Sp '' -- fastboot reboot <<<"${SPW}") |

Page 56: Hacking with Linux on Android devices    #MOCPON

56Chinese Tablet ARM processerProcesser Hack app Bootloader Root SDboot device Kernel CommentRK3066,RK2926RK3088,RK3188,RK3268

rkflashkitcreate-sdcard.7z

U-bootLinuxium

◯ ◯ MK802~8 RK3*** 主流Hacking toolsUbuntu

AllwinnerA10〜20AllwinnerA31

BROMBerryBootDebian-Installer

U-bootBareboxCoreboot

◯ ◯ CubieBoard SUNXILichee

主流Hacking toolsDebian

MT8389MT6577

Magic TWRP/CWMSPFlashTool

U-boot ◯ ◯ ThunderKernel

主流MediaTek

Exnos5250 U-boot ◯ ? Arndale Board Samsung

Snapdragon U-boot ◯ ? QualcommK3V2 fastboot U-boot ◯ ? HisiliconiMX6 U-boot ◯ ◯ Linao Freescale

Atom Z3735 UEFI ◯ 〇 Windows Tablet

ATM7029 U-boot ◯ ? NvidiaTegra U-boot ◯ ◯ DynabookAZ ActionsOMAP4470 U-boot ◯ ◯ End of Life

My internet search

One of some CPU manufacture provide Rooting app and bootloader hacking app.

Page 57: Hacking with Linux on Android devices    #MOCPON

57Android custom bootloader● In some ARM-chip devices, some custom bootloader

supported(about MultiROM,U-Boot,coreboot and others).

● RockchipRK3188 have 「Linuium」 Grub-like ROM botloader、they can boot NAND and SD Card OS images.

Page 58: Hacking with Linux on Android devices    #MOCPON

58-MultiROM and ZIP-ROM image build