Merge branch 'dev' into polling-limit

This commit is contained in:
Niels Andriesse 2021-05-24 13:37:13 +10:00
commit 716e768dac
6 changed files with 26 additions and 126 deletions

View File

@ -15,11 +15,11 @@ You will need Java 8 set up on your machine.
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)
* SDK Platform (all API levels)
* Android Support Repository
* Google Repository
In Android studio, this can be done from the Quickstart panel, choose "Configure" then "SDK Manager". 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. You may also need to install API version 28 in the SDK platforms tab.
In Android studio, this can be done from the Quickstart panel. Just choose "Configure", then "SDK Manager". In the SDK Tools tab of the SDK Manager, make sure that "Android Support Repository" is installed, and that the latest "Android SDK build-tools" are installed. Click "OK" to return to the Quickstart panel. You may also need to install API version 28 in the SDK platforms tab.
Setting up a development environment and building from Android Studio
------------------------------------
@ -33,27 +33,7 @@ Setting up a development environment and building from Android Studio
5. Default config options should be good enough.
6. Project initialization and building should proceed.
Building Session from the command line
---------------
The following steps should help you (re)build Session from the command line once all dependencies have been acquired.
1. Checkout the session-android project source with the command:
git clone https://github.com/oxen-io/session-android.git
2. Make sure you have the [Android SDK](https://developer.android.com/sdk/index.html) installed.
3. 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
4. Execute Gradle:
./gradlew :app:build
Contributing code
-----------------
The bulk of the Session code can be found under src/org/thoughtcrime/securesms/loki on this repo and java/main/java/org/whispersystems/signalservice/loki on the session-android-service repo.
Code contributions should be sent via github as pull requests, from feature branches [as explained here](https://help.github.com/articles/using-pull-requests).
Code contributions should be sent via Github as pull requests, from feature branches [as explained here](https://help.github.com/articles/using-pull-requests).

34
NOTICE
View File

@ -1,34 +0,0 @@
TextSecure provides encrypted text messages for Android.
Copyright 2011 Whisper Systems
This software has the follow third party dependencies:
Bouncy Castle 1.42
http://www.bouncycastle.org/
MIT License
Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ZXing
http://code.google.com/p/zxing/
Apache License 2.0
Copyright 2009 ZXing authors
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.

View File

@ -10,7 +10,7 @@ Add the [F-Droid repo](https://fdroid.getsession.org/)
Session integrates directly with [Oxen Service Nodes](https://docs.oxen.io/about-the-oxen-blockchain/oxen-service-nodes), 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)
<img src="https://i.imgur.com/RSMrR1F.png" width="320" />
## Want to contribute? Found a bug or have a feature request?
@ -20,33 +20,41 @@ Please search for any [existing issues](https://github.com/oxen-io/session-andro
Build instructions can be found in [BUILDING.md](BUILDING.md).
## Verifing signatures
## Translations
Get Kee's key and import it:
Want to help us translate Session into your language? You can do so at https://crowdin.com/project/session-android!
## Verifying signatures
**Step 1:**
```
wget https://raw.githubusercontent.com/oxen-io/oxen-core/master/utils/gpg_keys/KeeJef.asc
gpg --import KeeJef.asc
```
Get the signed hash for this release, the SESSION_VERSION needs to be updated for the release you want to verify
**Step 2:**
Get the signed hash for this release. `SESSION_VERSION` needs to be updated for the release you want to verify.
```
export SESSION_VERSION=1.10.4
wget https://github.com/oxen-io/session-android/releases/download/$SESSION_VERSION/signatures.asc
```
Verify the signature of the hashes of the files
**Step 3:**
Verify the signature of the hashes of the files.
```
gpg --verify signatures.asc 2>&1 |grep "Good signature from"
```
The command above should print "`Good signature from "Kee Jefferys...`"
If it does, the hashes are valid but we still have to make the sure the signed hashes matches the downloaded files.
The command above should print "`Good signature from "Kee Jefferys...`". If it does, the hashes are valid but we still have to make the sure the signed hashes matches the downloaded files.
Make sure the two commands below returns the same hash.
If they do, files are valid.
**Step 4:**
Make sure the two commands below returns the same hash. If they do, files are valid.
```
sha256sum session-$SESSION_VERSION-universal.apk
@ -59,6 +67,6 @@ Copyright 2011 Whisper Systems
Copyright 2013-2017 Open Whisper Systems
Copyright 2019-2020 The Loki Project
Copyright 2019-2021 The Loki Project
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html

View File

@ -1,54 +0,0 @@
## How to translate Session into new languages quickly and easily
There are people all around the world who can benefit from access to Session — and that means we need to make Session available in as many languages as possible. Weve had a number of requests from community members wanting to help out by translating Session into currently unsupported (or only partially supported) languages. If you speak multiple languages and you want to help us make Session available in another language you speak, this guide will show you how to translate Sessions iOS and Android apps quickly and easily.
### Translating Session for iOS:
Translating Session iOS into a new language is easy! Youll need a web browser, a plaintext editor (TextEdit on macOS or Notepad on Windows will do), and a little bit of time and patience.
#### Step 1: Retrieving English strings
- Go to [Sessions iOS GitHub page](https://github.com/loki-project/session-ios)
- In the list of folders and files, click **Session**
- Click **Meta**
- Click **Translations**
- Click **en.lproj**
- Click **localizable.strings**
- Scroll down to Line #2557 (using the line numbers on the left-hand side of the text). This line should contain the text `// MARK: - Session` (note: if this line does not contain that text, use Ctrl+F, Cmd+F, or your browsers Find on Page function to find the line which contains that text)
- Select and copy all text from that line down to the end of the file
- Open a plaintext editor (TextEdit on macOS, Notepad on Windows, or your preferred plaintext editor) and create a new file
- Paste the text you copied earlier into this blank file
#### Step 2: Translate!
This file will now have a large number of lines of code. Each line contains 2 sets of information, both in quotation marks, like this:
`"continue_2" = "Continue";`
For each line of code, translate the word or sentence to the **right** of the equals sign into the language you are translating into. Do **not** edit the text to the **left** of the equals sign.
Once you are finished translating, save the file with a filename that specifies which language you have translated the app into, and email the file to us at support@getsession.org along with information about the language you have translated the app into. Be sure to specify in your email that you have translated the iOS app (for information on translating the Android app, see below). Our developers will then take your translation and apply it to the Session iOS app. Thank you for helping make Session more accessible for everyone!
### Translating for Android:
Its just as easy to add new translations on Session Android! Once again, youll need a web browser, a plaintext editor (TextEdit on macOS or Notepad on Windows will do), and a little bit of time and patience.
#### Step 1: Retrieving English strings
- Go to [Sessions Android GitHub page](https://github.com/loki-project/session-android)
- In the list of files and folders, click **res**
- Click **values** (you will need to scroll down to find this folder; make sure you click the folder named **values** and not any of the folders named **values-xx** or with other suffixes)
- Click **strings.xml**
- Scroll down to Line #1657 (using the line numbers on the left-hand side of the text). This line should contain the text `<!-- Session -->` (note: if this line does not contain that text, use Ctrl+F, Cmd+F, or your browsers Find on Page function to find the line which contains that text)
- Select and copy all text from that line down to the end of the file
- Open a plaintext editor (TextEdit on macOS, Notepad on Windows, or your preferred plaintext editor) and create a new file
- Paste the text you copied earlier into this blank file
#### Step 2: Translate!
This file will now have a large number of lines of code. Each line will contain `<string name=”xxx”>` and `</string>` tags. To translate Session Android, translate the text between these tags. For example:
`<string name="continue_2">Continue</string>`
In this line, translate the word **Continue** into the language you are translating into. Do not translate any other text. Do **not** translate the text inside either pair of angled brackets <>.
Translate the word or sentence between each pair of `<string></string>` tags, on each line.
Once you are finished translating, save the file with a filename that specifies which language you have translated the app into, and email the file to us at support@getsession.org along with information about the language you have translated the app into. Be sure to specify in your email that you have translated the Android app (for information on translating the iOS app, see above). Our developers will then take your translation and apply it to the Session Android app. Thank you for helping make Session more accessible for everyone!

View File

@ -143,7 +143,7 @@ dependencies {
testImplementation 'org.robolectric:shadows-multidex:4.2'
}
def canonicalVersionCode = 171
def canonicalVersionCode = 172
def canonicalVersionName = "1.10.8"
def postFixSize = 10

View File

@ -37,14 +37,14 @@ class Contact(val sessionID: String) {
* The name to display in the UI. For local use only.
*/
fun displayName(context: ContactContext): String? {
this.nickname?.let { return it }
nickname?.let { return it }
return when (context) {
ContactContext.REGULAR -> this.name
ContactContext.REGULAR -> name
ContactContext.OPEN_GROUP -> {
// In open groups, where it's more likely that multiple users have the same name,
// we display a bit of the Session ID after a user's display name for added context.
this.name?.let {
return "${this.name} (...${this.sessionID.takeLast(8)})"
name?.let {
return "$name (...${sessionID.takeLast(8)})"
}
return null
}