Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The universe is an island, surrounded by whatever it is that surrounds universes.


computers / comp.mobile.android / Re: Permissions - is there a good explanation anywhere?

SubjectAuthor
* Permissions - is there a good explanation anywhere?Chris Green
+* Re: Permissions - is there a good explanation anywhere?Andy Burns
|`* Re: Permissions - is there a good explanation anywhere?Theo
| `* Re: Permissions - is there a good explanation anywhere?paul
|  `* Re: Permissions - is there a good explanation anywhere?Chris Green
|   `* Re: Permissions - is there a good explanation anywhere?paul
|    `* Re: Permissions - is there a good explanation anywhere?Chris Green
|     `* Re: Permissions - is there a good explanation anywhere?Chris Green
|      `* Re: Permissions - is there a good explanation anywhere?paul
|       `* Re: Permissions - is there a good explanation anywhere?Chris Green
|        +* Re: Permissions - is there a good explanation anywhere?Theo
|        |`* Re: Permissions - is there a good explanation anywhere?Chris Green
|        | `- Re: Permissions - is there a good explanation anywhere?Theo
|        `* Re: Permissions - is there a good explanation anywhere?paul
|         `- Re: Permissions - is there a good explanation anywhere?Chris Green
`* Re: Permissions - is there a good explanation anywhere?Eli the Bearded
 `- Re: Permissions - is there a good explanation anywhere?Chris Green

1
Permissions - is there a good explanation anywhere?

<anhish-3jd52.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17865&group=comp.mobile.android#17865

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Permissions - is there a good explanation anywhere?
Date: Tue, 20 Jul 2021 10:30:50 +0100
Lines: 25
Message-ID: <anhish-3jd52.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net csduqp00AeMtEOhzt9Hqtwtu4FORdKAvTdIymFEFLBjrH2BeA=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:xDuDf41dA7IAqx+vgUfmMnCnS3o=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Tue, 20 Jul 2021 09:30 UTC

As I've mumbled before here I'm a fairly experienced Unix/Linux
software engineer but I'm naive when it comes to Android.

So can someone point me to an explanation of how permissions on
Android work please.

It *seems* like each app has its own sandbox so that, in general, apps
can't talk to eah other. However, in addition, there are resources
(like GPS, camera) that apps may or may not have access to.

What I'm after knowing is how different apps can access the Contacts
database(s). On my phone there's list of 13 apps which could have
access to Contacts but only 6 of these actually do have access.

Is there any way I can make *another* app (Termux for example) have
access to Contacts? How do I get Termux to 'ask' for access?

I have adb set up so I can run adb shell commands on the phone. I
guess I may also be able to allow access to Contacts *files* (which is
what I want) by setting file permissions using the adb shell but I'd
really like to have a better understanding of how it all works.

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<ilnog3F2p6dU1@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17866&group=comp.mobile.android#17866

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: use...@andyburns.uk (Andy Burns)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Tue, 20 Jul 2021 11:57:05 +0100
Lines: 19
Message-ID: <ilnog3F2p6dU1@mid.individual.net>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net kQ3PUvZASsBALE+ZRHJIxgJ4IOPL9sKut2reYK0xco/52dXW77
Cancel-Lock: sha1:Dig9GOqdRVgxeGwpOdgUaNwHkpc=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
In-Reply-To: <anhish-3jd52.ln1@esprimo.zbmc.eu>
Content-Language: en-GB
 by: Andy Burns - Tue, 20 Jul 2021 10:57 UTC

Chris Green wrote:

> Is there any way I can make *another* app (Termux for example) have
> access to Contacts? How do I get Termux to 'ask' for access?

If Termux isn't programmed to use Contacts, giving it permission won't
help ... it's like thinking I can drive a car, so if someone gave me
permission to use their plane, I'd know how to fly it ...

Android permissions have changed over the years, and older apps still
use the older schemes, but

<https://developer.android.com/guide/topics/permissions/overview>

basically all apps get certain limited permissions "for free" if they
want more they have to declare which they want, the user can agree to
them at install time, or at runtime, newer androids actively take away
permissions from apps that don't use them, so you'll get asked again if
you ever run them again.

Re: Permissions - is there a good explanation anywhere?

<rNC*k8Apy@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17867&group=comp.mobile.android#17867

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!aioe.org!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED!not-for-mail
From: theom+n...@chiark.greenend.org.uk (Theo)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: 20 Jul 2021 13:06:01 +0100 (BST)
Organization: University of Cambridge, England
Lines: 32
Message-ID: <rNC*k8Apy@news.chiark.greenend.org.uk>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net>
NNTP-Posting-Host: chiark.greenend.org.uk
X-Trace: chiark.greenend.org.uk 1626782763 29609 212.13.197.229 (20 Jul 2021 12:06:03 GMT)
X-Complaints-To: abuse@chiark.greenend.org.uk
NNTP-Posting-Date: Tue, 20 Jul 2021 12:06:03 +0000 (UTC)
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/3.16.0-7-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Tue, 20 Jul 2021 12:06 UTC

