├── APACHE_COMMONS ├── ARTWORK_LICENSE ├── CHANGELOG.md ├── FONT_LICENSE ├── GNU_CRYPTO_LICENSE ├── InboxPager ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── org │ │ └── openintents │ │ └── openpgp │ │ ├── IOpenPgpService.aidl │ │ └── IOpenPgpService2.aidl │ ├── java │ ├── gnu │ │ └── crypto │ │ │ ├── Registry.java │ │ │ ├── cipher │ │ │ ├── BaseCipher.java │ │ │ ├── CipherFactory.java │ │ │ ├── IBlockCipher.java │ │ │ ├── IBlockCipherSpi.java │ │ │ ├── NullCipher.java │ │ │ ├── Rijndael.java │ │ │ └── Twofish.java │ │ │ ├── mode │ │ │ ├── BaseMode.java │ │ │ ├── CBC.java │ │ │ ├── CFB.java │ │ │ ├── CTR.java │ │ │ ├── ECB.java │ │ │ ├── ICM.java │ │ │ ├── IMode.java │ │ │ ├── ModeFactory.java │ │ │ └── OFB.java │ │ │ ├── pad │ │ │ ├── BasePad.java │ │ │ ├── IPad.java │ │ │ ├── PKCS7.java │ │ │ ├── PadFactory.java │ │ │ └── TBC.java │ │ │ └── util │ │ │ └── Util.java │ ├── net │ │ └── inbox │ │ │ ├── About.java │ │ │ ├── InboxGPG.java │ │ │ ├── InboxList.java │ │ │ ├── InboxMessage.java │ │ │ ├── InboxMessageExpList.java │ │ │ ├── InboxPager.java │ │ │ ├── InboxPreferences.java │ │ │ ├── InboxSend.java │ │ │ ├── Settings.java │ │ │ ├── SettingsFragment.java │ │ │ ├── db │ │ │ ├── Attachment.java │ │ │ ├── DBAccess.java │ │ │ ├── Inbox.java │ │ │ └── Message.java │ │ │ ├── server │ │ │ ├── EndToEnd.java │ │ │ ├── Handler.java │ │ │ ├── IMAP.java │ │ │ ├── POP.java │ │ │ ├── SMTP.java │ │ │ ├── SocketIO.java │ │ │ ├── Test.java │ │ │ └── Utils.java │ │ │ └── visuals │ │ │ ├── AttachmentDownloadPicker.java │ │ │ ├── AttachmentsList.java │ │ │ ├── Common.java │ │ │ ├── Dialogs.java │ │ │ ├── SendFileList.java │ │ │ ├── SendFilePicker.java │ │ │ └── SpinningStatus.java │ └── org │ │ ├── apache │ │ └── commons │ │ │ ├── codec │ │ │ ├── BinaryDecoder.java │ │ │ ├── BinaryEncoder.java │ │ │ ├── CharEncoding.java │ │ │ ├── CharSequenceUtils.java │ │ │ ├── Charsets.java │ │ │ ├── Decoder.java │ │ │ ├── DecoderException.java │ │ │ ├── Encoder.java │ │ │ ├── EncoderException.java │ │ │ ├── QuotedPrintableCodec.java │ │ │ ├── StringDecoder.java │ │ │ ├── StringEncoder.java │ │ │ ├── Utils.java │ │ │ ├── binary │ │ │ │ ├── Hex.java │ │ │ │ └── StringUtils.java │ │ │ └── digest │ │ │ │ ├── DigestUtils.java │ │ │ │ └── MessageDigestAlgorithms.java │ │ │ └── fileupload │ │ │ └── util │ │ │ └── mime │ │ │ ├── Base64Decoder.java │ │ │ ├── MimeUtility.java │ │ │ ├── ParseException.java │ │ │ └── QuotedPrintableDecoder.java │ │ └── openintents │ │ └── openpgp │ │ ├── OpenPgpDecryptionResult.java │ │ ├── OpenPgpError.java │ │ ├── OpenPgpMetadata.java │ │ ├── OpenPgpSignatureResult.java │ │ └── util │ │ ├── OpenPgpApi.java │ │ ├── OpenPgpServiceConnection.java │ │ ├── OpenPgpUtils.java │ │ └── ParcelFileDescriptorUtil.java │ └── res │ ├── anim │ ├── fade_in.xml │ ├── left_in.xml │ ├── left_out.xml │ ├── right_in.xml │ └── right_out.xml │ ├── drawable │ ├── application.xml │ ├── attachment.xml │ ├── attachments_unaffected.xml │ ├── btn_green.xml │ ├── btn_green_normal.xml │ ├── btn_green_pressed.xml │ ├── btn_orange.xml │ ├── btn_orange_normal.xml │ ├── btn_orange_pressed.xml │ ├── btn_refresh.xml │ ├── btn_refresh_normal.xml │ ├── btn_refresh_pressed.xml │ ├── btn_send_activity.xml │ ├── counter_rounded.xml │ ├── datetime.xml │ ├── drawer.xml │ ├── focus_mode_allmsg.xml │ ├── focus_mode_unread.xml │ ├── inbox_list_view_background.xml │ ├── location.xml │ ├── network.xml │ ├── padlock_aes.xml │ ├── padlock_error.xml │ ├── padlock_normal.xml │ ├── padlock_pgp_closed.xml │ ├── padlock_pgp_closed_inverted.xml │ ├── padlock_pgp_open.xml │ ├── padlock_pgp_open_inverted.xml │ ├── padlock_txt.xml │ ├── pick_file.xml │ ├── pick_folder.xml │ ├── popup_background.xml │ ├── remove_item.xml │ ├── reply_arrow.xml │ ├── sent_to_specific.xml │ ├── settings.xml │ ├── signature.xml │ ├── spinner_selector.xml │ ├── unseen_floating_normal.xml │ ├── unseen_floating_pressed.xml │ ├── unseen_in_group.xml │ └── unseen_in_list.xml │ ├── font │ ├── dottz.ttf │ └── dottz_type.xml │ ├── layout │ ├── about.xml │ ├── edit_account.xml │ ├── file_picker.xml │ ├── file_picker_list_row.xml │ ├── folder_picker.xml │ ├── folder_picker_attachment_list_row.xml │ ├── inbox_list_row.xml │ ├── message.xml │ ├── message_list_group.xml │ ├── message_list_row.xml │ ├── openpgp.xml │ ├── pager.xml │ ├── pager_toolbar.xml │ ├── popup.xml │ ├── pw_app.xml │ ├── pw_txt.xml │ ├── send.xml │ └── spinner_item.xml │ ├── menu │ ├── crypto_action_btns.xml │ ├── message_action_btns.xml │ ├── pager_action_btns.xml │ └── send_action_btns.xml │ ├── mipmap-hdpi │ └── application.png │ ├── mipmap-mdpi │ └── application.png │ ├── mipmap-xhdpi │ └── application.png │ ├── mipmap-xxhdpi │ └── application.png │ ├── mipmap-xxxhdpi │ └── application.png │ ├── values-bg │ └── strings.xml │ ├── values-de │ └── strings.xml │ ├── values-es │ └── strings.xml │ ├── values-fr │ └── strings.xml │ ├── values-pt │ └── strings.xml │ ├── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── data_extraction_rules.xml │ └── settings.xml ├── LICENSE ├── OPENKEYCHAIN_LICENSE ├── README.md ├── SQLCIPHER ├── SQLCIPHER_ANDROID_LIBS ├── build.gradle ├── fastlane └── metadata │ └── android │ ├── bg │ └── short_description.txt │ ├── de │ └── short_description.txt │ ├── en-US │ ├── changelogs │ │ ├── 10.txt │ │ ├── 11.txt │ │ ├── 12.txt │ │ ├── 13.txt │ │ ├── 14.txt │ │ ├── 15.txt │ │ ├── 16.txt │ │ ├── 17.txt │ │ ├── 18.txt │ │ ├── 19.txt │ │ ├── 20.txt │ │ ├── 4.txt │ │ ├── 5.txt │ │ ├── 6.txt │ │ ├── 7.txt │ │ ├── 8.txt │ │ └── 9.txt │ ├── full_description.txt │ ├── images │ │ └── phoneScreenshots │ │ │ ├── 1.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 13.png │ │ │ ├── 14.png │ │ │ ├── 15.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ ├── 9.png │ │ │ ├── block_text_encryption.png │ │ │ ├── cleartext.png │ │ │ ├── encryption.png │ │ │ └── verification.png │ ├── short_description.txt │ └── title.txt │ ├── fr │ └── short_description.txt │ ├── pl │ └── short_description.txt │ ├── pt-PT │ └── short_description.txt │ ├── pt │ └── short_description.txt │ ├── sq │ └── short_description.txt │ ├── tr │ └── short_description.txt │ └── zh-CN │ └── short_description.txt ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | --- 3 | ======= 4 | ### 6.1 (2020-06-12) 5 | 6 | Fixed QP processing and display. 7 | 8 | ### 6.0 (2020-06-10) 9 | 10 | More Cryptography, Android Content API for Files 11 | 12 | AES/Twofish end-to-end cryptogram (encrypted text message, unencrypted attachments). 13 | Single word or whole block. 14 | 15 | Attachment/message saving with Android content API. 16 | 17 | Auto vacuum database to reduce size. 18 | 19 | Checks for common network errors. 20 | 21 | Improved message parsing. 22 | 23 | Message datetime conversion to local device time, original is preserved. 24 | 25 | Option to delete all messages, keeping account settings. 26 | 27 | Patch for error: 5.1.3 Bad recipient address syntax. 28 | 29 | ### 5.0 (2020-05-24) 30 | 31 | Many new features and fixes. 32 | 33 | Migrated to the AndroidX extra library. 34 | 35 | Quoted-printable email and Encoded-word (RFC 2047) decoding with Apache Commons. 36 | 37 | A WebView that displays emails in html, in offline mode. 38 | 39 | Updated the internal SQLCipher database to v4.4.0. 40 | 41 | Remowrked password dialog. 42 | 43 | Mitigated Context leakages. 44 | 45 | Open account drawer by pressing on background of app. 46 | 47 | Added translations - French, German, Spanish. 48 | 49 | Updated animations. 50 | 51 | Beeping sound uses system message default. 52 | 53 | Long-press on message thread offers the option for direct reply. 54 | 55 | ### 4.5 (2020-04-17) 56 | 57 | Cert info with SHA-256. 58 | 59 | ### 4.4 (2020-04-10) 60 | 61 | Patch for cert info crash. 62 | 63 | ### 4.3 (2019-10-11) 64 | 65 | Spinning progress deletion fixes. 66 | 67 | ### 4.2 (2019-10-05) 68 | 69 | Fixed encodings. Only text/plain /html now. 70 | 71 | ### 4.1 (2019-08-28) 72 | 73 | Sort messages by sender. 74 | 75 | ### 4.0 (2018-12-01) 76 | 77 | UI Update. Internal File Manager. 78 | 79 | ### 3.1 (2018-11-07) 80 | 81 | Portuguese translation, UI tweaks for data leak prevention. 82 | 83 | ### 3.0 (2018-05-17) 84 | 85 | Changes in application Activity are now saved and restored correctly. 86 | 87 | Affects rotating screen portrait/landscape. 88 | 89 | Security Alteration dialog updated. 90 | 91 | Mailbox status and statistics dialog is now a menu item. 92 | 93 | Server diagnostic tools fixed. 94 | 95 | Server settings made easier. 96 | 97 | Small UI fixes. 98 | 99 | ### 2.2 (2018-05-12) 100 | 101 | Encoding and debugging updates. Updated SQLCipher to 3.5.9. 102 | 103 | ### 2.1 (2017-01-11) 104 | 105 | PGP/MIME enhanced sign-check. Updated license text button. 106 | 107 | ### 2.0 (2017-01-01) 108 | 109 | PGP/MIME, hostname checks. -------------------------------------------------------------------------------- /FONT_LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE 2 | 3 | Version 1.1 - 26 February 2007 4 | PREAMBLE 5 | 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | DEFINITIONS 21 | 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting — in part or in whole — any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | PERMISSION & CONDITIONS 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | TERMINATION 73 | 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | DISCLAIMER 77 | 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /GNU_CRYPTO_LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 2 | 3 | This file is part of GNU Crypto. 4 | 5 | GNU Crypto is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | GNU Crypto is distributed in the hope that it will be useful, but 11 | WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; see the file COPYING. If not, write to the 17 | 18 | Free Software Foundation Inc., 19 | 59 Temple Place - Suite 330, 20 | Boston, MA 02111-1307 21 | USA 22 | 23 | Linking this library statically or dynamically with other modules is 24 | making a combined work based on this library. Thus, the terms and 25 | conditions of the GNU General Public License cover the whole 26 | combination. 27 | 28 | As a special exception, the copyright holders of this library give 29 | you permission to link this library with independent modules to 30 | produce an executable, regardless of the license terms of these 31 | independent modules, and to copy and distribute the resulting 32 | executable under terms of your choice, provided that you also meet, 33 | for each linked independent module, the terms and conditions of the 34 | license of that module. An independent module is a module which is 35 | not derived from or based on this library. If you modify this 36 | library, you may extend this exception to your version of the 37 | library, but you are not obligated to do so. If you do not wish to 38 | do so, delete this exception statement from your version. 39 | 40 | -------------------------------------------------------------------------------- /InboxPager/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.android.application) 3 | } 4 | 5 | android { 6 | namespace 'net.inbox.pager' 7 | compileSdk 35 8 | 9 | defaultConfig { 10 | applicationId "net.inbox.pager" 11 | minSdk 23 12 | targetSdk 35 13 | versionCode 21 14 | versionName "7.0" 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility JavaVersion.VERSION_1_8 25 | targetCompatibility JavaVersion.VERSION_1_8 26 | } 27 | buildFeatures { 28 | buildFeatures.aidl true 29 | viewBinding true 30 | } 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | implementation libs.appcompat 36 | implementation libs.constraintlayout 37 | implementation libs.documentfile 38 | implementation libs.material 39 | implementation libs.preference 40 | implementation libs.sqlite 41 | implementation libs.android.database.sqlcipher 42 | } 43 | -------------------------------------------------------------------------------- /InboxPager/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /InboxPager/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 32 | 36 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /InboxPager/src/main/aidl/org/openintents/openpgp/IOpenPgpService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014-2015 Dominik Schürmann 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.openpgp; 18 | 19 | interface IOpenPgpService { 20 | 21 | /** 22 | * do NOT use this, data returned from the service through "output" may be truncated 23 | * @deprecated 24 | */ 25 | Intent execute(in Intent data, in ParcelFileDescriptor input, in ParcelFileDescriptor output); 26 | 27 | } -------------------------------------------------------------------------------- /InboxPager/src/main/aidl/org/openintents/openpgp/IOpenPgpService2.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Dominik Schürmann 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.openpgp; 18 | 19 | interface IOpenPgpService2 { 20 | 21 | /** 22 | * see org.openintents.openpgp.util.OpenPgpApi for documentation 23 | */ 24 | ParcelFileDescriptor createOutputPipe(in int pipeId); 25 | 26 | /** 27 | * see org.openintents.openpgp.util.OpenPgpApi for documentation 28 | */ 29 | Intent execute(in Intent data, in ParcelFileDescriptor input, int pipeId); 30 | } -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/Registry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | 42 | /* 43 | * A placeholder for names and literals used throughout this library. 44 | * 45 | * @version $Revision: 1.24 $ 46 | **/ 47 | package gnu.crypto; 48 | 49 | public interface Registry { 50 | 51 | String RIJNDAEL_CIPHER = "rijndael"; 52 | String TWOFISH_CIPHER = "twofish"; 53 | String NULL_CIPHER = "null"; 54 | 55 | // AES is synonymous to Rijndael for 128-bit block size only. 56 | String AES_CIPHER = "aes"; 57 | 58 | // Electronic CodeBook mode. 59 | String ECB_MODE = "ecb"; 60 | 61 | // Counter (NIST) mode. 62 | String CTR_MODE = "ctr"; 63 | 64 | // Integer Counter Mode (David McGrew). 65 | String ICM_MODE = "icm"; 66 | 67 | // Output Feedback Mode (NIST). 68 | String OFB_MODE = "ofb"; 69 | 70 | // Cipher block chaining mode (NIST). 71 | String CBC_MODE = "cbc"; 72 | 73 | // Cipher feedback mode (NIST). 74 | String CFB_MODE = "cfb"; 75 | 76 | // PKCS#7 padding scheme. 77 | String PKCS7_PAD = "pkcs7"; 78 | 79 | // Trailing Bit Complement padding scheme. 80 | String TBC_PAD = "tbc"; 81 | } 82 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/cipher/CipherFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.cipher; 42 | 43 | import gnu.crypto.Registry; 44 | 45 | import java.util.Collections; 46 | import java.util.HashSet; 47 | import java.util.Set; 48 | 49 | /* 50 | *

