[guardian-dev] Orbot sends no status when background starts disabled

Hans-Christoph Steiner hans at guardianproject.info
Fri Jun 3 05:17:21 EDT 2016


I guess that's not well documented.  The idea is that if your app sends
the regular ACTION_START Intent which starts Tor in the background, but
the user has disallowed that, then the reply should not pretend it is
allowed.  The app will need to do something different if it wants to
make the user start Tor, like calling OrbotHelper.requestShowOrbotStart().

Your app should always receive ACTION_STATUS Intents since any other app
could start Orbot, and user triggered starts and stops will also trigger
ACTION_STATUS Intents to be broadcast out.

Here's some improved javadoc that I just wrote, hopefully it is helpful:

    /**
     * First, checks whether Orbot is installed. If Orbot is installed,
then a
     * broadcast {@link Intent} is sent to request Orbot to start
     * transparently in the background. When Orbot receives this {@code
     * Intent}, it will immediately reply to the app that called this method
     * with an {@link #ACTION_STATUS} {@code Intent} that is broadcast
to the
     * {@code packageName} of the provided {@link Context} (i.e.  {@link
     * Context#getPackageName()}.
     * <p>
     * That reply {@link #ACTION_STATUS} {@code Intent} could say that
the user
     * has disabled background starts with the status
     * {@link #STATUS_STARTS_DISABLED}. That means that Orbot ignored this
     * request.  To directly prompt the user to start Tor, use
     * {@link #requestShowOrbotStart(Activity)}, which will bring up
     * Orbot itself for the user to manually start Tor.  Orbot always
broadcasts
     * it's status, so your app will receive those no matter how Tor gets
     * started.
     *
     * @param context the app {@link Context} will receive the reply
     * @return whether the start request was sent to Orbot
     *
     * @see #requestShowOrbotStart(Activity activity)
     */
    public static boolean requestStartTor(Context context) {

    /**
     * First, checks whether Orbot is installed, then checks whether
Orbot is
     * running. If Orbot is installed and not running, then an {@link
Intent} is
     * sent to request the user to start Orbot, which will show the main
Orbot screen.
     * The result will be returned in
     * {@link Activity#onActivityResult(int requestCode, int resultCode,
Intent data)}
     * with a {@code requestCode} of {@code START_TOR_RESULT}
     * <p>
     * Orbot will also always broadcast the status of starting Tor via the
     * {@link #ACTION_STATUS} Intent, no matter how it is started.
     *
     * @param activity the {@code Activity} that gets the result of the
     *            {@link #START_TOR_RESULT} request
     * @return whether the start request was sent to Orbot
     *
     * @see #requestStartTor(Context context)
     */
    public static boolean requestShowOrbotStart(Activity activity) {


Vanitas Vitae:
> Hi!
> 
> When I try to get Orbot's state by calling OrbotHelper.requestStartTor
> and listening for an intent as a reply while Orbot has background starts
> disabled, the Intent only contains the information about background
> starts disabled. There are no information about whether Orbot is
> running, starting, stopping or Orbot's proxy ports etc, even though
> Orbot is up and running.
> Is this intentional?
> _______________________________________________
> List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev
> To unsubscribe, email:  guardian-dev-unsubscribe at lists.mayfirst.org
> 

-- 
PGP fingerprint: EE66 20C7 136B 0D2C 456C  0A4D E9E2 8DEA 00AA 5556
https://pgp.mit.edu/pks/lookup?op=vindex&search=0xE9E28DEA00AA5556


More information about the guardian-dev mailing list