Andy Burns <usenet@andyburns.uk> wrote:
> Chris Green wrote:
>
> > Is there any way I can make *another* app (Termux for example) have
> > access to Contacts? How do I get Termux to 'ask' for access?
>
> If Termux isn't programmed to use Contacts, giving it permission won't
> help ... it's like thinking I can drive a car, so if someone gave me
> permission to use their plane, I'd know how to fly it ...

I think you /might/ be able to run a program inside Termux that speaks the
relevant APIs to access the contacts, in which case Android would pop up a
notification saying contacts access is requested. In Android every app is a
different Unix user, and so presumably Termux launching a shell will be
launched under Termux's userid. I don't know how the underlying plumbing
works - I think the 'binder' kernel interface is used for the app to talk to
services like the contacts service but not look at this in detail.

It is possible access to a permission is blocked if the app didn't declare
it in its manifest at install time. Indeed I think that's quite likely
given an app could be hacked to try to access things it wasn't intend to do.

For obvious reasons, an app won't be able to just look around the side at
the contacts database sqlite files, because that would break the whole
security model. However you can probably get at them if you have a rooted
phone (ie one in which you can run a shell as root and hence get access to
all the filesystem, not just the ones accessible to the Termux user)

Rooting your phone is left as an exercise for the reader...
(warning: you can't do it on many phones and it may wipe it of user data)

Theo

Re: Permissions - is there a good explanation anywhere?

<sd6rht$19lk$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17871&group=comp.mobile.android#17871

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!aioe.org!rMI8y0TFviZiY9K9JFuEEw.user.46.165.242.75.POSTED!not-for-mail
From: nos...@nospam.invalid (paul)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Tue, 20 Jul 2021 17:53:46 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sd6rht$19lk$1@gioia.aioe.org>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="42676"; posting-host="rMI8y0TFviZiY9K9JFuEEw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: ForteAgent/8.00.32.1272
X-Notice: Filtered by postfilter v. 0.9.2
 by: paul - Tue, 20 Jul 2021 15:53 UTC

I ran a quick google search which found this tutorial which may be of use
https://chombium.wordpress.com/2012/09/30/android-how-to-backup-contacts-and-sms-messages/

It's a tutorial for PC command line access to Android contacts & messages.
Messages: /data/data/com.android.providers.telephony/databases/mmssms.db
Contacts: /data/data/com.android.providers.contacts/databases/contacts2.db

It says on a non-rooted system connected by USB to a Windows PC you run:
./adb pull /data/data/com.android.providers.telephony/databases/mmssms.db
./adb pull /data/data/com.android.providers.contacts/databases/contacts2.db

This other article shows how to browse sqlite files from rooted Android.
https://android.stackexchange.com/questions/121073/sqlite-database-operation-from-android-terminal

In that cite they use Termux to install sqlite3
https://android.stackexchange.com/questions/5053/where-can-i-obtain-an-sqlite-3-command-line-binary-for-android

Then they use sqlite3 to read/write the contacts sqlite database on Android.
https://github.com/stockrt/sqlite3-android

HTH

Re: Permissions - is there a good explanation anywhere?

<mqojsh-ffp72.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17875&group=comp.mobile.android#17875

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Tue, 20 Jul 2021 21:38:14 +0100
Lines: 31
Message-ID: <mqojsh-ffp72.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net hUlDbgiz5OWsPq9HAotGwgF6BVEM8gf9pSX/8bGEQSWnKqNJg=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:FjUoXI5SpImpc3Le0xT+Wn3rBjo=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Tue, 20 Jul 2021 20:38 UTC

paul <nospam@nospam.invalid> wrote:
> I ran a quick google search which found this tutorial which may be of use
> https://chombium.wordpress.com/2012/09/30/android-how-to-backup-contacts-and-sms-messages/
>
> It's a tutorial for PC command line access to Android contacts & messages.
> Messages: /data/data/com.android.providers.telephony/databases/mmssms.db
> Contacts: /data/data/com.android.providers.contacts/databases/contacts2.db
>
> It says on a non-rooted system connected by USB to a Windows PC you run:
> ./adb pull /data/data/com.android.providers.telephony/databases/mmssms.db
> ./adb pull /data/data/com.android.providers.contacts/databases/contacts2.db
>
> This other article shows how to browse sqlite files from rooted Android.
> https://android.stackexchange.com/questions/121073/sqlite-database-operation-from-android-terminal
>
> In that cite they use Termux to install sqlite3
> https://android.stackexchange.com/questions/5053/where-can-i-obtain-an-sqlite-3-command-line-binary-for-android
>
>
> Then they use sqlite3 to read/write the contacts sqlite database on Android.
> https://github.com/stockrt/sqlite3-android
>
Yes, thanks, it's not quite what I want but I think it's the limit of
what's possible.

I suspect I may end up having to write some code myself if I want to
get exactly what I want.

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<sd7hmo$1rk7$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17885&group=comp.mobile.android#17885

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!aioe.org!rMI8y0TFviZiY9K9JFuEEw.user.46.165.242.75.POSTED!not-for-mail
From: nos...@nospam.invalid (paul)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Wed, 21 Jul 2021 00:11:49 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sd7hmo$1rk7$1@gioia.aioe.org>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="61063"; posting-host="rMI8y0TFviZiY9K9JFuEEw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: ForteAgent/8.00.32.1272
X-Notice: Filtered by postfilter v. 0.9.2
 by: paul - Tue, 20 Jul 2021 22:11 UTC

Chris Green wrote on 20.07.2021 22:38
> Yes, thanks, it's not quite what I want but I think it's the limit of
> what's possible.
>
> I suspect I may end up having to write some code myself if I want to
> get exactly what I want.

I thought it was strange they used Termix to install sqlite3, so I looked
for the sqlite3 program on Google Play but I haven't found it yet.

I did find a "Tasker SQLite Plugin" which says it allows you to create,
update, and query sqlite databases on the phone, but I don't use Tasker.
https://play.google.com/store/apps/details?id=com.jordanhotmann.taskersqliteplugin

It would be nice if we could read and write to our contacts sqlite db
with an sqlite manager on Android without being rooted, so to that end I
installed aSQLiteManager to see if was even possible on my phone.
https://play.google.com/store/apps/details?id=dk.andsen.asqlitemanager

The app opens up to a file manager display where I tried to get to /data
but since I'm not rooted, it wouldn't allow me into that system directory.

If anyone knows of an sqlite database which isn't in the system folder,
let me know as that way I can use aSQLiteManager to take a peek at that
sqlite database to see what an sqlite database on my phone looks like.

Re: Permissions - is there a good explanation anywhere?

<uc3lsh-5oea2.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17894&group=comp.mobile.android#17894

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Wed, 21 Jul 2021 09:44:46 +0100
Lines: 52
Message-ID: <uc3lsh-5oea2.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net mDwS4Qj0YhfNqjUIxiUTrAIj/GB4XDazLXnF5MhNs+6O2Hw9A=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:c22zfmJvcIZkzyA+9WjvvLFaU1U=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Wed, 21 Jul 2021 08:44 UTC

paul <nospam@nospam.invalid> wrote:
> Chris Green wrote on 20.07.2021 22:38
> > Yes, thanks, it's not quite what I want but I think it's the limit of
> > what's possible.
> >
> > I suspect I may end up having to write some code myself if I want to
> > get exactly what I want.
>
> I thought it was strange they used Termix to install sqlite3, so I looked
> for the sqlite3 program on Google Play but I haven't found it yet.
>
> I did find a "Tasker SQLite Plugin" which says it allows you to create,
> update, and query sqlite databases on the phone, but I don't use Tasker.
> https://play.google.com/store/apps/details?id=com.jordanhotmann.taskersqliteplugin
>
> It would be nice if we could read and write to our contacts sqlite db
> with an sqlite manager on Android without being rooted, so to that end I
> installed aSQLiteManager to see if was even possible on my phone.
> https://play.google.com/store/apps/details?id=dk.andsen.asqlitemanager
>
> The app opens up to a file manager display where I tried to get to /data
> but since I'm not rooted, it wouldn't allow me into that system directory.
>
> If anyone knows of an sqlite database which isn't in the system folder,
> let me know as that way I can use aSQLiteManager to take a peek at that
> sqlite database to see what an sqlite database on my phone looks like.

Yes, you're trying to do something very similar to what I want to do,
allow access to the Contacts database file.

There are lots of ways of copying the file out from its default
location but no way to actually edit it in place which would be much
more useful.

The Termux-API package allows extraction of data from the Contacts
database using the Termux command line. You just run
termux-contact-list at the Termux command prompt. It works too,
output is in XML though which isn't my favourite format.

I looked into the Termux-API and that does have:-

<uses-permission android:name="android.permission.READ_CONTACTS"/>

in its AndroidManifest.xml so that's how it can read the Contacts.

It's a whole pile of code just to be able to do this though!

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<aq3lsh-edga2.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17895&group=comp.mobile.android#17895

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Wed, 21 Jul 2021 09:51:54 +0100
Lines: 61
Message-ID: <aq3lsh-edga2.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net MGvufYuQvXFkk51y3BVmugy1TEWj8fkLeIB1DgoaAmU4tTtLw=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:ua8UoNwwPm2LzjFgk0GHsZJVKjE=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Wed, 21 Jul 2021 08:51 UTC

Chris Green <cl@isbd.net> wrote:
> paul <nospam@nospam.invalid> wrote:
> > Chris Green wrote on 20.07.2021 22:38
> > > Yes, thanks, it's not quite what I want but I think it's the limit of
> > > what's possible.
> > >
> > > I suspect I may end up having to write some code myself if I want to
> > > get exactly what I want.
> >
> > I thought it was strange they used Termix to install sqlite3, so I looked
> > for the sqlite3 program on Google Play but I haven't found it yet.
> >
> > I did find a "Tasker SQLite Plugin" which says it allows you to create,
> > update, and query sqlite databases on the phone, but I don't use Tasker.
> > https://play.google.com/store/apps/details?id=com.jordanhotmann.taskersqliteplugin
> >
> > It would be nice if we could read and write to our contacts sqlite db
> > with an sqlite manager on Android without being rooted, so to that end I
> > installed aSQLiteManager to see if was even possible on my phone.
> > https://play.google.com/store/apps/details?id=dk.andsen.asqlitemanager
> >
> > The app opens up to a file manager display where I tried to get to /data
> > but since I'm not rooted, it wouldn't allow me into that system directory.
> >
> > If anyone knows of an sqlite database which isn't in the system folder,
> > let me know as that way I can use aSQLiteManager to take a peek at that
> > sqlite database to see what an sqlite database on my phone looks like.
>
> Yes, you're trying to do something very similar to what I want to do,
> allow access to the Contacts database file.
>
> There are lots of ways of copying the file out from its default
> location but no way to actually edit it in place which would be much
> more useful.
>
> The Termux-API package allows extraction of data from the Contacts
> database using the Termux command line. You just run
> termux-contact-list at the Termux command prompt. It works too,
> output is in XML though which isn't my favourite format.

Oops, it's json not XML, I didn't look very hard at the output but
I've just been looking at the code! :-)

>
> I looked into the Termux-API and that does have:-
>
> <uses-permission android:name="android.permission.READ_CONTACTS"/>
>
> in its AndroidManifest.xml so that's how it can read the Contacts.
>
> It's a whole pile of code just to be able to do this though!
>
>
>
> --
> Chris Green
> ·

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<sd9dup$6v0$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17902&group=comp.mobile.android#17902

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!aioe.org!rMI8y0TFviZiY9K9JFuEEw.user.46.165.242.75.POSTED!not-for-mail
From: nos...@nospam.invalid (paul)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Wed, 21 Jul 2021 17:20:05 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sd9dup$6v0$1@gioia.aioe.org>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="7136"; posting-host="rMI8y0TFviZiY9K9JFuEEw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: ForteAgent/8.00.32.1272
X-Notice: Filtered by postfilter v. 0.9.2
 by: paul - Wed, 21 Jul 2021 15:20 UTC

I ran a quick search and all these tools exist but I didn't test any today.
Windows editors for vcard or csv files
Windows converters between vcard & csv (and vice versa)
Android contact managers that clean out duplicates & anomalies
Android contact managers which import & export contacts

One option is to export the contacts to a file, edit that file, and then
import the resulting contacts back (after deleting the original contacts).

I'm sure all that can be done on Android but I'd use Windows because of the
keyboard, mouse & monitor and tons of existing editing/conversion freeware.

If I needed to read, edit, and then write contacts on nonrooted Android
I would probably do something like this basic read/write workflow below.

1. On Android, export original contacts to contacts_orig.{csv,vcf}
2. Optionally, on Android, delete all contacts (to start fresh)
3. On Windows, edit the contacts and save to contacts_edit.{csv.vcf}
4. On Android, import the edited contacts & save to the sqlite database

Re: Permissions - is there a good explanation anywhere?

<330msh-vv5c2.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17905&group=comp.mobile.android#17905

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Wed, 21 Jul 2021 17:54:27 +0100
Lines: 39
Message-ID: <330msh-vv5c2.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu> <sd9dup$6v0$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net uA08bulRAv0e+EdB2LUUpQpXqEfshZ0ue5Cik846+9EzHlMF4=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:pWVGPBO4UI5M8PDEbjagF81yknk=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Wed, 21 Jul 2021 16:54 UTC

paul <nospam@nospam.invalid> wrote:
> If I needed to read, edit, and then write contacts on nonrooted Android
> I would probably do something like this basic read/write workflow below.
>
> 1. On Android, export original contacts to contacts_orig.{csv,vcf}
> 2. Optionally, on Android, delete all contacts (to start fresh)
> 3. On Windows, edit the contacts and save to contacts_edit.{csv.vcf}
> 4. On Android, import the edited contacts & save to the sqlite database

Yes, quite, I absolutely agree about wanting to do the editing and
creating of contacts on a desktop/laptop with a reasonably large
screen and a real keyboard.

The trouble is that neither csv nor vcf are particularly easy ways to
transport or even manage data. Another problem is that no two systems
(Google, Apple, Microsoft Outlook, a n other) agree on the format of
vCard files, they all use non-standard (but quite valid) 'extras'
to do their own thing.

I have my own address book, storage is in a sqlite database (which is
what addresses should be stored in IMHO) and I have a self-written
python gui for adding and editing contacts. I synchronise the
database between my laptop and my desktop so I can change things on
either system. My E-Mail program (mutt) queries the database directly
to get E-Mail addresses.

All I really want is a quick and easy way to get names and phone
numbers (and nothing else really) into my Android phone.

I think the best solution is probably going to be to export the
Names/Numbers from my database (trivial SQL script) as CSV or possibly
vCard and copy the result to my Android phone (even synchronise it
using syncthing) and then import into Contacts. However that last
step can't be done locally on the phone I don't think, nor can it be
automated.

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<Qfv*0nIpy@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17910&group=comp.mobile.android#17910

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!paganini.bofh.team!newsfeed.xs3.de!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED!not-for-mail
From: theom+n...@chiark.greenend.org.uk (Theo)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: 21 Jul 2021 22:12:50 +0100 (BST)
Organization: University of Cambridge, England
Lines: 14
Message-ID: <Qfv*0nIpy@news.chiark.greenend.org.uk>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu> <sd9dup$6v0$1@gioia.aioe.org> <330msh-vv5c2.ln1@esprimo.zbmc.eu>
NNTP-Posting-Host: chiark.greenend.org.uk
X-Trace: chiark.greenend.org.uk 1626901972 3282 212.13.197.229 (21 Jul 2021 21:12:52 GMT)
X-Complaints-To: abuse@chiark.greenend.org.uk
NNTP-Posting-Date: Wed, 21 Jul 2021 21:12:52 +0000 (UTC)
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/3.16.0-11-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Wed, 21 Jul 2021 21:12 UTC

Chris Green <cl@isbd.net> wrote:
> I think the best solution is probably going to be to export the
> Names/Numbers from my database (trivial SQL script) as CSV or possibly
> vCard and copy the result to my Android phone (even synchronise it
> using syncthing) and then import into Contacts. However that last
> step can't be done locally on the phone I don't think, nor can it be
> automated.

You could have a look at CardDAV which is a contacts syncing protocol. I
think you can set up Android to sync with a CardDAV server - you can run
your own via NextCloud (among others), and there are plugins for
Thunderbird or Outlook to access it on Windows.

Theo

Re: Permissions - is there a good explanation anywhere?

<sdai3j$vnn$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17915&group=comp.mobile.android#17915

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!aioe.org!/fcdRosSWaVyJTVfmO0y2g.user.46.165.242.75.POSTED!not-for-mail
From: nos...@nospam.invalid (paul)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Thu, 22 Jul 2021 03:37:04 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sdai3j$vnn$1@gioia.aioe.org>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu> <sd9dup$6v0$1@gioia.aioe.org> <330msh-vv5c2.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="32503"; posting-host="/fcdRosSWaVyJTVfmO0y2g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: ForteAgent/8.00.32.1272
X-Notice: Filtered by postfilter v. 0.9.2
 by: paul - Thu, 22 Jul 2021 01:37 UTC

Chris Green wrote on 21.07.2021 16:54
> and then import into Contacts. However that last
> step can't be done locally on the phone I don't think

It's a worthwhile effort to manage contacts without putting them on the net.

While I fully agree the most direct way to manage a contacts database on
Android is through an sqlite manager, it seems that option won't work for
non rooted Androids, unfortunately.

I probably don't understand your workaround requirements fully where I don't
think it should be difficult to wipe out the old contacts and import new
contacts. This effectively manages the sqlite database (indirectly).

I googled how to import contacts into Android where many ways showed up.

Some methods use Google (which I would shun like a fire breathing dragon).
https://www.tenorshare.com/android-data/how-to-import-csv-contacts-into-android.html

But others just import the contacts file directly using your contacts app.
https://www.mobikin.com/android-backup/import-csv-contacts-to-android.html

Once you have the contacts file, I wouldn't think import to be hard.
Searching Google Play for contact importers finds many.
https://play.google.com/store/apps/details?id=com.simpler.backup
https://play.google.com/store/apps/details?id=eu.stargw.contactsimport
https://play.google.com/store/apps/details?id=com.simpler.backup

I've tested some of those in the past but I don't recall the details.

> nor can it be automated.

I second the motion by Theo to try a CardDAV setup, although I've never
personally done it myself so I can only guess what you would need.

I suspect setting up CardDAV servers would be vastly easier on Linux than on
Windows but a quick search shows there appear to be tutorials for Windows.

Radicale Free and Open-Source CalDAV and CardDAV Server
https://radicale.org/3.0.html

First hits seem to be using Radicale (but others exist)
https://www.williamjbowman.com/blog/2015/07/24/setting-up-webdav-caldav-and-carddav-servers/

There is also DavDroid (which seems to be second to Radicale)
https://insinuator.net/2015/02/using-android-without-google-part-1/
--
On Android ngs people help each other out of the goodness of their hearts.

Re: Permissions - is there a good explanation anywhere?

<9lvnsh-u94g2.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17925&group=comp.mobile.android#17925

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Thu, 22 Jul 2021 11:59:21 +0100
Lines: 22
Message-ID: <9lvnsh-u94g2.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu> <sd9dup$6v0$1@gioia.aioe.org> <330msh-vv5c2.ln1@esprimo.zbmc.eu> <Qfv*0nIpy@news.chiark.greenend.org.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net YWkT2ragivUjH2dqWJHIyAdK8MWc9poVp+S6ig/YNGxPNabRg=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:bCDevrhrVr5ZqErlkjNI8hPFKOI=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Thu, 22 Jul 2021 10:59 UTC

Theo <theom+news@chiark.greenend.org.uk> wrote:
> Chris Green <cl@isbd.net> wrote:
> > I think the best solution is probably going to be to export the
> > Names/Numbers from my database (trivial SQL script) as CSV or possibly
> > vCard and copy the result to my Android phone (even synchronise it
> > using syncthing) and then import into Contacts. However that last
> > step can't be done locally on the phone I don't think, nor can it be
> > automated.
>
> You could have a look at CardDAV which is a contacts syncing protocol. I
> think you can set up Android to sync with a CardDAV server - you can run
> your own via NextCloud (among others), and there are plugins for
> Thunderbird or Outlook to access it on Windows.
>
Yes, there are several CardDAV based possibilities, however you still
end up with the vCard incompatibilities I mentioned. I don't use (and
I'm not going to use) Thunderbird or another GUI mail program. I like
and love mutt, nothing else is anwhere near as good.

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<ap0osh-f07g2.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17927&group=comp.mobile.android#17927

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Thu, 22 Jul 2021 12:18:34 +0100
Lines: 98
Message-ID: <ap0osh-f07g2.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu> <sd9dup$6v0$1@gioia.aioe.org> <330msh-vv5c2.ln1@esprimo.zbmc.eu> <sdai3j$vnn$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net KRNSJ2hJ/47YJQyUbR7dMwy3z8Hqm9TR0IKKnGbgoBAo8hPqs=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:H/LoxhiJAUPdi1fpnHZjQ5knwYs=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Thu, 22 Jul 2021 11:18 UTC

paul <nospam@nospam.invalid> wrote:
> Chris Green wrote on 21.07.2021 16:54
> > and then import into Contacts. However that last
> > step can't be done locally on the phone I don't think
>
> It's a worthwhile effort to manage contacts without putting them on the net.
>
Yes! :-)

