HiveMinds/appcommander

Make orbot torify desired apps.

Closed this issue · 3 comments

a-t-0 commented

Preliminary Requirements

  • Allow CLI args that specify the names of the apps that need to be torified.
    • In process args convert csv str to list,
    • use hardcoded supported dict to map the app name to android app name,
    • then verify those apps are installed.
    • Then pass that app name into screen 6 via script description.k
  • Verify Orbot, and those apps are installed on the phone.
  • Convert the android app name like org.nextcloud.android to whatever Orbot uses to identify the apps in the screen5 (start orbot screen with icons). (Unless the settings screen is used for this verification, see below)

In get_next_actions

  • Check if the apps are torified
    • Either in the screen directly using Icons
    • Or in the settings screen (if that easier and/or more robust).
  • If they are not all torified:
    • Call actions that torify the apps.
    • Verify all apps are torified.
    • Perform action to start orbot tor bridge.
  • else:
    • Perform action to start orbot tor bridge.

In Actions

Either enable all desired apps at once, and verify once. Or verify per app. (All at once is faster, and more secure).
If an desired app is not yet torrified:

  • Goto the settings menu
  • Torify the app.
  • Verify the app is torified.
  • Return to default Orbot screen.

Optional

Whether or not the apps are torrified or not, can also be read from some file in the phone, if it can be found.

a-t-0 commented

Note, an item in the VPN/torrified settings consists of 3 sub-items:

  • An image
  • A checkbox
  • A text.

The text is the app name as the user knows it. E.g. Nextcloud instead of org.nextcloud.android. Whether or not the app is torrified or not, is indicated by the (3rd) dict in the node that contains the dict that contains "@text": "Nextcloud". In other words, the checkbox is the one of the 3 that has: "@resource-id": "org.torproject.android:id/itemcheck", and its value is in "@checked".

                                "node": [
                                    {
                                        "@NAF": "true",
                                        "@bounds": "[75,407][185,517]",
                                        "@checkable": "false",
                                        "@checked": "false",
                                        "@class": "android.widget.ImageView",
                                        "@clickable": "true",
                                        "@content-desc": "",
                                        "@enabled": "true",
                                        "@focusable": "true",
                                        "@focused": "false",
                                        "@index": "0",
                                        "@long-clickable": "false",
                                        "@package": "org.torproject.android",
                                        "@password": "false",
                                        "@resource-id": "org.torproject.android:id/itemicon",
                                        "@scrollable": "false",
                                        "@selected": "false",
                                        "@text": "",
                                        "@visible-to-user": "true"
                                    },
                                    {
                                        "@bounds": "[20,517][240,600]",
                                        "@checkable": "false",
                                        "@checked": "false",
                                        "@class": "android.widget.TextView",
                                        "@clickable": "true",
                                        "@content-desc": "",
                                        "@enabled": "true",
                                        "@focusable": "true",
                                        "@focused": "false",
                                        "@index": "1",
                                        "@long-clickable": "false",
                                        "@package": "org.torproject.android",
                                        "@password": "false",
                                        "@resource-id": "org.torproject.android:id/itemtext",
                                        "@scrollable": "false",
                                        "@selected": "false",
                                        "@text": "Nextcloud",
                                        "@visible-to-user": "true"
                                    },
                                    {
                                        "@NAF": "true",
                                        "@bounds": "[86,600][174,655]",
                                        "@checkable": "true",
                                        "@checked": "false",
                                        "@class": "android.widget.CheckBox",
                                        "@clickable": "true",
                                        "@content-desc": "",
                                        "@enabled": "true",
                                        "@focusable": "true",
                                        "@focused": "false",
                                        "@index": "2",
                                        "@long-clickable": "false",
                                        "@package": "org.torproject.android",
                                        "@password": "false",
                                        "@resource-id": "org.torproject.android:id/itemcheck",
                                        "@scrollable": "false",
                                        "@selected": "false",
                                        "@text": "",
                                        "@visible-to-user": "true"
                                    }
                                ]
a-t-0 commented

Key Issue

One action here spans multiple screens.
When at the default screen where it wants to either start tor bridge or torify apps, it should either go to settings and select the apps to be torrified, and if they are already all torified, start the bridge.

But when it arrives at screen 5 it does not know whether all apps are torrified or not. Then if it goes to settings to torify them, it arrives again at screen 5 and still does not know whether it is torrified or not.

Think about how to preserve such information from one screen to another.

a-t-0 commented

The "torify app" action torrifies all selected apps, and is expected to throw an error otherwise. An image of the torrified app was not found in the default/home screen directly, so no verification is applied.