From owner-freebsd-questions@freebsd.org Sat Jul 13 22:03:28 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F36115CE25A for ; Sat, 13 Jul 2019 22:03:28 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09FE271509 for ; Sat, 13 Jul 2019 22:03:26 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.12.34.221]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPA (Nemesis) id 1MsYzF-1iaodC1Q5r-00tzz4; Sat, 13 Jul 2019 23:50:05 +0200 Date: Sat, 13 Jul 2019 23:50:03 +0200 From: Polytropon To: Manish Jain Cc: "freebsd-questions@freebsd.org" Subject: Re: How to explore Android device files under FreeBSD ? Message-Id: <20190713235003.da37dc7c.freebsd@edvax.de> In-Reply-To: <20190713224753.f5e51166.freebsd@edvax.de> References: <20190713224753.f5e51166.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:K47YEZO2Grm7p+Blxig03YncG+sbx2mdUEsC94ucXPuDs1SIm6V DFPRzarkyRqC30BB7uuDbR1DXTU01g8BKZ34ZAUBNTwJh8n57K8YdtENq8bXclIk1Tbo2/d 8o3bgpM1Kv3Af+2n1YalKrKTVhOY7KVPapTlhYJkfdXa3sVqKlq7lkwhrSCYa5UM71wqlW9 FXbRaRv3cTYqh8HecaRUA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pVJAo1f2XDQ=:MOBZbvsoULaLogL6RFCWtF sq2tU/lIou5bmUuvQ4x+YfX+jrHgd4pzjo6+N6NIg0pr0WPNXtXtDd4hYUBr3mUAS8TPUYTvg la8qStsl7nw30MyUIxjRxOf5IDQI83DkqcWUd0Pu3e50uy6To8BC/AhAGOG+3OkuGWIdScs80 fXdKRb3OLvoDO487i32Wh+g1eBeC0oFFBC7bKtgR0BdJI0CbSVS8XuoT3J17bOdNPyAsrLUui WpXrMNg6EyHq5jialTEkSuKBQYFqHE6AeiYoXl8prjoOI9Aa7eDfkMkeKdgVFQ+/T/NDNhGGW N0qt9fckXxYW7k1PQQ9PmWBMPAaEK5pFhbbwzrqLB3of28+Hy+WrdXF3n2k2ORoavzedMqP4m YF5otRmUP8k2HTp/c0IKqqv+9S4CHuCEzNbpZUTE5l60OJCq4/Nj2Uece9sXqfNtR5LbrmXOs ttW2vqi7A9cRlboJnzDAM3IZ3UYnUpetJGZ8CvAMag4wi57x5j47HlOF/v1rOtsPWfNRYK8CP EbaEhI+iZDlZo4nyhaSJGuogINZHrWIlfTlOhJxoSsUV9u0HzibNyAeQ08t10Afi7rEWgQM5c eKyIi/doLCrXpPMVWKDpa0vWE2XNKED7LPMUvUwe/AR0X17a66xlelN9MVNveuZL4dARffx/L k6s0eNm4jgiHYhbO/c2XY8JMpcZ6T6VNX4uzCnfJitoU6BaK/evyLY7xFr0oWD+8iHHIdQqMR +Nglg3TGUl4zfCGaEo2k6xN1hYJGcbkCazef5W9vcl6tuXZhEskPWl7Xyus= X-Rspamd-Queue-Id: 09FE271509 X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [5.94 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.01)[cached: mx00.schlund.de]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[hotmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[221.34.12.178.zen.spamhaus.org : 127.0.0.11]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.86)[0.862,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.60)[0.600,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[0.998,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[24.17.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.09)[ip: (-0.52), ipnet: 212.227.0.0/16(-1.43), asn: 8560(2.40), country: DE(-0.01)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2019 22:03:28 -0000 Addition from recycled notes: It is possible that more than one device will be recognized. Some versions of Android seem to differentiate between "built-in memory" and "external memory" (usually a micro-SD card, but sometimes also a built-in storage chip). In this case, you can mount both devices. On your phone, you'll usually have to do some preparation. I have no idea how the english version looks like, but if I translate from a german equivalent, the setting is: settings -> wireless and network -> USB settings -> mass storage Now two devices will be visible, the "internal memory": # mount -t msdosfs -o ro /dev/da0 /mnt/int And the micro-SD card: # mount -t msdosfs -o ro /dev/da1 /mnt/sd You can then use your favorite GUI file browser or the Midnight Commander to explore what you can get access to. Remember my previous statement: On non-rooted phones, access to a certain "inner storage" is not possible, which usually contains contacts, SMS, phone lists, and so on. Using some app (I think it was called "Total Commander", but I'm not sure, I only know this name as a Norton Commander GUI clone used in the pre-"Windows '95" era), it's sometimes possible to copy information from the "inner storage" to one of the non- restricted areas (equivalents of "int" and "sd" as shown in the example). In your settings, you can also enable access via adb: settings -> applications -> development -> USB debugging Now a new /dev/ugen* device will appear, and you can access it with the adb program. # adb start-server # adb devices Here, your phone should be listed. You can now invoke an interactive shell to explore the file systems: # adb shell Commands like "cd" and "ls" can be used. And if you know the locations of stuff, you can copy files, for example: # adb pull -p -a /sdcard/GreatApp/meow.txt . Or you can simply copy everything you can get, and review the content later on: # adb pull sdcard/ Note: In this example "sdcard" does _not_ mean the micro-SD card mentioned at the beginning! It's the internal memory without the "privileged area". There's also /sdcard/internal_sd, which I'm not sure anymore what it stands for. Simplified: /sdcard = / of da0 -> /mnt/int /sdcard/internal_sd = / of da1 -> /mnt/sd All other directory entries in / are _not_ being exported as direct access media; they can only be accessed with adb. Finally, here are two examples of "adb shell" which you can use to search for files and and download them: # adb shell find "/sdcard/" -iname "*jpg" | tr -d '\015' \ | while read LINE; do adb pull ${LINE}; done # adb shell ls /sdcard/gps*.trace | tr '\r' '' | xargs -n 1 adb pull All this information has been created from notes taken 3 years ago. I hardly deal with this stuff anymore, and I have no experience with modern technology, so see this as suggestions for further experiments. ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...