> While I fully agree the most direct way to manage a contacts database on
> Android is through an sqlite manager, it seems that option won't work for
> non rooted Androids, unfortunately.
>
> I probably don't understand your workaround requirements fully where I don't
> think it should be difficult to wipe out the old contacts and import new
> contacts. This effectively manages the sqlite database (indirectly).
>
> I googled how to import contacts into Android where many ways showed up.
>
> Some methods use Google (which I would shun like a fire breathing dragon).
> https://www.tenorshare.com/android-data/how-to-import-csv-contacts-into-android.html
>
> But others just import the contacts file directly using your contacts app.
> https://www.mobikin.com/android-backup/import-csv-contacts-to-android.html
>
> Once you have the contacts file, I wouldn't think import to be hard.
> Searching Google Play for contact importers finds many.
> https://play.google.com/store/apps/details?id=com.simpler.backup
> https://play.google.com/store/apps/details?id=eu.stargw.contactsimport
> https://play.google.com/store/apps/details?id=com.simpler.backup
>
None is automatic though I don't think. I.e. it's a manual process
every time I have changed a number in my database (on computer) to
tell Android's Contacts/Dialer to import the change(s).

> I've tested some of those in the past but I don't recall the details.
>
> > nor can it be automated.
>
> I second the motion by Theo to try a CardDAV setup, although I've never
> personally done it myself so I can only guess what you would need.
>
Yes, CardDAV is a possible approach but it's not ideal because the
information is stored in the fundamentally not very portable vCard
format.

