Compare commits
157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 756f36101f | |||
| b46bc99aad | |||
| d593096d92 | |||
| 354fea7da2 | |||
| 9f6a26713c | |||
| fe89841407 | |||
| 698763c544 | |||
| 8f540d01fa | |||
| 4d12385cb7 | |||
| 7962e880ef | |||
| d752a111fc | |||
| 5e8c20e30f | |||
| a70b1be603 | |||
| 3bde0cbe78 | |||
| 6544b221fd | |||
| 40675fa774 | |||
| 60d79021bf | |||
| 7cda8c0101 | |||
| 7bafff0ba7 | |||
| 5529acf36b | |||
| 0f6d5e3dcd | |||
| 71f4a55a0d | |||
| 75dc1e1527 | |||
| e663df903e | |||
| f1513f7e47 | |||
| fd36ceb847 | |||
| 6fde63f0b2 | |||
| ed6fabe99f | |||
| 1876e56e23 | |||
| 3122759c91 | |||
| 19f5a54ad2 | |||
| 1c6b7fe58f | |||
| 880421fd6f | |||
| a73a7b28de | |||
| bd8217196f | |||
| 54140476bf | |||
| 78fa449e99 | |||
| a7f26560fe | |||
| fb14484944 | |||
| ed30a16cc3 | |||
| 3136245693 | |||
| 98e42e6208 | |||
| d7e29abce6 | |||
| fbefdcf127 | |||
| a26f48f4f3 | |||
| 96d2a69fdb | |||
| 10ec1cad26 | |||
| ad0da65727 | |||
| a4c0f62005 | |||
| 8c1fbc0ae9 | |||
| 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 |
@@ -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">
|
||||
@@ -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"
|
||||
|
||||
@@ -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\""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,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 |
|
Before Width: | Height: | Size: 369 B |
|
Before Width: | Height: | Size: 304 B |
|
Before Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 709 B |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 390 B |
|
Before Width: | Height: | Size: 397 B |