Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsandriesse committed Apr 17, 2020
2 parents b5e10c7 + a055cf3 commit 18b95c7
Show file tree
Hide file tree
Showing 69 changed files with 1,268 additions and 207 deletions.
11 changes: 8 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,25 @@ Describe here the issue that you are experiencing.
- list the steps
- that reproduce the bug

**Actual result:** Describe here what happens after you run the steps above (i.e. the buggy behaviour)
**Actual result:**

**Expected result:** Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour)
Describe here what happens after you run the steps above (i.e. the buggy behaviour)

**Expected result:**

Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour)

### Screenshots
<!-- you can drag and drop images below -->


### Device info
<!-- replace the examples with your info -->

**Device:** Manufacturer Model XVI

**Android version:** 0.0.0

**Session version:** 0.0.0


### Link to debug log
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If applicable, add screenshots or logs to help explain your problem.

- Device: [e.g. Samsung Galaxy S8]
- OS: [e.g. Android Pie]
- Version of Loki Messenger or latest commit hash
- Version of Session or latest commit hash

**Additional context**

Expand Down
12 changes: 12 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />

Expand Down Expand Up @@ -112,6 +113,9 @@
android:name="org.thoughtcrime.securesms.loki.redesign.activities.DisplayNameActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="org.thoughtcrime.securesms.loki.redesign.activities.PNModeActivity"
android:screenOrientation="portrait" />
<activity
android:name="org.thoughtcrime.securesms.loki.redesign.activities.HomeActivity"
android:screenOrientation="portrait"
Expand Down Expand Up @@ -509,6 +513,14 @@
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:exported="true"
android:theme="@style/TextSecure.LightNoActionBar" />
<service
android:name="org.thoughtcrime.securesms.service.PushNotificationService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name="org.thoughtcrime.securesms.service.WebRtcCallService"
android:enabled="true" />
Expand Down
66 changes: 66 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Building Session
===============

Basics
------