I *could* export from my database in vCard format to one of the many
cardDav servers for Linux and use such as davx5 on Android to import
same to Contacts. However it is quite a lot of hassle for what seems
to me should be simple, i.e.:-

Add code to my address book GUI so that changes are also exported
in vCard format to the CardDAV sever. Apart from anything else I
need to find what custom vCard format is needed.

Install and run a CardDAV server on my virtual server, no great
problem but it's something more to do.

Add the CardDAV app to my Android device.

I have in fact now come up with what I think is a simpler (for me
anyway) solution. I run Termux on my Android device, I'm very
familiar and comfortable with the Linux command line. I have set up
Syncthing to synchronise my address book database with my Android
device (since I already synchronise it with other systems this is very
easy for me). Termux has a standard sqlite3 command line utility just
like on my Linux desktop and laptop so I can use the same script for
extracting data from the database. Termux can also invoke the dialer
on Android so all I need to do is link the two and I can implement a
simple command on Termux like:-

call fred

.... and it will look up fred's phone number and dial it.

I have no (other) use for Contacts on Android, if I want to get an
address it's the same procedure. I have already added the simple
command line way of getting an address out of my database on Termux:-

u0_a166@bison$ a Rackham

ER and RT Rackham

E-Mail:
Phone: 01728 746207
Address: ,

