[HOWTO] connect Porteus to Android device

Post tutorials, HOWTO's and other useful resources here.
aus9

[HOWTO] connect Porteus to Android device

Post#1 by aus9 » 31 Oct 2015, 06:38

This is a mini-howto to show you how to create an udev rule so you can use adb or fastboot commands from the
package android-tools to "talk" to your Android phone or Tablet via the command line.

Porteus stuff first
###################

As a local user or for those who login as root run this command with a usb data cable connected to your phone.
There is no need at this stage to enable USB debugging on Android. That can be done later.

Code: Select all

lsusb
My result is (culled of non-phone/tablet)
ID 0bb4:0c02 HTC (High Tech Computer Corp.) Dream / ADP1 / G1 / Magic / Tattoo (Debug)

Maker ID is a lie but lots of Chinese phones use other maker ID so lets move on.
Be careful if you manually type ids. Best to copy and paste, mine is (zero)bb4 not (Oh)bb4.

If you login as root.....skip this next part to add guest to the plugdev group.
Now run this command

Code: Select all

groups
My results
guest disk lp floppy dialout audio video cdrom games power netdev scanner vboxusers users

we need to add ourselves, using root powers, to the plugdev line in /etc/group so it reads
plugdev:x:83:guest
My number 83 may not be the same as yours. Just append guest. Reboot to test groups commands

All users guest or root rejoin here
####################################
Now use root powers to create the udev rule.
I will do this by command as we need to do extra command in a terminal as well.

Code: Select all

echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="666", GROUP="plugdev" 
' > /etc/udev/rules.d/55-0bb4.rules
If commands scare you, run a root powered text editor like leafpad, mousepad or kate.

Note that we have used a single quote as there are double quotes in the text file we are creating
Change the name of "0bb4" to anything you like but most people have only one phone??

Don't forget to change 0bb4 to your actual maker ID

Now either do a full reboot or try to update that rule live by running as root

Code: Select all

udevadm control --reload-rules
I am on 64 bit but we need android-tools so use usm to search/install for your package as root

Code: Select all

usm -g android-tools
There should be only one result so install it please and it should activate as well.

Now as local or root user do 2 commands please

Code: Select all

adb kill-server
adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
my result may be one of 2 main types
???????????? no permissions
or
0123456789ABCDEF unauthorized

If you get a serial number and a device, then you are already set up and can skip the next section

lets look at your device
Android
######

First ensure you have USB debugging turned on.
for me, settings -> Developer Options -> Section Debugging -> button for USB debugging.

If you can't find Developer search the internet how to get it, for most devices try this
settings -> about phone -> build number tap this about 7 times

USB debugging MUST I repeat must be turned on.

2) Older devices may not have any extra security but mine is nicer.

so for newer phones you will get a notification to allow a PC with a certain
fingerprint access to your Android. Naturally I choose yes. Note this is Android
notification about your PC.

Image

PC
#####

repeat command

Code: Select all

adb devices
List of devices attached 
0123456789ABCDEF	device
If you can not get any serial number, I suggest you post on the XDA forum.

Its beyond the scope of this tutorial on how to use adb or fastboot but I will just
show one command and result

Code: Select all

adb pull /storage/sdcard0/nfc.txt
8 KB/s (746 bytes in 0.082s)
cat nfc.txt 
/storage/emulated/legacy/nfc.txt
/storage/emulated/0/nfc.txt
/mnt/shell/emulated/0/nfc.txt
/system/etc/nfcse.cfg
/system/etc/nfcee_access.xml
/system/etc/nfc.cfg
/system/etc/permissions/com.android.nfc_extras.xml
/system/etc/permissions/android.hardware.nfc.hce.xml
/system/etc/permissions/android.hardware.nfc.xml
/system/lib/libnfc_ndef.so
/system/lib/libmtknfc_dynamic_load_jni.so
/system/lib/libmtknfc.so
/system/lib/libem_nfc_jni.so
/system/lib/libnfc_mt6605_jni.so
/system/framework/com.android.nfc_extras.jar
/system/framework/com.android.nfc_extras.odex
/system/xbin/nfcstackp
/data/misc/nfc_conformance
/data/data/com.mediatek.nfc.dta
/data/data/com.android.nfc
/data/data/com.mediatek.nfc.sysoper
/data/media/0/nfc.txt
/data/nfc_socket
YMMV