Session uses [Gradle](http://gradle.org) to build the project and to maintain
dependencies. However, you needn't install it yourself; the
"gradle wrapper" `gradlew`, mentioned below, will do that for you.

Building Session
---------------

The following steps should help you (re)build Session from the command line.

1. Checkout the session-android project source with the command:

git clone https://github.com/loki-project/session-android.git

2. Make sure you have the [Android SDK](https://developer.android.com/sdk/index.html) installed.
3. Ensure that the following packages are installed from the Android SDK manager:
* Android SDK Build Tools (see buildToolsVersion in build.gradle)
* SDK Platform (All API levels)
* Android Support Repository
* Google Repository
4. Create a local.properties file at the root of your source checkout and add an sdk.dir entry to it. For example:

sdk.dir=/Application/android-sdk-macosx

5. Using Java 8

6. Execute Gradle:

./gradlew build

Visual assets
----------------------

Source assets tend to be large binary blobs, which are best stored outside of git repositories. Some source files are SVGs that can be auto-colored and sized using a tool like [android-res-utils](https://github.com/sebkur/android-res-utils).

Sample command for generating our audio placeholder image:

```bash
pngs_from_svg.py ic_audio.svg /path/to/Session/res/ 150 --color #000 --opacity 0.54 --suffix _light
pngs_from_svg.py ic_audio.svg /path/to/Session/res/ 150 --color #fff --opacity 1.00 --suffix _light
```

Setting up a development environment
------------------------------------

[Android Studio](https://developer.android.com/sdk/installing/studio.html) is the recommended development environment.

1. Install Android Studio.
2. Open Android Studio. On a new installation, the Quickstart panel will appear. If you have open projects, close them using "File > Close Project" to see the Quickstart panel.
3. From the Quickstart panel, choose "Configure" then "SDK Manager".
4. In the SDK Tools tab of the SDK Manager, make sure that the "Android Support Repository" is installed, and that the latest "Android SDK build-tools" are installed. Click "OK" to return to the Quickstart panel.
5. From the Quickstart panel, choose "Checkout from Version Control" then "git".
6. Paste the URL for the session-android project when prompted (https://github.com/loki-project/session-android.git).
7. Android studio should detect the presence of a project file and ask you whether to open it. Click "yes".
9. Default config options should be good enough.
9. Project initialisation and build should proceed.

Contributing code
-----------------

Code contributions should be sent via github as pull requests, from feature branches [as explained here](https://help.github.com/articles/using-pull-requests).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

## Summary

Session integrates directly with [Loki Service Nodes](https://lokidocs.com/ServiceNodes/SNOverview/), which are a set of distributed, decentralized and Sybil resistant nodes. Service Nodes act as servers which store messages offline, and a set of nodes which allow for onion routing functionality obfuscating users IP addresses. For a full understanding of how Session works, read the [Session Whitepaper](https://getsession.org/whitepaper).
Session integrates directly with [Loki Service Nodes](https://lokidocs.com/ServiceNodes/SNOverview/), which are a set of distributed, decentralized and Sybil resistant nodes. Service Nodes act as servers which store messages offline, and a set of nodes which allow for onion routing functionality obfuscating users' IP addresses. For a full understanding of how Session works, read the [Session Whitepaper](https://getsession.org/whitepaper).

![AndroidSession](https://i.imgur.com/0YC9TyI.png)

## Want to Contribute? Found a Bug or Have a feature request?

Please search for any [existing issues](https://github.com/loki-project/session-android/issues) that describe your bugs in order to avoid duplicate submissions. Submissions can be made by making a pull request to our development branch. If you don't know where to start contributing , try reading the Github issues page for ideas.
Please search for any [existing issues](https://github.com/loki-project/session-android/issues) that describe your bugs in order to avoid duplicate submissions. Submissions can be made by making a pull request to our development branch. If you don't know where to start contributing, try reading the Github issues page for ideas.

## Build instruction

Expand Down
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ buildscript {
ext.kovenant_version = "3.3.0"
ext.identicon_version = "v11"
ext.rss_parser_version = "2.0.4"
ext.google_services_version = "4.3.3"
ext.firebase_messaging_version = "18.0.0"

repositories {
mavenLocal()
Expand All @@ -16,6 +18,7 @@ buildscript {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath files('libs/gradle-witness.jar')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.gms:google-services:$google_services_version"
}
}

Expand All @@ -24,6 +27,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'witness'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'

repositories {
mavenLocal()
Expand Down Expand Up @@ -87,6 +91,8 @@ dependencies {
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.lifecycle:common-java8:1.1.1'

implementation "com.google.firebase:firebase-messaging:$firebase_messaging_version"

implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'

Expand Down Expand Up @@ -184,8 +190,8 @@ dependencies {
implementation "com.github.ybq:Android-SpinKit:1.4.0"
}

def canonicalVersionCode = 48
def canonicalVersionName = "1.0.11"
def canonicalVersionCode = 49
def canonicalVersionName = "1.1.0"

def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
Expand Down
15 changes: 15 additions & 0 deletions res/drawable/pn_option_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid
android:color="@color/pn_option_background" />

<stroke
android:color="@color/pn_option_border"
android:width="@dimen/border_thickness" />

<corners android:radius="@dimen/pn_option_corner_radius" />

</shape>
5 changes: 5 additions & 0 deletions res/drawable/pn_option_background_deselect_transition.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/pn_option_background_selected" />
<item android:drawable="@drawable/pn_option_background" />
</transition>
5 changes: 5 additions & 0 deletions res/drawable/pn_option_background_select_transition.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/pn_option_background" />
<item android:drawable="@drawable/pn_option_background_selected" />
</transition>
15 changes: 15 additions & 0 deletions res/drawable/pn_option_background_selected.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid
android:color="@color/pn_option_background" />

<stroke
android:color="@color/accent"
android:width="@dimen/border_thickness" />

<corners android:radius="@dimen/pn_option_corner_radius" />

</shape>
116 changes: 116 additions & 0 deletions res/layout-sw400dp/activity_pn_mode.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/default_session_background"
android:orientation="vertical">

<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/very_large_spacing"
android:layout_marginRight="@dimen/very_large_spacing"
android:textSize="@dimen/very_large_font_size"
android:textStyle="bold"
android:textColor="@color/text"
android:text="@string/activity_pn_mode_title" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/very_large_spacing"
android:layout_marginTop="10dp"
android:layout_marginRight="@dimen/very_large_spacing"
android:textSize="@dimen/medium_font_size"
android:textColor="@color/text"
android:text="@string/activity_pn_mode_explanation" />

<LinearLayout
android:id="@+id/fcmOptionView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/very_large_spacing"
android:layout_marginTop="@dimen/medium_spacing"
android:layout_marginRight="@dimen/very_large_spacing"
android:padding="12dp"
android:orientation="vertical"
android:background="@drawable/pn_option_background">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/medium_font_size"
android:textColor="@color/text"
android:textStyle="bold"
android:text="@string/activity_pn_mode_fcm_option_title" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/text"
android:text="@string/activity_pn_mode_fcm_option_explanation" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/accent"
android:textStyle="bold"
android:text="@string/activity_pn_mode_recommended_option_tag" />

</LinearLayout>

<LinearLayout
android:id="@+id/backgroundPollingOptionView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/very_large_spacing"
android:layout_marginTop="@dimen/small_spacing"
android:layout_marginRight="@dimen/very_large_spacing"
android:padding="12dp"
android:orientation="vertical"
android:background="@drawable/pn_option_background">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/medium_font_size"
android:textColor="@color/text"
android:textStyle="bold"
android:text="@string/activity_pn_mode_background_polling_option_title" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/text"
android:text="@string/activity_pn_mode_background_polling_option_explanation" />

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>

<Button
style="@style/MediumProminentFilledButton"
android:id="@+id/registerButton"
android:layout_width="match_parent"
android:layout_height="@dimen/medium_button_height"
android:layout_marginLeft="@dimen/massive_spacing"
android:layout_marginRight="@dimen/massive_spacing"
android:layout_marginBottom="@dimen/medium_spacing"
android:text="Continue" />

</LinearLayout>
2 changes: 1 addition & 1 deletion res/layout-sw400dp/fragment_enter_chat_url.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
android:textColor="@color/text"
android:alpha="0.6"
android:textAlignment="center"
android:text="Open groups can be joined by anyone and do not provide full metadata protection" />
android:text="Open groups can be joined by anyone and do not provide full privacy protection" />

</LinearLayout>
Loading

0 comments on commit 18b95c7

Please sign in to comment.