net.openvpn.openvpn
Class OpenVPNClientBase

java.lang.Object
  extended by Activity
      extended by net.openvpn.openvpn.OpenVPNClientBase

public abstract class OpenVPNClientBase
extends Activity

OpenVPN Service-layer API for Android. Client Activity should inherit from this class.

Since:
2012-03-01

Nested Class Summary
protected static interface OpenVPNClientBase.EpkiPost
           
 
Field Summary
protected  OpenVPNService mBoundService
           
protected  ServiceConnection mConnection
           
 
Constructor Summary
OpenVPNClientBase()
           
 
Method Summary
protected  boolean action_enter(int actionId, KeyEvent event)
           
static void autostart(Context context)
           
protected  Intent buildDisconnectIntent(boolean stop_service)
           
protected  void createAppShortcut(java.lang.String shortcut_name)
           
protected  void createConnectShortcut(java.lang.String profile_name, java.lang.String shortcut_name)
           
protected  void createDisconnectShortcut(java.lang.String shortcut_name)
           
protected  OpenVPNService.Profile current_profile()
           
protected  void doBindService()
          Establish a connection with OpenVPN Service.
protected  void doUnbindService()
          Unbind from OpenVPN Service.
 void event(OpenVPNService.EventMsg ev)
           
protected  void gen_ui_reset_event(boolean exclude_self)
           
protected static java.lang.String get_app_expire_string()
           
 PendingIntent get_configure_intent()
           
protected  OpenVPNService.ConnectionStats get_connection_stats()
           
protected  OpenVPNService.EventMsg get_last_event_prof_manage()
           
protected  OpenVPNService.EventMsg get_last_event()
           
protected  ProxyList get_proxy_list()
           
protected  ClientAPI_LLVector get_stat_values_full()
           
protected  void import_pkcs12(java.lang.String path)
           
protected  void importProfileRemote(HttpsClient.AuthContext ac, boolean prefer_autologin, HttpsClient.CancelDetect.I cancel_source, java.lang.Runnable on_success, java.lang.Runnable on_fail, java.lang.String save_as_filename, boolean enable_cert_dialog, boolean enable_trust_error_dialog)
           
protected  void init_default_preferences(PrefUtil prefs)
           
protected  boolean is_active()
           
protected  void jellyBeanHackPurge()
           
 void log(OpenVPNService.LogMsg lm)
           
protected  long max_profile_size()
           
protected  OpenVPNService.MergedProfile merge_parse_profile(java.lang.String basename, java.lang.String profile_content)
           
protected  void ok_dialog(java.lang.String text)
           
protected  void ok_dialog(java.lang.String title, java.lang.String message)
           
 void onCreate(Bundle savedInstanceState)
           
protected  void post_bind()
           
protected  OpenVPNService.ProfileList profile_list()
           
protected  void raise_file_selection_dialog(int requestCode, int prompt_res_id)
           
protected static java.lang.String render_duration(int duration)
           
protected  void resolveExternalPkiAlias(OpenVPNService.Profile prof, OpenVPNClientBase.EpkiPost next_action)
           
protected  java.lang.String resString(int res_id)
           
protected  void submitConnectIntent(java.lang.String profile_name, java.lang.String server, java.lang.String vpn_proto, java.lang.String conn_timeout, java.lang.String username, java.lang.String password, boolean cache_password, java.lang.String pk_password, java.lang.String response, java.lang.String epki_alias, java.lang.String compression_mode, java.lang.String proxy_name, java.lang.String proxy_username, java.lang.String proxy_password, boolean proxy_allow_creds_dialog)
           
protected  void submitDeleteProfileIntent(java.lang.String profile_name)
           
protected  void submitDeleteProfileIntentWithConfirm(java.lang.String profile_name)
           
protected  void submitDisconnectIntent(boolean stop_service)
           
protected  void submitImportProfileIntent(java.lang.String profile_content, java.lang.String save_as_filename, boolean merge)
           
protected  void submitImportProfileViaPathIntent(java.lang.String profile_path)
           
protected  void submitRenameProfileIntent(java.lang.String profile_name, java.lang.String new_profile_name)
           
