Compare commits

...

157 Commits

Author SHA1 Message Date
B. Petersen 756f36101f note that the heuristic part is not yet implemented 2018-12-20 17:28:33 +01:00
B. Petersen b46bc99aad add mvbox options, remove forcing e2ee 2018-12-20 17:19:50 +01:00
B. Petersen d593096d92 show version number more visible 2018-12-20 16:36:06 +01:00
B. Petersen 354fea7da2 Update messenger-backend submodule. 2018-12-20 16:13:03 +01:00
B. Petersen 9f6a26713c Update messenger-backend submodule. 2018-12-20 02:20:47 +01:00
B. Petersen fe89841407 bump version 2018-12-20 02:20:33 +01:00
B. Petersen 698763c544 Update messenger-backend submodule. 2018-12-20 01:44:35 +01:00
B. Petersen 8f540d01fa add dc_move.c 2018-12-20 01:44:20 +01:00
B. Petersen 4d12385cb7 update translations 2018-12-20 00:19:04 +01:00
B. Petersen 7962e880ef update translations 2018-12-19 02:49:36 +01:00
B. Petersen d752a111fc update translations 2018-12-18 21:32:52 +01:00
björn petersen 5e8c20e30f Merge pull request #178 from adbenitez/master
fixed qrshow_join_contact_hint on strings.xml
2018-12-18 21:18:55 +01:00
Asiel Díaz Benítez a70b1be603 fixed qrshow_join_contact_hint on strings.xml 2018-12-18 14:48:38 -05:00
B. Petersen 3bde0cbe78 Update messenger-backend submodule. 2018-12-18 00:24:22 +01:00
B. Petersen 6544b221fd bump version 2018-12-17 23:41:42 +01:00
B. Petersen 40675fa774 remove SIGNAL_* buildConfigField's 2018-12-17 23:41:22 +01:00
B. Petersen 60d79021bf Update messenger-backend submodule. 2018-12-17 23:33:10 +01:00
B. Petersen 7cda8c0101 update translations 2018-12-17 20:14:09 +01:00
B. Petersen 7bafff0ba7 Update messenger-backend submodule. 2018-12-17 20:12:42 +01:00
B. Petersen 5529acf36b remove language_name string resource, closes #177 2018-12-17 20:02:41 +01:00
björn petersen 0f6d5e3dcd Merge pull request #174 from deltachat/happyuser
adapt to new mvbox api
2018-12-17 16:55:02 +01:00
B. Petersen 71f4a55a0d Update messenger-backend submodule. 2018-12-17 16:53:43 +01:00
B. Petersen 75dc1e1527 adapt to new mvbox api 2018-12-17 16:28:35 +01:00
björn petersen e663df903e Merge pull request #176 from adbenitez/master
Fixed ask_block_contact and ask_unblock_contact
2018-12-17 16:27:52 +01:00
Asiel Díaz Benítez f1513f7e47 Fixed ask_block_contact and ask_unblock_contact
Just removed the "calls" stuff and fixed some previous accidental removal while trying to fix this same issue.
2018-12-17 09:52:31 -05:00
Florian Haar fd36ceb847 right align lock/time/deliveryInfo in images #99 fix 2018-12-17 14:51:28 +01:00
B. Petersen 6fde63f0b2 wording, tackles #74 2018-12-17 14:06:07 +01:00
Florian Haar ed6fabe99f Merge branch 'master' of https://github.com/deltachat/deltachat-android-ii 2018-12-17 14:02:13 +01:00
Florian Haar 1876e56e23 right align lock/time/deliveryInfo in images #99 2018-12-17 14:00:41 +01:00
daniel.boehrs 3122759c91 Fixed transitions #147 2018-12-17 13:13:50 +01:00
daniel.boehrs 19f5a54ad2 Merge branch 'master' of https://github.com/deltachat/deltachat-android-ii 2018-12-17 11:29:28 +01:00
daniel.boehrs 1c6b7fe58f share with Delta #147 #74 2018-12-17 11:29:18 +01:00
Florian Haar 880421fd6f Status Text in Settings can not be empty #156 2018-12-17 10:35:36 +01:00
daniel.boehrs a73a7b28de HOTIFX Fix broken build due to HTML tags inside translation file 2018-12-17 10:10:12 +01:00
B. Petersen bd8217196f update translations 2018-12-16 21:48:48 +01:00
B. Petersen 54140476bf update translations 2018-12-16 21:47:52 +01:00
B. Petersen 78fa449e99 add italian language 2018-12-15 15:20:41 +01:00
B. Petersen a7f26560fe update translations 2018-12-15 15:11:53 +01:00
B. Petersen fb14484944 update translations 2018-12-15 04:01:02 +01:00
B. Petersen ed30a16cc3 remove html constraints from source strings 2018-12-15 00:59:13 +01:00
björn petersen 3136245693 Merge pull request #173 from ralphtheninja/master
Fix typo
2018-12-15 00:17:35 +01:00
Lars-Magnus Skog 98e42e6208 Fix typo 2018-12-14 23:59:56 +01:00
B. Petersen d7e29abce6 update translations 2018-12-14 23:57:35 +01:00
B. Petersen fbefdcf127 simplify ThreadRecord 2018-12-14 23:46:51 +01:00
B. Petersen a26f48f4f3 fix typos in source strings 2018-12-14 22:17:21 +01:00
B. Petersen 96d2a69fdb update translations 2018-12-14 21:51:04 +01:00
B. Petersen 10ec1cad26 fix wording 2018-12-14 21:38:55 +01:00
B. Petersen ad0da65727 update translations, add danks 2018-12-14 17:26:14 +01:00
B. Petersen a4c0f62005 refine some wordings, tackles https://github.com/deltachat/deltachat-desktop/issues/423 2018-12-14 17:14:22 +01:00
B. Petersen 8c1fbc0ae9 remove dead code 2018-12-13 16:37:02 +01:00
B. Petersen 3b193c35d9 Update messenger-backend submodule. 2018-12-13 15:09:20 +01:00
B. Petersen aab44755aa add 'dev' to app_name (was removed by reworking strings, we do not want temporary names in the tx repos) 2018-12-13 15:08:55 +01:00
B. Petersen 582b5d035b bump version 2018-12-13 15:02:32 +01:00
B. Petersen 4458577927 colored sender names in groups, tackles #170 2018-12-13 14:57:40 +01:00
B. Petersen cdf2aad98e simplify color handling 2018-12-13 14:41:32 +01:00
B. Petersen 6bc11ed1c0 simplify Recipient handling 2018-12-13 14:08:41 +01:00
B. Petersen c09333d5d6 use delta colors for the avatars in the notification area, remove dead code wrt colors 2018-12-13 13:27:53 +01:00
B. Petersen b9c43c7b6a update translations 2018-12-13 02:45:36 +01:00
B. Petersen 0401b2a0d9 clearify add-language instructions 2018-12-13 02:44:44 +01:00
B. Petersen 2ceb5e11bf update translations 2018-12-13 02:39:23 +01:00
B. Petersen 3d9345ed87 typo 2018-12-13 01:58:42 +01:00
B. Petersen 5af3284e06 add script to add a new language and base scripts to be called from the repo root 2018-12-13 01:55:07 +01:00
B. Petersen bc987a4591 Update messenger-backend submodule. 2018-12-13 01:54:12 +01:00
B. Petersen f3366681d0 add missing core-strings 2018-12-12 23:12:49 +01:00
B. Petersen 0ad2916bcf pimp search results 2018-12-12 21:23:32 +01:00
B. Petersen e4c564ace4 adjust app name, init transifex 2018-12-12 18:10:26 +01:00
björn petersen e90ab537d3 Merge pull request #171 from deltachat/transl
rework translations
2018-12-12 17:56:46 +01:00
B. Petersen defac037de rework strings 2018-12-12 17:55:08 +01:00
B. Petersen 33f07b584b remove unused strings and ids, remove translations for now 2018-12-11 23:31:58 +01:00
B. Petersen 6efbd89674 remove unused share menu; for creation of a new chat, the known floating button should be used 2018-12-11 22:49:49 +01:00
B. Petersen c7e37d153d set correct locale in share activity fragment, fixes crash in #147 2018-12-11 22:41:22 +01:00
B. Petersen 2021979d8e remove unused resources: styles 2018-12-11 22:11:42 +01:00
B. Petersen 5b8383dac3 remove dead code and unused resources wrt group creation 2018-12-11 21:55:09 +01:00
B. Petersen 0b05b954f7 remove unused resources: colors, authenticator, dimensions 2018-12-11 21:35:07 +01:00
B. Petersen 0376acb5ae remove unused google playstore strings 2018-12-11 21:34:25 +01:00
B. Petersen 17dc8cebca remove unused resources detected by lint 2018-12-11 16:45:09 +01:00
B. Petersen 33747e7a41 remove unused resources detected by lint 2018-12-11 14:49:32 +01:00
B. Petersen 99b1703097 remove unused resources detected by lint 2018-12-11 14:22:22 +01:00
B. Petersen a14547ce42 remove unused resources: message refresh 2018-12-11 14:11:25 +01:00
B. Petersen d682084542 remove unused resources: videocam 2018-12-11 14:04:08 +01:00
B. Petersen 9813f01da8 remove unused resources: block, visibility, misc 2018-12-11 13:54:46 +01:00
B. Petersen 27cfc39786 remove unused resources: menu, face 2018-12-11 13:38:54 +01:00
B. Petersen 86914bf4fc remove unused resources: dashboard, devices 2018-12-11 13:10:09 +01:00
B. Petersen 1f9bd90eae remove unused resources: textsms, laptio, video splash, message, signal 2018-12-11 13:05:11 +01:00
B. Petersen 9edbc23207 remove unused resources: document download button 2018-12-11 11:36:38 +01:00
B. Petersen e425533d68 remove unused resources: bluetooth, fingerprint, database, transfer controls 2018-12-11 11:30:52 +01:00
B. Petersen 451f03a6a8 remove unused resources: lockscreen, dialpad, profile splash 2018-12-11 11:19:38 +01:00
B. Petersen 1c76562fc6 remove unused resources: timer, call icons 2018-12-11 11:13:02 +01:00
B. Petersen 94592d46ae remove dead code 2018-12-11 02:56:26 +01:00
B. Petersen a02dde5d51 remove unused resources 2018-12-11 01:40:57 +01:00
B. Petersen 73359fba7d cleanup gradle 2018-12-11 01:12:26 +01:00
B. Petersen f65ac4d604 remove unused squareup/dagger and okhttp dependencies 2018-12-11 01:04:30 +01:00
B. Petersen a469713fbc remove dependency to signal-protocol, closes #138 2018-12-11 00:56:08 +01:00
B. Petersen c781f3b9a4 remove complicated dependencies for tiny appendInt() to array 2018-12-11 00:53:04 +01:00
B. Petersen 87e1937381 remove dependency to google's phonenumers library, tackles #138 2018-12-11 00:23:58 +01:00
B. Petersen cf45c566ba remove tiny dependency to spongycastle/bouncycastle 2018-12-11 00:02:48 +01:00
B. Petersen 612dab112c remove dead code 2018-12-10 23:55:58 +01:00
B. Petersen 1d7bf82b18 add logger from external source here 2018-12-10 23:12:08 +01:00
B. Petersen 55ca2d0ef6 use deltachat-yyyy-MM-dd-HHmmss as a fallback file name, closes #115 2018-12-10 22:30:22 +01:00
B. Petersen 3542455e2a bump version 2018-12-10 17:53:56 +01:00
B. Petersen 2217ce6788 add global information to log, closes #108 2018-12-10 17:36:50 +01:00
B. Petersen 6e48c126fa more logic appearance-preference-order 2018-12-10 17:16:22 +01:00
B. Petersen 177288a8d4 do not open unused deaddrop profile, closes #131 2018-12-10 17:11:58 +01:00
B. Petersen 229ede09f1 do not truncate text to sms-like-sizes, closes #169 2018-12-10 17:04:26 +01:00
B. Petersen e9de6f7e40 rework log handling, no log uploading to foreign servers, closes #119 2018-12-10 15:54:54 +01:00
B. Petersen ce0c181489 remove unused OkHttp 2018-12-10 02:15:31 +01:00
B. Petersen 4e73f4cd0a remove UpdateApk for now as it uses dependecies to signal-http we want to get rid of 2018-12-10 01:57:18 +01:00
B. Petersen 890052d018 remove HourglassView and other probably dead code 2018-12-10 01:28:55 +01:00
B. Petersen 46a7159c5a remove dead code and layouts, remove webrtc 2018-12-10 01:04:25 +01:00
B. Petersen cc94b66799 remove unneeded DisplayMode 2018-12-10 00:43:44 +01:00
B. Petersen 3e4bf6a4a7 remove curve25519 java-dependency 2018-12-10 00:14:20 +01:00
B. Petersen 5dfc54bd43 allow editing name of contact, closes #166 2018-12-10 00:07:58 +01:00
B. Petersen db99a1da6c show encryption info, closes #167 2018-12-09 23:54:52 +01:00
B. Petersen c3c110b55a remove dead code 2018-12-09 22:46:02 +01:00
B. Petersen 31d4e5260f add missing components to profile activity 2018-12-09 21:53:05 +01:00
B. Petersen 109d49668f use DcEventCenter in RecipientPreferenceActivity 2018-12-09 21:12:40 +01:00
B. Petersen 5f13330a8e set avatar-click-handler only if needed, tackles #30 2018-12-09 13:52:38 +01:00
B. Petersen 6503469686 remove unneeded LoaderManager indirection 2018-12-09 13:46:24 +01:00
B. Petersen 9acef33db9 hide unused items from contact profile, tackles #30 2018-12-09 13:22:20 +01:00
B. Petersen 70c44c3efc show contact profile on contact-avatar-click in groups, tackles #30 2018-12-09 12:53:01 +01:00
B. Petersen bb8d4b2ef9 remove sqlite dependency 2018-12-09 03:39:01 +01:00
B. Petersen efb0f31387 remove unneeded persistent jobs 2018-12-09 03:30:44 +01:00
B. Petersen 7fd90ca5d6 remove unneeded parameters from Job object 2018-12-09 03:22:11 +01:00
B. Petersen 9f01b780c7 Update messenger-backend submodule. 2018-12-09 03:06:35 +01:00
B. Petersen 2738251be9 do not create or use signal.db, closes #144 2018-12-09 03:03:14 +01:00
B. Petersen 2ecd6bed8d do not try to load MediaRecord from AttachmentDatabase 2018-12-09 02:50:55 +01:00
B. Petersen 858747149a remove dead code, forward reply-event 2018-12-09 02:43:15 +01:00
B. Petersen b166f1e4fd remove dead code 2018-12-09 02:33:41 +01:00
B. Petersen b34cbc2b88 remove PartDataSource 2018-12-09 02:15:11 +01:00
B. Petersen efb640fb91 remove unneeded PartProvider 2018-12-09 02:04:40 +01:00
B. Petersen db7fcf81d8 make video playback work, closes #152 2018-12-09 01:03:22 +01:00
björn petersen 87f887fe3f Merge pull request #157 from deltachat/clean_out_signal_database
[wip] Clean out signal database
2018-12-08 23:46:33 +01:00
B. Petersen 5da75c7dd0 remove AttachmentDatabase loadings from PartAuthority 2018-12-08 18:22:08 +01:00
B. Petersen a945e659f5 fix crash in MediaOverviewActivity 2018-12-08 18:21:30 +01:00
B. Petersen bcf460eefd Remove GroupDatabase, RecipientDatabase from DatabaseFactory 2018-12-08 17:50:16 +01:00
B. Petersen 496d7ea8a0 remove RecipientsAdapter and belonging functions 2018-12-08 16:35:48 +01:00
Angelo Fuchs 68a5d887c5 #138 removing ThreadDatabase and link from DatabaseFactory to MediaDatabase 2018-12-08 16:18:08 +01:00
Angelo Fuchs dc22c9ef22 #138 removing Mms and Sms Database 2018-12-08 16:18:07 +01:00
Angelo Fuchs 8588765dc7 #138 removing MmsSmsDatabase 2018-12-08 16:18:07 +01:00
B. Petersen f49226d335 tweak 'archived' label 2018-12-08 01:36:59 +01:00
daniel.boehrs 575c815c97 Sharing and forwarding to chats #74 #147 2018-12-07 13:33:47 +01:00
daniel.boehrs 392d6df2c8 Fixed typo 2018-12-07 10:31:32 +01:00
daniel.boehrs 911ed8919a Merge branch 'master' of https://github.com/deltachat/deltachat-android-ii 2018-12-07 10:30:50 +01:00
daniel.boehrs 9dd344e6b7 implement "attach contact" #148 2018-12-07 10:30:08 +01:00
Florian Haar f31817c0a1 Merge branch 'master' of https://github.com/deltachat/deltachat-android-ii 2018-12-07 08:41:49 +01:00
Florian Haar 823217c593 Added default image as default on preferences screen #50 2018-12-07 08:41:21 +01:00
daniel.boehrs 8517570014 Removed patches folder #151 2018-12-07 08:22:48 +01:00
B. Petersen 155bcd42ea round borders for date/system messages 2018-12-06 20:25:51 +01:00
B. Petersen 245982d111 make date and system messages more visible, closes #98 2018-12-06 19:36:35 +01:00
B. Petersen 323ed1b79f adapt default background 2018-12-06 17:54:49 +01:00
B. Petersen 18b4363e83 remove dead code 2018-12-06 17:26:54 +01:00
B. Petersen f30a18422f set bubble foreground colors 2018-12-06 16:31:04 +01:00
B. Petersen d4f5732496 set bubble background color 2018-12-06 16:09:34 +01:00
B. Petersen ada9377a37 use new colors in profile 2018-12-06 15:16:34 +01:00
B. Petersen ef0eb15034 Update messenger-backend submodule. 2018-12-05 20:17:05 +01:00
björn petersen 71ac87c50e Merge pull request #158 from deltachat/colors
addapt to new color api
2018-12-05 20:16:37 +01:00
B. Petersen 84957ace38 addapt to new color api 2018-12-05 16:10:16 +01:00
874 changed files with 6276 additions and 841658 deletions
+2 -2
View File
@@ -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
+9 -14
View File
@@ -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">
@@ -150,7 +150,7 @@
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"/>
@@ -168,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"/>
@@ -200,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"/>
@@ -232,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"/>
@@ -285,11 +285,6 @@
</intent-filter>
</receiver>
<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"
+3 -65
View File
@@ -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,18 +74,13 @@ 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'
@@ -96,10 +88,7 @@ dependencies {
compile 'com.pnikosis:materialish-progress:1.5'
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') {
@@ -108,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'
@@ -122,7 +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'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
@@ -139,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 {
@@ -167,28 +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.google.android.gms:play-services-iid:54e919f9957b8b7820da7ee9b83471d00d0cac1cf08ddea8b5b41aea80bb1a70',
'com.google.android.gms:play-services-base:0ca636a8fc9a5af45e607cdcd61783bf5d561cbbb0f862021ce69606eee5ad49',
'com.google.android.gms:play-services-tasks:69ec265168e601d0203d04cd42e34bb019b2f029aa1e16fabd38a5153eea2086',
@@ -211,25 +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',
'com.klinkerapps:logger:177e325259a8b111ad6745ec10db5861723c99f402222b80629f576f49408541',
'com.google.android:flexbox:a9989fd13ae2ee42765dfc515fe362edf4f326e74925d02a10369df8092a4935',
'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',
]
}
@@ -244,8 +198,8 @@ android {
}
defaultConfig {
versionCode 400
versionName "0.0.10"
versionCode 404
versionName "0.92.0"
applicationId "chat.delta.androidii"
minSdkVersion 14
@@ -256,10 +210,6 @@ android {
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", "USER_AGENT", "\"OWA\""
buildConfigField "boolean", "DEV_BUILD", "false"
ndk {
@@ -292,21 +242,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.cfg'
testProguardFiles 'proguard-automation.pro',
'proguard.cfg'
@@ -321,16 +263,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\""
}
}
+1
View File
@@ -903,6 +903,7 @@ messenger-backend/src/dc_key.c \
messenger-backend/src/dc_keyring.c \
messenger-backend/src/dc_loginparam.c \
messenger-backend/src/dc_lot.c \
messenger-backend/src/dc_move.c \
messenger-backend/src/dc_context.c \
messenger-backend/src/dc_configure.c \
messenger-backend/src/dc_e2ee.c \
+30
View File
@@ -262,6 +262,24 @@ JNIEXPORT void Java_com_b44t_messenger_DcContext_interruptImapIdle(JNIEnv *env,
}
JNIEXPORT void Java_com_b44t_messenger_DcContext_performMvboxFetch(JNIEnv *env, jobject obj)
{
dc_perform_mvbox_fetch(get_dc_context(env, obj));
}
JNIEXPORT void Java_com_b44t_messenger_DcContext_performMvboxIdle(JNIEnv *env, jobject obj)
{
dc_perform_mvbox_idle(get_dc_context(env, obj));
}
JNIEXPORT void Java_com_b44t_messenger_DcContext_interruptMvboxIdle(JNIEnv *env, jobject obj)
{
dc_interrupt_mvbox_idle(get_dc_context(env, obj));
}
JNIEXPORT void Java_com_b44t_messenger_DcContext_performSmtpJobs(JNIEnv *env, jobject obj)
{
dc_perform_smtp_jobs(get_dc_context(env, obj));
@@ -820,6 +838,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;
@@ -1181,6 +1205,12 @@ JNIEXPORT jstring Java_com_b44t_messenger_DcContact_getProfileImage(JNIEnv *env,
}
JNIEXPORT jint Java_com_b44t_messenger_DcContact_getColor(JNIEnv *env, jobject obj)
{
return dc_contact_get_color(get_dc_contact(env, obj));
}
JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_isBlocked(JNIEnv *env, jobject obj)
{
return (jboolean)(dc_contact_is_blocked(get_dc_contact(env, obj))!=0);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-907
View File
@@ -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
-20
View File
@@ -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.**
-3
View File
@@ -1,3 +0,0 @@
-dontwarn android.net.ConnectivityManager
-dontwarn android.net.ConnectivityManager$NetworkCallback
-dontwarn org.webrtc.NetworkMonitorAutoDetect$ConnectivityManagerDelegate
-3
View File
@@ -1,3 +0,0 @@
-dontwarn okio.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-26
View File
@@ -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.**
-5
View File
@@ -1,5 +0,0 @@
-keep class org.sqlite.** { *; }
-keep class org.sqlite.database.** { *; }
-keep class net.sqlcipher.** { *; }
-dontwarn net.sqlcipher.**
-6
View File
@@ -1,6 +0,0 @@
# OkHttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
-5
View File
@@ -1,5 +0,0 @@
# Okio
-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
-3
View File
@@ -1,3 +0,0 @@
-dontwarn org.webrtc.NetworkMonitorAutoDetect
-dontwarn android.net.Network
-keep class org.webrtc.** { *; }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

Some files were not shown because too many files have changed in this diff Show More