(If there was an address for the coal merchant it would have appeared,
I couldn't think of any other example where it wouldn't expose
personal data)

--
Chris Green
·

Re: Permissions - is there a good explanation anywhere?

<Ofv*8SLpy@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=17928&group=comp.mobile.android#17928

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED!not-for-mail
From: theom+n...@chiark.greenend.org.uk (Theo)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: 22 Jul 2021 14:04:48 +0100 (BST)
Organization: University of Cambridge, England
Lines: 14
Message-ID: <Ofv*8SLpy@news.chiark.greenend.org.uk>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <ilnog3F2p6dU1@mid.individual.net> <rNC*k8Apy@news.chiark.greenend.org.uk> <sd6rht$19lk$1@gioia.aioe.org> <mqojsh-ffp72.ln1@esprimo.zbmc.eu> <sd7hmo$1rk7$1@gioia.aioe.org> <uc3lsh-5oea2.ln1@esprimo.zbmc.eu> <aq3lsh-edga2.ln1@esprimo.zbmc.eu> <sd9dup$6v0$1@gioia.aioe.org> <330msh-vv5c2.ln1@esprimo.zbmc.eu> <Qfv*0nIpy@news.chiark.greenend.org.uk> <9lvnsh-u94g2.ln1@esprimo.zbmc.eu>
NNTP-Posting-Host: chiark.greenend.org.uk
X-Trace: chiark.greenend.org.uk 1626959090 1885 212.13.197.229 (22 Jul 2021 13:04:50 GMT)
X-Complaints-To: abuse@chiark.greenend.org.uk
NNTP-Posting-Date: Thu, 22 Jul 2021 13:04:50 +0000 (UTC)
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/3.16.0-11-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Thu, 22 Jul 2021 13:04 UTC