protected  void warn_app_expiration(PrefUtil prefs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mBoundService

protected OpenVPNService mBoundService

mConnection

protected ServiceConnection mConnection
Constructor Detail

OpenVPNClientBase

public OpenVPNClientBase()
Method Detail

onCreate

public void onCreate(Bundle savedInstanceState)

doBindService

protected void doBindService()
Establish a connection with OpenVPN Service.

Client Activity may call this method from its onCreate(Bundle) method. Note that this call is asynchronous and will return immediately. When the underlying bind has completed, post_bind() will be called.


doUnbindService

protected void doUnbindService()
Unbind from OpenVPN Service. Call from #onDestroy method.


post_bind

protected void post_bind()

event

public void event(OpenVPNService.EventMsg ev)

log

public void log(OpenVPNService.LogMsg lm)

get_configure_intent

public PendingIntent get_configure_intent()

is_active

protected boolean is_active()

current_profile

protected OpenVPNService.Profile current_profile()

profile_list

protected OpenVPNService.ProfileList profile_list()

max_profile_size

protected long max_profile_size()

merge_parse_profile

protected OpenVPNService.MergedProfile merge_parse_profile(java.lang.String basename,
                                                           java.lang.String profile_content)

get_stat_values_full

protected ClientAPI_LLVector get_stat_values_full()

get_connection_stats

protected OpenVPNService.ConnectionStats get_connection_stats()

get_last_event

protected OpenVPNService.EventMsg get_last_event()

get_last_event_prof_manage

protected OpenVPNService.EventMsg get_last_event_prof_manage()

jellyBeanHackPurge

protected void jellyBeanHackPurge()

get_proxy_list

protected ProxyList get_proxy_list()

gen_ui_reset_event

protected void gen_ui_reset_event(boolean exclude_self)

submitConnectIntent

protected void submitConnectIntent(java.lang.String profile_name,
                                   java.lang.String server,
                                   java.lang.String vpn_proto,
                                   java.lang.String conn_timeout,
                                   java.lang.String username,
                                   java.lang.String password,
                                   boolean cache_password,
                                   java.lang.String pk_password,
                                   java.lang.String response,
                                   java.lang.String epki_alias,
                                   java.lang.String compression_mode,
                                   java.lang.String proxy_name,
                                   java.lang.String proxy_username,
                                   java.lang.String proxy_password,
                                   boolean proxy_allow_creds_dialog)

autostart

public static void autostart(Context context)

buildDisconnectIntent

protected Intent buildDisconnectIntent(boolean stop_service)

submitDisconnectIntent

protected void submitDisconnectIntent(boolean stop_service)

submitImportProfileIntent

protected void submitImportProfileIntent(java.lang.String profile_content,
                                         java.lang.String save_as_filename,
                                         boolean merge)

submitImportProfileViaPathIntent

protected void submitImportProfileViaPathIntent(java.lang.String profile_path)

submitDeleteProfileIntent

protected void submitDeleteProfileIntent(java.lang.String profile_name)

submitDeleteProfileIntentWithConfirm

protected void submitDeleteProfileIntentWithConfirm(java.lang.String profile_name)

submitRenameProfileIntent

protected void submitRenameProfileIntent(java.lang.String profile_name,
                                         java.lang.String new_profile_name)

createConnectShortcut

protected void createConnectShortcut(java.lang.String profile_name,
                                     java.lang.String shortcut_name)

createDisconnectShortcut

protected void createDisconnectShortcut(java.lang.String shortcut_name)

createAppShortcut

protected void createAppShortcut(java.lang.String shortcut_name)

resolveExternalPkiAlias

protected void resolveExternalPkiAlias(OpenVPNService.Profile prof,
                                       OpenVPNClientBase.EpkiPost next_action)

import_pkcs12

protected void import_pkcs12(java.lang.String path)

render_duration

protected static java.lang.String render_duration(int duration)

ok_dialog

protected void ok_dialog(java.lang.String text)

ok_dialog

protected void ok_dialog(java.lang.String title,
                         java.lang.String message)

action_enter

protected boolean action_enter(int actionId,
                               KeyEvent event)

raise_file_selection_dialog

protected void raise_file_selection_dialog(int requestCode,
                                           int prompt_res_id)

get_app_expire_string

protected static java.lang.String get_app_expire_string()

warn_app_expiration

protected void warn_app_expiration(PrefUtil prefs)

init_default_preferences

protected void init_default_preferences(PrefUtil prefs)

resString

protected java.lang.String resString(int res_id)

importProfileRemote

protected void importProfileRemote(HttpsClient.AuthContext ac,
                                   boolean prefer_autologin,
                                   HttpsClient.CancelDetect.I cancel_source,
                                   java.lang.Runnable on_success,
                                   java.lang.Runnable on_fail,
                                   java.lang.String save_as_filename,
                                   boolean enable_cert_dialog,
                                   boolean enable_trust_error_dialog)