├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── app ├── build.gradle ├── libs │ └── Parse-1.8.2.jar ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── com │ │ └── android │ │ └── vending │ │ └── licensing │ │ ├── ILicenseResultListener.aidl │ │ └── ILicensingService.aidl │ ├── assets │ ├── abaker_usage │ │ ├── archive.html │ │ ├── css │ │ │ ├── archive.css │ │ │ ├── download.css │ │ │ ├── read.css │ │ │ └── shared.css │ │ ├── download.html │ │ ├── img │ │ │ ├── abaker-ui-archive-hand.png │ │ │ ├── abaker-ui-download-hand.png │ │ │ └── abaker-ui-read-hand.png │ │ └── read.html │ ├── background.html │ ├── books │ │ └── README │ ├── header.html │ ├── img │ │ ├── header.png │ │ ├── logo.png │ │ └── splash.png │ ├── info.html │ └── sample.mp4 │ ├── java │ └── com │ │ ├── bakerframework │ │ └── baker │ │ │ ├── BakerApplication.java │ │ │ ├── GcmBroadcastReceiver.java │ │ │ ├── activity │ │ │ ├── InfoActivity.java │ │ │ ├── IssueActivity.java │ │ │ ├── ModalActivity.java │ │ │ ├── ShelfActivity.java │ │ │ └── SplashActivity.java │ │ │ ├── adapter │ │ │ └── IssueAdapter.java │ │ │ ├── events │ │ │ ├── ArchiveIssueCompleteEvent.java │ │ │ ├── DownloadIssueCompleteEvent.java │ │ │ ├── DownloadIssueErrorEvent.java │ │ │ ├── DownloadIssueProgressEvent.java │ │ │ ├── DownloadManifestCompleteEvent.java │ │ │ ├── DownloadManifestErrorEvent.java │ │ │ ├── ExtractIssueCompleteEvent.java │ │ │ ├── ExtractIssueErrorEvent.java │ │ │ ├── ExtractIssueProgressEvent.java │ │ │ ├── FetchPurchasesCompleteEvent.java │ │ │ ├── FetchPurchasesErrorEvent.java │ │ │ ├── IssueCollectionErrorEvent.java │ │ │ ├── IssueCollectionLoadedEvent.java │ │ │ ├── IssueDataUpdatedEvent.java │ │ │ ├── ParseBookJsonCompleteEvent.java │ │ │ └── ParseBookJsonErrorEvent.java │ │ │ ├── handler │ │ │ ├── ApiRequestHandler.java │ │ │ ├── DownloadHandler.java │ │ │ └── PluginManager.java │ │ │ ├── helper │ │ │ ├── FileHelper.java │ │ │ └── ImageLoaderHelper.java │ │ │ ├── jobs │ │ │ ├── ArchiveIssueJob.java │ │ │ ├── DownloadIssueJob.java │ │ │ ├── DownloadManifestJob.java │ │ │ ├── ExtractIssueJob.java │ │ │ ├── FetchPurchasesJob.java │ │ │ ├── ParseBookJsonJob.java │ │ │ └── Priority.java │ │ │ ├── model │ │ │ ├── BookJson.java │ │ │ ├── Issue.java │ │ │ ├── IssueCollection.java │ │ │ ├── LocalIssueCollection.java │ │ │ └── RemoteIssueCollection.java │ │ │ ├── play │ │ │ ├── ApiPurchaseVerifier.java │ │ │ ├── LicenceManager.java │ │ │ └── LicenceManagerDelegate.java │ │ │ ├── plugin │ │ │ ├── BakerPlugin.java │ │ │ ├── GoogleAnalyticsPlugin.java │ │ │ └── ParsePlugin.java │ │ │ ├── settings │ │ │ ├── Configuration.java │ │ │ ├── SettingsActivity.java │ │ │ └── SettingsFragment.java │ │ │ ├── view │ │ │ ├── CustomWebView.java │ │ │ ├── IssueCardView.java │ │ │ ├── ShelfView.java │ │ │ ├── WebViewFragment.java │ │ │ └── WebViewFragmentPagerAdapter.java │ │ │ └── widget │ │ │ └── SwipeRefreshScrollLayout.java │ │ └── google │ │ └── android │ │ └── vending │ │ └── licensing │ │ ├── AESObfuscator.java │ │ ├── APKExpansionPolicy.java │ │ ├── DeviceLimiter.java │ │ ├── ILicenseResultListener.java │ │ ├── ILicensingService.java │ │ ├── LicenseChecker.java │ │ ├── LicenseCheckerCallback.java │ │ ├── LicenseValidator.java │ │ ├── NullDeviceLimiter.java │ │ ├── Obfuscator.java │ │ ├── Policy.java │ │ ├── PreferenceObfuscator.java │ │ ├── ResponseData.java │ │ ├── ServerManagedPolicy.java │ │ ├── StrictPolicy.java │ │ ├── ValidationException.java │ │ └── util │ │ ├── Base64.java │ │ └── Base64DecoderException.java │ └── res │ ├── anim │ ├── bounce.xml │ ├── fade_in.xml │ ├── fade_out.xml │ └── logo_fade_in.xml │ ├── drawable-hdpi │ ├── baker_action_button.xml │ ├── baker_modal_button.xml │ ├── drawer_shadow.9.png │ ├── ic_action_about.png │ ├── ic_action_labels.png │ ├── ic_action_refresh.png │ ├── ic_action_settings.png │ ├── ic_drawer.png │ ├── ic_launcher.png │ ├── logo.png │ ├── progressbar.xml │ └── rounded_corners.xml │ ├── drawable-mdpi │ ├── drawer_shadow.9.png │ ├── ic_action_about.png │ ├── ic_action_labels.png │ ├── ic_action_refresh.png │ ├── ic_action_settings.png │ ├── ic_drawer.png │ ├── ic_launcher.png │ └── logo.png │ ├── drawable-xhdpi │ ├── drawer_shadow.9.png │ ├── ic_action_about.png │ ├── ic_action_labels.png │ ├── ic_action_refresh.png │ ├── ic_action_settings.png │ ├── ic_drawer.png │ ├── ic_launcher.png │ └── logo.png │ ├── drawable-xxhdpi │ ├── drawer_shadow.9.png │ ├── ic_action_about.png │ ├── ic_action_labels.png │ ├── ic_action_refresh.png │ ├── ic_action_settings.png │ ├── ic_action_subscribe.png │ ├── ic_drawer.png │ ├── ic_launcher.png │ └── logo.png │ ├── drawable │ ├── baker_scrollbar_horizontal.xml │ ├── baker_scrollbar_vertical.xml │ ├── cover_shadow.9.png │ └── loading.jpg │ ├── layout-v14 │ └── drawer_list_item.xml │ ├── layout │ ├── drawer_list_item.xml │ ├── fragment_category.xml │ ├── info_activity.xml │ ├── issue_activity.xml │ ├── issue_card_view.xml │ ├── modal_activity.xml │ ├── settings_actionbar.xml │ ├── shelf_actionbar.xml │ ├── shelf_activity.xml │ ├── splash_activity.xml │ ├── usage_activity.xml │ ├── view_loading_video.xml │ └── web_view_fragment.xml │ ├── menu │ ├── magazine.xml │ ├── shelf.xml │ └── video.xml │ ├── values-sw600dp │ └── dimens.xml │ ├── values-sw720dp-land │ └── dimens.xml │ ├── values-v11 │ └── styles.xml │ ├── values-v14 │ └── styles.xml │ ├── values-v16 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ ├── values │ ├── attrs.xml │ ├── booleans.xml │ ├── dimens.xml │ ├── ga_settings.xml │ ├── strings.xml │ ├── styles.xml │ └── theme.xml │ └── xml │ ├── ecommerce_tracker.xml │ ├── global_tracker.xml │ └── preferences.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | #built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Windows thumbnail db 19 | Thumbs.db 20 | 21 | # OSX files 22 | .DS_Store 23 | 24 | # Eclipse project files 25 | .classpath 26 | .project 27 | 28 | # Android Studio 29 | .idea 30 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. 31 | .gradle 32 | build/ 33 | 34 | # Project specific 35 | secret.yml 36 | app/manifest-merger-release-report.txt 37 | app/src/main/assets/books/*/* 38 | *.iml 39 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Baker Android App Changelog 2 | 3 | 4.4.0: 4 | 5 | ▸ XWalkView 11.40.277.7 integration (Chromium version 40) 6 | ▸ Removal of native Android Webview 7 | ▸ Support for latest chromium features 8 | ▸ Web view stability improvements (memory-management) 9 | 10 | 4.3.0: 11 | 12 | ▸ Initial Release, based on refactoring bakerframework/baker-android repository 13 | ▸ In App Purchases and Subscriptions 14 | ▸ Performance optimizations 15 | ▸ UI / Usability optimizations (aligned with baker iOS) 16 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 2 | Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are 6 | permitted provided that the following conditions are met: 7 | 8 | Redistributions of source code must retain the above copyright notice, this list of 9 | conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | Neither the name of the Baker Framework nor the names of its contributors may be used to 14 | endorse or promote products derived from this software without specific prior written 15 | permission. 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 17 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Baker Android App [![Google Play](http://developer.android.com/images/brand/en_generic_rgb_wo_45.png)](https://play.google.com/store/apps/details?id=com.magloft.demo) [![Build Status](https://travis-ci.org/bakerframework/baker-android-refactor.png)](https://travis-ci.org/bakerframework/baker-android-refactor) 2 | 3 | The HTML5 ebook framework to publish interactive books & magazines on any Android device using simply open web standards http://bakerframework.com 4 | 5 | Please see the [issues](https://github.com/bakerframework/baker-android-refactor/issues) section to 6 | report any bugs or feature requests and to see the list of known issues. 7 | 8 | ## Preview 9 | 10 | [![View Demo](http://magloft-static.s3.amazonaws.com/baker-android.gif)](http://cdn.magloft.com/preview/baker-android.mp4) 11 | 12 | [![Download from Google Play](http://magloft-static.s3.amazonaws.com/baker-screen.png)](https://play.google.com/store/apps/details?id=com.magloft.demo) 13 | 14 | ## Requirements 15 | 16 | 1. Android Studio: 17 | 18 | Tools > Android SDK Tools 19 | Tools > Android SDK Platform-tools 20 | Tools > Android SDK Build-tools 21 | Android 5.0.1 (API 21) > SDK Platform 22 | Extras > Android Support Repository 23 | Extras > Android Support Library 24 | Extras > Google Play services 25 | Extras > Google Repository 26 | Extras > Google Play Billing Library 27 | Extras > Google Play Licensing Library 28 | 29 | ## Installation 30 | Clone or [Download](https://github.com/bakerframework/baker-android-refactor/archive/4.4.0.zip) this repository, import in Android Studio and build/run the _Baker_ build configuration 31 | 32 | $ git clone git@github.com:bakerframework/baker-android-refactor.git 33 | 34 | Beginner-friendly instructions can be found in [Tutorial - Installation Guide](https://github.com/bakerframework/baker-android-refactor/wiki/Tutorial---Installation-Guide) 35 | 36 | ## Tutorials 37 | 38 | Tutorials can be found in the [Baker Android Wiki](https://github.com/bakerframework/baker-android-refactor/wiki) 39 | 40 | ## Acknowledgements 41 | 42 | This project is based on the original [Baker Android](https://github.com/bakerframework/baker-android) project by @fcontreras, @hsalazarl and @nin9creative. 43 | 44 | This project follows the features and roadmap of the official [Baker iOS Project](https://github.com/bakerframework/baker), currently maintained by @pieterclaerhout, @nin9creative and the baker community. 45 | 46 | This project integrates nicely with [Baker Cloud Console](http://www.bakerframework.com/bakercloudce/) and [MagLoft](http://www.magloft.com). 47 | 48 | A special shout-out to Intel Open Source Technology Center for bringing a chromium-based webview to android, allowing modern HTML5/CSS3 awesomeness, which is not provided by the native webview in current android sdks. 49 | 50 | It also uses other great open source libraries such as: 51 | 52 | * [jsoup](https://github.com/jhy/jsoup) 53 | * [Android Checkout Library](https://github.com/serso/android-checkout) 54 | * [Google GSON](https://code.google.com/p/google-gson) 55 | * [Universal Image Loader](https://github.com/nostra13/Android-Universal-Image-Loader) 56 | * [ViewPagerIndicator](https://github.com/JakeWharton/Android-ViewPagerIndicator) 57 | * [The Crosswalk Project](https://crosswalk-project.org/) 58 | 59 | ## Contributing 60 | 61 | Please fork this repository and contribute back using 62 | [pull requests](https://github.com/bakerframework/baker-android-refactor/pulls). 63 | 64 | Any kind of contribution, features, bug fixes, language translations, unit/integration tests, refactors are welcome and appreciated but will be thoroughly reviewed and discussed. 65 | 66 | Please make sure that: 67 | 68 | * Your pull request is based on the latest possible version of the Baker Android `master` branch 69 | * You have provided a meaningful title for your pull request 70 | * You have briefly explained in the pull request what it does and why it should be merged 71 | * You have referenced any relevant issue 72 | 73 | ## License 74 | 75 | This software is free to use under the BSD license. 76 | See the [LICENSE file][] for license text and copyright information. 77 | 78 | 79 | [LICENSE file]: https://github.com/bakerframework/baker-android-refactor/blob/master/LICENSE.md 80 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | dependencies { 6 | classpath 'com.android.tools.build:gradle:1.0.0' 7 | } 8 | } 9 | 10 | apply plugin: 'com.android.application' 11 | apply plugin: 'maven' 12 | 13 | version '1.0' 14 | group 'com.baker' 15 | 16 | android { 17 | compileSdkVersion 21 18 | buildToolsVersion "21.1.2" 19 | 20 | defaultConfig { 21 | applicationId project.property("application-id") 22 | minSdkVersion 14 23 | targetSdkVersion 21 24 | versionCode 10 25 | versionName "1.0" 26 | } 27 | 28 | buildTypes { 29 | debug { 30 | debuggable true 31 | } 32 | release { 33 | minifyEnabled false 34 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 35 | } 36 | } 37 | 38 | dexOptions { 39 | incremental true 40 | javaMaxHeapSize "4g" 41 | preDexLibraries = false 42 | } 43 | } 44 | 45 | // Release signing for debugging 46 | if(project.hasProperty("extra-gradle") && new File(project.property("extra-gradle")).exists()) { 47 | apply from: project.property("extra-gradle"); 48 | } 49 | 50 | repositories { 51 | maven { url "http://dl.bintray.com/populov/maven" } 52 | maven { url "https://download.01.org/crosswalk/releases/crosswalk/android/maven2" } 53 | mavenCentral() 54 | maven { 55 | url 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath 56 | } 57 | } 58 | 59 | dependencies { 60 | compile 'com.google.android.gms:play-services:6.5.+' 61 | compile 'org.jsoup:jsoup:1.7.3' 62 | compile 'org.apache.commons:commons-compress:1.8.1' 63 | compile 'com.viewpagerindicator:library:2.4.1@aar' 64 | compile 'com.android.support:appcompat-v7:21.+' 65 | compile 'org.solovyev.android:checkout:0.6.2@aar' 66 | compile 'com.google.code.gson:gson:2.3.1' 67 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' 68 | compile 'com.path:android-priority-jobqueue:1.1.2' 69 | compile 'de.greenrobot:eventbus:2.4.0' 70 | compile 'org.zeroturnaround:zt-zip:1.8' 71 | compile 'com.parse.bolts:bolts-android:1.+' 72 | compile 'org.xwalk:xwalk_core_library:11.40.277.7' 73 | compile fileTree(dir: 'libs', include: 'Parse-*.jar') 74 | } 75 | -------------------------------------------------------------------------------- /app/libs/Parse-1.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/libs/Parse-1.8.2.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keepclassmembers class com.bakerframework.baker.view.VideoEnabledWebView$JavascriptInterface { public *; } 2 | -------------------------------------------------------------------------------- /app/src/main/aidl/com/android/vending/licensing/ILicenseResultListener.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.android.vending.licensing; 18 | 19 | // Android library projects do not yet support AIDL, so this has been 20 | // precompiled into the src directory. 21 | oneway interface ILicenseResultListener { 22 | void verifyLicense(int responseCode, String signedData, String signature); 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/aidl/com/android/vending/licensing/ILicensingService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.android.vending.licensing; 18 | 19 | import com.android.vending.licensing.ILicenseResultListener; 20 | 21 | // Android library projects do not yet support AIDL, so this has been 22 | // precompiled into the src directory. 23 | oneway interface ILicensingService { 24 | void checkLicense(long nonce, String packageName, in ILicenseResultListener listener); 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/archive.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |

10 | Archive issues 11 |

12 |

13 | Archive issues after you have finished with them! 14 |

15 |
16 | 17 | -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/css/archive.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-image: url('../img/abaker-ui-archive-hand.png'); 3 | background-repeat: no-repeat; 4 | background-size: cover; 5 | background-position:center center; 6 | } 7 | .overlay { 8 | 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/css/download.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-image: url('../img/abaker-ui-download-hand.png'); 3 | background-repeat: no-repeat; 4 | background-size: cover; 5 | background-position:center center; 6 | } 7 | .overlay { 8 | 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/css/read.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-image: url('../img/abaker-ui-read-hand.png'); 3 | background-repeat: no-repeat; 4 | background-size: cover; 5 | background-position:center center; 6 | } 7 | .overlay { 8 | 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/css/shared.css: -------------------------------------------------------------------------------- 1 | .summary { 2 | margin-top:20%; 3 | } 4 | .title { 5 | color:#AF160E; 6 | } 7 | .description { 8 | color:#FFFFFF; 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |

10 | Get the content 11 |

12 |

13 | Tap the "Download" button or the issue cover to get the content! 14 |

15 |
16 | 17 | -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/img/abaker-ui-archive-hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/abaker_usage/img/abaker-ui-archive-hand.png -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/img/abaker-ui-download-hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/abaker_usage/img/abaker-ui-download-hand.png -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/img/abaker-ui-read-hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/abaker_usage/img/abaker-ui-read-hand.png -------------------------------------------------------------------------------- /app/src/main/assets/abaker_usage/read.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |

10 | View the issue 11 |

12 |

13 | Tap the "Read" button to start viewing the issue! 14 |

15 |
16 | 17 | -------------------------------------------------------------------------------- /app/src/main/assets/background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/assets/books/README: -------------------------------------------------------------------------------- 1 | Place your issues in this directory if you want Baker to run as standalone. Also, enable the standalone mode in "res/values/booleans.xml". 2 | 3 | Each directory placed here will be considered an issue if it contains a book.json file. -------------------------------------------------------------------------------- /app/src/main/assets/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/assets/img/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/img/header.png -------------------------------------------------------------------------------- /app/src/main/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/img/logo.png -------------------------------------------------------------------------------- /app/src/main/assets/img/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/img/splash.png -------------------------------------------------------------------------------- /app/src/main/assets/info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 34 | 35 | 36 | 39 | 40 |
41 |
42 |

Baker is a HTML5 based digital publication framework for publishing interactive books & magazines on iPad & iPhone using simply open web standards.

43 |
44 |
45 | 46 | Splash 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/assets/sample.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/assets/sample.mp4 -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/activity/InfoActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.activity; 28 | 29 | import android.app.Activity; 30 | import android.content.Intent; 31 | import android.content.pm.ActivityInfo; 32 | import android.os.Bundle; 33 | import android.view.View; 34 | import android.webkit.WebSettings; 35 | import android.webkit.WebView; 36 | import android.webkit.WebViewClient; 37 | 38 | import com.bakerframework.baker.R; 39 | 40 | 41 | public class InfoActivity extends Activity { 42 | 43 | @Override 44 | protected void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | 47 | setContentView(R.layout.info_activity); 48 | 49 | // Here we allow the user to rotate the screen. 50 | this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); 51 | 52 | Intent intent = getIntent(); 53 | String url = intent.getStringExtra(IssueActivity.MODAL_URL); 54 | 55 | // Click on the CLOSE button. 56 | findViewById(R.id.btnCloseInfo).setOnClickListener(new View.OnClickListener() { 57 | public void onClick(View v) { 58 | InfoActivity.this.finish(); 59 | } 60 | }); 61 | 62 | WebView webView = (WebView) this.findViewById(R.id.infoWebView); 63 | WebSettings webSettings = webView.getSettings(); 64 | webSettings.setJavaScriptEnabled(true); 65 | webSettings.setSupportZoom(true); 66 | webSettings.setUseWideViewPort(true); 67 | webSettings.setDisplayZoomControls(false); 68 | webSettings.setBuiltInZoomControls(true); 69 | webSettings.setLoadWithOverviewMode(true); 70 | webView.setWebViewClient(new WebViewClient() { 71 | 72 | @Override 73 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 74 | view.loadUrl(url); 75 | return true; 76 | } 77 | }); 78 | webView.loadUrl(url); 79 | } 80 | 81 | @Override 82 | public void onStop() { 83 | super.onStop(); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/activity/ModalActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.activity; 28 | 29 | import android.app.Activity; 30 | import android.content.Intent; 31 | import android.content.pm.ActivityInfo; 32 | import android.os.Bundle; 33 | import android.support.annotation.NonNull; 34 | import android.view.KeyEvent; 35 | import android.view.Menu; 36 | import android.view.View; 37 | 38 | import com.bakerframework.baker.R; 39 | 40 | import org.xwalk.core.XWalkNavigationHistory; 41 | import org.xwalk.core.XWalkResourceClient; 42 | import org.xwalk.core.XWalkView; 43 | 44 | public class ModalActivity extends Activity { 45 | 46 | private int orientation; 47 | private XWalkView webView; 48 | 49 | @Override 50 | protected void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | 53 | setContentView(R.layout.modal_activity); 54 | 55 | // Here we allow the user to rotate the screen. 56 | this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); 57 | 58 | Intent intent = getIntent(); 59 | String baseUrl = intent.getStringExtra(IssueActivity.MODAL_URL); 60 | orientation = intent.getIntExtra(IssueActivity.ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_SENSOR); 61 | 62 | // Click on the CLOSE button. 63 | findViewById(R.id.btnCloseModal).setOnClickListener(new View.OnClickListener() { 64 | public void onClick(View v) { 65 | ModalActivity.this.finish(); 66 | } 67 | }); 68 | 69 | // Initialize the webview 70 | webView = (XWalkView) findViewById(R.id.modalWebView); 71 | webView.setResourceClient(new XWalkResourceClient(webView) { 72 | @Override 73 | public boolean shouldOverrideUrlLoading(XWalkView view, String url) { 74 | return false; 75 | } 76 | }); 77 | 78 | webView.load(baseUrl, null); 79 | } 80 | 81 | @Override 82 | public void onStop() { 83 | this.setRequestedOrientation(orientation); 84 | super.onStop(); 85 | } 86 | 87 | @Override 88 | public boolean onKeyDown(int keyCode, @NonNull KeyEvent event){ 89 | if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.getNavigationHistory().canGoBack()){ 90 | webView.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.BACKWARD, 1); 91 | return true; 92 | } 93 | return super.onKeyDown(keyCode, event); 94 | } 95 | 96 | @Override 97 | public boolean onCreateOptionsMenu(Menu menu) { 98 | return true; 99 | } 100 | 101 | @Override 102 | public void onDestroy() { 103 | webView.pauseTimers(); 104 | webView.onDestroy(); 105 | super.onDestroy(); 106 | } 107 | 108 | } 109 | 110 | 111 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/ArchiveIssueCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class ArchiveIssueCompleteEvent { 32 | private final Issue issue; 33 | 34 | public ArchiveIssueCompleteEvent(Issue issue) { 35 | this.issue = issue; 36 | } 37 | 38 | public Issue getIssue() { 39 | return issue; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/DownloadIssueCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class DownloadIssueCompleteEvent { 32 | private final Issue issue; 33 | 34 | public DownloadIssueCompleteEvent(Issue issue) { 35 | this.issue = issue; 36 | } 37 | 38 | public Issue getIssue() { 39 | return issue; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/DownloadIssueErrorEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class DownloadIssueErrorEvent { 32 | private final Issue issue; 33 | private final Throwable throwable; 34 | 35 | public DownloadIssueErrorEvent(Issue issue, Throwable throwable) { 36 | this.issue = issue; 37 | this.throwable = throwable; 38 | } 39 | 40 | public Issue getIssue() { 41 | return issue; 42 | } 43 | 44 | public Throwable getThrowable() { 45 | return throwable; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/DownloadIssueProgressEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class DownloadIssueProgressEvent { 32 | private final Issue issue; 33 | private final int progress; 34 | private final long bytesSoFar; 35 | private final long totalBytes; 36 | 37 | public DownloadIssueProgressEvent(Issue issue, int progress, long bytesSoFar, long totalBytes) { 38 | this.progress = progress; 39 | this.bytesSoFar = bytesSoFar; 40 | this.totalBytes = totalBytes; 41 | this.issue = issue; 42 | } 43 | 44 | public int getProgress() { 45 | return progress; 46 | } 47 | public long getBytesSoFar() { 48 | return bytesSoFar; 49 | } 50 | public long getTotalBytes() { 51 | return totalBytes; 52 | } 53 | 54 | public Issue getIssue() { 55 | return issue; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/DownloadManifestCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | public class DownloadManifestCompleteEvent { 30 | 31 | public DownloadManifestCompleteEvent() { 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/DownloadManifestErrorEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | public class DownloadManifestErrorEvent { 30 | private final Throwable throwable; 31 | 32 | public DownloadManifestErrorEvent(Throwable throwable) { 33 | this.throwable = throwable; 34 | } 35 | 36 | public Throwable getThrowable() { 37 | return throwable; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/ExtractIssueCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class ExtractIssueCompleteEvent { 32 | private final Issue issue; 33 | 34 | public ExtractIssueCompleteEvent(Issue issue) { 35 | this.issue = issue; 36 | } 37 | 38 | public Issue getIssue() { 39 | return issue; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/ExtractIssueErrorEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class ExtractIssueErrorEvent { 32 | private final Issue issue; 33 | 34 | public ExtractIssueErrorEvent(Issue issue) { 35 | this.issue = issue; 36 | } 37 | 38 | public Issue getIssue() { 39 | return issue; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/ExtractIssueProgressEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class ExtractIssueProgressEvent { 32 | private final Issue issue; 33 | private final int progress; 34 | 35 | public ExtractIssueProgressEvent(Issue issue, int progress) { 36 | this.progress = progress; 37 | this.issue = issue; 38 | } 39 | 40 | public int getProgress() { 41 | return progress; 42 | } 43 | 44 | public Issue getIssue() { 45 | return issue; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/FetchPurchasesCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.jobs.FetchPurchasesJob.FetchPurchasesResponse; 30 | 31 | public class FetchPurchasesCompleteEvent { 32 | private final FetchPurchasesResponse fetchPurchasesResponse; 33 | 34 | public FetchPurchasesCompleteEvent(FetchPurchasesResponse fetchPurchasesResponse) { 35 | this.fetchPurchasesResponse = fetchPurchasesResponse; 36 | } 37 | 38 | public FetchPurchasesResponse getFetchPurchasesResponse() { 39 | return fetchPurchasesResponse; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/FetchPurchasesErrorEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | public class FetchPurchasesErrorEvent { 30 | private final Throwable throwable; 31 | 32 | public FetchPurchasesErrorEvent(Throwable throwable) { 33 | this.throwable = throwable; 34 | } 35 | 36 | public Throwable getThrowable() { 37 | return throwable; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/IssueCollectionErrorEvent.java: -------------------------------------------------------------------------------- 1 | package com.bakerframework.baker.events; 2 | 3 | /** 4 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 5 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 6 | * All rights reserved. 7 | *

8 | * Redistribution and use in source and binary forms, with or without modification, are 9 | * permitted provided that the following conditions are met: 10 | *

11 | * Redistributions of source code must retain the above copyright notice, this list of 12 | * conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright notice, this list of 14 | * conditions and the following disclaimer in the documentation and/or other materials 15 | * provided with the distribution. 16 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 17 | * endorse or promote products derived from this software without specific prior written 18 | * permission. 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 22 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | public class IssueCollectionErrorEvent { 30 | private final Throwable throwable; 31 | 32 | public IssueCollectionErrorEvent(Throwable throwable) { 33 | this.throwable = throwable; 34 | } 35 | 36 | public Throwable getThrowable() { 37 | return throwable; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/IssueCollectionLoadedEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | public class IssueCollectionLoadedEvent { 30 | 31 | public IssueCollectionLoadedEvent() { 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/IssueDataUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class IssueDataUpdatedEvent { 32 | private final Issue issue; 33 | 34 | public IssueDataUpdatedEvent(Issue issue) { 35 | this.issue = issue; 36 | } 37 | 38 | public Issue getIssue() { 39 | return issue; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/ParseBookJsonCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.BookJson; 30 | import com.bakerframework.baker.model.Issue; 31 | 32 | public class ParseBookJsonCompleteEvent { 33 | private final Issue issue; 34 | private final BookJson bookJson; 35 | 36 | public ParseBookJsonCompleteEvent(Issue issue, BookJson bookJson) { 37 | this.issue = issue; 38 | this.bookJson = bookJson; 39 | } 40 | 41 | public Issue getIssue() { 42 | return issue; 43 | } 44 | public BookJson getBookJson() { 45 | return bookJson; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/events/ParseBookJsonErrorEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.events; 28 | 29 | import com.bakerframework.baker.model.Issue; 30 | 31 | public class ParseBookJsonErrorEvent { 32 | private final Issue issue; 33 | private final Throwable throwable; 34 | 35 | public ParseBookJsonErrorEvent(Issue issue, Throwable throwable) { 36 | this.issue = issue; 37 | this.throwable = throwable; 38 | } 39 | 40 | public Issue getIssue() { 41 | return issue; 42 | } 43 | public Throwable getThrowable() { 44 | return throwable; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/handler/PluginManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.handler; 28 | 29 | import android.app.Activity; 30 | import android.util.Log; 31 | 32 | import com.bakerframework.baker.BakerApplication; 33 | import com.bakerframework.baker.R; 34 | import com.bakerframework.baker.model.Issue; 35 | import com.bakerframework.baker.plugin.BakerPlugin; 36 | 37 | import org.solovyev.android.checkout.Sku; 38 | 39 | import java.lang.reflect.Constructor; 40 | import java.util.ArrayList; 41 | import java.util.Arrays; 42 | import java.util.List; 43 | 44 | public class PluginManager { 45 | private final List plugins; 46 | 47 | public PluginManager() { 48 | plugins = new ArrayList<>(); 49 | List pluginClassNames = Arrays.asList(BakerApplication.getInstance().getResources().getStringArray(R.array.baker_plugins)); 50 | for (String pluginClassName : pluginClassNames) { 51 | try { 52 | Class pluginClass = Class.forName("com.bakerframework.baker.plugin." + pluginClassName); 53 | Class[] types = {}; 54 | Constructor constructor = pluginClass.getConstructor(types); 55 | BakerPlugin plugin = (BakerPlugin) constructor.newInstance(); 56 | plugins.add(plugin); 57 | } catch (Exception e) { 58 | Log.e("BakerApplication", "Plugin Error: " + e.getMessage()); 59 | } 60 | } 61 | Log.d("BakerApplication", "Initialized " + plugins.size() + " plugins"); 62 | } 63 | 64 | // Activity Events 65 | 66 | public void onSplashActivityCreated(Activity activity) { 67 | for(BakerPlugin plugin : plugins) { 68 | plugin.onSplashActivityCreated(activity); 69 | } 70 | } 71 | 72 | public void onShelfActivityCreated(Activity activity) { 73 | for(BakerPlugin plugin : plugins) { 74 | plugin.onShelfActivityCreated(activity); 75 | } 76 | } 77 | 78 | public void onIssueActivityCreated(Activity activity) { 79 | for(BakerPlugin plugin : plugins) { 80 | plugin.onIssueActivityCreated(activity); 81 | } 82 | } 83 | 84 | // Shelf / Issue Events 85 | 86 | public void onIssueDownloadClicked(Issue issue) { 87 | for(BakerPlugin plugin : plugins) { 88 | plugin.onIssueDownloadClicked(issue); 89 | } 90 | } 91 | 92 | public void onIssuePurchaseClicked(Issue issue) { 93 | for(BakerPlugin plugin : plugins) { 94 | plugin.onIssuePurchaseClicked(issue); 95 | } 96 | } 97 | 98 | public void onIssueArchiveClicked(Issue issue) { 99 | for(BakerPlugin plugin : plugins) { 100 | plugin.onIssueArchiveClicked(issue); 101 | } 102 | } 103 | 104 | // Issue Navigation Events 105 | 106 | public void onIssuePageOpened(Issue issue, String pageTitle, int pageIndex) { 107 | for(BakerPlugin plugin : plugins) { 108 | plugin.onIssuePageOpened(issue, pageTitle, pageIndex); 109 | } 110 | } 111 | 112 | // Purchase Events 113 | 114 | public void onIssueReadClicked(Issue issue) { 115 | for(BakerPlugin plugin : plugins) { 116 | plugin.onIssueReadClicked(issue); 117 | } 118 | } 119 | 120 | public void onSubscribeClicked(Sku subscription) { 121 | for(BakerPlugin plugin : plugins) { 122 | plugin.onSubscribeClicked(subscription); 123 | } 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/helper/FileHelper.java: -------------------------------------------------------------------------------- 1 | package com.bakerframework.baker.helper; 2 | 3 | import com.bakerframework.baker.BakerApplication; 4 | 5 | import org.json.JSONArray; 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import java.io.File; 10 | import java.io.FileInputStream; 11 | import java.io.FileNotFoundException; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | 15 | /** 16 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 17 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 18 | * All rights reserved. 19 | *

20 | * Redistribution and use in source and binary forms, with or without modification, are 21 | * permitted provided that the following conditions are met: 22 | *

23 | * Redistributions of source code must retain the above copyright notice, this list of 24 | * conditions and the following disclaimer. 25 | * Redistributions in binary form must reproduce the above copyright notice, this list of 26 | * conditions and the following disclaimer in the documentation and/or other materials 27 | * provided with the distribution. 28 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 29 | * endorse or promote products derived from this software without specific prior written 30 | * permission. 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 32 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 33 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 34 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 35 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 36 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 37 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | */ 41 | public class FileHelper { 42 | 43 | public static String getContentsFromFile(File file) { 44 | FileInputStream in = null; 45 | try { 46 | in = new FileInputStream(file); 47 | byte[] buffer = new byte[1024]; 48 | StringBuilder data = new StringBuilder(""); 49 | while (in.read(buffer) != -1) { 50 | data.append(new String(buffer)); 51 | } 52 | in.close(); 53 | return data.toString(); 54 | } catch (FileNotFoundException e) { 55 | return null; 56 | } catch (IOException e) { 57 | return null; 58 | } 59 | } 60 | 61 | public static String getContentsFromInputStream(InputStream stream) { 62 | try { 63 | byte[] buffer = new byte[1024]; 64 | StringBuilder data = new StringBuilder(""); 65 | while (stream.read(buffer) != -1) { 66 | data.append(new String(buffer)); 67 | } 68 | stream.close(); 69 | return data.toString(); 70 | } catch (FileNotFoundException e) { 71 | return null; 72 | } catch (IOException e) { 73 | return null; 74 | } 75 | } 76 | 77 | public static JSONArray getJsonArrayFromFile(File file) { 78 | try { 79 | return new JSONArray(getContentsFromFile(file)); 80 | } catch (JSONException e) { 81 | return null; 82 | } 83 | } 84 | 85 | public static JSONObject getJsonObjectFromFile(File file) { 86 | try { 87 | return new JSONObject(getContentsFromFile(file)); 88 | } catch (JSONException e) { 89 | return null; 90 | } 91 | } 92 | 93 | public static JSONObject getJsonObjectFromAsset(String assetPath) { 94 | try { 95 | InputStream inputStream = BakerApplication.getInstance().getAssets().open(assetPath); 96 | String fileContents = getContentsFromInputStream(inputStream); 97 | inputStream.close(); 98 | return new JSONObject(fileContents); 99 | } catch (IOException e) { 100 | return null; 101 | } catch (JSONException e) { 102 | return null; 103 | } 104 | } 105 | 106 | 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/helper/ImageLoaderHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.helper; 28 | 29 | import android.content.Context; 30 | import android.graphics.Bitmap; 31 | import android.util.Log; 32 | 33 | import com.bakerframework.baker.R; 34 | import com.nostra13.universalimageloader.core.DisplayImageOptions; 35 | import com.nostra13.universalimageloader.core.ImageLoader; 36 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; 37 | import com.nostra13.universalimageloader.core.assist.ImageScaleType; 38 | import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; 39 | 40 | public class ImageLoaderHelper { 41 | 42 | 43 | private ImageLoaderHelper() {} 44 | 45 | public static ImageLoader getImageLoader(Context context){ 46 | try { 47 | if (ImageLoader.getInstance().isInited()) { 48 | return ImageLoader.getInstance(); 49 | } 50 | DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() 51 | .showImageOnLoading(R.drawable.loading) 52 | .showImageForEmptyUri(R.drawable.loading) 53 | .showImageOnFail(R.drawable.loading) 54 | .cacheInMemory(true) 55 | .cacheOnDisk(true) 56 | .displayer(new FadeInBitmapDisplayer(1000)) 57 | .bitmapConfig(Bitmap.Config.RGB_565) 58 | .imageScaleType(ImageScaleType.EXACTLY) 59 | .build(); 60 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) 61 | .memoryCacheExtraOptions(480, 320) 62 | .diskCacheExtraOptions(480, 320, null) 63 | .defaultDisplayImageOptions(defaultOptions).build(); 64 | ImageLoader.getInstance().init(config); 65 | return ImageLoader.getInstance(); 66 | } catch (Exception ex) { 67 | Log.e("ImageLoaderHelper", "Error loading image: " + ex); 68 | return null; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/jobs/ArchiveIssueJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.jobs; 28 | 29 | import android.util.Log; 30 | 31 | import com.bakerframework.baker.events.ArchiveIssueCompleteEvent; 32 | import com.bakerframework.baker.model.Issue; 33 | import com.bakerframework.baker.settings.Configuration; 34 | import com.path.android.jobqueue.Job; 35 | import com.path.android.jobqueue.Params; 36 | 37 | import java.io.File; 38 | 39 | import de.greenrobot.event.EventBus; 40 | 41 | public class ArchiveIssueJob extends Job { 42 | private final Issue issue; 43 | private boolean completed; 44 | 45 | public ArchiveIssueJob(Issue issue) { 46 | super(new Params(Priority.MID).setPersistent(false).setGroupId(issue.getName())); 47 | this.issue = issue; 48 | completed = false; 49 | } 50 | 51 | @Override 52 | public void onAdded() { 53 | 54 | } 55 | 56 | @Override 57 | public void onRun() throws Throwable { 58 | 59 | // Delete directory 60 | File issueDirectory = new File(Configuration.getMagazinesDirectory(), issue.getName()); 61 | Configuration.deleteDirectory(issueDirectory.getAbsolutePath()); 62 | 63 | // Post complete event 64 | completed = true; 65 | Log.i("ArchiveIssueJob", "completed"); 66 | EventBus.getDefault().post(new ArchiveIssueCompleteEvent(issue)); 67 | } 68 | 69 | @Override 70 | protected void onCancel() { 71 | 72 | } 73 | 74 | @Override 75 | protected boolean shouldReRunOnThrowable(Throwable throwable) { 76 | return false; 77 | } 78 | 79 | public boolean isCompleted() { 80 | return completed; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/jobs/DownloadIssueJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.jobs; 28 | 29 | import android.util.Log; 30 | 31 | import com.bakerframework.baker.events.DownloadIssueCompleteEvent; 32 | import com.bakerframework.baker.events.DownloadIssueErrorEvent; 33 | import com.bakerframework.baker.events.DownloadIssueProgressEvent; 34 | import com.bakerframework.baker.handler.DownloadHandler; 35 | import com.bakerframework.baker.model.Issue; 36 | import com.path.android.jobqueue.Job; 37 | import com.path.android.jobqueue.Params; 38 | 39 | import de.greenrobot.event.EventBus; 40 | 41 | public class DownloadIssueJob extends Job { 42 | private final Issue issue; 43 | private boolean completed; 44 | private DownloadHandler downloadHandler; 45 | 46 | public DownloadIssueJob(Issue issue) { 47 | super(new Params(Priority.LOW).requireNetwork().setPersistent(false).setGroupId(issue.getName())); 48 | this.issue = issue; 49 | this.completed = false; 50 | } 51 | 52 | @Override 53 | public void onAdded() { 54 | 55 | } 56 | 57 | @Override 58 | public void onRun() throws Throwable { 59 | // Download file 60 | downloadHandler = new DownloadHandler(issue.getUrl()) { 61 | @Override 62 | public void onDownloadProgress(int percentComplete, long bytesSoFar, long totalBytes) { 63 | EventBus.getDefault().post(new DownloadIssueProgressEvent(issue, percentComplete, bytesSoFar, totalBytes)); 64 | } 65 | }; 66 | downloadHandler.download(issue.getHpubFile()); 67 | 68 | // Complete job 69 | completed = true; 70 | EventBus.getDefault().post(new DownloadIssueCompleteEvent(issue)); 71 | } 72 | 73 | @Override 74 | protected boolean shouldReRunOnThrowable(Throwable throwable) { 75 | Log.e("DownloadIssueJob", throwable.getLocalizedMessage()); 76 | completed = true; 77 | EventBus.getDefault().post(new DownloadIssueErrorEvent(issue, throwable)); 78 | return false; 79 | } 80 | 81 | @Override 82 | protected void onCancel() { 83 | downloadHandler.cancel(); 84 | } 85 | 86 | public Issue getIssue() { 87 | return issue; 88 | } 89 | 90 | public boolean isCompleted() { 91 | return completed; 92 | } 93 | 94 | public void cancel() { 95 | this.completed = true; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/jobs/DownloadManifestJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.jobs; 28 | 29 | import android.util.Log; 30 | 31 | import com.bakerframework.baker.events.DownloadManifestCompleteEvent; 32 | import com.bakerframework.baker.events.DownloadManifestErrorEvent; 33 | import com.bakerframework.baker.handler.DownloadHandler; 34 | import com.path.android.jobqueue.Job; 35 | import com.path.android.jobqueue.Params; 36 | 37 | import java.io.File; 38 | 39 | import de.greenrobot.event.EventBus; 40 | 41 | public class DownloadManifestJob extends Job { 42 | private final String url; 43 | private final File targetFile; 44 | private boolean completed; 45 | private DownloadHandler downloadHandler; 46 | 47 | public DownloadManifestJob(String url, File targetFile) { 48 | super(new Params(Priority.LOW).setPersistent(false).setGroupId("application")); 49 | this.url= url; 50 | this.targetFile = targetFile; 51 | this.completed = false; 52 | } 53 | 54 | @Override 55 | public void onAdded() { 56 | 57 | } 58 | 59 | @Override 60 | public void onRun() throws Throwable { 61 | Log.d("DownloadManifestJob", "DOWNLOADING FILE: " + url); 62 | 63 | // Download file 64 | downloadHandler = new DownloadHandler(this.url); 65 | downloadHandler.download(this.targetFile); 66 | 67 | // Complete job 68 | completed = true; 69 | EventBus.getDefault().post(new DownloadManifestCompleteEvent()); 70 | } 71 | 72 | @Override 73 | protected boolean shouldReRunOnThrowable(Throwable throwable) { 74 | Log.e("DownloadManifestJob", throwable.getLocalizedMessage()); 75 | completed = true; 76 | EventBus.getDefault().post(new DownloadManifestErrorEvent(throwable)); 77 | return false; 78 | } 79 | 80 | @Override 81 | protected void onCancel() { 82 | downloadHandler.cancel(); 83 | } 84 | 85 | public boolean isCompleted() { 86 | return completed; 87 | } 88 | 89 | public void cancel() { 90 | this.completed = true; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/jobs/FetchPurchasesJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.jobs; 28 | 29 | import android.util.Log; 30 | 31 | import com.bakerframework.baker.events.FetchPurchasesCompleteEvent; 32 | import com.bakerframework.baker.events.FetchPurchasesErrorEvent; 33 | import com.bakerframework.baker.handler.ApiRequestHandler; 34 | import com.bakerframework.baker.handler.DownloadHandler; 35 | import com.bakerframework.baker.settings.Configuration; 36 | import com.path.android.jobqueue.Job; 37 | import com.path.android.jobqueue.Params; 38 | 39 | import java.util.List; 40 | 41 | import de.greenrobot.event.EventBus; 42 | 43 | public class FetchPurchasesJob extends Job { 44 | private final String url; 45 | private boolean completed; 46 | private DownloadHandler downloadHandler; 47 | 48 | public FetchPurchasesJob(String url) { 49 | super(new Params(Priority.LOW).requireNetwork().setPersistent(false).setGroupId("application")); 50 | this.url= url; 51 | this.completed = false; 52 | } 53 | 54 | @Override 55 | public void onAdded() { 56 | 57 | } 58 | 59 | @Override 60 | public void onRun() throws Throwable { 61 | Log.d("FetchPurchasesJob", "fetching purchases from " + url); 62 | String purchasesResult = ""; 63 | 64 | // Build request handler 65 | ApiRequestHandler apiRequestHandler = new ApiRequestHandler(Configuration.getPurchasesUrl()); 66 | 67 | // Post purchase verification request 68 | boolean success = apiRequestHandler.get(); 69 | completed = true; 70 | 71 | if(success) { 72 | FetchPurchasesResponse fetchPurchasesResponse = apiRequestHandler.getResponseObject(FetchPurchasesResponse.class); 73 | EventBus.getDefault().post(new FetchPurchasesCompleteEvent(fetchPurchasesResponse)); 74 | }else{ 75 | EventBus.getDefault().post(new FetchPurchasesErrorEvent(new Exception(apiRequestHandler.getResponseText()))); 76 | } 77 | 78 | } 79 | 80 | @Override 81 | protected boolean shouldReRunOnThrowable(Throwable throwable) { 82 | Log.e("FetchPurchasesJob", throwable.getLocalizedMessage()); 83 | completed = true; 84 | EventBus.getDefault().post(new FetchPurchasesErrorEvent(throwable)); 85 | return false; 86 | } 87 | 88 | @Override 89 | protected void onCancel() { 90 | downloadHandler.cancel(); 91 | } 92 | 93 | public boolean isCompleted() { 94 | return completed; 95 | } 96 | 97 | public void cancel() { 98 | this.completed = true; 99 | } 100 | 101 | public class FetchPurchasesResponse { 102 | public List issues; 103 | public boolean subscribed; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/jobs/ParseBookJsonJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.jobs; 28 | 29 | import android.util.Log; 30 | 31 | import com.bakerframework.baker.events.ParseBookJsonCompleteEvent; 32 | import com.bakerframework.baker.events.ParseBookJsonErrorEvent; 33 | import com.bakerframework.baker.model.BookJson; 34 | import com.bakerframework.baker.model.Issue; 35 | import com.path.android.jobqueue.Job; 36 | import com.path.android.jobqueue.Params; 37 | 38 | import de.greenrobot.event.EventBus; 39 | 40 | public class ParseBookJsonJob extends Job { 41 | private final Issue issue; 42 | private boolean completed; 43 | 44 | public ParseBookJsonJob(Issue issue) { 45 | super(new Params(Priority.MID).setPersistent(false).setGroupId(issue.getName())); 46 | this.issue = issue; 47 | this.completed = false; 48 | Log.i("ParseBookJsonJob", "JOB CREATED"); 49 | } 50 | 51 | @Override 52 | public void onAdded() { 53 | Log.i("ParseBookJsonJob", "JOB ADDED"); 54 | } 55 | 56 | @Override 57 | public void onRun() throws Throwable { 58 | Log.i("ParseBookJsonJob", "start"); 59 | 60 | // Create json result 61 | BookJson bookJson = new BookJson(); 62 | bookJson.fromIssue(issue); 63 | 64 | // Post complete event 65 | completed = true; 66 | Log.i("ParseBookJsonJob", "completed"); 67 | EventBus.getDefault().post(new ParseBookJsonCompleteEvent(issue, bookJson)); 68 | } 69 | 70 | @Override 71 | protected void onCancel() { 72 | completed = true; 73 | } 74 | 75 | @Override 76 | protected boolean shouldReRunOnThrowable(Throwable throwable) { 77 | if(throwable != null && throwable.getLocalizedMessage() != null) { 78 | Log.e("ParseBookJsonJob", throwable.getLocalizedMessage()); 79 | }else{ 80 | Log.e("ParseBookJsonJob", "An unknown error occured."); 81 | } 82 | 83 | EventBus.getDefault().post(new ParseBookJsonErrorEvent(issue, throwable)); 84 | return false; 85 | } 86 | 87 | 88 | public Issue getIssue() { 89 | return issue; 90 | } 91 | 92 | public boolean isCompleted() { 93 | return completed; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/jobs/Priority.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.jobs; 28 | 29 | public class Priority { 30 | public static final int LOW = 0; 31 | public static final int MID = 500; 32 | public static int HIGH = 1000; 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/model/IssueCollection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | *

6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | *

9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | package com.bakerframework.baker.model; 28 | 29 | import java.util.List; 30 | 31 | public interface IssueCollection { 32 | void load(); 33 | Issue getIssueByName(String issueName); 34 | List getCategories(); 35 | List getIssues(); 36 | void cancelDownloadingIssues(final List downloadingIssues); 37 | List getDownloadingIssues(); 38 | // void onEventMainThread(Object event); 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/play/ApiPurchaseVerifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.play; 28 | 29 | import android.support.annotation.NonNull; 30 | 31 | import com.bakerframework.baker.handler.ApiRequestHandler; 32 | import com.bakerframework.baker.settings.Configuration; 33 | 34 | import org.solovyev.android.checkout.BasePurchaseVerifier; 35 | import org.solovyev.android.checkout.Purchase; 36 | import org.solovyev.android.checkout.RequestListener; 37 | 38 | import java.util.List; 39 | 40 | public class ApiPurchaseVerifier extends BasePurchaseVerifier { 41 | 42 | public ApiPurchaseVerifier() { 43 | super(); 44 | } 45 | 46 | @Override 47 | protected void doVerify(@NonNull final List purchases, @NonNull final RequestListener> listener) { 48 | 49 | // Prepare params 50 | Purchase purchase = purchases.get(0); 51 | boolean isSubscription = Configuration.getSubscriptionProductIds().contains(purchase.sku); 52 | String purchaseType = isSubscription ? "subscription" : "product"; 53 | 54 | // Post purchase verification request 55 | ApiRequestHandler apiRequestHandler = new ApiRequestHandler(Configuration.getPurchaseConfirmationUrl(purchaseType)); 56 | PurchasesVerificationPayload purchasesVerificationPayload = new PurchasesVerificationPayload(purchase); 57 | boolean result = apiRequestHandler.post(purchasesVerificationPayload); 58 | 59 | // Trigger success 60 | if(result) { 61 | listener.onSuccess(purchases); 62 | }else{ 63 | listener.onError(apiRequestHandler.getStatusCode(), new PurchaseVerificationException(apiRequestHandler.getResponseText())); 64 | } 65 | 66 | } 67 | 68 | private class PurchaseVerificationException extends Exception { 69 | public PurchaseVerificationException(String message) { 70 | super(message); 71 | } 72 | } 73 | 74 | private class PurchasesVerificationPayload { 75 | public final String data; 76 | public final String order_id; 77 | public final String package_name; 78 | public final String payload; 79 | public final String signature; 80 | public final String sku; 81 | public final String state; 82 | public final String token; 83 | public final long time; 84 | 85 | public PurchasesVerificationPayload(Purchase purchase) { 86 | this.data = purchase.data; 87 | this.order_id = purchase.orderId; 88 | this.package_name = purchase.packageName; 89 | this.payload = purchase.payload; 90 | this.signature = purchase.signature; 91 | this.sku = purchase.sku; 92 | this.state = purchase.state.toString(); 93 | this.token = purchase.token; 94 | this.time = purchase.time; 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/play/LicenceManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.play; 28 | 29 | import android.app.Activity; 30 | 31 | import com.bakerframework.baker.BakerApplication; 32 | import com.bakerframework.baker.R; 33 | import com.bakerframework.baker.settings.Configuration; 34 | import com.google.android.vending.licensing.AESObfuscator; 35 | import com.google.android.vending.licensing.LicenseChecker; 36 | import com.google.android.vending.licensing.LicenseCheckerCallback; 37 | import com.google.android.vending.licensing.Policy; 38 | import com.google.android.vending.licensing.ServerManagedPolicy; 39 | 40 | public class LicenceManager { 41 | 42 | // Licencing 43 | private static final byte[] SALT = new byte[] { 44 | -46, 65, 30, -128, -103, -57, 74, -64, 51, 88, -95, 45 | -45, 77, -117, -36, -113, -11, 32, -64, 89 46 | }; 47 | private final LicenseCheckerCallback licenseCheckerCallback; 48 | private LicenceManagerDelegate delegate; 49 | 50 | public LicenceManager() { 51 | licenseCheckerCallback = new AppLicenseCheckerCallback(); 52 | } 53 | 54 | public void setDelegate(LicenceManagerDelegate delegate) { 55 | this.delegate = delegate; 56 | } 57 | 58 | public void checkAccess() { 59 | LicenseChecker licenseChecker = new LicenseChecker(BakerApplication.getInstance(), new ServerManagedPolicy(BakerApplication.getInstance(), new AESObfuscator(SALT, BakerApplication.getInstance().getPackageName(), Configuration.getUserId())), BakerApplication.getInstance().getString(R.string.google_play_license_key)); 60 | licenseChecker.checkAccess(licenseCheckerCallback); 61 | } 62 | 63 | private class AppLicenseCheckerCallback implements LicenseCheckerCallback { 64 | public void allow(int reason) { 65 | if (((Activity) delegate).isFinishing()) { return; } 66 | delegate.onLicenceValid(reason); 67 | } 68 | 69 | 70 | public void dontAllow(int reason) { 71 | if (((Activity) delegate).isFinishing()) { return; } 72 | if (reason == Policy.RETRY) { 73 | delegate.onLicenceRetry(reason); 74 | } else { 75 | delegate.onLicenceInvalid(reason); 76 | } 77 | } 78 | 79 | @Override 80 | public void applicationError(int reason) { 81 | delegate.onLicenceInvalid(reason); 82 | } 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/play/LicenceManagerDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.play; 28 | 29 | public interface LicenceManagerDelegate { 30 | void onLicenceValid(int reason); 31 | void onLicenceInvalid(int reason); 32 | void onLicenceRetry(int reason); 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/plugin/BakerPlugin.java: -------------------------------------------------------------------------------- 1 | package com.bakerframework.baker.plugin; 2 | 3 | import android.app.Activity; 4 | 5 | import com.bakerframework.baker.model.Issue; 6 | 7 | import org.solovyev.android.checkout.Sku; 8 | 9 | /** 10 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 11 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 12 | * All rights reserved. 13 | *

14 | * Redistribution and use in source and binary forms, with or without modification, are 15 | * permitted provided that the following conditions are met: 16 | *

17 | * Redistributions of source code must retain the above copyright notice, this list of 18 | * conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright notice, this list of 20 | * conditions and the following disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 23 | * endorse or promote products derived from this software without specific prior written 24 | * permission. 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 26 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 27 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 28 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 30 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | public interface BakerPlugin { 36 | // Activity Events 37 | public void onSplashActivityCreated(Activity activity); 38 | public void onShelfActivityCreated(Activity activity); 39 | public void onIssueActivityCreated(Activity activity); 40 | // Shelf / Issue events 41 | public void onIssueDownloadClicked(Issue issue); 42 | public void onIssueArchiveClicked(Issue issue); 43 | public void onIssueReadClicked(Issue issue); 44 | // Issue Navigation events 45 | public void onIssuePageOpened(Issue issue, String pageTitle, int pageIndex); 46 | // Purchase events 47 | public void onIssuePurchaseClicked(Issue issue); 48 | public void onSubscribeClicked(Sku subscription); 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/plugin/GoogleAnalyticsPlugin.java: -------------------------------------------------------------------------------- 1 | package com.bakerframework.baker.plugin; 2 | 3 | import android.app.Activity; 4 | 5 | import com.bakerframework.baker.BakerApplication; 6 | import com.bakerframework.baker.R; 7 | import com.bakerframework.baker.model.Issue; 8 | import com.google.android.gms.analytics.GoogleAnalytics; 9 | import com.google.android.gms.analytics.HitBuilders; 10 | import com.google.android.gms.analytics.Tracker; 11 | import com.parse.ParseAnalytics; 12 | 13 | import org.solovyev.android.checkout.Sku; 14 | 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | /** 19 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 20 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 21 | * All rights reserved. 22 | *

23 | * Redistribution and use in source and binary forms, with or without modification, are 24 | * permitted provided that the following conditions are met: 25 | *

26 | * Redistributions of source code must retain the above copyright notice, this list of 27 | * conditions and the following disclaimer. 28 | * Redistributions in binary form must reproduce the above copyright notice, this list of 29 | * conditions and the following disclaimer in the documentation and/or other materials 30 | * provided with the distribution. 31 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 32 | * endorse or promote products derived from this software without specific prior written 33 | * permission. 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 35 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 36 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 37 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 38 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 39 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 40 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 41 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 42 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | */ 44 | public class GoogleAnalyticsPlugin implements BakerPlugin { 45 | final Tracker tracker; 46 | 47 | public GoogleAnalyticsPlugin() { 48 | GoogleAnalytics analytics = GoogleAnalytics.getInstance(BakerApplication.getInstance()); 49 | tracker = analytics.newTracker(BakerApplication.getInstance().getString(R.string.google_analytics_tracking_id)); 50 | } 51 | 52 | // Navigation Events 53 | 54 | @Override 55 | public void onSplashActivityCreated(Activity activity) { 56 | sendScreen("Splash Screen"); 57 | sendEvent("Magazine", "Magazine Launched", "Magazine Launched"); 58 | } 59 | 60 | @Override 61 | public void onShelfActivityCreated(Activity activity) { 62 | sendScreen("Shelf Screen"); 63 | } 64 | 65 | @Override 66 | public void onIssueActivityCreated(Activity activity) { 67 | sendScreen("Issue Screen"); 68 | } 69 | 70 | // Shelf / Issue Events 71 | 72 | @Override 73 | public void onIssueDownloadClicked(Issue issue) { 74 | sendEvent("Issue", "Download Issue Clicked", issue.getTitle()); 75 | } 76 | 77 | @Override 78 | public void onIssueArchiveClicked(Issue issue) { 79 | sendEvent("Issue", "Archive Issue Clicked", issue.getTitle()); 80 | } 81 | 82 | @Override 83 | public void onIssueReadClicked(Issue issue) { 84 | sendEvent("Issue", "Read Issue Clicked", issue.getTitle()); 85 | } 86 | 87 | // Issue Navigation Events 88 | 89 | public void onIssuePageOpened(Issue issue, String pageTitle, int pageIndex) { 90 | Map dimensions = new HashMap<>(); 91 | dimensions.put("Issue Title", issue.getTitle()); 92 | dimensions.put("Page Title", pageTitle); 93 | dimensions.put("Page Index", String.valueOf(pageIndex)); 94 | ParseAnalytics.trackEventInBackground("View_Issue_Page", dimensions); 95 | sendEvent("Issue", "Page Views", issue.getTitle() + pageTitle); 96 | } 97 | 98 | // Purchase Events 99 | 100 | @Override 101 | public void onIssuePurchaseClicked(Issue issue) { 102 | sendEvent("Purchase Actions", "Purchase Button Clicked", issue.getTitle()); 103 | } 104 | 105 | @Override 106 | public void onSubscribeClicked(Sku subscription) { 107 | sendEvent("Purchase Actions", "Subscribe Button Clicked", subscription.title); 108 | } 109 | 110 | // Private methods 111 | 112 | private void sendScreen(String screenName) { 113 | tracker.setScreenName(screenName); 114 | tracker.send(new HitBuilders.AppViewBuilder().build()); 115 | } 116 | 117 | private void sendEvent(String category, String action, String label) { 118 | tracker.send(new HitBuilders.EventBuilder() 119 | .setCategory(category) 120 | .setAction(action) 121 | .setLabel(label) 122 | .build()); 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/settings/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.settings; 28 | 29 | import android.app.ActionBar; 30 | import android.os.Bundle; 31 | import android.support.v7.app.ActionBarActivity; 32 | 33 | import com.bakerframework.baker.R; 34 | 35 | 36 | public class SettingsActivity extends ActionBarActivity { 37 | 38 | @Override 39 | protected void onCreate(Bundle savedInstanceState) { 40 | super.onCreate(savedInstanceState); 41 | 42 | // Modify the action bar to use a custom layout to center the title. 43 | this.getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 44 | this.getSupportActionBar().setCustomView(R.layout.settings_actionbar); 45 | 46 | getFragmentManager().beginTransaction() 47 | .replace(android.R.id.content, new SettingsFragment()) 48 | .commit(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/settings/SettingsFragment.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.settings; 28 | 29 | import android.os.Bundle; 30 | import android.preference.PreferenceFragment; 31 | 32 | import com.bakerframework.baker.R; 33 | 34 | public class SettingsFragment extends PreferenceFragment { 35 | 36 | @Override 37 | public void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | 40 | // Load the preferences from an XML resource 41 | addPreferencesFromResource(R.xml.preferences); 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/view/CustomWebView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.view; 28 | 29 | import android.content.Context; 30 | import android.util.AttributeSet; 31 | import android.webkit.WebView; 32 | 33 | public class CustomWebView extends WebView { 34 | 35 | public CustomWebView(Context context) { 36 | super(context); 37 | } 38 | 39 | public CustomWebView(Context context, AttributeSet attrs) { 40 | super(context, attrs); 41 | } 42 | 43 | /** 44 | * API 14 already has a function canScrollHorizontally defined, we just added this 45 | * to support devices before API 14. 46 | */ 47 | public boolean canScrollHorizontal(int direction) { 48 | final int offset = computeHorizontalScrollOffset(); 49 | final int range = computeHorizontalScrollRange() - computeHorizontalScrollExtent(); 50 | if (range == 0) 51 | return false; 52 | if (direction < 0) { 53 | return offset > 0; 54 | } else { 55 | return offset < range - 1; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/view/ShelfView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.view; 28 | 29 | import android.content.Context; 30 | import android.content.res.Configuration; 31 | import android.util.AttributeSet; 32 | import android.util.DisplayMetrics; 33 | import android.widget.GridView; 34 | 35 | public class ShelfView extends GridView { 36 | 37 | public ShelfView(Context context, AttributeSet attrs) { 38 | super(context, attrs); 39 | updateColumnCount(); 40 | } 41 | 42 | @Override 43 | public void onConfigurationChanged(Configuration newConfig) { 44 | updateColumnCount(); 45 | super.onConfigurationChanged(newConfig); 46 | } 47 | 48 | private void updateColumnCount() { 49 | 50 | // Get metrics information 51 | DisplayMetrics metrics = getResources().getDisplayMetrics(); 52 | 53 | int width = metrics.widthPixels; 54 | 55 | // Each issue card needs at lease 550px width to display correctly 56 | int columnCount = ((int) Math.max(Math.floor(width / 550), 1)); 57 | setNumColumns(columnCount); 58 | 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/view/WebViewFragmentPagerAdapter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.view; 28 | 29 | import android.os.Bundle; 30 | import android.support.v4.app.Fragment; 31 | import android.support.v4.app.FragmentManager; 32 | import android.support.v4.app.FragmentStatePagerAdapter; 33 | 34 | import com.bakerframework.baker.activity.IssueActivity; 35 | import com.bakerframework.baker.model.BookJson; 36 | 37 | import java.io.File; 38 | 39 | public class WebViewFragmentPagerAdapter extends FragmentStatePagerAdapter { 40 | 41 | private BookJson book; 42 | 43 | private String magazinePath; 44 | 45 | private IssueActivity issueActivity; 46 | 47 | public WebViewFragmentPagerAdapter(FragmentManager fm, BookJson book, final String magazinePath, IssueActivity _issueActivity) { 48 | super(fm); 49 | this.issueActivity = _issueActivity; 50 | if (null == book) { 51 | this.book = new BookJson(); 52 | } else { 53 | this.book = book; 54 | } 55 | if (null == magazinePath) { 56 | this.magazinePath = ""; 57 | } else { 58 | this.magazinePath = magazinePath; 59 | } 60 | } 61 | 62 | @Override 63 | public Fragment getItem(int i) { 64 | // Return null if out of bounds 65 | if(i < 0 || i >= book.getContents().size()) { return null; } 66 | // Instantiate and return Fragment 67 | Bundle args = new Bundle(); 68 | String page = this.magazinePath + book.getMagazineName() + File.separator + book.getContents().get(i); 69 | args.putString("object", page); 70 | return Fragment.instantiate(issueActivity, WebViewFragment.class.getName(), args); 71 | } 72 | 73 | @Override 74 | public int getCount() { 75 | return book.getContents().size(); 76 | } 77 | 78 | @Override 79 | public CharSequence getPageTitle(int position) { 80 | return "OBJECT " + (position + 1); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/bakerframework/baker/widget/SwipeRefreshScrollLayout.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2014. Francisco Contreras, Holland Salazar. 3 | * Copyright (c) 2015. Tobias Strebitzer, Francisco Contreras, Holland Salazar. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | * conditions and the following disclaimer in the documentation and/or other materials 13 | * provided with the distribution. 14 | * Neither the name of the Baker Framework nor the names of its contributors may be used to 15 | * endorse or promote products derived from this software without specific prior written 16 | * permission. 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 20 | * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | **/ 27 | package com.bakerframework.baker.widget; 28 | 29 | import android.annotation.TargetApi; 30 | import android.content.Context; 31 | import android.content.res.TypedArray; 32 | import android.graphics.Color; 33 | import android.os.Build; 34 | import android.support.v4.widget.SwipeRefreshLayout; 35 | import android.util.AttributeSet; 36 | import android.widget.AdapterView; 37 | 38 | import com.bakerframework.baker.R; 39 | 40 | public class SwipeRefreshScrollLayout extends SwipeRefreshLayout { 41 | 42 | AdapterView adapterView; 43 | final int adapterViewId; 44 | 45 | public SwipeRefreshScrollLayout(Context context, AttributeSet attrs) { 46 | super(context, attrs); 47 | TypedArray styledAttributes = context.getTheme().obtainStyledAttributes(attrs, R.styleable.SwipeRefreshScrollLayout, 0, 0); 48 | adapterViewId = styledAttributes.getResourceId(R.styleable.SwipeRefreshScrollLayout_adapter_view, -1); 49 | styledAttributes.recycle (); 50 | 51 | // Set refresh indicator colors 52 | setColorSchemeColors(Color.RED, Color.BLUE, Color.RED, Color.BLUE); 53 | 54 | } 55 | 56 | @Override 57 | protected void onFinishInflate () { 58 | super.onFinishInflate (); 59 | adapterView = (AdapterView) findViewById (adapterViewId); 60 | } 61 | 62 | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) 63 | @Override 64 | public boolean canChildScrollUp() { 65 | return adapterView.canScrollVertically (-1); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/DeviceLimiter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * Allows the developer to limit the number of devices using a single license. 21 | *

22 | * The LICENSED response from the server contains a user identifier unique to 23 | * the <application, user> pair. The developer can send this identifier 24 | * to their own server along with some device identifier (a random number 25 | * generated and stored once per application installation, 26 | * {@link android.telephony.TelephonyManager#getDeviceId getDeviceId}, 27 | * {@link android.provider.Settings.Secure#ANDROID_ID ANDROID_ID}, etc). 28 | * The more sources used to identify the device, the harder it will be for an 29 | * attacker to spoof. 30 | *

31 | * The server can look at the <application, user, device id> tuple and 32 | * restrict a user's application license to run on at most 10 different devices 33 | * in a week (for example). We recommend not being too restrictive because a 34 | * user might legitimately have multiple devices or be in the process of 35 | * changing phones. This will catch egregious violations of multiple people 36 | * sharing one license. 37 | */ 38 | public interface DeviceLimiter { 39 | 40 | /** 41 | * Checks if this device is allowed to use the given user's license. 42 | * 43 | * @param userId the user whose license the server responded with 44 | * @return LICENSED if the device is allowed, NOT_LICENSED if not, RETRY if an error occurs 45 | */ 46 | int isDeviceAllowed(String userId); 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/ILicenseResultListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is auto-generated. DO NOT MODIFY. 3 | * Original file: aidl/ILicenseResultListener.aidl 4 | */ 5 | package com.google.android.vending.licensing; 6 | import java.lang.String; 7 | import android.os.RemoteException; 8 | import android.os.IBinder; 9 | import android.os.IInterface; 10 | import android.os.Binder; 11 | import android.os.Parcel; 12 | public interface ILicenseResultListener extends IInterface 13 | { 14 | /** Local-side IPC implementation stub class. */ 15 | public static abstract class Stub extends Binder implements ILicenseResultListener 16 | { 17 | private static final String DESCRIPTOR = "com.android.vending.licensing.ILicenseResultListener"; 18 | /** Construct the stub at attach it to the interface. */ 19 | public Stub() 20 | { 21 | this.attachInterface(this, DESCRIPTOR); 22 | } 23 | /** 24 | * Cast an IBinder object into an ILicenseResultListener interface, 25 | * generating a proxy if needed. 26 | */ 27 | public static ILicenseResultListener asInterface(IBinder obj) 28 | { 29 | if ((obj==null)) { 30 | return null; 31 | } 32 | IInterface iin = (IInterface)obj.queryLocalInterface(DESCRIPTOR); 33 | if (((iin!=null)&&(iin instanceof ILicenseResultListener))) { 34 | return ((ILicenseResultListener)iin); 35 | } 36 | return new Proxy(obj); 37 | } 38 | public IBinder asBinder() 39 | { 40 | return this; 41 | } 42 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException 43 | { 44 | switch (code) 45 | { 46 | case INTERFACE_TRANSACTION: 47 | { 48 | reply.writeString(DESCRIPTOR); 49 | return true; 50 | } 51 | case TRANSACTION_verifyLicense: 52 | { 53 | data.enforceInterface(DESCRIPTOR); 54 | int _arg0; 55 | _arg0 = data.readInt(); 56 | String _arg1; 57 | _arg1 = data.readString(); 58 | String _arg2; 59 | _arg2 = data.readString(); 60 | this.verifyLicense(_arg0, _arg1, _arg2); 61 | return true; 62 | } 63 | } 64 | return super.onTransact(code, data, reply, flags); 65 | } 66 | private static class Proxy implements ILicenseResultListener 67 | { 68 | private final IBinder mRemote; 69 | Proxy(IBinder remote) 70 | { 71 | mRemote = remote; 72 | } 73 | public IBinder asBinder() 74 | { 75 | return mRemote; 76 | } 77 | public String getInterfaceDescriptor() 78 | { 79 | return DESCRIPTOR; 80 | } 81 | public void verifyLicense(int responseCode, String signedData, String signature) throws RemoteException 82 | { 83 | Parcel _data = Parcel.obtain(); 84 | try { 85 | _data.writeInterfaceToken(DESCRIPTOR); 86 | _data.writeInt(responseCode); 87 | _data.writeString(signedData); 88 | _data.writeString(signature); 89 | mRemote.transact(Stub.TRANSACTION_verifyLicense, _data, null, IBinder.FLAG_ONEWAY); 90 | } 91 | finally { 92 | _data.recycle(); 93 | } 94 | } 95 | } 96 | static final int TRANSACTION_verifyLicense = (IBinder.FIRST_CALL_TRANSACTION + 0); 97 | } 98 | public void verifyLicense(int responseCode, String signedData, String signature) throws RemoteException; 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/ILicensingService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is auto-generated. DO NOT MODIFY. 3 | * Original file: aidl/ILicensingService.aidl 4 | */ 5 | package com.google.android.vending.licensing; 6 | import java.lang.String; 7 | import android.os.RemoteException; 8 | import android.os.IBinder; 9 | import android.os.IInterface; 10 | import android.os.Binder; 11 | import android.os.Parcel; 12 | public interface ILicensingService extends IInterface 13 | { 14 | /** Local-side IPC implementation stub class. */ 15 | public static abstract class Stub extends Binder implements ILicensingService 16 | { 17 | private static final String DESCRIPTOR = "com.android.vending.licensing.ILicensingService"; 18 | /** Construct the stub at attach it to the interface. */ 19 | public Stub() 20 | { 21 | this.attachInterface(this, DESCRIPTOR); 22 | } 23 | /** 24 | * Cast an IBinder object into an ILicensingService interface, 25 | * generating a proxy if needed. 26 | */ 27 | public static ILicensingService asInterface(IBinder obj) 28 | { 29 | if ((obj==null)) { 30 | return null; 31 | } 32 | IInterface iin = (IInterface)obj.queryLocalInterface(DESCRIPTOR); 33 | if (((iin!=null)&&(iin instanceof ILicensingService))) { 34 | return ((ILicensingService)iin); 35 | } 36 | return new Proxy(obj); 37 | } 38 | public IBinder asBinder() 39 | { 40 | return this; 41 | } 42 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException 43 | { 44 | switch (code) 45 | { 46 | case INTERFACE_TRANSACTION: 47 | { 48 | reply.writeString(DESCRIPTOR); 49 | return true; 50 | } 51 | case TRANSACTION_checkLicense: 52 | { 53 | data.enforceInterface(DESCRIPTOR); 54 | long _arg0; 55 | _arg0 = data.readLong(); 56 | String _arg1; 57 | _arg1 = data.readString(); 58 | com.google.android.vending.licensing.ILicenseResultListener _arg2; 59 | _arg2 = com.google.android.vending.licensing.ILicenseResultListener.Stub.asInterface(data.readStrongBinder()); 60 | this.checkLicense(_arg0, _arg1, _arg2); 61 | return true; 62 | } 63 | } 64 | return super.onTransact(code, data, reply, flags); 65 | } 66 | private static class Proxy implements ILicensingService 67 | { 68 | private final IBinder mRemote; 69 | Proxy(IBinder remote) 70 | { 71 | mRemote = remote; 72 | } 73 | public IBinder asBinder() 74 | { 75 | return mRemote; 76 | } 77 | public String getInterfaceDescriptor() 78 | { 79 | return DESCRIPTOR; 80 | } 81 | public void checkLicense(long nonce, String packageName, com.google.android.vending.licensing.ILicenseResultListener listener) throws RemoteException 82 | { 83 | Parcel _data = Parcel.obtain(); 84 | try { 85 | _data.writeInterfaceToken(DESCRIPTOR); 86 | _data.writeLong(nonce); 87 | _data.writeString(packageName); 88 | _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); 89 | mRemote.transact(Stub.TRANSACTION_checkLicense, _data, null, IBinder.FLAG_ONEWAY); 90 | } 91 | finally { 92 | _data.recycle(); 93 | } 94 | } 95 | } 96 | static final int TRANSACTION_checkLicense = (IBinder.FIRST_CALL_TRANSACTION + 0); 97 | } 98 | public void checkLicense(long nonce, String packageName, com.google.android.vending.licensing.ILicenseResultListener listener) throws RemoteException; 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/LicenseCheckerCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * Callback for the license checker library. 21 | *

22 | * Upon checking with the Market server and conferring with the {@link com.google.android.vending.licensing.Policy}, 23 | * the library calls the appropriate callback method to communicate the result. 24 | *

25 | * The callback does not occur in the original checking thread. Your 26 | * application should post to the appropriate handling thread or lock 27 | * accordingly. 28 | *

29 | * The reason that is passed back with allow/dontAllow is the base status handed 30 | * to the policy for allowed/disallowing the license. Policy.RETRY will call 31 | * allow or dontAllow depending on other statistics associated with the policy, 32 | * while in most cases Policy.NOT_LICENSED will call dontAllow and 33 | * Policy.LICENSED will Allow. 34 | */ 35 | public interface LicenseCheckerCallback { 36 | 37 | /** 38 | * Allow use. App should proceed as normal. 39 | * 40 | * @param reason Policy.LICENSED or Policy.RETRY typically. (although in 41 | * theory the policy can return Policy.NOT_LICENSED here as well) 42 | */ 43 | public void allow(int reason); 44 | 45 | /** 46 | * Don't allow use. App should inform user and take appropriate action. 47 | * 48 | * @param reason Policy.NOT_LICENSED or Policy.RETRY. (although in theory 49 | * the policy can return Policy.LICENSED here as well --- 50 | * perhaps the call to the LVL took too long, for example) 51 | */ 52 | public void dontAllow(int reason); 53 | 54 | /** Application error codes. */ 55 | public static final int ERROR_INVALID_PACKAGE_NAME = 1; 56 | public static final int ERROR_NON_MATCHING_UID = 2; 57 | public static final int ERROR_NOT_MARKET_MANAGED = 3; 58 | public static final int ERROR_CHECK_IN_PROGRESS = 4; 59 | public static final int ERROR_INVALID_PUBLIC_KEY = 5; 60 | public static final int ERROR_MISSING_PERMISSION = 6; 61 | 62 | /** 63 | * Error in application code. Caller did not call or set up license checker 64 | * correctly. Should be considered fatal. 65 | */ 66 | public void applicationError(int errorCode); 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/NullDeviceLimiter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * A DeviceLimiter that doesn't limit the number of devices that can use a 21 | * given user's license. 22 | *

23 | * Unless you have reason to believe that your application is being pirated 24 | * by multiple users using the same license (signing in to Market as the same 25 | * user), we recommend you use this implementation. 26 | */ 27 | public class NullDeviceLimiter implements DeviceLimiter { 28 | 29 | public int isDeviceAllowed(String userId) { 30 | return Policy.LICENSED; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/Obfuscator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * Interface used as part of a {@link com.google.android.vending.licensing.Policy} to allow application authors to obfuscate 21 | * licensing data that will be stored into a SharedPreferences file. 22 | *

23 | * Any transformation scheme must be reversable. Implementing classes may optionally implement an 24 | * integrity check to further prevent modification to preference data. Implementing classes 25 | * should use device-specific information as a key in the obfuscation algorithm to prevent 26 | * obfuscated preferences from being shared among devices. 27 | */ 28 | public interface Obfuscator { 29 | 30 | /** 31 | * Obfuscate a string that is being stored into shared preferences. 32 | * 33 | * @param original The data that is to be obfuscated. 34 | * @param key The key for the data that is to be obfuscated. 35 | * @return A transformed version of the original data. 36 | */ 37 | String obfuscate(String original, String key); 38 | 39 | /** 40 | * Undo the transformation applied to data by the obfuscate() method. 41 | * 42 | * @param original The data that is to be obfuscated. 43 | * @param key The key for the data that is to be obfuscated. 44 | * @return A transformed version of the original data. 45 | * @throws ValidationException Optionally thrown if a data integrity check fails. 46 | */ 47 | String unobfuscate(String obfuscated, String key) throws ValidationException; 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/Policy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * Policy used by {@link LicenseChecker} to determine whether a user should have 21 | * access to the application. 22 | */ 23 | public interface Policy { 24 | 25 | /** 26 | * Change these values to make it more difficult for tools to automatically 27 | * strip LVL protection from your APK. 28 | */ 29 | 30 | /** 31 | * LICENSED means that the server returned back a valid license response 32 | */ 33 | public static final int LICENSED = 0x0100; 34 | /** 35 | * NOT_LICENSED means that the server returned back a valid license response 36 | * that indicated that the user definitively is not licensed 37 | */ 38 | public static final int NOT_LICENSED = 0x0231; 39 | /** 40 | * RETRY means that the license response was unable to be determined --- 41 | * perhaps as a result of faulty networking 42 | */ 43 | public static final int RETRY = 0x0123; 44 | 45 | /** 46 | * Provide results from contact with the license server. Retry counts are 47 | * incremented if the current value of response is RETRY. Results will be 48 | * used for any future policy decisions. 49 | * 50 | * @param response the result from validating the server response 51 | * @param rawData the raw server response data, can be null for RETRY 52 | */ 53 | void processServerResponse(int response, ResponseData rawData); 54 | 55 | /** 56 | * Check if the user should be allowed access to the application. 57 | */ 58 | boolean allowAccess(); 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/PreferenceObfuscator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | import android.content.SharedPreferences; 20 | import android.util.Log; 21 | 22 | /** 23 | * An wrapper for SharedPreferences that transparently performs data obfuscation. 24 | */ 25 | public class PreferenceObfuscator { 26 | 27 | private static final String TAG = "PreferenceObfuscator"; 28 | 29 | private final SharedPreferences mPreferences; 30 | private final Obfuscator mObfuscator; 31 | private SharedPreferences.Editor mEditor; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param sp A SharedPreferences instance provided by the system. 37 | * @param o The Obfuscator to use when reading or writing data. 38 | */ 39 | public PreferenceObfuscator(SharedPreferences sp, Obfuscator o) { 40 | mPreferences = sp; 41 | mObfuscator = o; 42 | mEditor = null; 43 | } 44 | 45 | public void putString(String key, String value) { 46 | if (mEditor == null) { 47 | mEditor = mPreferences.edit(); 48 | } 49 | String obfuscatedValue = mObfuscator.obfuscate(value, key); 50 | mEditor.putString(key, obfuscatedValue); 51 | } 52 | 53 | public String getString(String key, String defValue) { 54 | String result; 55 | String value = mPreferences.getString(key, null); 56 | if (value != null) { 57 | try { 58 | result = mObfuscator.unobfuscate(value, key); 59 | } catch (ValidationException e) { 60 | // Unable to unobfuscate, data corrupt or tampered 61 | Log.w(TAG, "Validation error while reading preference: " + key); 62 | result = defValue; 63 | } 64 | } else { 65 | // Preference not found 66 | result = defValue; 67 | } 68 | return result; 69 | } 70 | 71 | public void commit() { 72 | if (mEditor != null) { 73 | mEditor.commit(); 74 | mEditor = null; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/ResponseData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | import java.util.regex.Pattern; 20 | 21 | import android.text.TextUtils; 22 | 23 | /** 24 | * ResponseData from licensing server. 25 | */ 26 | public class ResponseData { 27 | 28 | public int responseCode; 29 | public int nonce; 30 | public String packageName; 31 | public String versionCode; 32 | public String userId; 33 | public long timestamp; 34 | /** Response-specific data. */ 35 | public String extra; 36 | 37 | /** 38 | * Parses response string into ResponseData. 39 | * 40 | * @param responseData response data string 41 | * @throws IllegalArgumentException upon parsing error 42 | * @return ResponseData object 43 | */ 44 | public static ResponseData parse(String responseData) { 45 | // Must parse out main response data and response-specific data. 46 | int index = responseData.indexOf(':'); 47 | String mainData, extraData; 48 | if ( -1 == index ) { 49 | mainData = responseData; 50 | extraData = ""; 51 | } else { 52 | mainData = responseData.substring(0, index); 53 | extraData = index >= responseData.length() ? "" : responseData.substring(index+1); 54 | } 55 | 56 | String [] fields = TextUtils.split(mainData, Pattern.quote("|")); 57 | if (fields.length < 6) { 58 | throw new IllegalArgumentException("Wrong number of fields."); 59 | } 60 | 61 | ResponseData data = new ResponseData(); 62 | data.extra = extraData; 63 | data.responseCode = Integer.parseInt(fields[0]); 64 | data.nonce = Integer.parseInt(fields[1]); 65 | data.packageName = fields[2]; 66 | data.versionCode = fields[3]; 67 | // Application-specific user identifier. 68 | data.userId = fields[4]; 69 | data.timestamp = Long.parseLong(fields[5]); 70 | 71 | return data; 72 | } 73 | 74 | @Override 75 | public String toString() { 76 | return TextUtils.join("|", new Object [] { responseCode, nonce, packageName, versionCode, 77 | userId, timestamp }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/StrictPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * Non-caching policy. All requests will be sent to the licensing service, 21 | * and no local caching is performed. 22 | *

23 | * Using a non-caching policy ensures that there is no local preference data 24 | * for malicious users to tamper with. As a side effect, applications 25 | * will not be permitted to run while offline. Developers should carefully 26 | * weigh the risks of using this Policy over one which implements caching, 27 | * such as ServerManagedPolicy. 28 | *

29 | * Access to the application is only allowed if a LICESNED response is. 30 | * received. All other responses (including RETRY) will deny access. 31 | */ 32 | public class StrictPolicy implements Policy { 33 | 34 | private int mLastResponse; 35 | 36 | public StrictPolicy() { 37 | // Set default policy. This will force the application to check the policy on launch. 38 | mLastResponse = Policy.RETRY; 39 | } 40 | 41 | /** 42 | * Process a new response from the license server. Since we aren't 43 | * performing any caching, this equates to reading the LicenseResponse. 44 | * Any ResponseData provided is ignored. 45 | * 46 | * @param response the result from validating the server response 47 | * @param rawData the raw server response data 48 | */ 49 | public void processServerResponse(int response, ResponseData rawData) { 50 | mLastResponse = response; 51 | } 52 | 53 | /** 54 | * {@inheritDoc} 55 | * 56 | * This implementation allows access if and only if a LICENSED response 57 | * was received the last time the server was contacted. 58 | */ 59 | public boolean allowAccess() { 60 | return (mLastResponse == Policy.LICENSED); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/ValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 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 com.google.android.vending.licensing; 18 | 19 | /** 20 | * Indicates that an error occurred while validating the integrity of data managed by an 21 | * {@link com.google.android.vending.licensing.Obfuscator}.} 22 | */ 23 | public class ValidationException extends Exception { 24 | public ValidationException() { 25 | super(); 26 | } 27 | 28 | public ValidationException(String s) { 29 | super(s); 30 | } 31 | 32 | private static final long serialVersionUID = 1L; 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/vending/licensing/util/Base64DecoderException.java: -------------------------------------------------------------------------------- 1 | // Copyright 2002, Google, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package com.google.android.vending.licensing.util; 16 | 17 | /** 18 | * Exception thrown when encountering an invalid Base64 input character. 19 | * 20 | * @author nelson 21 | */ 22 | public class Base64DecoderException extends Exception { 23 | public Base64DecoderException() { 24 | super(); 25 | } 26 | 27 | public Base64DecoderException(String s) { 28 | super(s); 29 | } 30 | 31 | private static final long serialVersionUID = 1L; 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/anim/bounce.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/logo_fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/baker_action_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 15 | 16 | 17 | 18 | 19 | 23 | 26 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/baker_modal_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/ic_action_labels.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/ic_action_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/rounded_corners.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 11 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/ic_action_labels.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/ic_action_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/ic_action_labels.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/ic_action_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_action_labels.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_action_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_subscribe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_action_subscribe.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/baker_scrollbar_horizontal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/baker_scrollbar_vertical.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/cover_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable/cover_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/loading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakerframework/baker-android-refactor/e073b075ef8b0c8761db89f5e21e4e7943bc7164/app/src/main/res/drawable/loading.jpg -------------------------------------------------------------------------------- /app/src/main/res/layout-v14/drawer_list_item.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/drawer_list_item.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_category.xml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/info_activity.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 23 | 24 | 31 | 32 | 33 | 34 |