Chris Green <cl@isbd.net> wrote:
> Yes, there are several CardDAV based possibilities, however you still
> end up with the vCard incompatibilities I mentioned. I don't use (and
> I'm not going to use) Thunderbird or another GUI mail program. I like
> and love mutt, nothing else is anwhere near as good.

:-)

I was just thinking I really ought to learn how to set up mutt properly, but
the config always feels like writing low-level assembly language to me...

(I don't even use contacts with Mutt, I just grep the mbox files...)

Theo

Re: Permissions - is there a good explanation anywhere?

<eli$2107271706@qaz.wtf>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18020&group=comp.mobile.android#18020

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *...@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Tue, 27 Jul 2021 21:57:41 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2107271706@qaz.wtf>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu>
Injection-Date: Tue, 27 Jul 2021 21:57:41 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="9282"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Tue, 27 Jul 2021 21:57 UTC

In comp.mobile.android, Chris Green <cl@isbd.net> wrote:
> As I've mumbled before here I'm a fairly experienced Unix/Linux
> software engineer but I'm naive when it comes to Android.
>
> So can someone point me to an explanation of how permissions on
> Android work please.
>
> It *seems* like each app has its own sandbox so that, in general, apps
> can't talk to eah other. However, in addition, there are resources
> (like GPS, camera) that apps may or may not have access to.

Yes. That's what is seems like. Sometimes the sandboxes are tighter
than other times. $PHONE[-1] for me was super tight and lots of stuff
didn't work well.

> Is there any way I can make *another* app (Termux for example) have
> access to Contacts? How do I get Termux to 'ask' for access?

This worked for me (I had done steps 1 to 3 prior to today):

1. Install Termux (must use F-Droid or other non-Play store source).
2. Install Termux:API (helper add-on app)
3. Install termux-api (package in Termux: `pkg install termux-api` )
4. Run `termux-contact-list`, get prompted to give permissions to Termux
5. Run `termux-contact-list`, get contacts in JSON form.

On my previous phone, all Termux API stuff was broken. Termux tries to
communicate with the over app over a Unix socket, and apparently the
sandboxing prevented that from happening. The Termux API command
line tools are all simple shell scripts wrapping one binary. That
binary would just hang forever waiting for a response that device.

> I have adb set up so I can run adb shell commands on the phone. I
> guess I may also be able to allow access to Contacts *files* (which is
> what I want) by setting file permissions using the adb shell but I'd
> really like to have a better understanding of how it all works.

Contacts are kinda special, since they live (potentially) on the SIM
card which means they are (probably) not regular files in the file
system.

If anyone knows a good guide along the lines "How Android Works, for the
Seasoned Unix Admin" I'd like to see it. Unless it's way out of date.

My brief exploration has found there are many layers of security and
sandboxing, and clear documentation gets harder to find for newer
versions of Android that do more. Some things that seem to be at play:
each app[*] has its own user acount. SELinux is in enforcing mode.
Loopback mounts are used in lieu of old-school chroots.

[*] Might be per app, or might be per apk (Android package format)
signing key. Per signing key would make some sense for apps that
are meant to communicate with each other, eg Termux and Termux:API.

Re: Permissions - is there a good explanation anywhere?

<7gg7th-c779.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18033&group=comp.mobile.android#18033

  copy link   Newsgroups: comp.mobile.android
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: comp.mobile.android
Subject: Re: Permissions - is there a good explanation anywhere?
Date: Wed, 28 Jul 2021 09:18:47 +0100
Lines: 60
Message-ID: <7gg7th-c779.ln1@esprimo.zbmc.eu>
References: <anhish-3jd52.ln1@esprimo.zbmc.eu> <eli$2107271706@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net V4pwuyujKY227eb4g8NcTQ5TGjrRQpmJohFMKA2noBi7VsKlY=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:L818x+19LvHaD/1pDM1satC4iTM=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-22-generic (x86_64))
 by: Chris Green - Wed, 28 Jul 2021 08:18 UTC

