Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Commit

Permalink
Merge branch 'passcode-dev'
Browse files Browse the repository at this point in the history
Conflicts:
	src/info/guardianproject/otr/app/im/app/AccountActivity.java
	src/info/guardianproject/otr/app/im/app/SigningInActivity.java
	src/info/guardianproject/otr/app/im/plugin/xmpp/XmppConnection.java
  • Loading branch information
n8fr8 committed Sep 14, 2011
2 parents 401d76b + a86120a commit ee5a349
Show file tree
Hide file tree
Showing 32 changed files with 788 additions and 333 deletions.
2 changes: 1 addition & 1 deletion AndroidManifest.xml
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.guardianproject.otr.app.im"
android:sharedUserLabel="@string/perm_label"
android:versionName="0.0.4" android:versionCode="14">
android:versionName="0.0.5" android:versionCode="15">

<uses-sdk android:minSdkVersion="4"></uses-sdk>

Expand Down
Binary file modified res/drawable/bkgd_gibberbot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed res/drawable/gibberbg.jpg
Binary file not shown.
Binary file modified res/drawable/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions res/layout/account_activity.xml
Expand Up @@ -67,6 +67,32 @@
android:layout_marginTop="3dip"
android:text="@string/account_setup_advanced_button" android:layout_width="wrap_content"/>



<TextView android:id="@+id/lblFingerprint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:text="@string/label_fingerprint_local"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone"
/>
<TextView android:id="@+id/txtFingerprint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textAppearance="?android:attr/textAppearanceLarge"

/>

<TextView android:id="@+id/txtFingerprint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textAppearance="?android:attr/textAppearanceSmall"

/>

<!--
<TextView android:id="@+id/signUp"
android:layout_width="wrap_content"
Expand Down
38 changes: 38 additions & 0 deletions res/layout/alert_dialog_text_entry.xml
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">



<EditText
android:id="@+id/password_edit"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
android:autoText="false"
android:capitalize="none"
android:gravity="fill_horizontal"
android:password="true"
android:key="password"
android:textAppearance="?android:attr/textAppearanceMedium" />

</LinearLayout>
64 changes: 62 additions & 2 deletions res/layout/contact_list_filter_view.xml
Expand Up @@ -22,10 +22,70 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/contactFilterView"
android:orientation="vertical">
android:orientation="vertical"
android:background="@drawable/bkgd_gibberbot"
>

<ListView android:id="@+id/filteredList"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00000000"
android:cacheColorHint="#00000000"
/>


<info.guardianproject.otr.app.im.app.UserPresenceView
android:id="@+id/userPresence"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_centerVertical="true"
android:paddingTop="0dip"
android:paddingLeft="0dip"
android:paddingBottom="0dip"
android:paddingRight="0dip"
>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical">

<ImageButton android:id="@+id/statusDropDownButton"
android:paddingTop="2dip"
android:layout_marginRight="4dip"
android:paddingBottom="2dip"
android:scaleType="fitCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"/>

</LinearLayout>

<EditText android:id="@+id/statusEdit"
android:inputType="textCapSentences|textAutoCorrect"
android:selectAllOnFocus="true"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:hint="enter custom status"
/>

<TextView android:id="@+id/statusView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="5dip"
android:paddingLeft="3dip"
android:singleLine="true"
android:visibility="gone"
android:background="#55999999"
android:textAppearance="?android:attr/textAppearanceLargeInverse"/>

</info.guardianproject.otr.app.im.app.UserPresenceView>

</info.guardianproject.otr.app.im.app.ContactListFilterView>
56 changes: 2 additions & 54 deletions res/layout/contact_list_view.xml
Expand Up @@ -22,9 +22,8 @@
android:layout_height="fill_parent"
android:id="@+id/contactListView"
android:orientation="vertical"
android:background="@drawable/bkgd_gibberbot">


android:background="@drawable/bkgd_gibberbot"
>

<ExpandableListView android:id="@+id/contactsList"
android:layout_width="fill_parent"
Expand All @@ -34,56 +33,5 @@
android:layout_weight="1"
/>

<info.guardianproject.otr.app.im.app.UserPresenceView
android:id="@+id/userPresence"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_centerVertical="true"
android:paddingTop="0dip"
android:paddingLeft="0dip"
android:paddingBottom="0dip"
android:paddingRight="0dip"
>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical">

<ImageButton android:id="@+id/statusDropDownButton"
android:paddingTop="2dip"
android:layout_marginRight="4dip"
android:paddingBottom="2dip"
android:scaleType="fitCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"/>

</LinearLayout>

<EditText android:id="@+id/statusEdit"
android:inputType="textCapSentences|textAutoCorrect"
android:selectAllOnFocus="true"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
/>

<TextView android:id="@+id/statusView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="5dip"
android:paddingLeft="3dip"
android:singleLine="true"
android:visibility="gone"
android:background="#55999999"
android:textAppearance="?android:attr/textAppearanceLargeInverse"/>