aus9

Re: [HOWTO] connect Porteus to Android device

Post#2 by aus9 » 03 Jan 2016, 23:02

this is just a test of image restrictions and a translation of the factory mode screen seen on some phones

Image

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: [HOWTO] connect Porteus to Android device

Post#3 by brokenman » 04 Jan 2016, 22:22

Holy crap! I forgot why I love linux sooo much. Nothing like a challenge when you want to do something as simple as plug your god damn phone in. I'm lucky I only use my cell phone to actually call people, and keep an agenda. I think if i need to transfer files I will use bluetooth.

Thanks for putting this together. It will be useful for the digital native generation.
How do i become super user?
Wear your underpants on the outside and put on a cape.

aus9

Re: [HOWTO] connect Porteus to Android device

Post#4 by aus9 » 09 Jan 2016, 07:19

this is an update for those testing Nemesis

android tools won't use usm. I prefer a full injection rather than a module

Code: Select all

sudo pacman -S android-tools

(run as local user)adb devices
List of devices attached 
0123456789ABCDEF	device
 

aus9

Re: [HOWTO] connect Porteus to Android device

Post#5 by aus9 » 09 Jan 2016, 07:24

My device does not have a dumchar_info but it does allow me to do this

Code: Select all

adb shell
shell@H560:/proc $ cat partinfo                                                
Name             Start           	Size            
pgpt             0x0000000000000000	0x0000000000080000
proinfo          0x0000000000080000	0x0000000000300000
nvram            0x0000000000380000	0x0000000000500000
protect1         0x0000000000880000	0x0000000000a00000
protect2         0x0000000001280000	0x0000000000a00000
seccfg           0x0000000001c80000	0x0000000000040000
lk               0x0000000001cc0000	0x0000000000060000
boot             0x0000000001d20000	0x0000000001000000
recovery         0x0000000002d20000	0x0000000001000000
secro            0x0000000003d20000	0x0000000000600000
para             0x0000000004320000	0x0000000000080000
logo             0x00000000043a0000	0x0000000000800000
expdb            0x0000000004ba0000	0x0000000000a00000
tee1             0x00000000055a0000	0x0000000000500000
tee2             0x0000000005aa0000	0x0000000000500000
metadata         0x0000000005fa0000	0x0000000002060000
system           0x0000000008000000	0x0000000052000000
cache            0x000000005a000000	0x0000000007000000
userdata         0x0000000061000000	0x0000000341d80000
flashinfo        0x00000003a2d80000	0x0000000001000000
sgpt             0x00000003a3d80000	0x0000000000080000
Now I can start to have a look at a flash tool scatter file and see if I have a correct start position and size
https://www.dropbox.com/s/3coh213z7e2ar ... r.txt?dl=0

by comparing them....I find the mismatch begins with
partition_index: SYS19--------------------------error
partition_name: userdata
file_name: userdata.img
is_download: true
type: EXT4_IMG
linear_start_addr: 0x61000000
physical_start_addr: 0x61000000 61000000
partition_size: 0x49c00000 341d80000
and because the size is different the 2 next partitions also have changed start positions

verdict not good enough to try flashing with this scatter file unless I risk a format and change the last 3 partitions

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [HOWTO] connect Porteus to Android device

Post#6 by Bogomips » 12 Feb 2016, 22:51

brokenman wrote:Thanks for putting this together. It will be useful for the digital native generation.
There was a time not so long ago, when if one was sitting in a public place like a cafe, you would see people sitting down to table, and especially couples, taking out their cigarette packets and putting these in front of them on the table. Now it's no longer cigarette packets, but smartphones and the like. It's the new habit! :evil:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

aus9

Re: [HOWTO] connect Porteus to Android device

Post#7 by aus9 » 13 Feb 2016, 00:14

offtopic but even better observe that young people now sit at coffee table texting other people instead of chatting to their friend.

AbhayF18
White ninja
White ninja
Posts: 11
Joined: 25 Nov 2020, 05:37
Distribution: Porteus v5 rc2 KDE

[HOWTO] connect Porteus to Android device

Post#8 by AbhayF18 » 30 Nov 2020, 16:15

Here is the xzm modules for adb and fastboot for Porteus v5.0 rc2 since there is no more usm in it.
https://mega.nz/file/Dv5Qkaqa#0tPnet4rO ... R9mNESXZl8
:) :)
and this is from where I built from
https://slackbuilds.org/repository/14.1 ... oid-tools/

User avatar
evergreen
Shogun
Shogun
Posts: 201
Joined: 27 Mar 2016, 16:58
Distribution: Porteus x86_64
Location: Argentine, Patagonia
Contact:

[HOWTO] connect Porteus to Android device

Post#9 by evergreen » 01 Dec 2020, 00:04

I am not sure what is doing this tool, I can connect my phone to the computer without inconveniences .

I found a recent version for android-tools.5 its here

android-tools-8.0.0_r24-x86_64-1salix.txz
https://jsanki.com.ar/porteuspkg/index. ... 1salix.txz

to solved dependencies there is a list of missing libs for your Porteus 5 rc2 gtest-1.7.0-x86_64-1salix.txz (Google C++ Testing Framework)
and ninja-1.7.1-x86_64-1salix.txz ninja (small build system with a focus on speed)
AbhayF18 wrote:
30 Nov 2020, 16:15
Here is the xzm modules for adb and fastboot for Porteus v5.0 rc2 since there is no more usm in it.
https://mega.nz/file/Dv5Qkaqa#0tPnet4rO ... R9mNESXZl8
:) :)
and this is from where I built from
https://slackbuilds.org/repository/14.1 ... oid-tools/
AMD A8-7410, APU AMD Radeon R5 Graphics M330

AbhayF18
White ninja
White ninja
Posts: 11
Joined: 25 Nov 2020, 05:37
Distribution: Porteus v5 rc2 KDE

[HOWTO] connect Porteus to Android device

Post#10 by AbhayF18 » 23 Dec 2020, 08:05

Even this is not the latest version. Then I downloaded official android-platform-tools-linux.zip from official Android site and connected my device over WIFI using ./adb connect <IP address:Port>
Now I'm able to use scrcpy (mirror Android using adb)(good for old android phones in which touch doesn't work)
I used the appimage for scrcpy by srevinsaju

and AppImages are boon for all linux distro while other things like snapd and flatpak are not supported on every distro but this appimage works on most distros. and That's what I like.

Even I use brave-browser with appimage.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

[HOWTO] connect Porteus to Android device

Post#11 by francois » 23 Dec 2020, 12:09

What is the advantage? Under thunar my android device connects automatically without additional software.
Prendre son temps, profiter de celui qui passe.

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] connect Porteus to Android device

Post#12 by Rava » 24 Dec 2020, 18:11

francois wrote:
23 Dec 2020, 12:09
What is the advantage? Under thunar my android device connects automatically without additional software.
I presume this is the advantage
aus9 wrote:
31 Oct 2015, 06:38
how to create an udev rule so you can use adb or fastboot commands from the
package android-tools to "talk" to your Android phone or Tablet via the command line.
(highlighting by me)
If you can access your Android phone or Tablet via the command line you could be able to go into system folders Android usually not shows to a connected computer.

Though, I guess that would only be of use for very few people.
Cheers!
Yours Rava

Post Reply