Eli the Bearded <*@eli.users.panix.com> wrote:
> In comp.mobile.android, Chris Green <cl@isbd.net> wrote:
> > As I've mumbled before here I'm a fairly experienced Unix/Linux
> > software engineer but I'm naive when it comes to Android.
> >
> > So can someone point me to an explanation of how permissions on
> > Android work please.
> >
> > It *seems* like each app has its own sandbox so that, in general, apps
> > can't talk to eah other. However, in addition, there are resources
> > (like GPS, camera) that apps may or may not have access to.
>
> Yes. That's what is seems like. Sometimes the sandboxes are tighter
> than other times. $PHONE[-1] for me was super tight and lots of stuff
> didn't work well.
>
> > Is there any way I can make *another* app (Termux for example) have
> > access to Contacts? How do I get Termux to 'ask' for access?
>
> This worked for me (I had done steps 1 to 3 prior to today):
>
> 1. Install Termux (must use F-Droid or other non-Play store source).
> 2. Install Termux:API (helper add-on app)
> 3. Install termux-api (package in Termux: `pkg install termux-api` )
> 4. Run `termux-contact-list`, get prompted to give permissions to Termux
> 5. Run `termux-contact-list`, get contacts in JSON form.
>
Yes, I'd got there too! :-)

> On my previous phone, all Termux API stuff was broken. Termux tries to
> communicate with the over app over a Unix socket, and apparently the
> sandboxing prevented that from happening. The Termux API command
> line tools are all simple shell scripts wrapping one binary. That
> binary would just hang forever waiting for a response that device.
>
They all work perfectly on my Umidigi Bison running Android 11 and
some are very handy. The battery status one for example tells me far
more about the battery than a silly little icon can.

In general I'm very impressed by Termux, it's amazing what it can do
in spite of Android's restrictions.

> > I have adb set up so I can run adb shell commands on the phone. I
> > guess I may also be able to allow access to Contacts *files* (which is
> > what I want) by setting file permissions using the adb shell but I'd
> > really like to have a better understanding of how it all works.
>
> Contacts are kinda special, since they live (potentially) on the SIM
> card which means they are (probably) not regular files in the file
> system.
>
The Contacts database is (at least the ones in the Contacts 'sandbox')
a sqlite database.

--
Chris Green
·


computers / comp.mobile.android / Re: Permissions - is there a good explanation anywhere?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor