diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 6 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/EulaActivity.java | 34 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/HelpActivity.java | 13 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/HostListActivity.java | 20 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/SettingsActivity.java | 5 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/WizardActivity.java | 104 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/util/PreferenceConstants.java | 2 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_btn_back.png | bin | 861 -> 0 bytes | |||
-rw-r--r-- | app/src/main/res/drawable/ic_btn_next.png | bin | 729 -> 0 bytes | |||
-rw-r--r-- | app/src/main/res/layout/act_eula.xml | 92 | ||||
-rw-r--r-- | app/src/main/res/layout/act_wizard.xml | 62 | ||||
-rw-r--r-- | app/src/main/res/layout/wiz_eula.xml | 87 | ||||
-rw-r--r-- | app/src/main/res/values/arrays.xml | 6 | ||||
-rw-r--r-- | app/src/main/res/values/notrans.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 10 |
15 files changed, 149 insertions, 294 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4bbe055..a1b6501 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -64,10 +64,14 @@ <activity android:name=".HostEditorActivity" android:configChanges="keyboardHidden|orientation" /> <activity android:name=".PortForwardListActivity" android:configChanges="keyboardHidden|orientation" /> <activity android:name=".SettingsActivity" android:configChanges="keyboardHidden|orientation" /> - <activity android:name=".WizardActivity" android:configChanges="keyboardHidden|orientation" /> <activity android:name=".HelpActivity" android:configChanges="keyboardHidden|orientation" /> <activity android:name=".HelpTopicActivity" android:configChanges="keyboardHidden|orientation" /> <activity android:name=".ColorsActivity" android:configChanges="keyboardHidden|orientation" /> + <activity android:name=".EulaActivity" android:parentActivityName=".HelpActivity" + android:configChanges="keyboardHidden|orientation" > + <meta-data android:name="android.support.PARENT_ACTIVITY" + android:value="org.connectbot.HelpActivity" /> + </activity> <service android:name="org.connectbot.service.TerminalManager" android:configChanges="keyboardHidden|orientation" diff --git a/app/src/main/java/org/connectbot/EulaActivity.java b/app/src/main/java/org/connectbot/EulaActivity.java new file mode 100644 index 0000000..650a5b5 --- /dev/null +++ b/app/src/main/java/org/connectbot/EulaActivity.java @@ -0,0 +1,34 @@ +/* + * ConnectBot: simple, powerful, open-source SSH client for Android + * Copyright 2015 Kenny Root, Jeffrey Sharkey + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.connectbot; + +import android.app.Activity; +import android.os.Bundle; + +public class EulaActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.act_eula); + + this.setTitle(String.format("%s: %s", + getResources().getText(R.string.app_name), + getResources().getText(R.string.terms_and_conditions))); + } +} diff --git a/app/src/main/java/org/connectbot/HelpActivity.java b/app/src/main/java/org/connectbot/HelpActivity.java index 5c4fa79..0abcf17 100644 --- a/app/src/main/java/org/connectbot/HelpActivity.java +++ b/app/src/main/java/org/connectbot/HelpActivity.java @@ -73,5 +73,18 @@ public class HelpActivity extends Activity { // TODO Auto-generated catch block Log.e(TAG, "couldn't get list of help assets", e); } + + Button button = new Button(this); + final String topic = getResources().getString(R.string.terms_and_conditions); + button.setText(topic); + + button.setOnClickListener(new OnClickListener() { + public void onClick(View v) { + Intent intent = new Intent(HelpActivity.this, EulaActivity.class); + HelpActivity.this.startActivity(intent); + } + }); + + content.addView(button); } } diff --git a/app/src/main/java/org/connectbot/HostListActivity.java b/app/src/main/java/org/connectbot/HostListActivity.java index a0d7901..9943d00 100644 --- a/app/src/main/java/org/connectbot/HostListActivity.java +++ b/app/src/main/java/org/connectbot/HostListActivity.java @@ -70,8 +70,6 @@ public class HostListActivity extends ListActivity { public final static int REQUEST_EDIT = 1; - public final static int REQUEST_EULA = 2; - protected TerminalManager bound = null; protected HostDatabase hostdb; @@ -175,17 +173,7 @@ public class HostListActivity extends ListActivity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == REQUEST_EULA) { - if (resultCode == Activity.RESULT_OK) { - // yay they agreed, so store that info - Editor edit = prefs.edit(); - edit.putBoolean(PreferenceConstants.EULA, true); - edit.commit(); - } else { - // user didnt agree, so close - this.finish(); - } - } else if (requestCode == REQUEST_EDIT) { + if (requestCode == REQUEST_EDIT) { this.updateList(); } } @@ -224,12 +212,6 @@ public class HostListActivity extends ListActivity { } } - // check for eula agreement - boolean agreed = prefs.getBoolean(PreferenceConstants.EULA, false); - if (!agreed) { - this.startActivityForResult(new Intent(this, WizardActivity.class), REQUEST_EULA); - } - this.makingShortcut = Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction()) || Intent.ACTION_PICK.equals(getIntent().getAction()); diff --git a/app/src/main/java/org/connectbot/SettingsActivity.java b/app/src/main/java/org/connectbot/SettingsActivity.java index 38f3367..ef90196 100644 --- a/app/src/main/java/org/connectbot/SettingsActivity.java +++ b/app/src/main/java/org/connectbot/SettingsActivity.java @@ -45,11 +45,6 @@ public class SettingsActivity extends PreferenceActivity { PreferenceManager.setDefaultValues(this, R.xml.preferences, true); - // Since they were able to get to the Settings activity, they already agreed to the EULA - editor = preferences.edit(); - editor.putBoolean(PreferenceConstants.EULA, true); - editor.commit(); - addPreferencesFromResource(R.xml.preferences); } diff --git a/app/src/main/java/org/connectbot/WizardActivity.java b/app/src/main/java/org/connectbot/WizardActivity.java deleted file mode 100644 index 4069c50..0000000 --- a/app/src/main/java/org/connectbot/WizardActivity.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * ConnectBot: simple, powerful, open-source SSH client for Android - * Copyright 2007 Kenny Root, Jeffrey Sharkey - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.connectbot; - -import org.connectbot.util.HelpTopicView; - -import android.app.Activity; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.ViewFlipper; - -/** - * Show a series of wizard-like steps to the user, which might include an EULA, - * program credits, and helpful hints. - * - * @author jsharkey - */ -public class WizardActivity extends Activity { - protected ViewFlipper flipper = null; - private Button next, prev; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.act_wizard); - - this.flipper = (ViewFlipper) findViewById(R.id.wizard_flipper); - - // inflate the layout for EULA step - LayoutInflater inflater = LayoutInflater.from(this); - this.flipper.addView(inflater.inflate(R.layout.wiz_eula, this.flipper, false)); - - // Add a view for each help topic we want the user to see. - String[] topics = getResources().getStringArray(R.array.list_wizard_topics); - for (String topic : topics) { - flipper.addView(new HelpTopicView(this).setTopic(topic)); - } - - next = (Button) findViewById(R.id.action_next); - next.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - if (isLastDisplayed()) { - // user walked past end of wizard, so return okay - WizardActivity.this.setResult(Activity.RESULT_OK); - WizardActivity.this.finish(); - } else { - // show next step and update buttons - flipper.showNext(); - updateButtons(); - } - } - }); - - prev = (Button) findViewById(R.id.action_prev); - prev.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - if (isFirstDisplayed()) { - // user walked past beginning of wizard, so return that they cancelled - WizardActivity.this.setResult(Activity.RESULT_CANCELED); - WizardActivity.this.finish(); - } else { - // show previous step and update buttons - flipper.showPrevious(); - updateButtons(); - } - } - }); - - this.updateButtons(); - } - - protected boolean isFirstDisplayed() { - return (flipper.getDisplayedChild() == 0); - } - - protected boolean isLastDisplayed() { - return (flipper.getDisplayedChild() == flipper.getChildCount() - 1); - } - - protected void updateButtons() { - boolean eula = (flipper.getDisplayedChild() == 0); - - next.setText(eula ? getString(R.string.wizard_agree) : getString(R.string.wizard_next)); - prev.setText(eula ? getString(R.string.delete_neg) : getString(R.string.wizard_back)); - } -} diff --git a/app/src/main/java/org/connectbot/util/PreferenceConstants.java b/app/src/main/java/org/connectbot/util/PreferenceConstants.java index d3cd832..eb0e396 100644 --- a/app/src/main/java/org/connectbot/util/PreferenceConstants.java +++ b/app/src/main/java/org/connectbot/util/PreferenceConstants.java @@ -66,8 +66,6 @@ public class PreferenceConstants { public static final String BUMPY_ARROWS = "bumpyarrows"; - public static final String EULA = "eula"; - public static final String SORT_BY_COLOR = "sortByColor"; public static final String BELL = "bell"; diff --git a/app/src/main/res/drawable/ic_btn_back.png b/app/src/main/res/drawable/ic_btn_back.png Binary files differdeleted file mode 100644 index 9615e67..0000000 --- a/app/src/main/res/drawable/ic_btn_back.png +++ /dev/null diff --git a/app/src/main/res/drawable/ic_btn_next.png b/app/src/main/res/drawable/ic_btn_next.png Binary files differdeleted file mode 100644 index ea2a80e..0000000 --- a/app/src/main/res/drawable/ic_btn_next.png +++ /dev/null diff --git a/app/src/main/res/layout/act_eula.xml b/app/src/main/res/layout/act_eula.xml new file mode 100644 index 0000000..de4ddc4 --- /dev/null +++ b/app/src/main/res/layout/act_eula.xml @@ -0,0 +1,92 @@ +<!-- + ~ ConnectBot: simple, powerful, open-source SSH client for Android + ~ Copyright 2015 Kenny Root, Jeffrey Sharkey + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context="org.connectbot.EulaActivity"> + + <ScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + > + + <LinearLayout + android:orientation="vertical" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="10dip" + > + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="ConnectBot is a simple, powerful, open-source Secure Shell (SSH) client for your Android device." + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:paddingTop="10dip" + android:text="It can manage several SSH sessions, create secure tunnels, and copy/paste between other apps." + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:paddingTop="10dip" + android:autoLink="web" + android:text="@string/copyright_info" + android:textAppearance="?android:attr/textAppearanceSmall" + /> + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:paddingTop="10dip" + android:text="About and Credits" + android:textAppearance="?android:attr/textAppearanceMedium" + /> + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:paddingTop="10dip" + android:autoLink="web" + android:text="Copyright \u00a9 2007-2008 Kenny Root http://the-b.org, Jeffrey Sharkey http://jsharkey.org\n\nBased in part on the Trilead SSH2 client, provided under a BSD-style license. Copyright \u00a9 2007 Trilead AG. http://www.trilead.com\n\nAlso based on JTA Telnet/SSH client, provided under the GPLv2 license. Copyright \u00a9 Matthias L. Jugel, Marcus Meiner 1996-2005. http://www.javassh.org\n\nAlso based in part on the JSOCKS library, provided under the GNU LGPL license. http://jsocks.sourceforge.net\n\nAlso based in part on JZlib provided under a BSD-style license. Copyright \u00a9 JCraft, Inc., 2000-2004 http://www.jcraft.com" + android:textSize="14sp" + android:textColor="#bebebe" + /> + + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:paddingTop="10dip" + android:text="@string/msg_version" + android:textAppearance="?android:attr/textAppearanceSmall" + /> + + </LinearLayout> + + </ScrollView> + +</RelativeLayout> diff --git a/app/src/main/res/layout/act_wizard.xml b/app/src/main/res/layout/act_wizard.xml deleted file mode 100644 index 97205b9..0000000 --- a/app/src/main/res/layout/act_wizard.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* - * ConnectBot: simple, powerful, open-source SSH client for Android - * Copyright 2007 Kenny Root, Jeffrey Sharkey - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:gravity="end" - > - - <ViewFlipper - android:id="@+id/wizard_flipper" - android:layout_width="fill_parent" - android:layout_height="0dip" - android:layout_weight="1" - /> - - <LinearLayout - android:orientation="horizontal" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="5dip" - > - - <Button - android:id="@+id/action_prev" - android:layout_width="120dip" - android:layout_height="wrap_content" - android:drawableLeft="@drawable/ic_btn_back" - android:text="Cancel" - android:gravity="center" - /> - - <Button - android:id="@+id/action_next" - android:layout_width="120dip" - android:layout_height="wrap_content" - android:drawableRight="@drawable/ic_btn_next" - android:text="Agree" - android:gravity="center" - /> - - </LinearLayout> - -</LinearLayout> diff --git a/app/src/main/res/layout/wiz_eula.xml b/app/src/main/res/layout/wiz_eula.xml deleted file mode 100644 index 228befe..0000000 --- a/app/src/main/res/layout/wiz_eula.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* - * ConnectBot: simple, powerful, open-source SSH client for Android - * Copyright 2007 Kenny Root, Jeffrey Sharkey - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ ---> - -<ScrollView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - > - - <LinearLayout - android:orientation="vertical" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="10dip" - > - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="ConnectBot is a simple, powerful, open-source Secure Shell (SSH) client for your Android device." - android:textAppearance="?android:attr/textAppearanceMedium" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingTop="10dip" - android:text="It can manage several SSH sessions, create secure tunnels, and copy/paste between other apps." - android:textAppearance="?android:attr/textAppearanceMedium" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingTop="10dip" - android:autoLink="web" - android:text="@string/copyright_info" - android:textAppearance="?android:attr/textAppearanceSmall" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingTop="10dip" - android:text="About and Credits" - android:textAppearance="?android:attr/textAppearanceMedium" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingTop="10dip" - android:autoLink="web" - android:text="Copyright \u00a9 2007-2008 Kenny Root http://the-b.org, Jeffrey Sharkey http://jsharkey.org\n\nBased in part on the Trilead SSH2 client, provided under a BSD-style license. Copyright \u00a9 2007 Trilead AG. http://www.trilead.com\n\nAlso based on JTA Telnet/SSH client, provided under the GPLv2 license. Copyright \u00a9 Matthias L. Jugel, Marcus Meiner 1996-2005. http://www.javassh.org\n\nAlso based in part on the JSOCKS library, provided under the GNU LGPL license. http://jsocks.sourceforge.net\n\nAlso based in part on JZlib provided under a BSD-style license. Copyright \u00a9 JCraft, Inc., 2000-2004 http://www.jcraft.com" - android:textSize="14sp" - android:textColor="#bebebe" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingTop="10dip" - android:text="@string/msg_version" - android:textAppearance="?android:attr/textAppearanceSmall" - /> - - </LinearLayout> - -</ScrollView> diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 4721490..23bb1d9 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -123,12 +123,6 @@ <item>@string/portforward_dynamic</item> </string-array> - <string-array name="list_wizard_topics" translatable="false"> - <item>Hints</item> - <item>PhysicalKeyboard</item> - <item>VirtualKeyboard</item> - </string-array> - <string-array name="list_delkey" translatable="false"> <item>@string/list_delkey_del</item> <item>@string/list_delkey_backspace</item> diff --git a/app/src/main/res/values/notrans.xml b/app/src/main/res/values/notrans.xml index 5dacca6..4311e3b 100644 --- a/app/src/main/res/values/notrans.xml +++ b/app/src/main/res/values/notrans.xml @@ -20,7 +20,7 @@ <resources> <string name="app_name" translatable="false">ConnectBot</string> - <string name="copyright_info" translatable="false">Before we get started, we need to get some legal information out of the way. ConnectBot is provided under the Apache License, Version 2.0 (the “License”). Here are a few key points:\n\nYou may not use this program except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</string> + <string name="copyright_info" translatable="false">ConnectBot is provided under the Apache License, Version 2.0 (the “License”). Here are a few key points:\n\nYou may not use this program except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</string> <!-- "Up" button in virtual keyboard. --> <string name="button_key_up">\u25B2</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e08dbd4..c2ce2e7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -53,6 +53,9 @@ <string name="help_about">"About ConnectBot"</string> <string name="help_keyboard">"Keyboard"</string> + <!-- Title for the help page with the terms & conditions of the app. --> + <string name="terms_and_conditions">"Terms & Conditions"</string> + <string name="pubkey_generate">"Generate"</string> <string name="pubkey_import">"Import"</string> <string name="pubkey_delete">"Delete key"</string> @@ -429,13 +432,6 @@ <string name="disconnect_all_pos">"Yes, disconnect"</string> <string name="disconnect_all_neg">"Cancel"</string> - <!-- Button to agree to license terms. --> - <string name="wizard_agree">"Agree"</string> - <!-- Button to go to the next page in the first time start-up wizard. --> - <string name="wizard_next">"Next"</string> - <!-- Button to go to the previous page in the first time start-up wizard. --> - <string name="wizard_back">"Back"</string> - <string name="terminal_no_hosts_connected">"No hosts currently connected"</string> <!-- Displayed in terminal when attempting to connect to a host. The first two |