A Factory to instantiate symmetric block cipher instances.

51 | * 52 | * @version $Revision: 1.11 $ 53 | **/ 54 | public class CipherFactory implements Registry { 55 | 56 | private CipherFactory() { 57 | super(); 58 | } 59 | 60 | /** 61 | *

Returns an instance of a block cipher given its name.

62 | * 63 | * @param name the case-insensitive name of the symmetric-key block cipher 64 | * algorithm. 65 | * @return an instance of the designated cipher algorithm, or 66 | * null if none is found. 67 | * @exception InternalError if the implementation does not pass its 68 | * self-test. 69 | */ 70 | public static final IBlockCipher getInstance(String name) { 71 | if (name == null) { 72 | return null; 73 | } 74 | 75 | name = name.trim(); 76 | IBlockCipher result = null; 77 | if (name.equalsIgnoreCase(RIJNDAEL_CIPHER) 78 | || name.equalsIgnoreCase(AES_CIPHER)) { 79 | result = new Rijndael(); 80 | } else if (name.equalsIgnoreCase(TWOFISH_CIPHER)) { 81 | result = new Twofish(); 82 | } else if (name.equalsIgnoreCase(NULL_CIPHER)) { 83 | result = new NullCipher(); 84 | } 85 | 86 | if (result != null && !result.selfTest()) { 87 | throw new InternalError(result.name()); 88 | } 89 | 90 | return result; 91 | } 92 | 93 | /** 94 | *

Returns a {@link Set} of symmetric key block cipher implementation 95 | * names supported by this Factory.

96 | * 97 | * @return a {@link Set} of block cipher names (Strings). 98 | */ 99 | public static final Set getNames() { 100 | HashSet hs = new HashSet<>(); 101 | hs.add(RIJNDAEL_CIPHER);// AES 102 | hs.add(TWOFISH_CIPHER); 103 | hs.add(NULL_CIPHER); 104 | 105 | return Collections.unmodifiableSet(hs); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/mode/ECB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.mode; 42 | 43 | import gnu.crypto.Registry; 44 | import gnu.crypto.cipher.IBlockCipher; 45 | 46 | /* 47 | *

The implementation of the Electronic Codebook mode.

48 | * 49 | *

The Electronic Codebook (ECB) mode is a confidentiality mode that is 50 | * defined as follows:

51 | * 52 | *
    53 | *
  • ECB Encryption: Cj = CIPHK(Pj) for j = 1...n
  • 54 | *
  • ECB Decryption: Pj = CIPH-1K(Cj) for j = 1...n
  • 55 | *
56 | * 57 | *

In ECB encryption, the forward cipher function is applied directly, and 58 | * independently, to each block of the plaintext. The resulting sequence of 59 | * output blocks is the ciphertext.

60 | * 61 | *

In ECB decryption, the inverse cipher function is applied directly, and 62 | * independently, to each block of the ciphertext. The resulting sequence of 63 | * output blocks is the plaintext.

64 | * 65 | *

References:

66 | * 67 | *
    68 | *
  1. 69 | * Recommendation for Block Cipher Modes of Operation Methods and Techniques, 70 | * Morris Dworkin.
  2. 71 | *
72 | * 73 | * @version $Revision: 1.5 $ 74 | **/ 75 | public class ECB extends BaseMode implements Cloneable { 76 | 77 | /** 78 | *

Trivial package-private constructor for use by the Factory class.

79 | * 80 | * @param underlyingCipher the underlying cipher implementation. 81 | * @param cipherBlockSize the underlying cipher block size to use. 82 | */ 83 | ECB(IBlockCipher underlyingCipher, int cipherBlockSize) { 84 | super(Registry.ECB_MODE, underlyingCipher, cipherBlockSize); 85 | } 86 | 87 | /** 88 | *

Private constructor for cloning purposes.

89 | * 90 | * @param that the mode to clone. 91 | */ 92 | private ECB(ECB that) { 93 | this((IBlockCipher) that.cipher.clone(), that.cipherBlockSize); 94 | } 95 | 96 | public Object clone() { 97 | return new ECB(this); 98 | } 99 | 100 | public void setup() { 101 | if (modeBlockSize != cipherBlockSize) { 102 | throw new IllegalArgumentException(IMode.MODE_BLOCK_SIZE); 103 | } 104 | } 105 | 106 | public void teardown() { 107 | } 108 | 109 | public void encryptBlock(byte[] in, int i, byte[] out, int o) { 110 | cipher.encryptBlock(in, i, out, o); 111 | } 112 | 113 | public void decryptBlock(byte[] in, int i, byte[] out, int o) { 114 | cipher.decryptBlock(in, i, out, o); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/pad/BasePad.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | * 41 | **/ 42 | package gnu.crypto.pad; 43 | 44 | /* 45 | *

An abstract class to facilitate implementing padding algorithms.

46 | * 47 | * @version $Revision: 1.5 $ 48 | **/ 49 | public abstract class BasePad implements IPad { 50 | 51 | // The canonical name prefix of the padding algorithm. 52 | protected String name; 53 | 54 | // The block size, in bytes, for this instance. 55 | protected int blockSize; 56 | 57 | protected BasePad(final String name) { 58 | super(); 59 | 60 | this.name = name; 61 | blockSize = -1; 62 | } 63 | 64 | public String name() { 65 | final StringBuilder sb = new StringBuilder(name); 66 | if (blockSize != -1) { 67 | sb.append('-').append(8*blockSize); 68 | } 69 | return sb.toString(); 70 | } 71 | 72 | public void init(final int bs) throws IllegalStateException { 73 | if (blockSize != -1) { 74 | throw new IllegalStateException(); 75 | } 76 | blockSize = bs; 77 | setup(); 78 | } 79 | 80 | public void reset() { 81 | blockSize = -1; 82 | } 83 | 84 | public boolean selfTest() { 85 | byte[] padBytes; 86 | final int offset = 5; 87 | final int limit = 1024; 88 | final byte[] in = new byte[limit]; 89 | for (int bs = 2; bs < 256; bs++) { 90 | this.init(bs); 91 | for (int i = 0; i < limit-offset-blockSize; i++) { 92 | padBytes = pad(in, offset, i); 93 | if (((i + padBytes.length) % blockSize) != 0) { 94 | new RuntimeException(name()).printStackTrace(System.err); 95 | return false; 96 | } 97 | 98 | System.arraycopy(padBytes, 0, in, offset+i, padBytes.length); 99 | try { 100 | if (padBytes.length != unpad(in, offset, i+padBytes.length)) { 101 | new RuntimeException(name()).printStackTrace(System.err); 102 | return false; 103 | } 104 | } catch (Exception x) { 105 | x.printStackTrace(System.err); 106 | return false; 107 | } 108 | } 109 | this.reset(); 110 | } 111 | 112 | return true; 113 | } 114 | 115 | /** 116 | *

If any additional checks or resource setup must be done by the 117 | * subclass, then this is the hook for it. This method will be called before 118 | * the {@link #init(int)} method returns.

119 | */ 120 | public abstract void setup(); 121 | 122 | public abstract byte[] pad(byte[] in, int off, int len); 123 | 124 | public abstract int unpad(byte[] in, int off, int len) throws Exception; 125 | } 126 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/pad/IPad.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002, Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.pad; 42 | 43 | /* 44 | *

The basic visible methods of any padding algorithm.

45 | * 46 | *

Padding algorithms serve to pad and unpad byte arrays usually 47 | * as the last step in an encryption or respectively a decryption 48 | * operation. Their input buffers are usually those processed by instances of 49 | * {@link gnu.crypto.mode.IMode} and/or {@link gnu.crypto.cipher.IBlockCipher}.

50 | * 51 | * @version $Revision: 1.3 $ 52 | **/ 53 | public interface IPad { 54 | 55 | /** @return the canonical name of this instance. */ 56 | String name(); 57 | 58 | /** 59 | * Initialises the padding scheme with a designated block size. 60 | * 61 | * @param bs the designated block size. 62 | * @exception IllegalStateException if the instance is already initialised. 63 | * @exception IllegalArgumentException if the block size value is invalid. 64 | */ 65 | void init(int bs) throws IllegalStateException; 66 | 67 | /** 68 | * Returns the byte sequence that should be appended to the designated input. 69 | * 70 | * @param in the input buffer containing the bytes to pad. 71 | * @param offset the starting index of meaningful data in in. 72 | * @param length the number of meaningful bytes in in. 73 | * @return the possibly 0-byte long sequence to be appended to the designated 74 | * input. 75 | */ 76 | byte[] pad(byte[] in, int offset, int length); 77 | 78 | /** 79 | * Returns the number of bytes to discard from a designated input buffer. 80 | * 81 | * @param in the input buffer containing the bytes to unpad. 82 | * @param offset the starting index of meaningful data in in. 83 | * @param length the number of meaningful bytes in in. 84 | * @return the number of bytes to discard, to the left of index position 85 | * offset + length in in. In other words, if the return 86 | * value of a successful invocation of this method is result, then 87 | * the unpadded byte sequence will be offset + length - result bytes 88 | * in in, starting from index position offset. 89 | * @exception Exception if the data is not terminated with the 90 | * expected padding bytes. 91 | */ 92 | int unpad(byte[] in, int offset, int length) throws Exception; 93 | 94 | /** 95 | * Resets the scheme instance for re-initialisation and use with other 96 | * characteristics. This method always succeeds. 97 | */ 98 | void reset(); 99 | 100 | /** 101 | * A basic symmetric pad/unpad test. 102 | * 103 | * @return true if the implementation passes a basic symmetric 104 | * self-test. Returns false otherwise. 105 | */ 106 | boolean selfTest(); 107 | } 108 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/pad/PKCS7.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.pad; 42 | 43 | import gnu.crypto.Registry; 44 | 45 | /* 46 | *

The implementation of the PKCS7 padding algorithm.

47 | * 48 | *

This algorithm is described for 8-byte blocks in [RFC-1423] and extended to 49 | * block sizes of up to 256 bytes in [PKCS-7].

50 | * 51 | * References:
52 | * RFC-1423: Privacy 53 | * Enhancement for Internet Electronic Mail: Part III: Algorithms, Modes, and 54 | * Identifiers.
55 | * IETF. 56 | * [PKCS-7]PKCS #7: 57 | * Cryptographic Message Syntax Standard - An RSA Laboratories Technical Note.
58 | * RSA Security.

59 | * 60 | * @version $Revision: 1.4 $ 61 | **/ 62 | public final class PKCS7 extends BasePad { 63 | 64 | PKCS7() { 65 | super(Registry.PKCS7_PAD); 66 | } 67 | 68 | public void setup() { 69 | if (blockSize < 2 || blockSize > 256) { 70 | throw new IllegalArgumentException(); 71 | } 72 | } 73 | 74 | public byte[] pad(byte[] in, int offset, int length) { 75 | int padLength = blockSize; 76 | if (length % blockSize != 0) { 77 | padLength = blockSize - length % blockSize; 78 | } 79 | byte[] result = new byte[padLength]; 80 | for (int i = 0; i < padLength; ) { 81 | result[i++] = (byte) padLength; 82 | } 83 | 84 | return result; 85 | } 86 | 87 | public int unpad(byte[] in, int offset, int length) throws Exception { 88 | int limit = offset + length; 89 | int result = in[limit-1] & 0xFF; 90 | for (int i = 0; i < result; i++) { 91 | if (result != (in[--limit] & 0xFF)) { 92 | throw new Exception(); 93 | } 94 | } 95 | 96 | return result; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/pad/PadFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.pad; 42 | 43 | import gnu.crypto.Registry; 44 | 45 | import java.util.Collections; 46 | import java.util.HashSet; 47 | import java.util.Set; 48 | 49 | /* 50 | *

A Factory to instantiate padding schemes.

51 | * 52 | * @version $Revision: 1.6 $ 53 | **/ 54 | public class PadFactory implements Registry { 55 | 56 | private PadFactory() { 57 | super(); 58 | } 59 | 60 | /** 61 | *

Returns an instance of a padding algorithm given its name.

62 | * 63 | * @param pad the case-insensitive name of the padding algorithm. 64 | * @return an instance of the padding algorithm, operating with a given 65 | * block size, or null if none found. 66 | * @throws InternalError if the implementation does not pass its self-test. 67 | */ 68 | public static final IPad getInstance(String pad) { 69 | if (pad == null) { 70 | return null; 71 | } 72 | 73 | pad = pad.trim(); 74 | IPad result = null; 75 | if (pad.equalsIgnoreCase(PKCS7_PAD)) { 76 | result = new PKCS7(); 77 | } else if (pad.equalsIgnoreCase(TBC_PAD)) { 78 | result = new TBC(); 79 | } 80 | 81 | if (result != null && !result.selfTest()) { 82 | throw new InternalError(result.name()); 83 | } 84 | 85 | return result; 86 | } 87 | 88 | /** 89 | *

Returns a {@link Set} of names of padding algorithms 90 | * supported by this Factory.

91 | * 92 | * @return a {@link Set} of padding algorithm names (Strings). 93 | */ 94 | public static final Set getNames() { 95 | HashSet hs = new HashSet<>(); 96 | hs.add(PKCS7_PAD); 97 | hs.add(TBC_PAD); 98 | 99 | return Collections.unmodifiableSet(hs); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/pad/TBC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.pad; 42 | 43 | import gnu.crypto.Registry; 44 | 45 | /* 46 | *

The implementation of the Trailing Bit Complement (TBC) padding algorithm.

47 | * 48 | *

In this mode, "...the data string is padded at the trailing end with the 49 | * complement of the trailing bit of the unpadded message: if the trailing bit 50 | * is 1, then 0 bits are appended, and if the trailing bit is 51 | * 0, then 1 bits are appended. As few bits are added as are 52 | * necessary to meet the formatting size requirement."

53 | * 54 | * References:
55 | * 56 | * Recommendation for Block Cipher Modes of Operation Methods and Techniques, 57 | * Morris Dworkin.

58 | * 59 | * @version $Revision: 1.4 $ 60 | **/ 61 | public final class TBC extends BasePad { 62 | 63 | TBC() { 64 | super(Registry.TBC_PAD); 65 | } 66 | 67 | public void setup() { 68 | if (blockSize < 1 || blockSize > 256) { 69 | throw new IllegalArgumentException(); 70 | } 71 | } 72 | 73 | public byte[] pad(byte[] in, int offset, int length) { 74 | int padLength = blockSize; 75 | if (length % blockSize != 0) { 76 | padLength = blockSize - length % blockSize; 77 | } 78 | byte[] result = new byte[padLength]; 79 | int lastBit = in[offset+length-1] & 0x01; 80 | if (lastBit == 0) { 81 | for (int i = 0; i < padLength; ) { 82 | result[i++] = 0x01; 83 | } 84 | } // else it's already set to zeroes by virtue of initialisation 85 | 86 | return result; 87 | } 88 | 89 | public int unpad(byte[] in, int offset, int length) throws Exception { 90 | int limit = offset + length - 1; 91 | int lastBit = in[limit] & 0xFF; 92 | int result = 0; 93 | while (lastBit == (in[limit] & 0xFF)) { 94 | result++; 95 | limit--; 96 | } 97 | 98 | if (result > length) { 99 | throw new Exception(); 100 | } 101 | 102 | return result; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/gnu/crypto/util/Util.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Crypto. 5 | * 6 | * GNU Crypto is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Crypto is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; see the file COPYING. If not, write to the 18 | * 19 | * Free Software Foundation Inc., 20 | * 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307 22 | * USA 23 | * 24 | * Linking this library statically or dynamically with other modules is 25 | * making a combined work based on this library. Thus, the terms and 26 | * conditions of the GNU General Public License cover the whole 27 | * combination. 28 | * 29 | * As a special exception, the copyright holders of this library give 30 | * you permission to link this library with independent modules to 31 | * produce an executable, regardless of the license terms of these 32 | * independent modules, and to copy and distribute the resulting 33 | * executable under terms of your choice, provided that you also meet, 34 | * for each linked independent module, the terms and conditions of the 35 | * license of that module. An independent module is a module which is 36 | * not derived from or based on this library. If you modify this 37 | * library, you may extend this exception to your version of the 38 | * library, but you are not obligated to do so. If you do not wish to 39 | * do so, delete this exception statement from your version. 40 | **/ 41 | package gnu.crypto.util; 42 | 43 | /* 44 | *

A collection of utility methods used throughout this project.

45 | * 46 | * @version $Revision: 1.10 $ 47 | **/ 48 | public class Util { 49 | 50 | private Util() { 51 | super(); 52 | } 53 | 54 | /** 55 | *

Returns a byte array from a string of hexadecimal digits.

56 | * 57 | * @param s a string of hexadecimal ASCII characters 58 | * @return the decoded byte array from the input hexadecimal string. 59 | */ 60 | public static byte[] toBytesFromString(String s) { 61 | int limit = s.length(); 62 | byte[] result = new byte[((limit + 1) / 2)]; 63 | int i = 0, j = 0; 64 | if ((limit % 2) == 1) { 65 | result[j++] = (byte) fromDigit(s.charAt(i++)); 66 | } 67 | while (i < limit) { 68 | result[j ] = (byte) (fromDigit(s.charAt(i++)) << 4); 69 | result[j++] |= (byte) fromDigit(s.charAt(i++)); 70 | } 71 | return result; 72 | } 73 | 74 | /** 75 | *

Returns a number from 0 to 15 corresponding 76 | * to the designated hexadecimal digit.

77 | * 78 | * @param c a hexadecimal ASCII symbol. 79 | */ 80 | public static int fromDigit(char c) { 81 | if (c >= '0' && c <= '9') { 82 | return c - '0'; 83 | } else if (c >= 'A' && c <= 'F') { 84 | return c - 'A' + 10; 85 | } else if (c >= 'a' && c <= 'f') { 86 | return c - 'a' + 10; 87 | } else throw new IllegalArgumentException("Invalid hexadecimal digit: " + c); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/net/inbox/InboxList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InboxPager, an android email client. 3 | * Copyright (C) 2016-2024 ITPROJECTS 4 | *

5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | *

10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | **/ 17 | package net.inbox; 18 | 19 | import android.content.Context; 20 | import android.view.LayoutInflater; 21 | import android.view.View; 22 | import android.view.ViewGroup; 23 | import android.widget.BaseAdapter; 24 | import android.widget.TextView; 25 | 26 | import net.inbox.pager.R; 27 | 28 | import java.util.ArrayList; 29 | 30 | public class InboxList extends BaseAdapter { 31 | 32 | private Context ctx; 33 | private ArrayList inboxes; 34 | 35 | InboxList(Context ctx, ArrayList inboxes) { 36 | this.ctx = ctx; 37 | this.inboxes = inboxes; 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return inboxes.size(); 43 | } 44 | 45 | @Override 46 | public Object getItem(int position) { 47 | return inboxes.get(position); 48 | } 49 | 50 | @Override 51 | public long getItemId(int position) { 52 | return position; 53 | } 54 | 55 | @Override 56 | public View getView(int position, View v, ViewGroup parent) { 57 | if (v == null) { 58 | v = (LayoutInflater.from(this.ctx)).inflate(R.layout.inbox_list_row, parent, false); 59 | } 60 | 61 | InboxListItem itm = (InboxListItem) getItem(position); 62 | TextView tv_title = v.findViewById(R.id.inbox_list_title); 63 | tv_title.setText(itm.get_inbox()); 64 | TextView tv_count = v.findViewById(R.id.inbox_list_count); 65 | if (Integer.parseInt(itm.get_count()) < 1) { 66 | tv_count.setVisibility(View.GONE); 67 | } else { 68 | tv_count.setVisibility(View.VISIBLE); 69 | } 70 | 71 | tv_count.setText(itm.get_count()); 72 | 73 | return v; 74 | } 75 | } 76 | 77 | class InboxListItem { 78 | 79 | private int id; 80 | private String inbox_name; 81 | private String count; 82 | 83 | InboxListItem(int i, String si, int ic) { 84 | this.id = i; 85 | this.inbox_name = si; 86 | set_count(ic); 87 | } 88 | 89 | public int get_id() { 90 | return id; 91 | } 92 | 93 | String get_inbox() { 94 | return inbox_name; 95 | } 96 | 97 | String get_count() { 98 | return count; 99 | } 100 | 101 | void set_count(int i) { 102 | if (i < 1) { 103 | count = "000"; 104 | } else { 105 | if (i < 10) { 106 | count = "00" + i; 107 | } if (i > 9 && i < 100) { 108 | count = "0" + i; 109 | } else if (i > 999) { 110 | count = "+" + i; 111 | } 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/net/inbox/Settings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InboxPager, an android email client. 3 | * Copyright (C) 2016-2024 ITPROJECTS 4 | *

5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | *

10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | **/ 17 | package net.inbox; 18 | 19 | import android.os.Bundle; 20 | import androidx.fragment.app.FragmentActivity; 21 | import android.view.WindowManager; 22 | 23 | import net.inbox.pager.R; 24 | 25 | public class Settings extends FragmentActivity { 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | 31 | // Prevent Android Switcher leaking data via screenshots 32 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, 33 | WindowManager.LayoutParams.FLAG_SECURE); 34 | 35 | getSupportFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit(); 36 | } 37 | 38 | @Override 39 | public void finish() { 40 | super.finish(); 41 | overridePendingTransition(R.anim.left_in, R.anim.left_out); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/net/inbox/db/Attachment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InboxPager, an android email client. 3 | * Copyright (C) 2016-2024 ITPROJECTS 4 | *

5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | *

10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | **/ 17 | package net.inbox.db; 18 | 19 | import android.os.Parcel; 20 | import android.os.Parcelable; 21 | 22 | public class Attachment implements Parcelable { 23 | 24 | private int id = -2; 25 | private int account = -2; 26 | private int message = -2; 27 | private String imap_uid; 28 | private String pop_indx; 29 | private String mime_type; 30 | private String boundary; 31 | private String name; 32 | private String transfer_encoding; 33 | private int size;// octet = 8 bits 34 | 35 | public Attachment() {} 36 | 37 | public int get_id() { 38 | return id; 39 | } 40 | 41 | public int get_account() { 42 | return account; 43 | } 44 | 45 | public int get_message() { 46 | return message; 47 | } 48 | 49 | public String get_imap_uid() { 50 | return imap_uid; 51 | } 52 | 53 | public String get_pop_indx() { 54 | return pop_indx; 55 | } 56 | 57 | public String get_mime_type() { 58 | return mime_type; 59 | } 60 | 61 | public String get_boundary() { 62 | return boundary; 63 | } 64 | 65 | public String get_name() { 66 | return name; 67 | } 68 | 69 | public String get_transfer_encoding() { 70 | return transfer_encoding; 71 | } 72 | 73 | public int get_size() { 74 | return size; 75 | } 76 | 77 | public void set_id(int i) { 78 | id = i; 79 | } 80 | 81 | public void set_account(int i) { 82 | account = i; 83 | } 84 | 85 | public void set_message(int i) { 86 | message = i; 87 | } 88 | 89 | public void set_imap_uid(String s) { 90 | imap_uid = s; 91 | } 92 | 93 | public void set_pop_indx(String s) { 94 | pop_indx = s; 95 | } 96 | 97 | public void set_mime_type(String s) { 98 | mime_type = s; 99 | } 100 | 101 | public void set_boundary(String s) { 102 | boundary = s; 103 | } 104 | 105 | public void set_name(String s) { 106 | name = s; 107 | } 108 | 109 | public void set_transfer_encoding(String s) { 110 | transfer_encoding = s; 111 | } 112 | 113 | public void set_size(int i) { 114 | size = i; 115 | } 116 | 117 | protected Attachment(Parcel in) { 118 | id = in.readInt(); 119 | account = in.readInt(); 120 | message = in.readInt(); 121 | imap_uid = in.readString(); 122 | pop_indx = in.readString(); 123 | mime_type = in.readString(); 124 | boundary = in.readString(); 125 | name = in.readString(); 126 | transfer_encoding = in.readString(); 127 | size = in.readInt(); 128 | } 129 | 130 | @Override 131 | public int describeContents() { 132 | return 0; 133 | } 134 | 135 | @Override 136 | public void writeToParcel(Parcel dest, int flags) { 137 | dest.writeInt(id); 138 | dest.writeInt(account); 139 | dest.writeInt(message); 140 | dest.writeString(imap_uid); 141 | dest.writeString(pop_indx); 142 | dest.writeString(mime_type); 143 | dest.writeString(boundary); 144 | dest.writeString(name); 145 | dest.writeString(transfer_encoding); 146 | dest.writeInt(size); 147 | } 148 | 149 | @SuppressWarnings("unused") 150 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 151 | @Override 152 | public Attachment createFromParcel(Parcel in) { 153 | return new Attachment(in); 154 | } 155 | 156 | @Override 157 | public Attachment[] newArray(int size) { 158 | return new Attachment[size]; 159 | } 160 | }; 161 | } 162 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/net/inbox/visuals/AttachmentsList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InboxPager, an android email client. 3 | * Copyright (C) 2018-2024 ITPROJECTS 4 | *

5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | *

10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | **/ 17 | package net.inbox.visuals; 18 | 19 | import android.content.Context; 20 | import android.view.LayoutInflater; 21 | import android.view.View; 22 | import android.view.ViewGroup; 23 | import android.widget.BaseAdapter; 24 | import android.widget.RadioButton; 25 | import android.widget.TextView; 26 | 27 | import net.inbox.pager.R; 28 | 29 | import java.util.ArrayList; 30 | 31 | public class AttachmentsList extends BaseAdapter { 32 | 33 | private Context ctx; 34 | private ArrayList attachment_items; 35 | 36 | AttachmentsList(Context ctx, ArrayList attachment_items) { 37 | this.ctx = ctx; 38 | this.attachment_items = attachment_items; 39 | } 40 | 41 | @Override 42 | public int getCount() { 43 | return attachment_items.size(); 44 | } 45 | 46 | @Override 47 | public Object getItem(int position) { 48 | return attachment_items.get(position); 49 | } 50 | 51 | @Override 52 | public long getItemId(int position) { 53 | return position; 54 | } 55 | 56 | @Override 57 | public View getView(int position, View v, ViewGroup parent) { 58 | if (v == null) { 59 | v = (LayoutInflater.from(this.ctx)).inflate(R.layout.folder_picker_attachment_list_row, parent, false); 60 | } 61 | final AttachmentItem itm = (AttachmentItem) getItem(position); 62 | RadioButton rb_attachments = v.findViewById(R.id.rb_attachments); 63 | rb_attachments.setChecked(itm.get_picked()); 64 | TextView tv_pick_file_name = v.findViewById(R.id.attachments_name); 65 | tv_pick_file_name.setText(itm.get_file_name()); 66 | TextView tv_pick_file_type = v.findViewById(R.id.attachment_type); 67 | tv_pick_file_type.setText(itm.get_file_type()); 68 | if (itm.get_file_type() == null) { 69 | tv_pick_file_type.setVisibility(View.GONE); 70 | } else { 71 | tv_pick_file_type.setVisibility(View.VISIBLE); 72 | } 73 | TextView tv_pick_size = v.findViewById(R.id.attachment_size); 74 | tv_pick_size.setText(itm.get_s_file_size()); 75 | 76 | return v; 77 | } 78 | } 79 | 80 | class AttachmentItem { 81 | 82 | private boolean picked = false; 83 | private int i_file_size; 84 | private String s_file_size; 85 | private String file_name; 86 | private String file_type; 87 | private String file_uuid; 88 | 89 | AttachmentItem(int i_file_size, String s_file_size, String file_name, String file_type, 90 | String file_uuid) { 91 | this.i_file_size = i_file_size; 92 | this.s_file_size = s_file_size; 93 | this.file_name = file_name; 94 | this.file_type = file_type; 95 | this.file_uuid = file_uuid; 96 | } 97 | 98 | int get_i_file_size() { 99 | return i_file_size; 100 | } 101 | 102 | String get_s_file_size() { 103 | return s_file_size; 104 | } 105 | 106 | String get_file_name() { 107 | return file_name; 108 | } 109 | 110 | String get_file_type() { 111 | return file_type; 112 | } 113 | 114 | String get_file_uuid() { 115 | return file_uuid; 116 | } 117 | 118 | boolean get_picked() { 119 | return picked; 120 | } 121 | 122 | void set_picked(boolean p) { 123 | this.picked = p; 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/BinaryDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Defines common decoding methods for byte array decoders. 22 | * 23 | */ 24 | public interface BinaryDecoder extends Decoder { 25 | 26 | /** 27 | * Decodes a byte array and returns the results as a byte array. 28 | * 29 | * @param source 30 | * A byte array which has been encoded with the appropriate encoder 31 | * @return a byte array that contains decoded content 32 | * @throws DecoderException 33 | * A decoder exception is thrown if a Decoder encounters a failure condition during the decode process. 34 | */ 35 | byte[] decode(byte[] source) throws DecoderException; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/BinaryEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Defines common encoding methods for byte array encoders. 22 | * 23 | */ 24 | public interface BinaryEncoder extends Encoder { 25 | 26 | /** 27 | * Encodes a byte array and return the encoded data as a byte array. 28 | * 29 | * @param source 30 | * Data to be encoded 31 | * @return A byte array containing the encoded data 32 | * @throws EncoderException 33 | * thrown if the Encoder encounters a failure condition during the encoding process. 34 | */ 35 | byte[] encode(byte[] source) throws EncoderException; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/CharSequenceUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.commons.codec; 18 | 19 | /** 20 | *

21 | * Operations on {@link CharSequence} that are {@code null} safe. 22 | *

23 | *

24 | * Copied from Apache Commons Lang r1586295 on April 10, 2014 (day of 3.3.2 release). 25 | *

26 | * 27 | * @see CharSequence 28 | * @since 1.10 29 | */ 30 | public class CharSequenceUtils { 31 | 32 | /** 33 | * Green implementation of regionMatches. 34 | * 35 | * @param cs 36 | * the {@code CharSequence} to be processed 37 | * @param ignoreCase 38 | * whether or not to be case insensitive 39 | * @param thisStart 40 | * the index to start on the {@code cs} CharSequence 41 | * @param substring 42 | * the {@code CharSequence} to be looked for 43 | * @param start 44 | * the index to start on the {@code substring} CharSequence 45 | * @param length 46 | * character length of the region 47 | * @return whether the region matched 48 | */ 49 | public static boolean regionMatches(final CharSequence cs, final boolean ignoreCase, final int thisStart, 50 | final CharSequence substring, final int start, final int length) { 51 | if (cs instanceof String && substring instanceof String) { 52 | return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length); 53 | } 54 | int index1 = thisStart; 55 | int index2 = start; 56 | int tmpLen = length; 57 | 58 | while (tmpLen-- > 0) { 59 | final char c1 = cs.charAt(index1++); 60 | final char c2 = substring.charAt(index2++); 61 | 62 | if (c1 == c2) { 63 | continue; 64 | } 65 | 66 | if (!ignoreCase) { 67 | return false; 68 | } 69 | 70 | // The same check as in String.regionMatches(): 71 | if (Character.toUpperCase(c1) != Character.toUpperCase(c2) && 72 | Character.toLowerCase(c1) != Character.toLowerCase(c2)) { 73 | return false; 74 | } 75 | } 76 | 77 | return true; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/Decoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Provides the highest level of abstraction for Decoders. 22 | *

23 | * This is the sister interface of {@link Encoder}. All Decoders implement this common generic interface. 24 | * Allows a user to pass a generic Object to any Decoder implementation in the codec package. 25 | *

26 | * One of the two interfaces at the center of the codec package. 27 | * 28 | */ 29 | public interface Decoder { 30 | 31 | /** 32 | * Decodes an "encoded" Object and returns a "decoded" Object. Note that the implementation of this interface will 33 | * try to cast the Object parameter to the specific type expected by a particular Decoder implementation. If a 34 | * {@link ClassCastException} occurs this decode method will throw a DecoderException. 35 | * 36 | * @param source 37 | * the object to decode 38 | * @return a 'decoded" object 39 | * @throws DecoderException 40 | * a decoder exception can be thrown for any number of reasons. Some good candidates are that the 41 | * parameter passed to this method is null, a param cannot be cast to the appropriate type for a 42 | * specific encoder. 43 | */ 44 | Object decode(Object source) throws DecoderException; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/DecoderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Thrown when there is a failure condition during the decoding process. This exception is thrown when a {@link Decoder} 22 | * encounters a decoding specific exception such as invalid data, or characters outside of the expected range. 23 | * 24 | */ 25 | public class DecoderException extends Exception { 26 | 27 | /** 28 | * Declares the Serial Version Uid. 29 | * 30 | * @see Always Declare Serial Version Uid 31 | */ 32 | private static final long serialVersionUID = 1L; 33 | 34 | /** 35 | * Constructs a new exception with {@code null} as its detail message. The cause is not initialized, and may 36 | * subsequently be initialized by a call to {@link #initCause}. 37 | * 38 | * @since 1.4 39 | */ 40 | public DecoderException() { 41 | super(); 42 | } 43 | 44 | /** 45 | * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently 46 | * be initialized by a call to {@link #initCause}. 47 | * 48 | * @param message 49 | * The detail message which is saved for later retrieval by the {@link #getMessage()} method. 50 | */ 51 | public DecoderException(final String message) { 52 | super(message); 53 | } 54 | 55 | /** 56 | * Constructs a new exception with the specified detail message and cause. 57 | *

58 | * Note that the detail message associated with {@code cause} is not automatically incorporated into this 59 | * exception's detail message. 60 | * 61 | * @param message 62 | * The detail message which is saved for later retrieval by the {@link #getMessage()} method. 63 | * @param cause 64 | * The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null} 65 | * value is permitted, and indicates that the cause is nonexistent or unknown. 66 | * @since 1.4 67 | */ 68 | public DecoderException(final String message, final Throwable cause) { 69 | super(message, cause); 70 | } 71 | 72 | /** 73 | * Constructs a new exception with the specified cause and a detail message of (cause==null ? 74 | * null : cause.toString()) (which typically contains the class and detail message of {@code cause}). 75 | * This constructor is useful for exceptions that are little more than wrappers for other throwables. 76 | * 77 | * @param cause 78 | * The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null} 79 | * value is permitted, and indicates that the cause is nonexistent or unknown. 80 | * @since 1.4 81 | */ 82 | public DecoderException(final Throwable cause) { 83 | super(cause); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/Encoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Provides the highest level of abstraction for Encoders. 22 | *

23 | * This is the sister interface of {@link Decoder}. Every implementation of Encoder provides this 24 | * common generic interface which allows a user to pass a generic Object to any Encoder implementation 25 | * in the codec package. 26 | * 27 | */ 28 | public interface Encoder { 29 | 30 | /** 31 | * Encodes an "Object" and returns the encoded content as an Object. The Objects here may just be 32 | * {@code byte[]} or {@code String}s depending on the implementation used. 33 | * 34 | * @param source 35 | * An object to encode 36 | * @return An "encoded" Object 37 | * @throws EncoderException 38 | * An encoder exception is thrown if the encoder experiences a failure condition during the encoding 39 | * process. 40 | */ 41 | Object encode(Object source) throws EncoderException; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/EncoderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Thrown when there is a failure condition during the encoding process. This exception is thrown when an 22 | * {@link Encoder} encounters a encoding specific exception such as invalid data, inability to calculate a checksum, 23 | * characters outside of the expected range. 24 | * 25 | */ 26 | public class EncoderException extends Exception { 27 | 28 | /** 29 | * Declares the Serial Version Uid. 30 | * 31 | * @see Always Declare Serial Version Uid 32 | */ 33 | private static final long serialVersionUID = 1L; 34 | 35 | /** 36 | * Constructs a new exception with {@code null} as its detail message. The cause is not initialized, and may 37 | * subsequently be initialized by a call to {@link #initCause}. 38 | * 39 | * @since 1.4 40 | */ 41 | public EncoderException() { 42 | super(); 43 | } 44 | 45 | /** 46 | * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently 47 | * be initialized by a call to {@link #initCause}. 48 | * 49 | * @param message 50 | * a useful message relating to the encoder specific error. 51 | */ 52 | public EncoderException(final String message) { 53 | super(message); 54 | } 55 | 56 | /** 57 | * Constructs a new exception with the specified detail message and cause. 58 | * 59 | *

60 | * Note that the detail message associated with {@code cause} is not automatically incorporated into this 61 | * exception's detail message. 62 | *

63 | * 64 | * @param message 65 | * The detail message which is saved for later retrieval by the {@link #getMessage()} method. 66 | * @param cause 67 | * The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null} 68 | * value is permitted, and indicates that the cause is nonexistent or unknown. 69 | * @since 1.4 70 | */ 71 | public EncoderException(final String message, final Throwable cause) { 72 | super(message, cause); 73 | } 74 | 75 | /** 76 | * Constructs a new exception with the specified cause and a detail message of (cause==null ? 77 | * null : cause.toString()) (which typically contains the class and detail message of {@code cause}). 78 | * This constructor is useful for exceptions that are little more than wrappers for other throwables. 79 | * 80 | * @param cause 81 | * The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null} 82 | * value is permitted, and indicates that the cause is nonexistent or unknown. 83 | * @since 1.4 84 | */ 85 | public EncoderException(final Throwable cause) { 86 | super(cause); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/StringDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Defines common decoding methods for String decoders. 22 | * 23 | */ 24 | public interface StringDecoder extends Decoder { 25 | 26 | /** 27 | * Decodes a String and returns a String. 28 | * 29 | * @param source 30 | * the String to decode 31 | * @return the encoded String 32 | * @throws DecoderException 33 | * thrown if there is an error condition during the Encoding process. 34 | */ 35 | String decode(String source) throws DecoderException; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/StringEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | /** 21 | * Defines common encoding methods for String encoders. 22 | * 23 | */ 24 | public interface StringEncoder extends Encoder { 25 | 26 | /** 27 | * Encodes a String and returns a String. 28 | * 29 | * @param source 30 | * the String to encode 31 | * @return the encoded String 32 | * @throws EncoderException 33 | * thrown if there is an error condition during the encoding process. 34 | */ 35 | String encode(String source) throws EncoderException; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/codec/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.codec; 19 | 20 | import org.apache.commons.codec.DecoderException; 21 | 22 | /** 23 | * Utility methods for this package. 24 | * 25 | *

This class is immutable and thread-safe.

26 | * 27 | * @since 1.4 28 | */ 29 | class Utils { 30 | 31 | /** 32 | * Radix used in encoding and decoding. 33 | */ 34 | private static final int RADIX = 16; 35 | 36 | /** 37 | * Returns the numeric value of the character {@code b} in radix 16. 38 | * 39 | * @param b 40 | * The byte to be converted. 41 | * @return The numeric value represented by the character in radix 16. 42 | * 43 | * @throws DecoderException 44 | * Thrown when the byte is not valid per {@link Character#digit(char,int)} 45 | */ 46 | static int digit16(final byte b) throws DecoderException { 47 | final int i = Character.digit((char) b, RADIX); 48 | if (i == -1) { 49 | throw new DecoderException("Invalid URL encoding: not a valid digit (radix " + RADIX + "): " + b); 50 | } 51 | return i; 52 | } 53 | 54 | /** 55 | * Returns the upper case hex digit of the lower 4 bits of the int. 56 | * 57 | * @param b the input int 58 | * @return the upper case hex digit of the lower 4 bits of the int. 59 | */ 60 | static char hexDigit(final int b) { 61 | return Character.toUpperCase(Character.forDigit(b & 0xF, RADIX)); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.commons.fileupload.util.mime; 18 | 19 | /** 20 | * @since 1.3 21 | */ 22 | final class ParseException extends Exception { 23 | 24 | /** 25 | * The UID to use when serializing this instance. 26 | */ 27 | private static final long serialVersionUID = 5355281266579392077L; 28 | 29 | /** 30 | * Constructs a new exception with the specified detail message. 31 | * 32 | * @param message the detail message. 33 | */ 34 | public ParseException(String message) { 35 | super(message); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.commons.fileupload.util.mime; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * @since 1.3 24 | */ 25 | final class QuotedPrintableDecoder { 26 | 27 | /** 28 | * The shift value required to create the upper nibble 29 | * from the first of 2 byte values converted from ascii hex. 30 | */ 31 | private static final int UPPER_NIBBLE_SHIFT = Byte.SIZE / 2; 32 | 33 | /** 34 | * Hidden constructor, this class must not be instantiated. 35 | */ 36 | private QuotedPrintableDecoder() { 37 | // do nothing 38 | } 39 | 40 | /** 41 | * Decode the encoded byte data writing it to the given output stream. 42 | * 43 | * @param data The array of byte data to decode. 44 | * @param out The output stream used to return the decoded data. 45 | * 46 | * @return the number of bytes produced. 47 | * @throws IOException 48 | */ 49 | public static int decode(byte[] data, OutputStream out) throws IOException { 50 | int off = 0; 51 | int length = data.length; 52 | int endOffset = off + length; 53 | int bytesWritten = 0; 54 | 55 | while (off < endOffset) { 56 | byte ch = data[off++]; 57 | 58 | // space characters were translated to '_' on encode, so we need to translate them back. 59 | if (ch == '_') { 60 | out.write(' '); 61 | } else if (ch == '=') { 62 | // we found an encoded character. Reduce the 3 char sequence to one. 63 | // but first, make sure we have two characters to work with. 64 | if (off + 1 >= endOffset) { 65 | throw new IOException("Invalid quoted printable encoding; truncated escape sequence"); 66 | } 67 | 68 | byte b1 = data[off++]; 69 | byte b2 = data[off++]; 70 | 71 | // we've found an encoded carriage return. The next char needs to be a newline 72 | if (b1 == '\r') { 73 | if (b2 != '\n') { 74 | throw new IOException("Invalid quoted printable encoding; CR must be followed by LF"); 75 | } 76 | // this was a soft linebreak inserted by the encoding. We just toss this away 77 | // on decode. 78 | } else { 79 | // this is a hex pair we need to convert back to a single byte. 80 | int c1 = hexToBinary(b1); 81 | int c2 = hexToBinary(b2); 82 | out.write((c1 << UPPER_NIBBLE_SHIFT) | c2); 83 | // 3 bytes in, one byte out 84 | bytesWritten++; 85 | } 86 | } else { 87 | // simple character, just write it out. 88 | out.write(ch); 89 | bytesWritten++; 90 | } 91 | } 92 | 93 | return bytesWritten; 94 | } 95 | 96 | /** 97 | * Convert a hex digit to the binary value it represents. 98 | * 99 | * @param b the ascii hex byte to convert (0-0, A-F, a-f) 100 | * @return the int value of the hex byte, 0-15 101 | * @throws IOException if the byte is not a valid hex digit. 102 | */ 103 | private static int hexToBinary(final byte b) throws IOException { 104 | // CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE 105 | final int i = Character.digit((char) b, 16); 106 | if (i == -1) { 107 | throw new IOException("Invalid quoted printable encoding: not a valid hex digit: " + b); 108 | } 109 | return i; 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/openintents/openpgp/OpenPgpError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014-2015 Dominik Schürmann 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.openpgp; 18 | 19 | import android.os.Parcel; 20 | import android.os.Parcelable; 21 | 22 | public class OpenPgpError implements Parcelable { 23 | /** 24 | * Since there might be a case where new versions of the client using the library getting 25 | * old versions of the protocol (and thus old versions of this class), we need a versioning 26 | * system for the parcels sent between the clients and the providers. 27 | */ 28 | public static final int PARCELABLE_VERSION = 1; 29 | 30 | // possible values for errorId 31 | public static final int CLIENT_SIDE_ERROR = -1; 32 | public static final int GENERIC_ERROR = 0; 33 | public static final int INCOMPATIBLE_API_VERSIONS = 1; 34 | public static final int NO_OR_WRONG_PASSPHRASE = 2; 35 | public static final int NO_USER_IDS = 3; 36 | public static final int OPPORTUNISTIC_MISSING_KEYS = 4; 37 | 38 | 39 | int errorId; 40 | String message; 41 | 42 | public OpenPgpError() { 43 | } 44 | 45 | public OpenPgpError(int errorId, String message) { 46 | this.errorId = errorId; 47 | this.message = message; 48 | } 49 | 50 | public OpenPgpError(OpenPgpError b) { 51 | this.errorId = b.errorId; 52 | this.message = b.message; 53 | } 54 | 55 | public int getErrorId() { 56 | return errorId; 57 | } 58 | 59 | public void setErrorId(int errorId) { 60 | this.errorId = errorId; 61 | } 62 | 63 | public String getMessage() { 64 | return message; 65 | } 66 | 67 | public void setMessage(String message) { 68 | this.message = message; 69 | } 70 | 71 | public int describeContents() { 72 | return 0; 73 | } 74 | 75 | public void writeToParcel(Parcel dest, int flags) { 76 | /** 77 | * NOTE: When adding fields in the process of updating this API, make sure to bump 78 | * {@link #PARCELABLE_VERSION}. 79 | */ 80 | dest.writeInt(PARCELABLE_VERSION); 81 | // Inject a placeholder that will store the parcel size from this point on 82 | // (not including the size itself). 83 | int sizePosition = dest.dataPosition(); 84 | dest.writeInt(0); 85 | int startPosition = dest.dataPosition(); 86 | // version 1 87 | dest.writeInt(errorId); 88 | dest.writeString(message); 89 | // Go back and write the size 90 | int parcelableSize = dest.dataPosition() - startPosition; 91 | dest.setDataPosition(sizePosition); 92 | dest.writeInt(parcelableSize); 93 | dest.setDataPosition(startPosition + parcelableSize); 94 | } 95 | 96 | public static final Creator CREATOR = new Creator() { 97 | public OpenPgpError createFromParcel(final Parcel source) { 98 | source.readInt(); // parcelableVersion 99 | int parcelableSize = source.readInt(); 100 | int startPosition = source.dataPosition(); 101 | 102 | OpenPgpError error = new OpenPgpError(); 103 | error.errorId = source.readInt(); 104 | error.message = source.readString(); 105 | 106 | // skip over all fields added in future versions of this parcel 107 | source.setDataPosition(startPosition + parcelableSize); 108 | 109 | return error; 110 | } 111 | 112 | public OpenPgpError[] newArray(final int size) { 113 | return new OpenPgpError[size]; 114 | } 115 | }; 116 | } 117 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/openintents/openpgp/util/OpenPgpServiceConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014-2015 Dominik Schürmann 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.openintents.openpgp.util; 18 | 19 | import android.content.ComponentName; 20 | import android.content.Context; 21 | import android.content.Intent; 22 | import android.content.ServiceConnection; 23 | import android.os.IBinder; 24 | 25 | import org.openintents.openpgp.IOpenPgpService2; 26 | 27 | public class OpenPgpServiceConnection { 28 | 29 | // callback interface 30 | public interface OnBound { 31 | void onBound(IOpenPgpService2 service); 32 | 33 | void onError(Exception e); 34 | } 35 | 36 | private Context mApplicationContext; 37 | 38 | private IOpenPgpService2 mService; 39 | private String mProviderPackageName; 40 | 41 | private OnBound mOnBoundListener; 42 | 43 | /** 44 | * Create new connection 45 | * 46 | * @param context 47 | * @param providerPackageName specify package name of OpenPGP provider, 48 | * e.g., "org.sufficientlysecure.keychain" 49 | */ 50 | public OpenPgpServiceConnection(Context context, String providerPackageName) { 51 | this.mApplicationContext = context.getApplicationContext(); 52 | this.mProviderPackageName = providerPackageName; 53 | } 54 | 55 | /** 56 | * Create new connection with callback 57 | * 58 | * @param context 59 | * @param providerPackageName specify package name of OpenPGP provider, 60 | * e.g., "org.sufficientlysecure.keychain" 61 | * @param onBoundListener callback, executed when connection to service has been established 62 | */ 63 | public OpenPgpServiceConnection(Context context, String providerPackageName, 64 | OnBound onBoundListener) { 65 | this(context, providerPackageName); 66 | this.mOnBoundListener = onBoundListener; 67 | } 68 | 69 | public IOpenPgpService2 getService() { 70 | return mService; 71 | } 72 | 73 | public boolean isBound() { 74 | return (mService != null); 75 | } 76 | 77 | private ServiceConnection mServiceConnection = new ServiceConnection() { 78 | public void onServiceConnected(ComponentName name, IBinder service) { 79 | mService = IOpenPgpService2.Stub.asInterface(service); 80 | if (mOnBoundListener != null) { 81 | mOnBoundListener.onBound(mService); 82 | } 83 | } 84 | 85 | public void onServiceDisconnected(ComponentName name) { 86 | mService = null; 87 | } 88 | }; 89 | 90 | /** 91 | * If not already bound, bind to service! 92 | * 93 | * @return 94 | */ 95 | public void bindToService() { 96 | // if not already bound... 97 | if (mService == null) { 98 | try { 99 | Intent serviceIntent = new Intent(OpenPgpApi.SERVICE_INTENT_2); 100 | // NOTE: setPackage is very important to restrict the intent to this provider only! 101 | serviceIntent.setPackage(mProviderPackageName); 102 | boolean connect = mApplicationContext.bindService(serviceIntent, mServiceConnection, 103 | Context.BIND_AUTO_CREATE); 104 | if (!connect) { 105 | throw new Exception("bindService() returned false!"); 106 | } 107 | } catch (Exception e) { 108 | if (mOnBoundListener != null) { 109 | mOnBoundListener.onError(e); 110 | } 111 | } 112 | } else { 113 | // already bound, but also inform client about it with callback 114 | if (mOnBoundListener != null) { 115 | mOnBoundListener.onBound(mService); 116 | } 117 | } 118 | } 119 | 120 | public void unbindFromService() { 121 | mApplicationContext.unbindService(mServiceConnection); 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /InboxPager/src/main/java/org/openintents/openpgp/util/ParcelFileDescriptorUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014-2015 Dominik Schürmann 3 | * 2013 Florian Schmaus 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.openintents.openpgp.util; 19 | 20 | import android.os.ParcelFileDescriptor; 21 | import android.util.Log; 22 | 23 | import java.io.IOException; 24 | import java.io.InputStream; 25 | import java.io.OutputStream; 26 | 27 | public class ParcelFileDescriptorUtil { 28 | 29 | public static ParcelFileDescriptor pipeFrom(InputStream inputStream) 30 | throws IOException { 31 | ParcelFileDescriptor[] pipe = ParcelFileDescriptor.createPipe(); 32 | ParcelFileDescriptor readSide = pipe[0]; 33 | ParcelFileDescriptor writeSide = pipe[1]; 34 | 35 | new TransferThread(inputStream, new ParcelFileDescriptor.AutoCloseOutputStream(writeSide)) 36 | .start(); 37 | 38 | return readSide; 39 | } 40 | 41 | 42 | public static TransferThread pipeTo(OutputStream outputStream, ParcelFileDescriptor output) 43 | throws IOException { 44 | 45 | TransferThread t = new TransferThread(new ParcelFileDescriptor.AutoCloseInputStream(output), outputStream); 46 | 47 | t.start(); 48 | return t; 49 | } 50 | 51 | 52 | static class TransferThread extends Thread { 53 | final InputStream mIn; 54 | final OutputStream mOut; 55 | 56 | TransferThread(InputStream in, OutputStream out) { 57 | super("IPC Transfer Thread"); 58 | mIn = in; 59 | mOut = out; 60 | setDaemon(true); 61 | } 62 | 63 | @Override 64 | public void run() { 65 | byte[] buf = new byte[4096]; 66 | int len; 67 | 68 | try { 69 | while ((len = mIn.read(buf)) > 0) { 70 | mOut.write(buf, 0, len); 71 | } 72 | } catch (IOException e) { 73 | Log.e(OpenPgpApi.TAG, "IOException when writing to out", e); 74 | } finally { 75 | try { 76 | mIn.close(); 77 | } catch (IOException ignored) { 78 | } 79 | try { 80 | mOut.close(); 81 | } catch (IOException ignored) { 82 | } 83 | } 84 | } 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/anim/left_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/anim/left_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/anim/right_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/anim/right_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/attachment.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/attachments_unaffected.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_green_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_green_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_orange.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_orange_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_orange_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_refresh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_refresh_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 16 | 24 | 25 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_refresh_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 16 | 24 | 25 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/btn_send_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/counter_rounded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/datetime.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/drawer.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/focus_mode_allmsg.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 20 | 27 | 34 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/focus_mode_unread.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 20 | 27 | 34 | 40 | 46 | 52 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/inbox_list_view_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/location.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/network.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_aes.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_error.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_normal.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_pgp_closed.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_pgp_closed_inverted.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_pgp_open.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 16 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_pgp_open_inverted.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 16 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/padlock_txt.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 14 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/pick_file.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/pick_folder.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/popup_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/remove_item.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/reply_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/sent_to_specific.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/signature.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/spinner_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/unseen_floating_normal.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 23 | 24 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/unseen_floating_pressed.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 23 | 24 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/unseen_in_group.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/drawable/unseen_in_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/font/dottz.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itprojects/InboxPager/bea1cf543dde6a40be1c00ebc5cef0f562c46116/InboxPager/src/main/res/font/dottz.ttf -------------------------------------------------------------------------------- /InboxPager/src/main/res/font/dottz_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 12 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/file_picker.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 19 | 20 | 31 | 32 | 42 | 43 | 62 | 63 | 64 | 65 | 75 | 76 | 82 | 83 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/file_picker_list_row.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 28 | 29 | 43 | 44 | 55 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/folder_picker.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 19 | 20 | 31 | 32 | 42 | 43 | 62 | 63 | 64 | 65 | 74 | 75 | 82 | 83 | 88 | 89 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/folder_picker_attachment_list_row.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 28 | 29 | 43 | 44 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/inbox_list_row.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 21 | 22 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/message_list_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 20 | 21 | 32 | 33 | 44 | 45 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/message_list_row.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | 14 | 22 | 23 | 32 | 33 | 34 | 35 | 45 | 46 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/pager.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 38 | 39 | 40 | 41 | 47 | 48 | 52 | 53 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/popup.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/pw_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | 21 | 31 | 32 | 37 | 38 | 48 | 49 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/pw_txt.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 27 | 28 | 39 | 40 | 50 | 51 | 52 | 53 | 61 | 62 | 73 | 74 | 79 | 80 | 90 | 91 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/layout/spinner_item.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/menu/crypto_action_btns.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/menu/message_action_btns.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/menu/pager_action_btns.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/menu/send_action_btns.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/mipmap-hdpi/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itprojects/InboxPager/bea1cf543dde6a40be1c00ebc5cef0f562c46116/InboxPager/src/main/res/mipmap-hdpi/application.png -------------------------------------------------------------------------------- /InboxPager/src/main/res/mipmap-mdpi/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itprojects/InboxPager/bea1cf543dde6a40be1c00ebc5cef0f562c46116/InboxPager/src/main/res/mipmap-mdpi/application.png -------------------------------------------------------------------------------- /InboxPager/src/main/res/mipmap-xhdpi/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itprojects/InboxPager/bea1cf543dde6a40be1c00ebc5cef0f562c46116/InboxPager/src/main/res/mipmap-xhdpi/application.png -------------------------------------------------------------------------------- /InboxPager/src/main/res/mipmap-xxhdpi/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itprojects/InboxPager/bea1cf543dde6a40be1c00ebc5cef0f562c46116/InboxPager/src/main/res/mipmap-xxhdpi/application.png -------------------------------------------------------------------------------- /InboxPager/src/main/res/mipmap-xxxhdpi/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itprojects/InboxPager/bea1cf543dde6a40be1c00ebc5cef0f562c46116/InboxPager/src/main/res/mipmap-xxxhdpi/application.png -------------------------------------------------------------------------------- /InboxPager/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F6F38C 4 | #1D2412 5 | #FFFFFF 6 | #499c4a 7 | #0ab12f 8 | #0fd63b 9 | #F60 10 | #ffa366 11 | #f50c08 12 | #E91E63 13 | 14 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22sp 4 | 22sp 5 | 22sp 6 | 18sp 7 | 8 | 9 | -------------------------------------------------------------------------------- /InboxPager/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 25 | 26 |