Compare commits
196 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b193c35d9 | |||
| aab44755aa | |||
| 582b5d035b | |||
| 4458577927 | |||
| cdf2aad98e | |||
| 6bc11ed1c0 | |||
| c09333d5d6 | |||
| b9c43c7b6a | |||
| 0401b2a0d9 | |||
| 2ceb5e11bf | |||
| 3d9345ed87 | |||
| 5af3284e06 | |||
| bc987a4591 | |||
| f3366681d0 | |||
| 0ad2916bcf | |||
| e4c564ace4 | |||
| e90ab537d3 | |||
| defac037de | |||
| 33f07b584b | |||
| 6efbd89674 | |||
| c7e37d153d | |||
| 2021979d8e | |||
| 5b8383dac3 | |||
| 0b05b954f7 | |||
| 0376acb5ae | |||
| 17dc8cebca | |||
| 33747e7a41 | |||
| 99b1703097 | |||
| a14547ce42 | |||
| d682084542 | |||
| 9813f01da8 | |||
| 27cfc39786 | |||
| 86914bf4fc | |||
| 1f9bd90eae | |||
| 9edbc23207 | |||
| e425533d68 | |||
| 451f03a6a8 | |||
| 1c76562fc6 | |||
| 94592d46ae | |||
| a02dde5d51 | |||
| 73359fba7d | |||
| f65ac4d604 | |||
| a469713fbc | |||
| c781f3b9a4 | |||
| 87e1937381 | |||
| cf45c566ba | |||
| 612dab112c | |||
| 1d7bf82b18 | |||
| 55ca2d0ef6 | |||
| 3542455e2a | |||
| 2217ce6788 | |||
| 6e48c126fa | |||
| 177288a8d4 | |||
| 229ede09f1 | |||
| e9de6f7e40 | |||
| ce0c181489 | |||
| 4e73f4cd0a | |||
| 890052d018 | |||
| 46a7159c5a | |||
| cc94b66799 | |||
| 3e4bf6a4a7 | |||
| 5dfc54bd43 | |||
| db99a1da6c | |||
| c3c110b55a | |||
| 31d4e5260f | |||
| 109d49668f | |||
| 5f13330a8e | |||
| 6503469686 | |||
| 9acef33db9 | |||
| 70c44c3efc | |||
| bb8d4b2ef9 | |||
| efb0f31387 | |||
| 7fd90ca5d6 | |||
| 9f01b780c7 | |||
| 2738251be9 | |||
| 2ecd6bed8d | |||
| 858747149a | |||
| b166f1e4fd | |||
| b34cbc2b88 | |||
| efb640fb91 | |||
| db7fcf81d8 | |||
| 87f887fe3f | |||
| 5da75c7dd0 | |||
| a945e659f5 | |||
| bcf460eefd | |||
| 496d7ea8a0 | |||
| 68a5d887c5 | |||
| dc22c9ef22 | |||
| 8588765dc7 | |||
| f49226d335 | |||
| 575c815c97 | |||
| 392d6df2c8 | |||
| 911ed8919a | |||
| 9dd344e6b7 | |||
| f31817c0a1 | |||
| 823217c593 | |||
| 8517570014 | |||
| 155bcd42ea | |||
| 245982d111 | |||
| 323ed1b79f | |||
| 18b4363e83 | |||
| f30a18422f | |||
| d4f5732496 | |||
| ada9377a37 | |||
| ef0eb15034 | |||
| 71ac87c50e | |||
| 84957ace38 | |||
| 77f436c871 | |||
| b8b94265a1 | |||
| c80cca5cb9 | |||
| 4a258ee155 | |||
| e03a78d6a9 | |||
| 58a4bef619 | |||
| 48b3982a9e | |||
| 83d42f689f | |||
| ec094dbd3d | |||
| d89540d798 | |||
| 89355667c3 | |||
| fb6b30185d | |||
| c2bc362cb3 | |||
| e7b2a63e39 | |||
| 9835021582 | |||
| a190897dfe | |||
| a37dc03324 | |||
| be30da8821 | |||
| 91a9363d20 | |||
| 5d235341f8 | |||
| eb1773799c | |||
| caef11536b | |||
| b641a72de4 | |||
| 5a530ca258 | |||
| f0a7f54025 | |||
| 5f159e1d4d | |||
| 5aa526d979 | |||
| 7879f9c22d | |||
| 17399f08e5 | |||
| 868678b91d | |||
| ef11e1beb2 | |||
| d608f72599 | |||
| 3417cf428b | |||
| 2a6609e76e | |||
| 6f19f922c6 | |||
| ba7bedb789 | |||
| df55c901f0 | |||
| f90d1d6306 | |||
| e7ba46273e | |||
| f2cecff741 | |||
| e840e3bcbd | |||
| bf4053d093 | |||
| 1750c07f4d | |||
| 983ee6bb80 | |||
| 7a33f75ba5 | |||
| df5f3ded29 | |||
| 96e1a19b4c | |||
| fce4a4267a | |||
| dd8c869eb6 | |||
| 126b730f7e | |||
| c0e365d2c7 | |||
| 1f29102176 | |||
| 676308a6fb | |||
| ba635754ed | |||
| 01de3d1599 | |||
| ebcfd61e9a | |||
| 38218d1846 | |||
| 01b078cd38 | |||
| 7f3f8451c3 | |||
| ffe0f2b22d | |||
| 44269cc6bb | |||
| eb4be81dce | |||
| a69d99dc7a | |||
| d028ce34b0 | |||
| f8affc698e | |||
| f84e468402 | |||
| 2632117a34 | |||
| 80dc9f2bd4 | |||
| bf122cdb6b | |||
| 4f5b43579b | |||
| b379dafbb5 | |||
| 8fffcf9c80 | |||
| ef7fdee701 | |||
| 48b98150dc | |||
| af97da38da | |||
| 39ad881eb2 | |||
| 0bcec8ba44 | |||
| 8eb5b33aec | |||
| 612d7aa2b2 | |||
| 1927961002 | |||
| 2417ac06c4 | |||
| 3340df3cc7 | |||
| e3becf575a | |||
| 1363e56014 | |||
| df37936ca9 | |||
| 7b6af2557d | |||
| f2b1967831 | |||
| d305c61645 | |||
| ded1ad56a7 |
@@ -30,3 +30,6 @@ jni/libspeex/.deps/
|
||||
|
||||
# contains files for ndk-build when done from gradle.
|
||||
.externalNativeBuild
|
||||
|
||||
# no vi tmp files
|
||||
*.swp
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = fr_CA:fr-rCA,pt_BR:pt-rBR,pt_PT:pt,zh_CN:zh-rCN,zh_HK:zh-rHK,zh_TW:zh-rTW,da_DK:da-rDK,de_DE:de,tr_TR:tr,fr_FR:fr,es_ES:es,hu_HU:hu,sv_SE:sv-rSE,bg_BG:bg,el_GR:el,kn_IN:kn-rIN,cs_CZ:cs,he:iw,id:in,lt_LT:lt,km_KH:km-rKH,th_TH:th
|
||||
lang_map = nl_NL:nl
|
||||
|
||||
[signal-android.master]
|
||||
[delta-chat-app.stringsxml]
|
||||
file_filter = res/values-<lang>/strings.xml
|
||||
source_file = res/values/strings.xml
|
||||
source_lang = en
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
<application android:name=".ApplicationContext"
|
||||
android:icon="@mipmap/ic_launcher_dev"
|
||||
android:label="@string/app_name"
|
||||
android:label="Delta Chat dev"
|
||||
android:supportsRtl="true"
|
||||
tools:replace="android:allowBackup"
|
||||
android:allowBackup="false"
|
||||
@@ -90,7 +90,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name=".ConversationListActivity"
|
||||
android:label="@string/app_name"
|
||||
android:label="Delta Chat dev"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
@@ -114,7 +114,7 @@
|
||||
</activity-alias>
|
||||
|
||||
<activity android:name=".ConversationListArchiveActivity"
|
||||
android:label="@string/AndroidManifest_archived_conversations"
|
||||
android:label="@string/chat_archived_chats_title"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:parentActivityName=".ConversationListActivity">
|
||||
@@ -144,42 +144,16 @@
|
||||
<activity android:name=".GroupCreateActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".DatabaseUpgradeActivity"
|
||||
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphraseCreateActivity"
|
||||
android:label="@string/AndroidManifest__create_passphrase"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphrasePromptActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightIntroTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".NewConversationActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysVisible"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ContactMultiSelectionActivity"
|
||||
android:label="@string/AndroidManifest__select_contacts"
|
||||
android:label="@string/contacts_title"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".giph.ui.GiphyActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".PassphraseChangeActivity"
|
||||
android:label="@string/AndroidManifest__change_passphrase"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ApplicationPreferencesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
@@ -194,13 +168,13 @@
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".LogSubmitActivity"
|
||||
android:label="@string/AndroidManifest__log_submit"
|
||||
<activity android:name=".LogViewActivity"
|
||||
android:label="@string/pref_view_log"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".MediaPreviewActivity"
|
||||
android:label="@string/AndroidManifest__media_preview"
|
||||
android:label="@string/media_preview"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
@@ -226,7 +200,7 @@
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".BlockedContactsActivity"
|
||||
<activity android:name=".BlockedAndShareContactsActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
@@ -258,7 +232,7 @@
|
||||
android:theme="@style/Theme.AppCompat.Dialog.Alert"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:icon="@drawable/clear_profile_avatar"
|
||||
android:label="@string/AndroidManifest_remove_photo">
|
||||
android:label="@string/menu_delete_image">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="org.thoughtcrime.securesms.action.CLEAR_PROFILE_PHOTO"/>
|
||||
@@ -266,24 +240,10 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".contactshare.ContactShareEditActivity"
|
||||
<activity android:name=".preferences.ChatBackgroundActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.ContactNameEditActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".contactshare.SharedContactDetailsActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".preferences.ChatBackgroundActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<service android:enabled="true" android:exported="false" android:name=".service.KeyCachingService"/>
|
||||
|
||||
<service android:name=".connect.KeepAliveService" android:enabled="true"/>
|
||||
|
||||
<service android:name=".service.DirectShareService"
|
||||
@@ -293,8 +253,6 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".service.GenericForegroundService"/>
|
||||
|
||||
<receiver android:name=".connect.TimerReceiver" android:enabled="true"/>
|
||||
|
||||
<receiver android:name=".notifications.MarkReadReceiver"
|
||||
@@ -327,13 +285,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".service.ExpirationListener" />
|
||||
|
||||
<provider android:name=".providers.PartProvider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false"
|
||||
android:authorities="${applicationId}.provider.securesms" />
|
||||
|
||||
<provider android:name="android.support.v4.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
Building Signal
|
||||
===============
|
||||
|
||||
Basics
|
||||
------
|
||||
|
||||
Signal 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 Signal
|
||||
---------------
|
||||
|
||||
The following steps should help you (re)build Signal from the command line.
|
||||
|
||||
1. Checkout the Signal-Android project source with the command:
|
||||
|
||||
git clone https://github.com/signalapp/Signal-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/Signal/res/ 150 --color #000 --opacity 0.54 --suffix _light
|
||||
pngs_from_svg.py ic_audio.svg /path/to/Signal/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 Signal-Android project when prompted (https://github.com/signalapp/Signal-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).
|
||||
|
||||
Mailing list
|
||||
------------
|
||||
|
||||
Development discussion happens on the whispersystems mailing list.
|
||||
[To join](https://lists.riseup.net/www/info/whispersystems)
|
||||
Send emails to whispersystems@lists.riseup.net
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
*.db
|
||||
*.db.gz
|
||||
@@ -1,106 +0,0 @@
|
||||
import sys
|
||||
import re
|
||||
import argparse
|
||||
import sqlite3
|
||||
import gzip
|
||||
from progressbar import ProgressBar, Counter, Timer
|
||||
from lxml import etree
|
||||
|
||||
parser = argparse.ArgumentParser(prog='apntool', description="""Process Android's apn xml files and drop them into an
|
||||
easily queryable SQLite db. Tested up to version 9 of
|
||||
their APN file.""")
|
||||
parser.add_argument('-v', '--version', action='version', version='%(prog)s v1.1')
|
||||
parser.add_argument('-i', '--input', help='the xml file to parse', default='apns.xml', required=False)
|
||||
parser.add_argument('-o', '--output', help='the sqlite db output file', default='apns.db', required=False)
|
||||
parser.add_argument('--quiet', help='do not show progress or verbose instructions', action='store_true', required=False)
|
||||
parser.add_argument('--no-gzip', help="do not gzip after creation", action='store_true', required=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
def normalized(target):
|
||||
o2_typo = re.compile(r"02\.co\.uk")
|
||||
port_typo = re.compile(r"(\d+\.\d+\.\d+\.\d+)\.(\d+)")
|
||||
leading_zeros = re.compile(r"(/|\.|^)0+(\d+)")
|
||||
subbed = o2_typo.sub(r'o2.co.uk', target)
|
||||
subbed = port_typo.sub(r'\1:\2', subbed)
|
||||
subbed = leading_zeros.sub(r'\1\2', subbed)
|
||||
return subbed
|
||||
|
||||
try:
|
||||
connection = sqlite3.connect(args.output)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute('SELECT SQLITE_VERSION()')
|
||||
version = cursor.fetchone()
|
||||
if not args.quiet:
|
||||
print("SQLite version: %s" % version)
|
||||
print("Opening %s" % args.input)
|
||||
|
||||
cursor.execute("PRAGMA legacy_file_format=ON")
|
||||
cursor.execute("PRAGMA journal_mode=DELETE")
|
||||
cursor.execute("PRAGMA page_size=32768")
|
||||
cursor.execute("VACUUM")
|
||||
cursor.execute("DROP TABLE IF EXISTS apns")
|
||||
cursor.execute("""CREATE TABLE apns(_id INTEGER PRIMARY KEY, mccmnc TEXT, mcc TEXT, mnc TEXT, carrier TEXT,
|
||||
apn TEXT, mmsc TEXT, port INTEGER, type TEXT, protocol TEXT, bearer TEXT, roaming_protocol TEXT,
|
||||
carrier_enabled INTEGER, mmsproxy TEXT, mmsport INTEGER, proxy TEXT, mvno_match_data TEXT,
|
||||
mvno_type TEXT, authtype INTEGER, user TEXT, password TEXT, server TEXT)""")
|
||||
|
||||
apns = etree.parse(args.input)
|
||||
root = apns.getroot()
|
||||
pbar = None
|
||||
if not args.quiet:
|
||||
pbar = ProgressBar(widgets=['Processed: ', Counter(), ' apns (', Timer(), ')'], maxval=len(list(root))).start()
|
||||
|
||||
count = 0
|
||||
for apn in root.iter("apn"):
|
||||
if apn.get("mmsc") is None:
|
||||
continue
|
||||
sqlvars = ["?" for x in apn.attrib.keys()] + ["?"]
|
||||
mccmnc = "%s%s" % (apn.get("mcc"), apn.get("mnc"))
|
||||
normalized_mmsc = normalized(apn.get("mmsc"))
|
||||
if normalized_mmsc != apn.get("mmsc"):
|
||||
print("normalize MMSC: %s => %s" % (apn.get("mmsc"), normalized_mmsc))
|
||||
apn.set("mmsc", normalized_mmsc)
|
||||
|
||||
if not apn.get("mmsproxy") is None:
|
||||
normalized_mmsproxy = normalized(apn.get("mmsproxy"))
|
||||
if normalized_mmsproxy != apn.get("mmsproxy"):
|
||||
print("normalize proxy: %s => %s" % (apn.get("mmsproxy"), normalized_mmsproxy))
|
||||
apn.set("mmsproxy", normalized_mmsproxy)
|
||||
|
||||
values = [apn.get(attrib) for attrib in apn.attrib.keys()] + [mccmnc]
|
||||
keys = apn.attrib.keys() + ["mccmnc"]
|
||||
|
||||
cursor.execute("SELECT 1 FROM apns WHERE mccmnc = ? AND apn = ?", [mccmnc, apn.get("apn")])
|
||||
if cursor.fetchone() is None:
|
||||
statement = "INSERT INTO apns (%s) VALUES (%s)" % (", ".join(keys), ", ".join(sqlvars))
|
||||
cursor.execute(statement, values)
|
||||
|
||||
count += 1
|
||||
if not args.quiet:
|
||||
pbar.update(count)
|
||||
|
||||
if not args.quiet:
|
||||
pbar.finish()
|
||||
connection.commit()
|
||||
print("Successfully written to %s" % args.output)
|
||||
|
||||
if not args.no_gzip:
|
||||
gzipped_file = "%s.gz" % (args.output,)
|
||||
with open(args.output, 'rb') as orig:
|
||||
with gzip.open(gzipped_file, 'wb') as gzipped:
|
||||
gzipped.writelines(orig)
|
||||
print("Successfully gzipped to %s" % gzipped_file)
|
||||
|
||||
if not args.quiet:
|
||||
print("\nTo include this in the distribution, copy it to the project's assets/databases/ directory.")
|
||||
print("If you support API 10 or lower, you must use the gzipped version to avoid corruption.")
|
||||
|
||||
except sqlite3.Error, e:
|
||||
if connection:
|
||||
connection.rollback()
|
||||
print("Error: %s" % e.args[0])
|
||||
sys.exit(1)
|
||||
finally:
|
||||
if connection:
|
||||
connection.close()
|
||||
@@ -1,3 +0,0 @@
|
||||
argparse>=1.2.1
|
||||
lxml>=3.3.3
|
||||
progressbar-latest>=2.4
|
||||
|
Before Width: | Height: | Size: 33 KiB |
@@ -39,9 +39,6 @@ repositories {
|
||||
maven {
|
||||
url "https://raw.github.com/signalapp/maven/master/circular-progress-button/releases/"
|
||||
}
|
||||
maven {
|
||||
url "https://raw.github.com/signalapp/maven/master/sqlcipher/release/"
|
||||
}
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
@@ -77,30 +74,21 @@ dependencies {
|
||||
|
||||
compile 'com.google.android.exoplayer:exoplayer:r2.3.1'
|
||||
|
||||
compile('org.whispersystems:libpastelog:1.1.2') {
|
||||
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||
}
|
||||
compile 'org.whispersystems:signal-service-android:2.7.6'
|
||||
compile 'org.whispersystems:webrtc-android:M68'
|
||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
|
||||
|
||||
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
|
||||
|
||||
compile "me.leolin:ShortcutBadger:1.1.16"
|
||||
compile 'se.emilsjolander:stickylistheaders:2.7.0'
|
||||
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
|
||||
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
|
||||
compile 'com.github.chrisbanes:PhotoView:2.1.3'
|
||||
compile 'com.github.bumptech.glide:glide:4.5.0'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
|
||||
compile 'com.makeramen:roundedimageview:2.1.0'
|
||||
compile 'com.pnikosis:materialish-progress:1.5'
|
||||
compile 'pl.tajchert:waitingdots:0.1.0'
|
||||
compile 'com.soundcloud.android:android-crop:0.9.10@aar'
|
||||
compile 'com.melnykov:floatingactionbutton:1.3.0'
|
||||
compile 'com.squareup.dagger:dagger:1.2.2'
|
||||
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
|
||||
compile 'mobi.upod:time-duration-picker:1.1.3'
|
||||
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
|
||||
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||
compile 'com.google.zxing:core:3.2.1'
|
||||
compile ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
||||
@@ -109,13 +97,6 @@ dependencies {
|
||||
compile ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
}
|
||||
compile ('com.tomergoldst.android:tooltips:1.0.6') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
}
|
||||
compile ('com.klinkerapps:android-smsmms:4.0.1') {
|
||||
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
||||
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
||||
}
|
||||
compile 'com.annimon:stream:1.1.8'
|
||||
compile ('com.takisoft.fix:colorpicker:0.9.1') {
|
||||
exclude group: 'com.android.support', module: 'appcompat-v7'
|
||||
@@ -123,11 +104,6 @@ dependencies {
|
||||
}
|
||||
compile 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
||||
compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
||||
compile 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
||||
compile ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
||||
exclude group: 'com.fasterxml.jackson.core'
|
||||
exclude group: 'org.freemarker'
|
||||
}
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'org.assertj:assertj-core:1.7.1'
|
||||
@@ -144,10 +120,6 @@ dependencies {
|
||||
androidTestCompile ('org.assertj:assertj-core:1.7.1') {
|
||||
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
||||
}
|
||||
androidTestCompile ('com.squareup.assertj:assertj-android:1.1.1') {
|
||||
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
}
|
||||
}
|
||||
|
||||
dependencyVerification {
|
||||
@@ -156,7 +128,6 @@ dependencyVerification {
|
||||
'com.android.support:preference-v14:1fcf40bd560dc21ce55b6a292d1326d28f52dc5e4f2a64eef2f38dd95777b645',
|
||||
'com.android.support:preference-v7:d9f32ddc92f8d6a0bd86a18f4fcaff805fa021245e395b6e7dd382907443ee53',
|
||||
'com.pnikosis:materialish-progress:d71d80e00717a096784482aee21001a9d299fec3833e4ebd87739ed36cf77c54',
|
||||
'pl.tajchert:waitingdots:2835d49e0787dbcb606c5a60021ced66578503b1e9fddcd7a5ef0cd5f095ba2c',
|
||||
'mobi.upod:time-duration-picker:db469ce0f48dd96b892eac424ed76870e54bf00fe0a28cdcddfbe5f2a226a0e1',
|
||||
'com.codewaves.stickyheadergrid:stickyheadergrid:5b4aa6a52a957cfd55f60f4220c11c0c371385a3cb9786cae03c260dcdef5794',
|
||||
'com.android.support:appcompat-v7:b2825e8b47f665d3362d8481c8d147d1af9230d16f23a2b94f6ccbc53c68cec1',
|
||||
@@ -173,29 +144,20 @@ dependencyVerification {
|
||||
'com.google.android.gms:play-services-places:abf3a4a3b146ec7e6e753be62775e512868cf37d6f88ffe2d81167b33b57132b',
|
||||
'com.google.android.gms:play-services-maps:45e8021e7ddac4a44a82a0e9698991389ded3023d35c58f38dbd86d54211ec0e',
|
||||
'com.google.android.exoplayer:exoplayer:955085aa611a8f7cf6c61b88ae03d1a392f4ad94c9bfbc153f3dedb9ffb14718',
|
||||
'org.whispersystems:libpastelog:fe56b4db9ec743c8b565e3e4caa9228fafe132dc0bf82000d6e359b97a81177c',
|
||||
'org.whispersystems:signal-service-android:823eed29e64fb0aa30d2078cb5ec0245e2a0713a4028121329c5c28788ef27f8',
|
||||
'org.whispersystems:webrtc-android:66cb312eb024eaf6aa93e662d37d0c46632e049d47a2dcc9c291207589ee7a43',
|
||||
'me.leolin:ShortcutBadger:e3cb3e7625892129b0c92dd5e4bc649faffdd526d5af26d9c45ee31ff8851774',
|
||||
'se.emilsjolander:stickylistheaders:a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb',
|
||||
'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa',
|
||||
'org.apache.httpcomponents:httpclient-android:6f56466a9bd0d42934b90bfbfe9977a8b654c058bf44a12bdc2877c4e1f033f1',
|
||||
'com.github.chrisbanes:PhotoView:ed06775308da260e1fd86d1d3288988fcd3d80db24ce0d7c9fcfedc39e622292',
|
||||
'com.github.bumptech.glide:glide:997de7ac95be6c944d3b8cbe13de11307736ea45451c1b09a6cec7c328ead59f',
|
||||
'com.makeramen:roundedimageview:1f5a1865796b308c6cdd114acc6e78408b110f0a62fc63553278fbeacd489cd1',
|
||||
'com.soundcloud.android:android-crop:ffd4b973cf6e97f7d64118a0dc088df50e9066fd5634fe6911dd0c0c5d346177',
|
||||
'com.squareup.dagger:dagger:789aca24537022e49f91fc6444078d9de8f1dd99e1bfb090f18491b186967883',
|
||||
'com.amulyakhare:com.amulyakhare.textdrawable:54c92b5fba38cfd316a07e5a30528068f45ce8515a6890f1297df4c401af5dcb',
|
||||
'com.google.zxing:core:b4d82452e7a6bf6ec2698904b332431717ed8f9a850224f295aec89de80f2259',
|
||||
'com.davemorrissey.labs:subsampling-scale-image-view:550c5baa07e0bb4ff0a18b705e96d34436d22619248bd8c08c08c730b1f55cfe',
|
||||
'cn.carbswang.android:NumberPickerView:18b3c316d62c7c277978a8d4ed57a5b8f4e943762264960f579a8a549c756729',
|
||||
'com.tomergoldst.android:tooltips:4c56697dd1ad64b8066535c61f961a6d901e7ae5d97ae27084ba40ad620349b6',
|
||||
'com.klinkerapps:android-smsmms:e7c3328a0f3a8dd44daa8129de4e99996f3057a4546e47891b036b81e0ebf1d1',
|
||||
'com.annimon:stream:5da6e2e3e0551d61a3ea7014f04312276549e3dd739cf637996e4cf43c5535b9',
|
||||
'com.takisoft.fix:colorpicker:f5d0dbabe406a1800498ca9c1faf34db36e021d8488bf10360f29961fe3ab0d1',
|
||||
'com.github.dmytrodanylyk.circular-progress-button:library:8dc6a29a5a8db7b2ad5a9a7fda1dc9ae0893f4c8f0545732b2c63854ea693e8e',
|
||||
'org.signal:android-database-sqlcipher:33d4063336893af00b9d68b418e7b290cace74c20ce8aacffddc0911010d3d73',
|
||||
'com.googlecode.ez-vcard:ez-vcard:7e24ad50b222d2f70ac91bdccfa3c0f6200b078d797cb784837f75e77bb4210f',
|
||||
'com.google.android.gms:play-services-iid:54e919f9957b8b7820da7ee9b83471d00d0cac1cf08ddea8b5b41aea80bb1a70',
|
||||
'com.google.android.gms:play-services-base:0ca636a8fc9a5af45e607cdcd61783bf5d561cbbb0f862021ce69606eee5ad49',
|
||||
'com.google.android.gms:play-services-tasks:69ec265168e601d0203d04cd42e34bb019b2f029aa1e16fabd38a5153eea2086',
|
||||
@@ -218,27 +180,10 @@ dependencyVerification {
|
||||
'android.arch.lifecycle:viewmodel:7de29cfaba77d6b5d5be234c57f6812d0150d087e63941af22ba1d1f8e2bc96a',
|
||||
'com.github.bumptech.glide:gifdecoder:59ccf3bb0cec11dab4b857382cbe0b171111b6fc62bf141adce4e1180889af15',
|
||||
'com.android.support:support-annotations:af05330d997eb92a066534dbe0a3ea24347d26d7001221092113ae02a8f233da',
|
||||
'org.whispersystems:signal-protocol-android:5b8acded7f2a40178eb90ab8e8cbfec89d170d91b3ff5e78487d1098df6185a1',
|
||||
'org.whispersystems:signal-service-java:6169643c65dcba8c784744006fc3afd9b6f309041b310a33a624121e3577433a',
|
||||
'com.github.bumptech.glide:disklrucache:c1b1b6f5bbd01e2fcdc9d7f60913c8d338bdb65ed4a93bfa02b56f19daaade4b',
|
||||
'com.github.bumptech.glide:annotations:bede99ef9f71517a4274bac18fd3e483e9f2b6108d7d6fe8f4949be4aa4d9512',
|
||||
'com.nineoldandroids:library:68025a14e3e7673d6ad2f95e4b46d78d7d068343aa99256b686fe59de1b3163a',
|
||||
'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
|
||||
'com.klinkerapps:logger:177e325259a8b111ad6745ec10db5861723c99f402222b80629f576f49408541',
|
||||
'com.google.android:flexbox:a9989fd13ae2ee42765dfc515fe362edf4f326e74925d02a10369df8092a4935',
|
||||
'org.jsoup:jsoup:abeaf34795a4de70f72aed6de5966d2955ec7eb348eeb813324f23c999575473',
|
||||
'org.whispersystems:curve25519-android:82595394422b957d4a5b5f1b27b75ba25cf6dc4db4d312418ca38cd6fff279ca',
|
||||
'org.whispersystems:signal-protocol-java:5152c2b01a25147967d6bf82e540f947901bdfa79260be3eb3e96b03f787d6b5',
|
||||
'com.google.protobuf:protobuf-java:e0c1c64575c005601725e7c6a02cebf9e1285e888f756b2a1d73ffa8d725cc74',
|
||||
'com.googlecode.libphonenumber:libphonenumber:183392c0565be16d3f6f86680b4106bbde6fe31a402ad21bf9823d938c0c8706',
|
||||
'com.fasterxml.jackson.core:jackson-databind:835097bcdd11f5bc8a08378c70d4c8054dfa4b911691cc2752063c75534d198d',
|
||||
'com.squareup.okhttp3:okhttp:7265adbd6f028aade307f58569d814835cd02bc9beffb70c25f72c9de50d61c4',
|
||||
'com.madgag.spongycastle:prov:b8c3fec3a59aac1aa04ccf4dad7179351e54ef7672f53f508151b614c131398a',
|
||||
'org.whispersystems:curve25519-java:7dd659d8822c06c3aea1a47f18fac9e5761e29cab8100030b877db445005f03e',
|
||||
'com.fasterxml.jackson.core:jackson-annotations:0ca408c24202a7626ec8b861e99d85eca5e38b73311dd6dd12e3e9deecc3fe94',
|
||||
'com.fasterxml.jackson.core:jackson-core:cbf4604784b4de226262845447a1ad3bb38a6728cebe86562e2c5afada8be2c0',
|
||||
'com.squareup.okio:okio:734269c3ebc5090e3b23566db558f421f0b4027277c79ad5d176b8ec168bb850',
|
||||
'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f',
|
||||
]
|
||||
}
|
||||
|
||||
@@ -253,8 +198,8 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode 399
|
||||
versionName "0.0.9"
|
||||
versionCode 402
|
||||
versionName "0.90.0"
|
||||
applicationId "chat.delta.androidii"
|
||||
|
||||
minSdkVersion 14
|
||||
@@ -262,14 +207,12 @@ android {
|
||||
multiDexEnabled true
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
project.ext.set("archivesBaseName", "Signal");
|
||||
project.ext.set("archivesBaseName", "Deltachat");
|
||||
|
||||
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
|
||||
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service.whispersystems.org\""
|
||||
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://cdn.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"uptime.signal.org\""
|
||||
buildConfigField "String", "GIPHY_PROXY_HOST", "\"giphy-proxy-production.whispersystems.org\""
|
||||
buildConfigField "int", "GIPHY_PROXY_PORT", "80"
|
||||
buildConfigField "String", "USER_AGENT", "\"OWA\""
|
||||
buildConfigField "boolean", "DEV_BUILD", "false"
|
||||
|
||||
@@ -303,22 +246,13 @@ android {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||
'proguard-google-play-services.pro',
|
||||
'proguard-dagger.pro',
|
||||
'proguard-jackson.pro',
|
||||
'proguard-sqlite.pro',
|
||||
'proguard-appcompat-v7.pro',
|
||||
'proguard-square-okhttp.pro',
|
||||
'proguard-square-okio.pro',
|
||||
'proguard-spongycastle.pro',
|
||||
'proguard-rounded-image-view.pro',
|
||||
'proguard-glide.pro',
|
||||
'proguard-shortcutbadger.pro',
|
||||
'proguard-retrofit.pro',
|
||||
'proguard-webrtc.pro',
|
||||
'proguard-klinker.pro',
|
||||
'proguard-retrolambda.pro',
|
||||
'proguard-okhttp.pro',
|
||||
'proguard-ez-vcard.pro',
|
||||
'proguard.cfg'
|
||||
testProguardFiles 'proguard-automation.pro',
|
||||
'proguard.cfg'
|
||||
@@ -333,16 +267,12 @@ android {
|
||||
productFlavors {
|
||||
play {
|
||||
dimension "none"
|
||||
ext.websiteUpdateUrl = "null"
|
||||
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
||||
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
||||
}
|
||||
|
||||
website {
|
||||
dimension "none"
|
||||
ext.websiteUpdateUrl = "https://updates.signal.org/android"
|
||||
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
||||
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -452,11 +452,15 @@ JNIEXPORT jint Java_com_b44t_messenger_DcContext_removeContactFromChat(JNIEnv *e
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_setDraft(JNIEnv *env, jobject obj, jint chat_id, jstring draft /* NULL=delete */)
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_setDraft(JNIEnv *env, jobject obj, jint chat_id, jobject msg /* NULL=delete */)
|
||||
{
|
||||
CHAR_REF(draft);
|
||||
dc_set_text_draft(get_dc_context(env, obj), chat_id, draftPtr /* NULL=delete */);
|
||||
CHAR_UNREF(draft);
|
||||
dc_set_draft(get_dc_context(env, obj), chat_id, get_dc_msg(env, msg));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jlong Java_com_b44t_messenger_DcContext_getDraftCPtr(JNIEnv *env, jobject obj, jint chat_id)
|
||||
{
|
||||
return (jlong)dc_get_draft(get_dc_context(env, obj), chat_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -816,6 +820,12 @@ JNIEXPORT jstring Java_com_b44t_messenger_DcChat_getProfileImage(JNIEnv *env, jo
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcChat_getColor(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chat_get_color(get_dc_chat(env, obj));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isUnpromoted(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chat_is_unpromoted(get_dc_chat(env, obj))!=0;
|
||||
@@ -834,21 +844,6 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isVerified(JNIEnv *env, jobjec
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jstring Java_com_b44t_messenger_DcChat_getDraft(JNIEnv *env, jobject obj) /* returns NULL for "no draft" */
|
||||
{
|
||||
const char* temp = dc_chat_get_text_draft(get_dc_chat(env, obj));
|
||||
jstring ret = temp? JSTRING_NEW(temp) : NULL;
|
||||
free(temp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jlong Java_com_b44t_messenger_DcChat_getDraftTimestamp(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return JTIMESTAMP(dc_chat_get_draft_timestamp(get_dc_chat(env, obj)));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jintArray Java_com_b44t_messenger_DcContext_getChatMedia(JNIEnv *env, jobject obj, jint chat_id, jint msg_type, jint or_msg_type)
|
||||
{
|
||||
dc_array_t* ca = dc_get_chat_media(get_dc_context(env, obj), chat_id, msg_type, or_msg_type);
|
||||
@@ -900,12 +895,14 @@ JNIEXPORT jintArray Java_com_b44t_messenger_DcContext_getChatContacts(JNIEnv *en
|
||||
static dc_msg_t* get_dc_msg(JNIEnv *env, jobject obj)
|
||||
{
|
||||
static jfieldID fid = 0;
|
||||
if (fid==0) {
|
||||
jclass cls = (*env)->GetObjectClass(env, obj);
|
||||
fid = (*env)->GetFieldID(env, cls, "msgCPtr", "J" /*Signature, J=long*/);
|
||||
}
|
||||
if (fid) {
|
||||
return (dc_msg_t*)(*env)->GetLongField(env, obj, fid);
|
||||
if (env && obj) {
|
||||
if (fid==0) {
|
||||
jclass cls = (*env)->GetObjectClass(env, obj);
|
||||
fid = (*env)->GetFieldID(env, cls, "msgCPtr", "J" /*Signature, J=long*/);
|
||||
}
|
||||
if (fid) {
|
||||
return (dc_msg_t*)(*env)->GetLongField(env, obj, fid);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1183,7 +1180,16 @@ JNIEXPORT jstring Java_com_b44t_messenger_DcContact_getNameNAddr(JNIEnv *env, jo
|
||||
|
||||
JNIEXPORT jstring Java_com_b44t_messenger_DcContact_getProfileImage(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return JSTRING_NEW("");
|
||||
const char* temp = dc_contact_get_profile_image(get_dc_contact(env, obj));
|
||||
jstring ret = JSTRING_NEW(temp);
|
||||
free(temp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContact_getColor(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_contact_get_color(get_dc_contact(env, obj));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,907 +0,0 @@
|
||||
From e6d913938a67f8ef3174722a7ce38be8be92305f Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <e6d913938a67f8ef3174722a7ce38be8be92305f.1534410135.git.daniel.boehrs@open-xchange.com>
|
||||
In-Reply-To: <371694c11a8b1192ef5230b98af3a5719add98ef.1534410134.git.daniel.boehrs@open-xchange.com>
|
||||
References: <371694c11a8b1192ef5230b98af3a5719add98ef.1534410134.git.daniel.boehrs@open-xchange.com>
|
||||
From: "B. Petersen" <r10s@b44t.com>
|
||||
Date: Fri, 27 Jul 2018 17:12:43 +0200
|
||||
Subject: [PATCH 5/6] add java-binding-classes
|
||||
|
||||
---
|
||||
src/com/b44t/messenger/MrChat.java | 87 ++++++
|
||||
src/com/b44t/messenger/MrChatlist.java | 64 +++++
|
||||
src/com/b44t/messenger/MrContact.java | 57 ++++
|
||||
src/com/b44t/messenger/MrLot.java | 56 ++++
|
||||
src/com/b44t/messenger/MrMailbox.java | 485 +++++++++++++++++++++++++++++++++
|
||||
src/com/b44t/messenger/MrMsg.java | 102 +++++++
|
||||
6 files changed, 851 insertions(+)
|
||||
|
||||
diff --git a/src/com/b44t/messenger/MrChat.java b/src/com/b44t/messenger/MrChat.java
|
||||
new file mode 100644
|
||||
index 0000000..2165182
|
||||
--- /dev/null
|
||||
+++ b/src/com/b44t/messenger/MrChat.java
|
||||
@@ -0,0 +1,87 @@
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * Delta Chat Android
|
||||
+ * (C) 2017 Björn Petersen
|
||||
+ * Contact: r10s@b44t.com, http://b44t.com
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License as published by the Free Software
|
||||
+ * Foundation, either version 3 of the License, or (at your option) any later
|
||||
+ * version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
+ * details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see http://www.gnu.org/licenses/ .
|
||||
+ *
|
||||
+ *******************************************************************************
|
||||
+ *
|
||||
+ * File: MrChat.java
|
||||
+ * Purpose: Wrap around mrchat_t
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+package com.b44t.messenger;
|
||||
+
|
||||
+import android.text.TextUtils;
|
||||
+
|
||||
+public class MrChat {
|
||||
+
|
||||
+ public final static int MR_CHAT_ID_DEADDROP = 1;
|
||||
+ public final static int MR_CHAT_ID_STARRED = 5;
|
||||
+ public final static int MR_CHAT_ID_ARCHIVED_LINK = 6;
|
||||
+ public final static int MR_CHAT_ID_LAST_SPECIAL = 9;
|
||||
+
|
||||
+ public MrChat(long hChat) {
|
||||
+ m_hChat = hChat;
|
||||
+ }
|
||||
+
|
||||
+ @Override protected void finalize() throws Throwable {
|
||||
+ super.finalize();
|
||||
+ MrChatUnref(m_hChat);
|
||||
+ m_hChat = 0;
|
||||
+ }
|
||||
+
|
||||
+ public native int getId();
|
||||
+ public native boolean isGroup();
|
||||
+ public native int getArchived();
|
||||
+ public native String getName();
|
||||
+ public native String getSubtitle();
|
||||
+
|
||||
+ public native String getProfileImage();
|
||||
+ public native boolean isUnpromoted();
|
||||
+ public native boolean isSelfTalk();
|
||||
+ public native boolean isVerified();
|
||||
+ public native String getDraft();
|
||||
+ public native long getDraftTimestamp();
|
||||
+
|
||||
+ private long m_hChat; // must not be renamed as referenced by JNI under the name "m_hChat"
|
||||
+ private native static void MrChatUnref (long hChat);
|
||||
+
|
||||
+
|
||||
+ /* additional functions that are not 1:1 available in the backend
|
||||
+ **********************************************************************************************/
|
||||
+
|
||||
+ public long getCPtr() {
|
||||
+ return m_hChat;
|
||||
+ }
|
||||
+
|
||||
+ public String getNameNAddr()
|
||||
+ {
|
||||
+ // returns name of group chats or name+email-address for normal chats
|
||||
+ String name = "ErrGrpNameNAddr";
|
||||
+ if( isGroup() ) {
|
||||
+ name = getName();
|
||||
+ }
|
||||
+ else {
|
||||
+ int contacts[] = MrMailbox.getChatContacts(getId());
|
||||
+ if( contacts.length==1 ) {
|
||||
+ name = MrMailbox.getContact(contacts[0]).getNameNAddr();
|
||||
+ }
|
||||
+ }
|
||||
+ return name;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/com/b44t/messenger/MrChatlist.java b/src/com/b44t/messenger/MrChatlist.java
|
||||
new file mode 100644
|
||||
index 0000000..c9194e7
|
||||
--- /dev/null
|
||||
+++ b/src/com/b44t/messenger/MrChatlist.java
|
||||
@@ -0,0 +1,64 @@
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * Delta Chat Android
|
||||
+ * (C) 2017 Björn Petersen
|
||||
+ * Contact: r10s@b44t.com, http://b44t.com
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License as published by the Free Software
|
||||
+ * Foundation, either version 3 of the License, or (at your option) any later
|
||||
+ * version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
+ * details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see http://www.gnu.org/licenses/ .
|
||||
+ *
|
||||
+ *******************************************************************************
|
||||
+ *
|
||||
+ * File: MrChatlist.java
|
||||
+ * Purpose: Wrap around mrchatlist_t
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+
|
||||
+package com.b44t.messenger;
|
||||
+
|
||||
+
|
||||
+public class MrChatlist {
|
||||
+ public MrChatlist(long hChatlist) {
|
||||
+ m_hChatlist = hChatlist;
|
||||
+ }
|
||||
+
|
||||
+ @Override protected void finalize() throws Throwable {
|
||||
+ super.finalize();
|
||||
+ MrChatlistUnref(m_hChatlist);
|
||||
+ m_hChatlist = 0;
|
||||
+ }
|
||||
+
|
||||
+ public int getCnt() {
|
||||
+ return MrChatlistGetCnt(m_hChatlist);
|
||||
+ }
|
||||
+
|
||||
+ public MrChat getChatByIndex(int index) {
|
||||
+ return new MrChat(MrChatlistGetChatByIndex(m_hChatlist, index));
|
||||
+ }
|
||||
+
|
||||
+ public MrMsg getMsgByIndex(int index) {
|
||||
+ return new MrMsg(MrChatlistGetMsgByIndex(m_hChatlist, index));
|
||||
+ }
|
||||
+
|
||||
+ public MrLot getSummaryByIndex(int index, MrChat chat) {
|
||||
+ return new MrLot(MrChatlistGetSummaryByIndex(m_hChatlist, index, chat.getCPtr()));
|
||||
+ }
|
||||
+
|
||||
+ private long m_hChatlist;
|
||||
+ private native static void MrChatlistUnref (long hChatlist);
|
||||
+ private native static int MrChatlistGetCnt (long hChatlist);
|
||||
+ private native static long MrChatlistGetChatByIndex (long hChatlist, int index); // returns hChat which must be unref'd after usage
|
||||
+ private native static long MrChatlistGetMsgByIndex (long hChatlist, int index); // returns hMsg which must be unref'd after usage
|
||||
+ private native static long MrChatlistGetSummaryByIndex(long hChatlist, int index, long hChat);
|
||||
+}
|
||||
diff --git a/src/com/b44t/messenger/MrContact.java b/src/com/b44t/messenger/MrContact.java
|
||||
new file mode 100644
|
||||
index 0000000..9ad568b
|
||||
--- /dev/null
|
||||
+++ b/src/com/b44t/messenger/MrContact.java
|
||||
@@ -0,0 +1,57 @@
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * Delta Chat Android
|
||||
+ * (C) 2017 Björn Petersen
|
||||
+ * Contact: r10s@b44t.com, http://b44t.com
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License as published by the Free Software
|
||||
+ * Foundation, either version 3 of the License, or (at your option) any later
|
||||
+ * version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
+ * details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see http://www.gnu.org/licenses/ .
|
||||
+ *
|
||||
+ *******************************************************************************
|
||||
+ *
|
||||
+ * File: MrContact.java
|
||||
+ * Purpose: Wrap around mrcontact_t
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+
|
||||
+package com.b44t.messenger;
|
||||
+
|
||||
+
|
||||
+public class MrContact {
|
||||
+
|
||||
+ public final static int MR_CONTACT_ID_SELF = 1;
|
||||
+ public final static int MR_CONTACT_ID_DEVICE = 2;
|
||||
+ public final static int MR_CONTACT_ID_LAST_SPECIAL = 9;
|
||||
+
|
||||
+ public MrContact(long hContact) {
|
||||
+ m_hContact = hContact;
|
||||
+ }
|
||||
+
|
||||
+ @Override protected void finalize() throws Throwable {
|
||||
+ super.finalize();
|
||||
+ MrContactUnref(m_hContact);
|
||||
+ m_hContact = 0;
|
||||
+ }
|
||||
+
|
||||
+ public native String getName();
|
||||
+ public native String getDisplayName();
|
||||
+ public native String getFirstName();
|
||||
+ public native String getAddr();
|
||||
+ public native String getNameNAddr();
|
||||
+ public native boolean isBlocked();
|
||||
+ public native boolean isVerified();
|
||||
+
|
||||
+ private long m_hContact;
|
||||
+ private native static void MrContactUnref (long hContact);
|
||||
+}
|
||||
diff --git a/src/com/b44t/messenger/MrLot.java b/src/com/b44t/messenger/MrLot.java
|
||||
new file mode 100644
|
||||
index 0000000..1e61f75
|
||||
--- /dev/null
|
||||
+++ b/src/com/b44t/messenger/MrLot.java
|
||||
@@ -0,0 +1,56 @@
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * Delta Chat Android
|
||||
+ * (C) 2017 Björn Petersen
|
||||
+ * Contact: r10s@b44t.com, http://b44t.com
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License as published by the Free Software
|
||||
+ * Foundation, either version 3 of the License, or (at your option) any later
|
||||
+ * version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
+ * details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see http://www.gnu.org/licenses/ .
|
||||
+ *
|
||||
+ *******************************************************************************
|
||||
+ *
|
||||
+ * File: MrLot.java
|
||||
+ * Purpose: Wrap around mrpoortext_t
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+
|
||||
+package com.b44t.messenger;
|
||||
+
|
||||
+
|
||||
+public class MrLot {
|
||||
+
|
||||
+ public final static int MR_TEXT1_DRAFT = 1;
|
||||
+ public final static int MR_TEXT1_USERNAME = 2;
|
||||
+ public final static int MR_TEXT1_SELF = 3;
|
||||
+
|
||||
+ public MrLot(long hLot) {
|
||||
+ m_hLot = hLot;
|
||||
+ }
|
||||
+
|
||||
+ @Override protected void finalize() throws Throwable {
|
||||
+ super.finalize();
|
||||
+ MrLotUnref(m_hLot);
|
||||
+ m_hLot = 0;
|
||||
+ }
|
||||
+
|
||||
+ public native String getText1();
|
||||
+ public native int getText1Meaning();
|
||||
+ public native String getText2();
|
||||
+ public native long getTimestamp();
|
||||
+ public native int getState();
|
||||
+ public native int getId();
|
||||
+
|
||||
+ private long m_hLot;
|
||||
+ private native static void MrLotUnref(long hLot);
|
||||
+}
|
||||
diff --git a/src/com/b44t/messenger/MrMailbox.java b/src/com/b44t/messenger/MrMailbox.java
|
||||
new file mode 100644
|
||||
index 0000000..be11d67
|
||||
--- /dev/null
|
||||
+++ b/src/com/b44t/messenger/MrMailbox.java
|
||||
@@ -0,0 +1,485 @@
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * Delta Chat Android
|
||||
+ * (C) 2017 Björn Petersen
|
||||
+ * Contact: r10s@b44t.com, http://b44t.com
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License as published by the Free Software
|
||||
+ * Foundation, either version 3 of the License, or (at your option) any later
|
||||
+ * version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
+ * details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see http://www.gnu.org/licenses/ .
|
||||
+ *
|
||||
+ *******************************************************************************
|
||||
+ *
|
||||
+ * File: MrMailbox.java
|
||||
+ * Purpose: Wrap around mrmailbox_t
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+
|
||||
+package com.b44t.messenger;
|
||||
+
|
||||
+
|
||||
+import android.app.Activity;
|
||||
+import android.content.SharedPreferences;
|
||||
+import android.util.Log;
|
||||
+
|
||||
+import java.io.BufferedInputStream;
|
||||
+import java.io.BufferedReader;
|
||||
+import java.io.InputStream;
|
||||
+import java.io.InputStreamReader;
|
||||
+import java.net.HttpURLConnection;
|
||||
+import java.net.URL;
|
||||
+
|
||||
+public class MrMailbox {
|
||||
+
|
||||
+ public static void init () {
|
||||
+ m_hMailbox = MrMailboxNew();
|
||||
+ }
|
||||
+
|
||||
+ public native static int open(String dbfile);
|
||||
+ public native static void close();
|
||||
+ public native static String getBlobdir();
|
||||
+
|
||||
+ public native static void configure();
|
||||
+ public native static void stopOngoingProcess();
|
||||
+
|
||||
+ public native static int isConfigured();
|
||||
+
|
||||
+ public native static void performJobs();
|
||||
+ public native static void fetch();
|
||||
+ public native static void idle();
|
||||
+ public native static void interruptIdle();
|
||||
+
|
||||
+ public native static void performSmtpJobs();
|
||||
+ public native static void performSmtpIdle();
|
||||
+ public native static void interruptSmtpIdle();
|
||||
+
|
||||
+ public native static void setConfig(String key, String value);
|
||||
+ public native static void setConfigInt(String key, int value);
|
||||
+ public native static String getConfig(String key, String def);
|
||||
+ public native static int getConfigInt(String key, int def);
|
||||
+
|
||||
+ public native static String getInfo();
|
||||
+ public native static String cmdline(String cmd);
|
||||
+
|
||||
+ public native static String initiateKeyTransfer();
|
||||
+ public native static boolean continueKeyTransfer(int msg_id, String setup_code);
|
||||
+ public final static int MR_IMEX_EXPORT_SELF_KEYS = 1;
|
||||
+ public final static int MR_IMEX_IMPORT_SELF_KEYS = 2;
|
||||
+ public final static int MR_IMEX_EXPORT_BACKUP = 11;
|
||||
+ public final static int MR_IMEX_IMPORT_BACKUP = 12;
|
||||
+ public native static void imex(int what, String dir);
|
||||
+ public native static String imexHasBackup(String dir);
|
||||
+ public native static int checkPassword(String pw);
|
||||
+
|
||||
+ private static long m_hMailbox = 0; // do not rename this, is used in C-part
|
||||
+ private native static long MrMailboxNew(); // returns hMailbox which must be unref'd after usage (Names as mrmailbox_new don't work due to the additional underscore)
|
||||
+
|
||||
+ // contacts
|
||||
+ public final static int MR_GCL_VERIFIED_ONLY = 1;
|
||||
+ public final static int MR_GCL_ADD_SELF = 2;
|
||||
+ public native static int[] getContacts(int flags, String query);
|
||||
+ public native static int getBlockedCount();
|
||||
+ public native static int[] getBlockedContacts();
|
||||
+
|
||||
+ public static MrContact getContact(int contact_id) {
|
||||
+ return new MrContact(MrMailboxGetContact(m_hMailbox, contact_id));
|
||||
+ }
|
||||
+
|
||||
+ public static int createContact(String name, String addr) {
|
||||
+ return MrMailboxCreateContact(m_hMailbox, name, addr);
|
||||
+ }
|
||||
+
|
||||
+ public static void blockContact(int id, int block) {
|
||||
+ MrMailboxBlockContact(m_hMailbox, id, block);
|
||||
+ }
|
||||
+
|
||||
+ public native static String getContactEncrInfo(int contact_id);
|
||||
+
|
||||
+ public static int deleteContact(int id) {
|
||||
+ return MrMailboxDeleteContact(m_hMailbox, id);
|
||||
+ }
|
||||
+
|
||||
+ public static int addAddressBook(String adrbook) {
|
||||
+ return MrMailboxAddAddressBook(m_hMailbox, adrbook);
|
||||
+ }
|
||||
+
|
||||
+ private native static long MrMailboxGetContact (long hMailbox, int id);// returns hContact which must be unref'd after usage
|
||||
+ private native static int MrMailboxCreateContact (long hMailbox, String name, String addr);
|
||||
+ private native static void MrMailboxBlockContact (long hMailbox, int id, int block);
|
||||
+ private native static int MrMailboxDeleteContact (long hMailbox, int id); // returns 0 if the contact could not be deleted (eg. it is in use, maybe by deaddrop)
|
||||
+ private native static int MrMailboxAddAddressBook (long hMailbox, String adrbook);
|
||||
+
|
||||
+
|
||||
+ // chats
|
||||
+ public final static int MR_GCL_ARCHIVED_ONLY = 0x01;
|
||||
+ public final static int MR_GCL_NO_SPECIALS = 0x02;
|
||||
+ public static MrChatlist getChatlist(int listflags, String query, int queryId) {
|
||||
+ return new MrChatlist(MrMailboxGetChatlist(m_hMailbox, listflags, query, queryId));
|
||||
+ }
|
||||
+
|
||||
+ public static MrChat getChat(int chat_id) {
|
||||
+ return new MrChat(MrMailboxGetChat(m_hMailbox, chat_id));
|
||||
+ }
|
||||
+
|
||||
+ public native static void markseenMsgs (int msg_ids[]);
|
||||
+ public native static void marknoticedChat (int chat_id);
|
||||
+ public native static void marknoticedContact (int contact_id);
|
||||
+ public native static void archiveChat (int chat_id, int archive);
|
||||
+
|
||||
+ public native static int getChatIdByContactId (int contact_id);
|
||||
+ public native static int createChatByContactId(int contact_id);
|
||||
+ public native static int createChatByMsgId (int msg_id);
|
||||
+
|
||||
+ public native static int createGroupChat (boolean verified, String name);
|
||||
+ public native static int isContactInChat (int chat_id, int contact_id);
|
||||
+ public native static int addContactToChat (int chat_id, int contact_id);
|
||||
+ public native static int removeContactFromChat (int chat_id, int contact_id);
|
||||
+ public native static void setDraft (int chat_id, String draft/*NULL=delete*/);
|
||||
+ public native static int setChatName (int chat_id, String name);
|
||||
+ public native static int setChatProfileImage (int chat_id, String name);
|
||||
+
|
||||
+ public final static int MR_GCM_ADDDAYMARKER = 0x01;
|
||||
+ public native static int[] getChatMsgs(int chat_id, int flags, int marker1before);
|
||||
+
|
||||
+ public native static int[] searchMsgs(int chat_id, String query);
|
||||
+
|
||||
+ public native static int[] getFreshMsgs();
|
||||
+
|
||||
+ public native static int[] getChatMedia(int chat_id, int msg_type, int or_msg_type);
|
||||
+ public native static int getNextMedia(int msg_id, int dir);
|
||||
+ public native static int[] getChatContacts(int chat_id);
|
||||
+ public native static void deleteChat(int chat_id);
|
||||
+
|
||||
+ private native static long MrMailboxGetChatlist (long hMailbox, int listflags, String query, int queryId); // returns hChatlist which must be unref'd after usage
|
||||
+ private native static long MrMailboxGetChat (long hMailbox, int chat_id); // return hChat which must be unref'd after usage
|
||||
+
|
||||
+
|
||||
+ // msgs
|
||||
+ public static MrMsg getMsg(int msg_id) {
|
||||
+ return new MrMsg(MrMailboxGetMsg(m_hMailbox, msg_id));
|
||||
+ }
|
||||
+
|
||||
+ public static String getMsgInfo(int id) {
|
||||
+ return MrMailboxGetMsgInfo(m_hMailbox, id);
|
||||
+ }
|
||||
+
|
||||
+ public static native int getFreshMsgCount(int chat_id);
|
||||
+
|
||||
+ public native static void deleteMsgs(int msg_ids[]);
|
||||
+ public native static void forwardMsgs(int msg_ids[], int chat_ids);
|
||||
+
|
||||
+ public native static int sendTextMsg(int chat_id, String text);
|
||||
+ public native static int sendVcardMsg(int chat_id, int contact_id);
|
||||
+ public native static int sendMediaMsg(int chat_id, int type, String file, String mime, int w, int h, int time_ms, String author, String trackname);
|
||||
+
|
||||
+ private native static long MrMailboxGetMsg (long hMailbox, int id); // return hMsg which must be unref'd after usage
|
||||
+ private native static String MrMailboxGetMsgInfo (long hMailbox, int id);
|
||||
+
|
||||
+ // out-of-band verification
|
||||
+ public final static int MR_QR_ASK_VERIFYCONTACT = 200;
|
||||
+ public final static int MR_QR_ASK_VERIFYGROUP = 202;
|
||||
+ public final static int MR_QR_FPR_OK = 210;
|
||||
+ public final static int MR_QR_FPR_MISMATCH = 220;
|
||||
+ public final static int MR_QR_FPR_WITHOUT_ADDR = 230;
|
||||
+ public final static int MR_QR_ADDR = 320;
|
||||
+ public final static int MR_QR_TEXT = 330;
|
||||
+ public final static int MR_QR_URL = 332;
|
||||
+ public final static int MR_QR_ERROR = 400;
|
||||
+ public native static int checkQrCPtr(String qr);
|
||||
+ public static MrLot checkQr(String qr) { return new MrLot(checkQrCPtr(qr)); }
|
||||
+
|
||||
+ public native static String getSecurejoinQr(int chat_id);
|
||||
+ public native static int joinSecurejoin(String qr);
|
||||
+
|
||||
+ // static
|
||||
+ public native static String MrGetVersionStr ();
|
||||
+ public native static String CPtr2String (long hString); // get strings eg. from data1 from the callback
|
||||
+ public native static long String2CPtr (String str);
|
||||
+
|
||||
+ /* receive events
|
||||
+ **********************************************************************************************/
|
||||
+
|
||||
+ public final static int MR_EVENT_INFO = 100;
|
||||
+ public final static int MR_EVENT_WARNING = 300;
|
||||
+ public final static int MR_EVENT_ERROR = 400; // INFO and WARNING are blocked in the mrwrapper.c
|
||||
+
|
||||
+ public final static int MR_EVENT_MSGS_CHANGED = 2000;
|
||||
+ public final static int MR_EVENT_INCOMING_MSG = 2005;
|
||||
+ public final static int MR_EVENT_MSG_DELIVERED = 2010;
|
||||
+ public final static int DC_EVENT_MSG_FAILED = 2012;
|
||||
+ public final static int MR_EVENT_MSG_READ = 2015;
|
||||
+
|
||||
+ public final static int MR_EVENT_CHAT_MODIFIED = 2020;
|
||||
+
|
||||
+ public final static int MR_EVENT_CONTACTS_CHANGED = 2030;
|
||||
+
|
||||
+ public final static int MR_EVENT_CONFIGURE_PROGRESS = 2041;
|
||||
+
|
||||
+ public final static int MR_EVENT_IMEX_PROGRESS = 2051;
|
||||
+ public final static int MR_EVENT_IMEX_FILE_WRITTEN = 2052;
|
||||
+
|
||||
+ public final static int MR_EVENT_SECUREJOIN_INVITER_PROGRESS = 2060;
|
||||
+ public final static int MR_EVENT_SECUREJOIN_JOINER_PROGRESS = 2061;
|
||||
+
|
||||
+ public final static int MR_EVENT_IS_OFFLINE = 2081;
|
||||
+ public final static int MR_EVENT_GET_STRING = 2091;
|
||||
+ public final static int MR_EVENT_GET_QUANTITIY_STRING = 2092;
|
||||
+ public final static int MR_EVENT_HTTP_GET = 2100;
|
||||
+
|
||||
+ public static final Object m_lastErrorLock = new Object();
|
||||
+ public static int m_lastErrorCode = 0;
|
||||
+ public static String m_lastErrorString = "";
|
||||
+ public static boolean m_showNextErrorAsToast = true;
|
||||
+
|
||||
+ public static long MrCallback(final int event, final long data1, final long data2) // this function is called from within the C-wrapper
|
||||
+ {
|
||||
+ switch(event) {
|
||||
+ case MR_EVENT_CONFIGURE_PROGRESS:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ if( data1 == 0 || data1 == 1000 ) {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.configureEnded, (int)data1);
|
||||
+ }
|
||||
+ else {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.configureProgress, (int)data1);
|
||||
+ }
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_IMEX_PROGRESS:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ if (data1==0 || data1==1000) {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.imexEnded, (int) data1);
|
||||
+ }
|
||||
+ else {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.imexProgress, (int) data1);
|
||||
+ }
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_IMEX_FILE_WRITTEN: {
|
||||
+ /*final String fileName = CPtr2String(data1);
|
||||
+ AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.imexFileWritten, fileName);
|
||||
+ }
|
||||
+ });*/
|
||||
+ }
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_SECUREJOIN_INVITER_PROGRESS:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.secureJoinInviterProgress, (int)data1, (int)data2);
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_SECUREJOIN_JOINER_PROGRESS:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.secureJoinJoinerProgress, (int)data1, (int)data2);
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_MSGS_CHANGED:
|
||||
+ case MR_EVENT_INCOMING_MSG:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload, event, (int)data1, (int)data2);
|
||||
+ if( event == MR_EVENT_INCOMING_MSG ) {
|
||||
+ NotificationsController.getInstance().processNewMessages((int)data1, (int)data2);
|
||||
+ }
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_MSG_DELIVERED:
|
||||
+ case MR_EVENT_MSG_READ:
|
||||
+ case DC_EVENT_MSG_FAILED:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.messagesSentOrRead, event, (int)data1, (int)data2);
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_CONTACTS_CHANGED:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.contactsDidLoaded, (int)data1);
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.blockedUsersDidLoaded);
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_CHAT_MODIFIED:
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
+ NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces,
|
||||
+ UPDATE_MASK_NAME|UPDATE_MASK_CHAT_NAME|
|
||||
+ UPDATE_MASK_CHAT_MEMBERS|UPDATE_MASK_AVATAR);
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_INFO:
|
||||
+ Log.i("DeltaChat", CPtr2String(data2));
|
||||
+ break;
|
||||
+
|
||||
+ case MR_EVENT_WARNING:
|
||||
+ Log.w("DeltaChat", CPtr2String(data2));
|
||||
+ break;
|
||||
+
|
||||
+ case MR_EVENT_ERROR:
|
||||
+ Log.e("DeltaChat", CPtr2String(data2));
|
||||
+ synchronized (m_lastErrorLock) {
|
||||
+ m_lastErrorCode = (int)data1;
|
||||
+ m_lastErrorString = CPtr2String(data2);
|
||||
+ }
|
||||
+ /*AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ synchronized (m_lastErrorLock) {
|
||||
+ if( m_showNextErrorAsToast ) {
|
||||
+ if(ForegroundDetector.getInstance().isForeground()) {
|
||||
+ AndroidUtilities.showHint(ApplicationLoader.applicationContext, m_lastErrorString);
|
||||
+ }
|
||||
+ }
|
||||
+ m_showNextErrorAsToast = true;
|
||||
+ }
|
||||
+ }
|
||||
+ });*/
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_GET_STRING:
|
||||
+ /*String s;
|
||||
+ switch( (int)data1 ) {
|
||||
+ // the string-IDs are defined in the backend; as this is the only place where they're used, there is no benefit in creating an enum or sth. like that.
|
||||
+ case 1: s = ApplicationLoader.applicationContext.getString(R.string.NoMessages); break;
|
||||
+ case 2: s = ApplicationLoader.applicationContext.getString(R.string.FromSelf); break;
|
||||
+ case 3: s = ApplicationLoader.applicationContext.getString(R.string.Draft); break;
|
||||
+ case 7: s = ApplicationLoader.applicationContext.getString(R.string.AttachVoiceMessage); break;
|
||||
+ case 8: s = ApplicationLoader.applicationContext.getString(R.string.Deaddrop); break;
|
||||
+ case 9: s = ApplicationLoader.applicationContext.getString(R.string.AttachPhoto); break;
|
||||
+ case 10: s = ApplicationLoader.applicationContext.getString(R.string.AttachVideo); break;
|
||||
+ case 11: s = ApplicationLoader.applicationContext.getString(R.string.Audio); break;
|
||||
+ case 12: s = ApplicationLoader.applicationContext.getString(R.string.AttachDocument); break;
|
||||
+ case 13: s = ApplicationLoader.applicationContext.getString(R.string.DefaultStatusText); break;
|
||||
+ case 14: s = ApplicationLoader.applicationContext.getString(R.string.MsgNewGroupDraft); break;
|
||||
+ case 15: s = ApplicationLoader.applicationContext.getString(R.string.MsgGroupNameChanged); break;
|
||||
+ case 16: s = ApplicationLoader.applicationContext.getString(R.string.MsgGroupImageChanged); break;
|
||||
+ case 17: s = ApplicationLoader.applicationContext.getString(R.string.MsgMemberAddedToGroup); break;
|
||||
+ case 18: s = ApplicationLoader.applicationContext.getString(R.string.MsgMemberRemovedFromToGroup); break;
|
||||
+ case 19: s = ApplicationLoader.applicationContext.getString(R.string.MsgGroupLeft); break;
|
||||
+ case 20: s = ApplicationLoader.applicationContext.getString(R.string.Error); break;
|
||||
+ case 21: s = ApplicationLoader.applicationContext.getString(R.string.ErrSelfNotInGroup); break;
|
||||
+ case 22: s = ApplicationLoader.applicationContext.getString(R.string.NoNetwork); break;
|
||||
+ case 23: s = ApplicationLoader.applicationContext.getString(R.string.AttachGif); break;
|
||||
+ case 24: s = ApplicationLoader.applicationContext.getString(R.string.EncryptedMessage); break;
|
||||
+ case 25: s = ApplicationLoader.applicationContext.getString(R.string.EncrinfoE2EAvailable); break;
|
||||
+ case 27: s = ApplicationLoader.applicationContext.getString(R.string.EncrinfoTransport); break;
|
||||
+ case 28: s = ApplicationLoader.applicationContext.getString(R.string.EncrinfoNone); break;
|
||||
+ case 29: s = ApplicationLoader.applicationContext.getString(R.string.CannotDecryptBody); break;
|
||||
+ case 30: s = ApplicationLoader.applicationContext.getString(R.string.EncrinfoFingerprints); break;
|
||||
+ case 31: s = ApplicationLoader.applicationContext.getString(R.string.ReadReceipt); break;
|
||||
+ case 32: s = ApplicationLoader.applicationContext.getString(R.string.ReadReceiptMailBody); break;
|
||||
+ case 33: s = ApplicationLoader.applicationContext.getString(R.string.MsgGroupImageDeleted); break;
|
||||
+ case 34: s = ApplicationLoader.applicationContext.getString(R.string.E2EEncryptionPreferred); break;
|
||||
+ case 40: s = ApplicationLoader.applicationContext.getString(R.string.ArchivedChats); break;
|
||||
+ case 42: s = ApplicationLoader.applicationContext.getString(R.string.AutocryptSetupMessageSubject); break;
|
||||
+ case 43: s = ApplicationLoader.applicationContext.getString(R.string.AutocryptSetupMessageGeneralBody); break;
|
||||
+ case 50: s = ApplicationLoader.applicationContext.getString(R.string.SelfTalkSubtitle); break;
|
||||
+ case 60: s = ApplicationLoader.applicationContext.getString(R.string.ErrCannotLogin); break;
|
||||
+ case 61: s = "<c#808080>" + ApplicationLoader.applicationContext.getString(R.string.ErrSeverResponse) + "</c>"; break;
|
||||
+ default: s = null; break;
|
||||
+ }
|
||||
+ return String2CPtr(s);
|
||||
+ */
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_GET_QUANTITIY_STRING:
|
||||
+ /*String sp = "ErrQtyStrBadId";
|
||||
+ switch( (int)data1 ) {
|
||||
+ // the string-IDs are defined in the backend; as this is the only place where they're used, there is no benefit in creating an enum or sth. like that.
|
||||
+ case 4: sp = ApplicationLoader.applicationContext.getResources().getQuantityString(R.plurals.Members, (int)data2, (int)data2); break;
|
||||
+ case 6: sp = ApplicationLoader.applicationContext.getResources().getQuantityString(R.plurals.Contacts, (int)data2, (int)data2); break;
|
||||
+ }
|
||||
+ return String2CPtr(sp);
|
||||
+ */
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_IS_OFFLINE:
|
||||
+ //return ApplicationLoader.isNetworkOnline()? 0 : 1;
|
||||
+ return 0;
|
||||
+
|
||||
+ case MR_EVENT_HTTP_GET:
|
||||
+ String httpContent = null;
|
||||
+ try {
|
||||
+ URL url = new URL(CPtr2String(data1));
|
||||
+ HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
||||
+ try {
|
||||
+ urlConnection.setConnectTimeout(10*1000);
|
||||
+ InputStream inputStream = new BufferedInputStream(urlConnection.getInputStream());
|
||||
+
|
||||
+ BufferedReader r = new BufferedReader(new InputStreamReader(inputStream));
|
||||
+
|
||||
+ StringBuilder total = new StringBuilder();
|
||||
+ String line;
|
||||
+ while ((line = r.readLine()) != null) {
|
||||
+ total.append(line).append('\n');
|
||||
+ }
|
||||
+ httpContent = total.toString();
|
||||
+ } finally {
|
||||
+ urlConnection.disconnect();
|
||||
+ }
|
||||
+ }
|
||||
+ catch(Exception e) {
|
||||
+ e.printStackTrace();
|
||||
+ }
|
||||
+ return String2CPtr(httpContent);
|
||||
+ }
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ /* additional functions that are not 1:1 available in the backend
|
||||
+ **********************************************************************************************/
|
||||
+
|
||||
+ public static void log_i(String tag, String msg)
|
||||
+ {
|
||||
+ Log.i(tag, msg);
|
||||
+ }
|
||||
+
|
||||
+ public native static int getCurrentTime ();
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+}
|
||||
diff --git a/src/com/b44t/messenger/MrMsg.java b/src/com/b44t/messenger/MrMsg.java
|
||||
new file mode 100644
|
||||
index 0000000..52a8ed2
|
||||
--- /dev/null
|
||||
+++ b/src/com/b44t/messenger/MrMsg.java
|
||||
@@ -0,0 +1,102 @@
|
||||
+/*******************************************************************************
|
||||
+ *
|
||||
+ * Delta Chat Android
|
||||
+ * (C) 2017 Björn Petersen
|
||||
+ * Contact: r10s@b44t.com, http://b44t.com
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License as published by the Free Software
|
||||
+ * Foundation, either version 3 of the License, or (at your option) any later
|
||||
+ * version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
+ * details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program. If not, see http://www.gnu.org/licenses/ .
|
||||
+ *
|
||||
+ *******************************************************************************
|
||||
+ *
|
||||
+ * File: MrMsg.java
|
||||
+ * Purpose: Wrap around mrmsg_t
|
||||
+ *
|
||||
+ ******************************************************************************/
|
||||
+
|
||||
+
|
||||
+package com.b44t.messenger;
|
||||
+
|
||||
+import android.graphics.Bitmap;
|
||||
+import android.media.ThumbnailUtils;
|
||||
+import android.provider.MediaStore;
|
||||
+
|
||||
+import java.io.File;
|
||||
+
|
||||
+public class MrMsg {
|
||||
+
|
||||
+ private static final String TAG = "MrMsg";
|
||||
+
|
||||
+ public final static int MR_MSG_UNDEFINED = 0;
|
||||
+ public final static int MR_MSG_TEXT = 10;
|
||||
+ public final static int MR_MSG_IMAGE = 20;
|
||||
+ public final static int MR_MSG_GIF = 21;
|
||||
+ public final static int MR_MSG_AUDIO = 40;
|
||||
+ public final static int MR_MSG_VOICE = 41;
|
||||
+ public final static int MR_MSG_VIDEO = 50;
|
||||
+ public final static int MR_MSG_FILE = 60;
|
||||
+
|
||||
+ public final static int MR_STATE_UNDEFINED = 0;
|
||||
+ public final static int MR_IN_FRESH = 10;
|
||||
+ public final static int MR_IN_NOTICED = 13;
|
||||
+ public final static int MR_OUT_PENDING = 20;
|
||||
+ public final static int MR_OUT_ERROR = 24;
|
||||
+ public final static int MR_OUT_DELIVERED = 26;
|
||||
+ public final static int MR_OUT_MDN_RCVD = 28;
|
||||
+
|
||||
+ public final static int MR_MSG_ID_MARKER1 = 1;
|
||||
+ public final static int MR_MSG_ID_DAYMARKER = 9;
|
||||
+
|
||||
+ public MrMsg(long hMsg) {
|
||||
+ m_hMsg = hMsg;
|
||||
+ }
|
||||
+
|
||||
+ @Override protected void finalize() throws Throwable {
|
||||
+ super.finalize();
|
||||
+ MrMsgUnref(m_hMsg);
|
||||
+ m_hMsg = 0;
|
||||
+ }
|
||||
+
|
||||
+ public native int getId();
|
||||
+ public native String getText();
|
||||
+ public native long getTimestamp();
|
||||
+ public native int getType();
|
||||
+ public native int getState();
|
||||
+ public native int getChatId();
|
||||
+ public native int getFromId();
|
||||
+
|
||||
+ public native int getWidth(int def);
|
||||
+ public native int getHeight(int def);
|
||||
+ public native int getDuration();
|
||||
+ public native void lateFilingMediaSize(int width, int height, int duration);
|
||||
+
|
||||
+ public native int getBytes();
|
||||
+ public MrLot getSummary(MrChat chat) { return new MrLot(getSummaryCPtr(chat.getCPtr())); }
|
||||
+ private native long getSummaryCPtr(long hChat);
|
||||
+ public native String getSummarytext(int approx_characters);
|
||||
+ public native int showPadlock();
|
||||
+ public MrLot getMediainfo() { return new MrLot(getMediainfoCPtr()); }
|
||||
+ private native long getMediainfoCPtr();
|
||||
+ public native String getFile();
|
||||
+ public native String getFilemime();
|
||||
+ public native String getFilename();
|
||||
+ public native boolean isForwarded();
|
||||
+ public native boolean isInfo();
|
||||
+ public native boolean isSetupMessage();
|
||||
+ public native String getSetupCodeBegin();
|
||||
+ public native boolean isIncreation();
|
||||
+
|
||||
+ private long m_hMsg; // must not be renamed as referenced by JNI under the name "m_hMsg"
|
||||
+ private native static void MrMsgUnref (long hMsg);
|
||||
+
|
||||
+};
|
||||
--
|
||||
2.8.2
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
From 60d175313bdadedeb331923dde3b5c10bbf582ae Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <60d175313bdadedeb331923dde3b5c10bbf582ae.1534410135.git.daniel.boehrs@open-xchange.com>
|
||||
In-Reply-To: <371694c11a8b1192ef5230b98af3a5719add98ef.1534410134.git.daniel.boehrs@open-xchange.com>
|
||||
References: <371694c11a8b1192ef5230b98af3a5719add98ef.1534410134.git.daniel.boehrs@open-xchange.com>
|
||||
From: "B. Petersen" <r10s@b44t.com>
|
||||
Date: Fri, 27 Jul 2018 17:13:16 +0200
|
||||
Subject: [PATCH 6/6] initialize the java-bindings, all functions should be
|
||||
callable now :)
|
||||
|
||||
---
|
||||
src/org/thoughtcrime/securesms/ApplicationContext.java | 6 ++++++
|
||||
src/org/thoughtcrime/securesms/util/FileUtils.java | 4 ----
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/org/thoughtcrime/securesms/ApplicationContext.java b/src/org/thoughtcrime/securesms/ApplicationContext.java
|
||||
index f49cba5..fa22338 100644
|
||||
--- a/src/org/thoughtcrime/securesms/ApplicationContext.java
|
||||
+++ b/src/org/thoughtcrime/securesms/ApplicationContext.java
|
||||
@@ -27,6 +27,7 @@ import android.support.annotation.NonNull;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
import android.util.Log;
|
||||
|
||||
+import com.b44t.messenger.MrMailbox;
|
||||
import com.google.android.gms.security.ProviderInstaller;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.PRNGFixes;
|
||||
@@ -88,6 +89,11 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
+
|
||||
+ System.loadLibrary("native-utils");
|
||||
+ MrMailbox.MrCallback(0, 0, 0); // do not remove this call; this makes sure, the function is not removed from build or warnings are printed!
|
||||
+ MrMailbox.init();
|
||||
+
|
||||
initializeRandomNumberFix();
|
||||
initializeLogging();
|
||||
initializeDependencyInjection();
|
||||
diff --git a/src/org/thoughtcrime/securesms/util/FileUtils.java b/src/org/thoughtcrime/securesms/util/FileUtils.java
|
||||
index e437edd..8927af6 100644
|
||||
--- a/src/org/thoughtcrime/securesms/util/FileUtils.java
|
||||
+++ b/src/org/thoughtcrime/securesms/util/FileUtils.java
|
||||
@@ -9,10 +9,6 @@ import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class FileUtils {
|
||||
|
||||
- static {
|
||||
- System.loadLibrary("native-utils");
|
||||
- }
|
||||
-
|
||||
public static native int getFileDescriptorOwner(FileDescriptor fileDescriptor);
|
||||
|
||||
public static byte[] getFileDigest(FileInputStream fin) throws IOException {
|
||||
--
|
||||
2.8.2
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
-keepattributes *Annotation*,EnclosingMethod
|
||||
-keep @interface dagger.*,javax.inject.*
|
||||
-keep @dagger.Module class *
|
||||
-keepclassmembers class * {
|
||||
@javax.inject.* *;
|
||||
@dagger.* *;
|
||||
<init>();
|
||||
}
|
||||
-keepclasseswithmembernames class * {
|
||||
@javax.inject.* <fields>;
|
||||
}
|
||||
-keep class javax.inject.** { *; }
|
||||
-keep class **$$ModuleAdapter
|
||||
-keep class **$$InjectAdapter
|
||||
-keep class **$$StaticInjection
|
||||
|
||||
-keep class dagger.** { *; }
|
||||
-keep class * extends dagger.** { *; }
|
||||
-keep interface dagger.** {*;}
|
||||
-dontwarn dagger.internal.codegen.**
|
||||
@@ -1 +0,0 @@
|
||||
-dontwarn ezvcard.io.html.HCardPage
|
||||
@@ -1,3 +0,0 @@
|
||||
-dontwarn android.net.ConnectivityManager
|
||||
-dontwarn android.net.ConnectivityManager$NetworkCallback
|
||||
-dontwarn org.webrtc.NetworkMonitorAutoDetect$ConnectivityManagerDelegate
|
||||
@@ -1,3 +0,0 @@
|
||||
-dontwarn okio.**
|
||||
-dontwarn javax.annotation.Nullable
|
||||
-dontwarn javax.annotation.ParametersAreNonnullByDefault
|
||||
@@ -1,26 +0,0 @@
|
||||
-keep class org.spongycastle.crypto.* {*;}
|
||||
-keep class org.spongycastle.crypto.agreement.** {*;}
|
||||
-keep class org.spongycastle.crypto.digests.* {*;}
|
||||
-keep class org.spongycastle.crypto.ec.* {*;}
|
||||
-keep class org.spongycastle.crypto.encodings.* {*;}
|
||||
-keep class org.spongycastle.crypto.engines.* {*;}
|
||||
-keep class org.spongycastle.crypto.macs.* {*;}
|
||||
-keep class org.spongycastle.crypto.modes.* {*;}
|
||||
-keep class org.spongycastle.crypto.paddings.* {*;}
|
||||
-keep class org.spongycastle.crypto.params.* {*;}
|
||||
-keep class org.spongycastle.crypto.prng.* {*;}
|
||||
-keep class org.spongycastle.crypto.signers.* {*;}
|
||||
|
||||
-keep class org.spongycastle.jcajce.provider.asymmetric.* {*;}
|
||||
-keep class org.spongycastle.jcajce.provider.asymmetric.util.* {*;}
|
||||
-keep class org.spongycastle.jcajce.provider.asymmetric.dh.* {*;}
|
||||
-keep class org.spongycastle.jcajce.provider.asymmetric.ec.* {*;}
|
||||
|
||||
-keep class org.spongycastle.jcajce.provider.digest.** {*;}
|
||||
-keep class org.spongycastle.jcajce.provider.keystore.** {*;}
|
||||
-keep class org.spongycastle.jcajce.provider.symmetric.** {*;}
|
||||
-keep class org.spongycastle.jcajce.spec.* {*;}
|
||||
-keep class org.spongycastle.jce.** {*;}
|
||||
|
||||
|
||||
-dontwarn javax.naming.**
|
||||
@@ -1,5 +0,0 @@
|
||||
-keep class org.sqlite.** { *; }
|
||||
-keep class org.sqlite.database.** { *; }
|
||||
|
||||
-keep class net.sqlcipher.** { *; }
|
||||
-dontwarn net.sqlcipher.**
|
||||
@@ -1,6 +0,0 @@
|
||||
# OkHttp
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
-keep class com.squareup.okhttp.** { *; }
|
||||
-keep interface com.squareup.okhttp.** { *; }
|
||||
-dontwarn com.squareup.okhttp.**
|
||||
@@ -1,5 +0,0 @@
|
||||
# Okio
|
||||
-keep class sun.misc.Unsafe { *; }
|
||||
-dontwarn java.nio.file.*
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
||||
-dontwarn okio.**
|
||||
@@ -1,3 +0,0 @@
|
||||
-dontwarn org.webrtc.NetworkMonitorAutoDetect
|
||||
-dontwarn android.net.Network
|
||||
-keep class org.webrtc.** { *; }
|
||||
|
Before Width: | Height: | Size: 656 B |
|
Before Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 297 B |
|
Before Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 178 B |
|
Before Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 484 B |
|
Before Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 307 B |
|
Before Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 553 B |
|
Before Width: | Height: | Size: 284 B |
|
Before Width: | Height: | Size: 311 B |
|
Before Width: | Height: | Size: 309 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 276 B |
|
Before Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 448 B |
|
Before Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 568 B |
|
Before Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 483 B |
|
Before Width: | Height: | Size: 656 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 540 B |
|
Before Width: | Height: | Size: 876 B |
|
Before Width: | Height: | Size: 664 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 354 B |
|
Before Width: | Height: | Size: 188 B |
|
Before Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 457 B |
|
Before Width: | Height: | Size: 571 B |
|
Before Width: | Height: | Size: 509 B |
|
Before Width: | Height: | Size: 397 B |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 195 B |
|
Before Width: | Height: | Size: 265 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 555 B |
|
Before Width: | Height: | Size: 814 B |
|
Before Width: | Height: | Size: 173 B |
|
Before Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 366 B |
|
Before Width: | Height: | Size: 560 B |
|
Before Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 365 B |
|
Before Width: | Height: | Size: 721 B |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 635 B |