</info.guardianproject.otr.app.im.app.UserPresenceView>

</info.guardianproject.otr.app.im.app.ContactListView>
2 changes: 1 addition & 1 deletion res/layout/fields_buttons_view.xml
Expand Up @@ -4,7 +4,7 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/gibberbg">
android:background="@drawable/bkgd_gibberbot">

<TextView android:text="TITLE" android:textColor="#00ff00"
android:id="@+id/WizardTextTitle" android:textSize="14pt"
Expand Down
10 changes: 9 additions & 1 deletion res/menu/account_settings_menu.xml
Expand Up @@ -19,7 +19,15 @@
-->

<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_account_settings"

<!-- <item android:id="@+id/menu_account_settings"
android:title="@string/account_settings_title" />
-->

<item android:id="@+id/menu_gen_key"
android:title="@string/menu_gen_key"
android:icon="@drawable/ic_menu_key"
/>


</menu>
4 changes: 0 additions & 4 deletions res/menu/chat_screen_menu.xml
Expand Up @@ -45,10 +45,6 @@
android:title="@string/menu_end_conversation"
android:icon="@drawable/ic_menu_close" />

<item android:id="@+id/menu_gen_key"
android:title="@string/menu_gen_key"
android:icon="@drawable/ic_menu_key"
/>

<!--
Expand Down
6 changes: 6 additions & 0 deletions res/menu/contact_list_menu.xml
Expand Up @@ -42,6 +42,12 @@
android:title="@string/menu_view_accounts"
android:icon="@drawable/ic_menu_sign_in"
/>


<item android:id="@+id/menu_view_groups"
android:title="@string/menu_view_groups"
android:icon="@drawable/ic_menu_switch"
/>

<item android:id="@+id/menu_quit"
android:title="@string/bg_data_prompt_cancel"
Expand Down
7 changes: 7 additions & 0 deletions res/values/strings.xml
Expand Up @@ -96,6 +96,8 @@
displayed when the user long clicks on a conversation in the contact list. It lets the
user to end a chat with a contact. May be overrided by the plugin.-->



<!-- OTRCHAT Adding in new menu options -->
<string name="menu_otr_start">Start Encryption</string>
<string name="menu_otr_stop">Stop Encryption</string>
Expand Down Expand Up @@ -666,4 +668,9 @@

<string name="warning_alpha">WARNING: This is an early release of Gibberbot that may still include security holes or bugs.</string>

<!-- added 2011/09/01 -->
<string name="menu_view_groups">Groups</string>

<string name="otr_gen_key">Generating new OTR keypair...</string>

</resources>
37 changes: 0 additions & 37 deletions src/info/guardianproject/otr/AndroidSecureRandom.java

This file was deleted.

37 changes: 32 additions & 5 deletions src/info/guardianproject/otr/OtrKeyManagerAdapter.java
Expand Up @@ -18,7 +18,9 @@ public class OtrKeyManagerAdapter extends IOtrKeyManager.Stub {

private SessionID _sessionId;

public OtrKeyManagerAdapter (OtrAndroidKeyManagerImpl keyManager, SessionID sessionId)
private String _accountId;

public OtrKeyManagerAdapter (OtrAndroidKeyManagerImpl keyManager, SessionID sessionId, String accountId)
{


Expand All @@ -27,11 +29,30 @@ public OtrKeyManagerAdapter (OtrAndroidKeyManagerImpl keyManager, SessionID sess

_sessionId = sessionId;

_accountId = accountId;
}

public OtrKeyManagerAdapter (OtrAndroidKeyManagerImpl keyManager)
{


_keyManager = keyManager;


}





public void setSessionId(SessionID _sessionId) {
this._sessionId = _sessionId;
}

public void setAccountId(String _accountId) {
this._accountId = _accountId;
}

/* (non-Javadoc)
* @see info.guardianproject.otr.IOtrKeyManager#verifyKey(java.lang.String)
*/
Expand Down Expand Up @@ -67,8 +88,12 @@ public boolean isKeyVerified(String address) throws RemoteException {
@Override
public String getLocalFingerprint() throws RemoteException {

return _keyManager.getLocalFingerprint(_sessionId);

if (_sessionId != null)
return _keyManager.getLocalFingerprint(_sessionId);
else if (_accountId != null)
return _keyManager.getLocalFingerprint(_accountId);
else
return null;
}

/* (non-Javadoc)
Expand All @@ -86,8 +111,10 @@ public String getRemoteFingerprint() throws RemoteException {
@Override
public void generateLocalKeyPair() throws RemoteException {

_keyManager.generateLocalKeyPair(_sessionId);

if (_sessionId != null)
_keyManager.generateLocalKeyPair(_sessionId);
else if (_accountId != null)
_keyManager.generateLocalKeyPair(_accountId);
}

}

0 comments on commit ee5a349

Please sign in to comment.