├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE.md ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── xposed_init │ ├── java │ │ └── com │ │ │ └── icecream │ │ │ └── snorlax │ │ │ ├── app │ │ │ ├── SnorlaxApp.java │ │ │ ├── home │ │ │ │ ├── HomeActivity.java │ │ │ │ └── HomeDialog.java │ │ │ ├── settings │ │ │ │ ├── SettingsFragment.java │ │ │ │ └── SettingsReadable.java │ │ │ └── widget │ │ │ │ └── SummaryEditTextPreference.java │ │ │ ├── common │ │ │ ├── Decimals.java │ │ │ ├── Strings.java │ │ │ └── rx │ │ │ │ ├── RxBus.java │ │ │ │ └── RxFuncitons.java │ │ │ └── module │ │ │ ├── Log.java │ │ │ ├── Snorlax.java │ │ │ ├── SnorlaxComponent.java │ │ │ ├── SnorlaxModule.java │ │ │ ├── context │ │ │ ├── pokemongo │ │ │ │ ├── PokemonGo.java │ │ │ │ ├── PokemonGoContext.java │ │ │ │ ├── PokemonGoContextFactory.java │ │ │ │ └── PokemonGoContextModule.java │ │ │ └── snorlax │ │ │ │ ├── Snorlax.java │ │ │ │ ├── SnorlaxContext.java │ │ │ │ ├── SnorlaxContextFactory.java │ │ │ │ └── SnorlaxContextModule.java │ │ │ ├── feature │ │ │ ├── Feature.java │ │ │ ├── FeatureHelper.java │ │ │ ├── capture │ │ │ │ ├── Capture.java │ │ │ │ ├── CaptureEvent.java │ │ │ │ ├── CaptureNotification.java │ │ │ │ └── CapturePreferences.java │ │ │ ├── encounter │ │ │ │ ├── Encounter.java │ │ │ │ ├── EncounterNotification.java │ │ │ │ └── EncounterPreferences.java │ │ │ ├── mitm │ │ │ │ ├── Mitm.java │ │ │ │ ├── MitmEnvelope.java │ │ │ │ ├── MitmInputStream.java │ │ │ │ ├── MitmInputStreamFactory.java │ │ │ │ ├── MitmListener.java │ │ │ │ ├── MitmOutputStream.java │ │ │ │ ├── MitmOutputStreamFactory.java │ │ │ │ ├── MitmProvider.java │ │ │ │ └── MitmRelay.java │ │ │ ├── mock │ │ │ │ ├── Mock.java │ │ │ │ └── MockPreferences.java │ │ │ ├── rename │ │ │ │ ├── Rename.java │ │ │ │ ├── RenameFormat.java │ │ │ │ └── RenamePreferences.java │ │ │ └── ui │ │ │ │ └── Ui.java │ │ │ └── pokemon │ │ │ ├── MovementType.java │ │ │ ├── Pokemon.java │ │ │ ├── PokemonClass.java │ │ │ ├── PokemonCp.java │ │ │ ├── PokemonFactory.java │ │ │ ├── PokemonMeta.java │ │ │ ├── PokemonMetaRegistry.java │ │ │ ├── PokemonMoveMeta.java │ │ │ ├── PokemonMoveMetaRegistry.java │ │ │ ├── PokemonType.java │ │ │ └── probability │ │ │ ├── PokemonProbability.java │ │ │ └── PokemonProbabilityFactory.java │ └── res │ │ ├── drawable │ │ ├── dialog.xml │ │ ├── egg.png │ │ ├── ic_pokeball.xml │ │ ├── pokemon_001.png │ │ ├── pokemon_002.png │ │ ├── pokemon_003.png │ │ ├── pokemon_004.png │ │ ├── pokemon_005.png │ │ ├── pokemon_006.png │ │ ├── pokemon_007.png │ │ ├── pokemon_008.png │ │ ├── pokemon_009.png │ │ ├── pokemon_010.png │ │ ├── pokemon_011.png │ │ ├── pokemon_012.png │ │ ├── pokemon_013.png │ │ ├── pokemon_014.png │ │ ├── pokemon_015.png │ │ ├── pokemon_016.png │ │ ├── pokemon_017.png │ │ ├── pokemon_018.png │ │ ├── pokemon_019.png │ │ ├── pokemon_020.png │ │ ├── pokemon_021.png │ │ ├── pokemon_022.png │ │ ├── pokemon_023.png │ │ ├── pokemon_024.png │ │ ├── pokemon_025.png │ │ ├── pokemon_026.png │ │ ├── pokemon_027.png │ │ ├── pokemon_028.png │ │ ├── pokemon_029.png │ │ ├── pokemon_030.png │ │ ├── pokemon_031.png │ │ ├── pokemon_032.png │ │ ├── pokemon_033.png │ │ ├── pokemon_034.png │ │ ├── pokemon_035.png │ │ ├── pokemon_036.png │ │ ├── pokemon_037.png │ │ ├── pokemon_038.png │ │ ├── pokemon_039.png │ │ ├── pokemon_040.png │ │ ├── pokemon_041.png │ │ ├── pokemon_042.png │ │ ├── pokemon_043.png │ │ ├── pokemon_044.png │ │ ├── pokemon_045.png │ │ ├── pokemon_046.png │ │ ├── pokemon_047.png │ │ ├── pokemon_048.png │ │ ├── pokemon_049.png │ │ ├── pokemon_050.png │ │ ├── pokemon_051.png │ │ ├── pokemon_052.png │ │ ├── pokemon_053.png │ │ ├── pokemon_054.png │ │ ├── pokemon_055.png │ │ ├── pokemon_056.png │ │ ├── pokemon_057.png │ │ ├── pokemon_058.png │ │ ├── pokemon_059.png │ │ ├── pokemon_060.png │ │ ├── pokemon_061.png │ │ ├── pokemon_062.png │ │ ├── pokemon_063.png │ │ ├── pokemon_064.png │ │ ├── pokemon_065.png │ │ ├── pokemon_066.png │ │ ├── pokemon_067.png │ │ ├── pokemon_068.png │ │ ├── pokemon_069.png │ │ ├── pokemon_070.png │ │ ├── pokemon_071.png │ │ ├── pokemon_072.png │ │ ├── pokemon_073.png │ │ ├── pokemon_074.png │ │ ├── pokemon_075.png │ │ ├── pokemon_076.png │ │ ├── pokemon_077.png │ │ ├── pokemon_078.png │ │ ├── pokemon_079.png │ │ ├── pokemon_080.png │ │ ├── pokemon_081.png │ │ ├── pokemon_082.png │ │ ├── pokemon_083.png │ │ ├── pokemon_084.png │ │ ├── pokemon_085.png │ │ ├── pokemon_086.png │ │ ├── pokemon_087.png │ │ ├── pokemon_088.png │ │ ├── pokemon_089.png │ │ ├── pokemon_090.png │ │ ├── pokemon_091.png │ │ ├── pokemon_092.png │ │ ├── pokemon_093.png │ │ ├── pokemon_094.png │ │ ├── pokemon_095.png │ │ ├── pokemon_096.png │ │ ├── pokemon_097.png │ │ ├── pokemon_098.png │ │ ├── pokemon_099.png │ │ ├── pokemon_100.png │ │ ├── pokemon_101.png │ │ ├── pokemon_102.png │ │ ├── pokemon_103.png │ │ ├── pokemon_104.png │ │ ├── pokemon_105.png │ │ ├── pokemon_106.png │ │ ├── pokemon_107.png │ │ ├── pokemon_108.png │ │ ├── pokemon_109.png │ │ ├── pokemon_110.png │ │ ├── pokemon_111.png │ │ ├── pokemon_112.png │ │ ├── pokemon_113.png │ │ ├── pokemon_114.png │ │ ├── pokemon_115.png │ │ ├── pokemon_116.png │ │ ├── pokemon_117.png │ │ ├── pokemon_118.png │ │ ├── pokemon_119.png │ │ ├── pokemon_120.png │ │ ├── pokemon_121.png │ │ ├── pokemon_122.png │ │ ├── pokemon_123.png │ │ ├── pokemon_124.png │ │ ├── pokemon_125.png │ │ ├── pokemon_126.png │ │ ├── pokemon_127.png │ │ ├── pokemon_128.png │ │ ├── pokemon_129.png │ │ ├── pokemon_130.png │ │ ├── pokemon_131.png │ │ ├── pokemon_132.png │ │ ├── pokemon_133.png │ │ ├── pokemon_134.png │ │ ├── pokemon_135.png │ │ ├── pokemon_136.png │ │ ├── pokemon_137.png │ │ ├── pokemon_138.png │ │ ├── pokemon_139.png │ │ ├── pokemon_140.png │ │ ├── pokemon_141.png │ │ ├── pokemon_142.png │ │ ├── pokemon_143.png │ │ ├── pokemon_144.png │ │ ├── pokemon_145.png │ │ ├── pokemon_146.png │ │ ├── pokemon_147.png │ │ ├── pokemon_148.png │ │ ├── pokemon_149.png │ │ ├── pokemon_150.png │ │ └── pokemon_151.png │ │ ├── layout │ │ ├── about_dialog.xml │ │ ├── donation_dialog.xml │ │ ├── format_dialog.xml │ │ ├── home_activity.xml │ │ └── ui_feature.xml │ │ ├── menu │ │ └── menu_home.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-de │ │ └── pokemons.xml │ │ ├── values-fr │ │ └── pokemons.xml │ │ ├── values │ │ ├── bools.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── drawables.xml │ │ ├── pokemons.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── preferences.xml │ └── test │ └── java │ └── com │ └── icecream │ └── snorlax │ └── module │ └── feature │ └── rename │ └── RenameFormatTest.java ├── build.gradle ├── buildscript ├── configuration.gradle ├── dependencies.gradle ├── signing │ ├── debug.keystore │ └── sign.gradle ├── testing.gradle └── version.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Folders 2 | .idea 3 | .gradle 4 | build 5 | buildscript/signing/* 6 | 7 | # Files 8 | *.iml 9 | Thumbs.db 10 | local.properties 11 | gradle.properties 12 | !buildscript/signing/sign.gradle 13 | !buildscript/signing/debug.keystore 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "app/src/proto"] 2 | path = app/src/proto 3 | url = https://github.com/AeonLucid/POGOProtos.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | android: 7 | components: 8 | - tools 9 | - platform-tools 10 | - build-tools-24.0.2 11 | - android-24 12 | - extra-android-m2repository 13 | - extra-google-m2repository 14 | - extra-android-support 15 | - extra-google-google_play_services 16 | 17 | before_install: 18 | - chmod +x gradlew 19 | - export CI=true 20 | 21 | before_cache: 22 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 23 | 24 | script: 25 | - ./gradlew clean build connectedCheck 26 | 27 | sudo: false 28 | 29 | notifications: 30 | email: false 31 | 32 | cache: 33 | directories: 34 | - $HOME/.m2 35 | - $HOME/.gradle 36 | - $HOME/.gradle/caches/ 37 | - $HOME/.gradle/wrapper/ 38 | 39 | branches: 40 | only: 41 | - master 42 | - dev 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Snorlax [![Build Status](https://travis-ci.org/igoticecream/Snorlax.svg?branch=master)](https://travis-ci.org/igoticecream/Snorlax) [![License](https://img.shields.io/badge/license-apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9PPGNDJEC33E) 2 | Check pokemons stats. [Available through Xposed repository](http://repo.xposed.info/module/com.icecream.snorlax) 3 | 4 | This module acts as a [man in the middle](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) on Pokémon Go's communications with the server, and allows us to add extra features to the game. 5 | 6 | Features: 7 | - Prevent PokemonGo from detecting GPS is being spoofed (similar to Mock Mock Locations) 8 | - Show pokemon stats on the inventory with custom formats 9 | - Show pokemon stats as a system notification when you encounter them: IV's, HP, CP, level, moves, catch probability 10 | - Show catch results: Success, missed, flee, etc. 11 | 12 | Check out the [Wiki page](https://github.com/igoticecream/Snorlax/wiki/Custom-formats) to learn how to use custom formats. 13 | 14 | ## Libraries and tools 15 | - Android's support libraries 16 | - Reactive extensions: [RxJava](https://github.com/ReactiveX/RxJava), [RxAndroid](https://github.com/ReactiveX/RxAndroid), [RxBinding](https://github.com/JakeWharton/RxBinding) and [RxRelay](https://github.com/JakeWharton/RxRelay) 17 | - Dependency injector: [Dagger 2](http://google.github.io/dagger/) 18 | - Android's views binding: [Butterknife](https://github.com/JakeWharton/butterknife) 19 | - Logging utility: [Timber](https://github.com/JakeWharton/timber) 20 | - Generated immutable value classes: [AutoValue](https://github.com/google/auto/tree/master/value) 21 | - [Xposed framework](https://github.com/rovo89/XposedBridge) 22 | - [Protobuf](https://github.com/google/protobuf-gradle-plugin) 23 | 24 | ## Build requirements 25 | - JDK 1.8 26 | - [Android SDK](http://developer.android.com/sdk/index.html) 27 | - Android N [(API 24) ](http://developer.android.com/tools/revisions/platforms.html) 28 | - Latest Android SDK Tools and build tools 29 | - Lombok plugin for Android Studio / IntelliJ IDEA 30 | - Your device must be rooted and the xposed framekwork must be installed. You can download the xposed framework [here](http://repo.xposed.info/module/de.robv.android.xposed.installer). 31 | 32 | ## Build source 33 | Clone the repository (you must have Git installed) 34 | ``` 35 | git clone https://github.com/igoticecream/Snorlax.git 36 | cd .\Snorlax\ 37 | git submodule update --init 38 | ``` 39 | 40 | Build 41 | ``` 42 | .\gradlew build 43 | ``` 44 | 45 | To build a release APK 46 | ``` 47 | .\gradlew assembleRelease 48 | ``` 49 | 50 | To install directly to the phone connected via ADB 51 | ``` 52 | .\gradlew installRelease 53 | ``` 54 | 55 | ## Contributing 56 | - Fork it! 57 | - Create your feature branch: `git checkout -b my-new-feature` 58 | - Commit your changes: `git commit -am 'Useful information about your new features'` 59 | - Push to the branch: `git push origin my-new-feature` 60 | - Submit a pull request on the `dev` (all pull request on master branch will be rejected) 61 | 62 | ## Special thanks 63 | Snorlax would not have been possible without: 64 | - [chuparCh0pper](https://github.com/chuparCh0pper/PoGoIV_xposed) for his awesome [module](https://github.com/chuparCh0pper/PoGoIV_xposed) which Snorlax is inspired on 65 | - [ELynx](https://github.com/ELynx) for the method to MITM PokemonGo communications, check his [repo](https://github.com/ELynx/pokemon-go-xposed-mitm) too 66 | - And last but not least, [AeonLucid](https://github.com/AeonLucid) for the [PokemonGo's protos](https://github.com/AeonLucid/POGOProtos) 67 | 68 | ## Donation 69 | I hope you are liking Snorlax! 70 | 71 | If you do, you can support this project to keep coming with new features by buying me a cup of coffee (so i can code by night) or a BigMac at McDonalds. Click the link below and thanks you! 72 | 73 | [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9PPGNDJEC33E) 74 | 75 | ## License 76 | Copyright (c) 2016. Pedro Diaz 77 | 78 | Licensed under the Apache License, Version 2.0 (the "License"); 79 | you may not use this file except in compliance with the License. 80 | You may obtain a copy of the License at 81 | 82 | http://www.apache.org/licenses/LICENSE-2.0 83 | 84 | Unless required by applicable law or agreed to in writing, software 85 | distributed under the License is distributed on an "AS IS" BASIS, 86 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 87 | See the License for the specific language governing permissions and 88 | limitations under the License. 89 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | # Folders 2 | build 3 | Thumbs.db 4 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.google.protobuf' 3 | apply plugin: 'me.tatarka.retrolambda' 4 | 5 | apply from: "${rootDir}/buildscript/signing/sign.gradle" 6 | apply from: "${rootDir}/buildscript/testing.gradle" 7 | 8 | android { 9 | compileSdkVersion config.compileSdkVersion 10 | buildToolsVersion config.buildToolsVersion 11 | 12 | defaultConfig { 13 | applicationId config.package 14 | 15 | minSdkVersion config.minSdkVersion 16 | targetSdkVersion config.targetSdkVersion 17 | 18 | versionCode config.versionCode 19 | versionName config.versionName 20 | 21 | // resConfig 'en' 22 | resValue 'string', 'app_name', config.name 23 | resValue 'string', 'app_desc', config.desc 24 | 25 | vectorDrawables.useSupportLibrary true 26 | 27 | buildConfigField 'String', 'GIT_COMMIT', "\"${config.commit}\"" 28 | buildConfigField 'java.util.Date', 'BUILD_TIME', "new java.util.Date(${config.date}L)" 29 | 30 | buildConfigField 'String', 'XPOSED_ID', "\"${config.xposedId}\"" 31 | buildConfigField 'String', 'SNORLAX_ID', "\"${config.package}\"" 32 | buildConfigField 'String', 'POKEMON_GO_ID', "\"${config.pokemonGoId}\"" 33 | 34 | archivesBaseName = project.name.toLowerCase() 35 | } 36 | buildTypes { 37 | debug { 38 | signingConfig signingConfigs.snorlax 39 | } 40 | release { 41 | signingConfig signingConfigs.snorlax 42 | 43 | useProguard true 44 | minifyEnabled true 45 | shrinkResources true 46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 47 | } 48 | } 49 | lintOptions { 50 | showAll true 51 | abortOnError true 52 | explainIssues true 53 | checkAllWarnings true 54 | warningsAsErrors true 55 | textReport true 56 | textOutput 'stdout' 57 | 58 | disable 'RtlEnabled', 59 | 'AllowBackup', 60 | 'InvalidPackage', 61 | 'UnusedResources', 62 | 'GoogleAppIndexingWarning', 63 | 'IconLocation', 64 | 'MissingTranslation' 65 | } 66 | dexOptions { 67 | dexInProcess true 68 | preDexLibraries config.predex && !config.ci 69 | javaMaxHeapSize '4g' 70 | } 71 | compileOptions { 72 | incremental true 73 | sourceCompatibility config.sourceCompatibilityVersion 74 | targetCompatibility config.targetCompatibilityVersion 75 | } 76 | packagingOptions { 77 | exclude 'META-INF/rxjava.properties' 78 | } 79 | sourceSets { 80 | main { 81 | proto { 82 | srcDir 'src/proto/src' 83 | } 84 | } 85 | } 86 | } 87 | 88 | retrolambda { 89 | incremental true 90 | } 91 | 92 | protobuf { 93 | protoc { 94 | artifact = libraries.protobufArtifact 95 | } 96 | plugins { 97 | javalite { 98 | artifact = libraries.protobufLiteArtifact 99 | } 100 | } 101 | generateProtoTasks { 102 | all().each { task -> 103 | task.builtins { 104 | remove java 105 | } 106 | task.plugins { 107 | javalite { 108 | } 109 | } 110 | } 111 | } 112 | } 113 | 114 | dependencies { 115 | compile libraries.superuser 116 | compile libraries.protobufLite 117 | compile libraries.supportLib 118 | compile libraries.timber 119 | 120 | compile libraries.rxJava 121 | compile libraries.rxAndroid 122 | compile libraries.rxBinding 123 | compile libraries.rxRelay 124 | 125 | compile libraries.butterknife 126 | annotationProcessor libraries.butterknifeCompiler 127 | 128 | compile libraries.dagger 129 | annotationProcessor libraries.daggerCompiler 130 | 131 | annotationProcessor libraries.autoValue 132 | provided libraries.autoValueAnnotations 133 | 134 | provided libraries.xposed 135 | 136 | provided libraries.lombok 137 | annotationProcessor libraries.lombok 138 | } 139 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | ## General 2 | -keepattributes EnclosingMethod 3 | -keepattributes Signature 4 | -keepattributes Exceptions 5 | -keepattributes *Annotation* 6 | 7 | ## Xposed and Snorlax Module 8 | -keep class com.icecream.snorlax.module.Snorlax{*;} 9 | -keep class com.icecream.snorlax.app.SnorlaxApp{*;} 10 | -keep class de.robv.android.xposed.**{*;} 11 | 12 | ## RxJava 13 | -dontwarn sun.misc.** 14 | 15 | -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { 16 | long producerIndex; 17 | long consumerIndex; 18 | } 19 | 20 | -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { 21 | rx.internal.util.atomic.LinkedQueueNode producerNode; 22 | } 23 | 24 | -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef { 25 | rx.internal.util.atomic.LinkedQueueNode consumerNode; 26 | } 27 | 28 | ## Retrolambda 29 | -dontwarn java.lang.invoke.* 30 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 18 | 22 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | com.icecream.snorlax.module.Snorlax 2 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/app/SnorlaxApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.app; 18 | 19 | import android.app.Application; 20 | 21 | import com.icecream.snorlax.BuildConfig; 22 | 23 | import timber.log.Timber; 24 | 25 | public class SnorlaxApp extends Application { 26 | 27 | public static boolean isEnabled() { 28 | return false; 29 | } 30 | 31 | @Override 32 | public void onCreate() { 33 | super.onCreate(); 34 | 35 | if (BuildConfig.DEBUG) { 36 | Timber.plant(new Timber.DebugTree()); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/app/home/HomeActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.app.home; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | import android.content.SharedPreferences; 22 | import android.os.Bundle; 23 | import android.support.design.widget.CoordinatorLayout; 24 | import android.support.design.widget.FloatingActionButton; 25 | import android.support.design.widget.Snackbar; 26 | import android.support.v7.app.AlertDialog; 27 | import android.support.v7.app.AppCompatActivity; 28 | import android.support.v7.preference.PreferenceManager; 29 | import android.support.v7.widget.Toolbar; 30 | import android.view.Menu; 31 | import android.view.MenuItem; 32 | 33 | import com.icecream.snorlax.BuildConfig; 34 | import com.icecream.snorlax.R; 35 | import com.icecream.snorlax.app.SnorlaxApp; 36 | import com.icecream.snorlax.app.settings.SettingsFragment; 37 | import com.jakewharton.rxbinding.view.RxView; 38 | 39 | import butterknife.BindView; 40 | import butterknife.ButterKnife; 41 | import butterknife.Unbinder; 42 | import rx.Observable; 43 | 44 | import static com.icecream.snorlax.R.xml.preferences; 45 | 46 | public class HomeActivity extends AppCompatActivity { 47 | 48 | @BindView(R.id.coordinator) 49 | CoordinatorLayout mCoordinatorLayout; 50 | @BindView(R.id.toolbar) 51 | Toolbar mToolbar; 52 | @BindView(R.id.fab) 53 | FloatingActionButton mFab; 54 | 55 | private Unbinder mUnbinder; 56 | private AlertDialog mAboutDialog; 57 | private AlertDialog mFormatInfoDialog; 58 | private AlertDialog mDonationDialog; 59 | 60 | @Override 61 | protected void onCreate(Bundle savedInstanceState) { 62 | super.onCreate(savedInstanceState); 63 | setContentView(R.layout.home_activity); 64 | mUnbinder = ButterKnife.bind(this); 65 | 66 | setupToolbar(); 67 | setupPreferences(); 68 | 69 | if (savedInstanceState == null) { 70 | Observable 71 | .just(SnorlaxApp.isEnabled()) 72 | .filter(enabled -> !enabled) 73 | .map(enabled -> getPackageManager().getLaunchIntentForPackage(BuildConfig.XPOSED_ID)) 74 | .map(intent -> { 75 | if (intent != null) { 76 | return Snackbar.make(mFab, R.string.error_xposed_disabled, Snackbar.LENGTH_LONG).setAction(R.string.enable, v -> startActivity(intent)); 77 | } 78 | else { 79 | return Snackbar.make(mFab, R.string.error_xposed_missing, Snackbar.LENGTH_LONG); 80 | } 81 | }) 82 | .subscribe(Snackbar::show); 83 | } 84 | 85 | RxView 86 | .clicks(mFab) 87 | .throttleFirst(3, TimeUnit.SECONDS) 88 | .map(click -> getPackageManager().getLaunchIntentForPackage(BuildConfig.POKEMON_GO_ID)) 89 | .doOnNext(intent -> { 90 | if (intent == null) { 91 | Snackbar.make(mFab, R.string.error_pokemon_missing, Snackbar.LENGTH_LONG).show(); 92 | } 93 | }) 94 | .filter(intent -> intent != null) 95 | .subscribe(this::startActivity); 96 | 97 | checkIfFirstTime(); 98 | } 99 | 100 | private void setupToolbar() { 101 | setSupportActionBar(mToolbar); 102 | } 103 | 104 | private void setupPreferences() { 105 | PreferenceManager.setDefaultValues(this, preferences, false); 106 | 107 | getSupportFragmentManager() 108 | .beginTransaction() 109 | .replace(R.id.content, new SettingsFragment()) 110 | .commit(); 111 | } 112 | 113 | private void checkIfFirstTime() { 114 | final String version = "version"; 115 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); 116 | 117 | if (preferences.getInt(version, -1) < BuildConfig.VERSION_CODE) { 118 | mDonationDialog = HomeDialog.showDonation(this); 119 | preferences.edit().putInt(version, BuildConfig.VERSION_CODE).apply(); 120 | } 121 | } 122 | 123 | @Override 124 | protected void onDestroy() { 125 | super.onDestroy(); 126 | mUnbinder.unbind(); 127 | } 128 | 129 | @Override 130 | public boolean onCreateOptionsMenu(Menu menu) { 131 | getMenuInflater().inflate(R.menu.menu_home, menu); 132 | return true; 133 | } 134 | 135 | @Override 136 | public boolean onOptionsItemSelected(MenuItem item) { 137 | switch (item.getItemId()) { 138 | case R.id.about: 139 | mAboutDialog = HomeDialog.showAbout(this); 140 | return true; 141 | case R.id.format_info: 142 | mFormatInfoDialog = HomeDialog.showFormatInfo(this); 143 | return true; 144 | case R.id.donation: 145 | mDonationDialog = HomeDialog.showDonation(this); 146 | return true; 147 | default: 148 | return super.onOptionsItemSelected(item); 149 | } 150 | } 151 | 152 | @Override 153 | protected void onPause() { 154 | super.onPause(); 155 | HomeDialog.dismiss(mFormatInfoDialog, mAboutDialog, mDonationDialog); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/app/home/HomeDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.app.home; 18 | 19 | import android.annotation.SuppressLint; 20 | import android.app.Dialog; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.net.Uri; 24 | import android.support.v7.app.AlertDialog; 25 | import android.view.LayoutInflater; 26 | import android.view.View; 27 | import android.widget.TextView; 28 | 29 | import com.icecream.snorlax.BuildConfig; 30 | import com.icecream.snorlax.R; 31 | 32 | import rx.Observable; 33 | 34 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 35 | final class HomeDialog { 36 | 37 | @SuppressLint("InflateParams") 38 | static AlertDialog showDonation(Context context) { 39 | return new AlertDialog.Builder(context, R.style.Snorlax_Dialog) 40 | .setTitle(R.string.donation) 41 | .setView(LayoutInflater.from(context).inflate(R.layout.donation_dialog, null, false)) 42 | .setPositiveButton("Paypal", (dialog, which) -> context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9PPGNDJEC33E")))) 43 | .setCancelable(true) 44 | .show(); 45 | } 46 | 47 | @SuppressLint("InflateParams") 48 | static AlertDialog showAbout(Context context) { 49 | View view = LayoutInflater.from(context).inflate(R.layout.about_dialog, null, false); 50 | 51 | TextView version = (TextView) view.findViewById(R.id.version); 52 | version.setText(context.getString(R.string.about_version, BuildConfig.VERSION_NAME)); 53 | 54 | TextView author = (TextView) view.findViewById(R.id.author); 55 | author.setText(context.getString(R.string.about_author)); 56 | 57 | TextView github = (TextView) view.findViewById(R.id.github); 58 | github.setText(context.getString(R.string.about_github)); 59 | 60 | TextView thanks = (TextView) view.findViewById(R.id.thanks); 61 | thanks.setText(context.getString(R.string.about_thanks)); 62 | 63 | return new AlertDialog.Builder(context, R.style.Snorlax_Dialog) 64 | .setTitle(R.string.app_name) 65 | .setView(view) 66 | .setPositiveButton("Github", (dialog, which) -> context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.about_repository))))) 67 | .setCancelable(true) 68 | .show(); 69 | } 70 | 71 | @SuppressLint("InflateParams") 72 | static AlertDialog showFormatInfo(Context context) { 73 | return new AlertDialog.Builder(context) 74 | .setTitle(R.string.format_info) 75 | .setView(LayoutInflater.from(context).inflate(R.layout.format_dialog, null, false)) 76 | .setPositiveButton(android.R.string.ok, null) 77 | .setCancelable(true) 78 | .show(); 79 | } 80 | 81 | static void dismiss(AlertDialog... dialogs) { 82 | Observable 83 | .from(dialogs) 84 | .filter(dialog -> dialog != null) 85 | .filter(Dialog::isShowing) 86 | .forEach(Dialog::dismiss); 87 | } 88 | 89 | HomeDialog() { 90 | throw new AssertionError("No instances"); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/app/settings/SettingsFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.app.settings; 18 | 19 | import android.graphics.Color; 20 | import android.graphics.drawable.ColorDrawable; 21 | import android.os.Bundle; 22 | import android.support.v7.preference.PreferenceFragmentCompat; 23 | import android.widget.Toast; 24 | 25 | import com.icecream.snorlax.R; 26 | 27 | import timber.log.Timber; 28 | 29 | import static com.icecream.snorlax.R.xml.preferences; 30 | 31 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 32 | public class SettingsFragment extends PreferenceFragmentCompat { 33 | 34 | private SettingsReadable mSettingsReadable; 35 | 36 | @Override 37 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 38 | addPreferencesFromResource(preferences); 39 | } 40 | 41 | @Override 42 | public void onActivityCreated(Bundle savedInstanceState) { 43 | super.onActivityCreated(savedInstanceState); 44 | 45 | setDivider(new ColorDrawable(Color.TRANSPARENT)); 46 | setDividerHeight(0); 47 | 48 | getListView().setPadding(0, 0, 0, getActivity().getResources().getDimensionPixelSize(R.dimen.padding_list_bottom)); 49 | } 50 | 51 | @Override 52 | public void onPause() { 53 | super.onPause(); 54 | SettingsReadable settingsReadable = new SettingsReadable( 55 | getActivity().getApplicationInfo(), 56 | getPreferenceManager() 57 | ); 58 | 59 | settingsReadable 60 | .setReadable() 61 | .subscribe(Timber::d, throwable -> { 62 | Timber.e(throwable); 63 | showReadableError(); 64 | }); 65 | } 66 | 67 | private void showReadableError() { 68 | if (getActivity() != null) { 69 | Toast.makeText(getActivity(), R.string.error_readable, Toast.LENGTH_LONG).show(); 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/app/settings/SettingsReadable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.app.settings; 18 | 19 | import java.io.File; 20 | import java.util.List; 21 | 22 | import android.content.pm.ApplicationInfo; 23 | import android.support.v7.preference.PreferenceManager; 24 | 25 | import eu.chainfire.libsuperuser.Shell; 26 | import rx.Observable; 27 | import rx.android.schedulers.AndroidSchedulers; 28 | import rx.schedulers.Schedulers; 29 | 30 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 31 | final class SettingsReadable { 32 | 33 | private final ApplicationInfo mApplicationInfo; 34 | private final PreferenceManager mPreferenceManager; 35 | 36 | SettingsReadable(ApplicationInfo applicationInfo, PreferenceManager preferenceManager) { 37 | mApplicationInfo = applicationInfo; 38 | mPreferenceManager = preferenceManager; 39 | } 40 | 41 | private List execute() { 42 | File directory = new File(mApplicationInfo.dataDir, "shared_prefs"); 43 | File file = new File(directory, mPreferenceManager.getSharedPreferencesName() + ".xml"); 44 | 45 | // Using SH since we are the owner of the files 46 | return Shell.SH.run(new String[]{ 47 | String.format("chmod 755 %s", directory.getAbsolutePath()), 48 | String.format("chmod 664 %s", file.getAbsolutePath()) 49 | }); 50 | } 51 | 52 | Observable setReadable() { 53 | return Observable 54 | .fromCallable(this::execute) 55 | .flatMapIterable(strings -> strings) 56 | .map(string -> String.format("%s%c", string, (char) 10)) 57 | .subscribeOn(Schedulers.io()) 58 | .observeOn(AndroidSchedulers.mainThread()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/app/widget/SummaryEditTextPreference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.app.widget; 18 | 19 | import android.annotation.TargetApi; 20 | import android.content.Context; 21 | import android.os.Build; 22 | import android.support.v7.preference.EditTextPreference; 23 | import android.util.AttributeSet; 24 | 25 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 26 | public class SummaryEditTextPreference extends EditTextPreference { 27 | 28 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 29 | public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 30 | super(context, attrs, defStyleAttr, defStyleRes); 31 | } 32 | 33 | public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr) { 34 | super(context, attrs, defStyleAttr); 35 | } 36 | 37 | public SummaryEditTextPreference(Context context, AttributeSet attrs) { 38 | super(context, attrs); 39 | } 40 | 41 | public SummaryEditTextPreference(Context context) { 42 | super(context); 43 | } 44 | 45 | @Override 46 | public CharSequence getSummary() { 47 | return getText(); 48 | } 49 | 50 | @Override 51 | public void setText(String text) { 52 | super.setText(text); 53 | setSummary(text); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/common/Decimals.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.common; 18 | 19 | import java.math.RoundingMode; 20 | import java.text.DecimalFormat; 21 | 22 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 23 | public final class Decimals { 24 | 25 | public static String format(float value, int minIntegerDigits, int maxIntegerDigits, int minFractionDigits, int maxFractionDigits) { 26 | return getDecimalFormat(minIntegerDigits, maxIntegerDigits, minFractionDigits, maxFractionDigits).format(value); 27 | } 28 | 29 | private static DecimalFormat getDecimalFormat(int minIntegerDigits, int maxIntegerDigits, int minFractionDigits, int maxFractionDigits) { 30 | DecimalFormat format = new DecimalFormat(); 31 | format.setRoundingMode(RoundingMode.HALF_UP); 32 | format.setMinimumFractionDigits(minFractionDigits); 33 | format.setMaximumFractionDigits(maxFractionDigits); 34 | format.setMinimumIntegerDigits(minIntegerDigits); 35 | format.setMaximumIntegerDigits(maxIntegerDigits); 36 | return format; 37 | } 38 | 39 | public static String format(double value, int minIntegerDigits, int maxIntegerDigits, int minFractionDigits, int maxFractionDigits) { 40 | return getDecimalFormat(minIntegerDigits, maxIntegerDigits, minFractionDigits, maxFractionDigits).format(value); 41 | } 42 | 43 | public static String format(int value, int minIntegerDigits, int maxIntegerDigits, int minFractionDigits, int maxFractionDigits) { 44 | return getDecimalFormat(minIntegerDigits, maxIntegerDigits, minFractionDigits, maxFractionDigits).format(value); 45 | } 46 | 47 | private Decimals() { 48 | throw new AssertionError("No instances"); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/common/Strings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.common; 18 | 19 | import java.util.Locale; 20 | 21 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 22 | public final class Strings { 23 | 24 | public static final String EMPTY = ""; 25 | public static final String DOT = "."; 26 | public static final String COLON = ":"; 27 | public static final String SPACE = " "; 28 | 29 | public static String nullToEmpty(String string) { 30 | return (string == null) ? EMPTY : string; 31 | } 32 | 33 | public static String emptyToNull(String string) { 34 | return isNullOrEmpty(string) ? null : string; 35 | } 36 | 37 | public static boolean isNullOrEmpty(String string) { 38 | return isNull(string) || isEmpty(string); 39 | } 40 | 41 | public static boolean isNull(String string) { 42 | return string == null; 43 | } 44 | 45 | public static boolean isEmpty(String string) { 46 | return string.trim().length() == 0; 47 | } 48 | 49 | public static String valueOrDefault(String string, String defaultString) { 50 | return isNullOrEmpty(string) ? defaultString : string; 51 | } 52 | 53 | public static String truncateAt(String string, int length) { 54 | return (string.length() > length) ? string.substring(0, length) : string; 55 | } 56 | 57 | public static String padEnd(String string, int minLength, char padChar) { 58 | if (string.length() >= minLength) { 59 | return string; 60 | } 61 | StringBuilder sb = new StringBuilder(minLength); 62 | sb.append(string); 63 | for (int i = string.length(); i < minLength; i++) { 64 | sb.append(padChar); 65 | } 66 | return sb.toString(); 67 | } 68 | 69 | public static String padStart(String string, int minLength, char padChar) { 70 | if (string.length() >= minLength) { 71 | return string; 72 | } 73 | StringBuilder sb = new StringBuilder(minLength); 74 | for (int i = string.length(); i < minLength; i++) { 75 | sb.append(padChar); 76 | } 77 | sb.append(string); 78 | return sb.toString(); 79 | } 80 | 81 | public static String capitalize(String[] string) { 82 | if (string == null) { 83 | return null; 84 | } 85 | StringBuilder builder = new StringBuilder(); 86 | for (String sub : string) { 87 | builder 88 | .append(capitalize(sub)) 89 | .append(" "); 90 | } 91 | return builder.toString().trim(); 92 | } 93 | 94 | public static String capitalize(String string) { 95 | if (isNullOrEmpty(string) || string.trim().length() < 2) { 96 | return string; 97 | } 98 | return String.valueOf(string.charAt(0)).toUpperCase(Locale.US) + string.substring(1).toLowerCase(Locale.US); 99 | } 100 | 101 | private Strings() { 102 | throw new AssertionError("No instances"); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/common/rx/RxBus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.common.rx; 18 | 19 | import com.jakewharton.rxrelay.PublishRelay; 20 | import com.jakewharton.rxrelay.SerializedRelay; 21 | 22 | import rx.Observable; 23 | import rx.Subscription; 24 | import rx.functions.Action1; 25 | 26 | @SuppressWarnings({"unused", "WeakerAccess", "FieldCanBeLocal"}) 27 | public final class RxBus { 28 | 29 | private static volatile RxBus sInstance = null; 30 | 31 | public static RxBus getInstance() { 32 | if (sInstance == null) { 33 | synchronized (RxBus.class) { 34 | if (sInstance == null) { 35 | sInstance = new RxBus(); 36 | } 37 | } 38 | } 39 | return sInstance; 40 | } 41 | 42 | private final SerializedRelay mSubject; 43 | 44 | private RxBus() { 45 | mSubject = PublishRelay.create().toSerialized(); 46 | } 47 | 48 | public void post(Object event) { 49 | mSubject.call(event); 50 | } 51 | 52 | public Subscription receive(final Class klass, Action1 onNext) { 53 | return receive(klass).subscribe(onNext); 54 | } 55 | 56 | public Observable receive(final Class klass) { 57 | return receive().ofType(klass); 58 | } 59 | 60 | public Observable receive() { 61 | return mSubject; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/common/rx/RxFuncitons.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.common.rx; 18 | 19 | import rx.Subscription; 20 | import rx.subscriptions.CompositeSubscription; 21 | 22 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 23 | public final class RxFuncitons { 24 | 25 | public static void unsubscribe(Subscription subscription) { 26 | if (subscription != null && !subscription.isUnsubscribed()) { 27 | subscription.unsubscribe(); 28 | } 29 | } 30 | 31 | public static void unsubscribe(CompositeSubscription subscription) { 32 | if (subscription != null && !subscription.isUnsubscribed()) { 33 | subscription.unsubscribe(); 34 | } 35 | } 36 | 37 | private RxFuncitons() { 38 | throw new AssertionError("No instances"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/Log.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module; 18 | 19 | import java.util.Locale; 20 | 21 | import de.robv.android.xposed.XposedBridge; 22 | 23 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 24 | public final class Log { 25 | 26 | public static void d(String format, Object... args) { 27 | XposedBridge.log(String.format(Locale.US, format, args)); 28 | } 29 | 30 | public static void e(Throwable throwable) { 31 | XposedBridge.log(throwable); 32 | } 33 | 34 | public static void e(Throwable throwable, String format, Object... args) { 35 | XposedBridge.log(new Exception(String.format(Locale.US, format, args), throwable)); 36 | } 37 | 38 | public static void e(String format, Object... args) { 39 | XposedBridge.log(new Exception(String.format(Locale.US, format, args))); 40 | } 41 | 42 | private Log() { 43 | throw new AssertionError("No instances"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/Snorlax.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module; 18 | 19 | import javax.inject.Inject; 20 | 21 | import android.app.Application; 22 | 23 | import com.icecream.snorlax.BuildConfig; 24 | import com.icecream.snorlax.app.SnorlaxApp; 25 | import com.icecream.snorlax.module.feature.FeatureHelper; 26 | import com.icecream.snorlax.module.feature.capture.Capture; 27 | import com.icecream.snorlax.module.feature.encounter.Encounter; 28 | import com.icecream.snorlax.module.feature.mitm.Mitm; 29 | import com.icecream.snorlax.module.feature.mock.Mock; 30 | import com.icecream.snorlax.module.feature.rename.Rename; 31 | 32 | import de.robv.android.xposed.IXposedHookLoadPackage; 33 | import de.robv.android.xposed.IXposedHookZygoteInit; 34 | import de.robv.android.xposed.XC_MethodHook; 35 | import de.robv.android.xposed.XC_MethodReplacement; 36 | import de.robv.android.xposed.XSharedPreferences; 37 | import de.robv.android.xposed.XposedHelpers; 38 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 39 | 40 | public class Snorlax implements IXposedHookLoadPackage, IXposedHookZygoteInit { 41 | 42 | @Inject 43 | Mock mMock; 44 | @Inject 45 | Mitm mMitm; 46 | @Inject 47 | Capture mCapture; 48 | @Inject 49 | Encounter mEncounter; 50 | @Inject 51 | Rename mRename; 52 | 53 | private XSharedPreferences mXSharedPreferences; 54 | 55 | @Override 56 | public void initZygote(StartupParam startupParam) throws Throwable { 57 | mXSharedPreferences = new XSharedPreferences(BuildConfig.SNORLAX_ID); 58 | mXSharedPreferences.makeWorldReadable(); 59 | } 60 | 61 | @Override 62 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { 63 | final ClassLoader classLoader = lpparam.classLoader; 64 | 65 | if (lpparam.packageName.equals(BuildConfig.POKEMON_GO_ID)) { 66 | handlePokemonGoLoadPackage(classLoader); 67 | } 68 | 69 | if (lpparam.packageName.equals(BuildConfig.SNORLAX_ID)) { 70 | handleSnorlaxLoadPackage(classLoader); 71 | } 72 | } 73 | 74 | private void handlePokemonGoLoadPackage(final ClassLoader classLoader) { 75 | XposedHelpers.findAndHookMethod(Application.class, "onCreate", new XC_MethodHook() { 76 | @Override 77 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 78 | getComponent((Application) param.thisObject, classLoader, mXSharedPreferences).inject(Snorlax.this); 79 | 80 | FeatureHelper.subscribe(mMitm, mMock, mCapture, mEncounter, mRename); 81 | } 82 | }); 83 | XposedHelpers.findAndHookMethod(Application.class, "onTerminate", new XC_MethodHook() { 84 | @Override 85 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 86 | FeatureHelper.unsubscribe(mMitm, mMock, mCapture, mEncounter, mRename); 87 | } 88 | }); 89 | } 90 | 91 | private void handleSnorlaxLoadPackage(final ClassLoader classLoader) { 92 | XposedHelpers.findAndHookMethod(SnorlaxApp.class.getName(), classLoader, "isEnabled", XC_MethodReplacement.returnConstant(true)); 93 | } 94 | 95 | private SnorlaxComponent getComponent(Application application, ClassLoader classLoader, XSharedPreferences preferences) { 96 | return DaggerSnorlaxComponent.builder() 97 | .snorlaxModule(new SnorlaxModule(application, classLoader, preferences)) 98 | .build(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/SnorlaxComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module; 18 | 19 | import javax.inject.Singleton; 20 | 21 | import com.icecream.snorlax.module.context.pokemongo.PokemonGoContextModule; 22 | import com.icecream.snorlax.module.context.snorlax.SnorlaxContextModule; 23 | 24 | import dagger.Component; 25 | 26 | @Singleton 27 | @Component(modules = { 28 | SnorlaxModule.class, 29 | SnorlaxContextModule.class, 30 | PokemonGoContextModule.class 31 | }) 32 | interface SnorlaxComponent { 33 | 34 | void inject(Snorlax snorlax); 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/SnorlaxModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module; 18 | 19 | import java.util.List; 20 | 21 | import javax.inject.Singleton; 22 | 23 | import android.app.Application; 24 | import android.util.LongSparseArray; 25 | 26 | import com.icecream.snorlax.common.rx.RxBus; 27 | import com.icecream.snorlax.module.feature.mitm.MitmRelay; 28 | 29 | import dagger.Module; 30 | import dagger.Provides; 31 | import de.robv.android.xposed.XSharedPreferences; 32 | 33 | import static POGOProtos.Networking.Requests.RequestOuterClass.Request; 34 | 35 | @Module 36 | final class SnorlaxModule { 37 | 38 | private final Application mApplication; 39 | private final ClassLoader mClassLoader; 40 | private final XSharedPreferences mXSharedPreferences; 41 | 42 | SnorlaxModule(Application application, ClassLoader classLoader, XSharedPreferences xSharedPreferences) { 43 | mApplication = application; 44 | mClassLoader = classLoader; 45 | mXSharedPreferences = xSharedPreferences; 46 | } 47 | 48 | @Provides 49 | ClassLoader provideClassLoader() { 50 | return mClassLoader; 51 | } 52 | 53 | @Provides 54 | XSharedPreferences provideXSharedPreferences() { 55 | return mXSharedPreferences; 56 | } 57 | 58 | @Provides 59 | Application provideAppliction() { 60 | return mApplication; 61 | } 62 | 63 | @Provides 64 | @Singleton 65 | MitmRelay provideMitmRelay() { 66 | return MitmRelay.getInstance(); 67 | } 68 | 69 | @Provides 70 | @Singleton 71 | LongSparseArray> provideLongSparseArray() { 72 | return new LongSparseArray<>(); 73 | } 74 | 75 | @Provides 76 | RxBus provideRxBus() { 77 | return RxBus.getInstance(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/pokemongo/PokemonGo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.pokemongo; 18 | 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | 22 | import javax.inject.Qualifier; 23 | 24 | @Qualifier 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface PokemonGo { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/pokemongo/PokemonGoContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.pokemongo; 18 | 19 | import android.content.Context; 20 | import android.content.ContextWrapper; 21 | 22 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 23 | final class PokemonGoContext extends ContextWrapper { 24 | 25 | PokemonGoContext(Context base) { 26 | super(base); 27 | } 28 | 29 | @Override 30 | public Context getApplicationContext() { 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/pokemongo/PokemonGoContextFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.pokemongo; 18 | 19 | import android.content.Context; 20 | import android.content.pm.PackageManager; 21 | 22 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 23 | final class PokemonGoContextFactory { 24 | 25 | static PokemonGoContext create(Context from) throws PackageManager.NameNotFoundException { 26 | return new PokemonGoContext(from); 27 | } 28 | 29 | private PokemonGoContextFactory() { 30 | throw new AssertionError("No instances"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/pokemongo/PokemonGoContextModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.pokemongo; 18 | 19 | import javax.inject.Singleton; 20 | 21 | import android.app.Application; 22 | import android.app.NotificationManager; 23 | import android.content.Context; 24 | import android.content.pm.PackageManager; 25 | 26 | import dagger.Module; 27 | import dagger.Provides; 28 | 29 | @Module 30 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 31 | public final class PokemonGoContextModule { 32 | 33 | @Provides 34 | @PokemonGo 35 | @Singleton 36 | static Context provideContext(Application application) { 37 | try { 38 | return PokemonGoContextFactory.create(application); 39 | } 40 | catch (PackageManager.NameNotFoundException e) { 41 | throw new RuntimeException("Pokemon Go package not found... Cannot continue"); 42 | } 43 | } 44 | 45 | @Provides 46 | @PokemonGo 47 | @Singleton 48 | static NotificationManager provideNotificationManager(@PokemonGo Context context) { 49 | return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/snorlax/Snorlax.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.snorlax; 18 | 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | 22 | import javax.inject.Qualifier; 23 | 24 | @Qualifier 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface Snorlax { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/snorlax/SnorlaxContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.snorlax; 18 | 19 | import android.content.Context; 20 | import android.content.ContextWrapper; 21 | 22 | import com.icecream.snorlax.R; 23 | 24 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 25 | final class SnorlaxContext extends ContextWrapper { 26 | 27 | SnorlaxContext(Context base) { 28 | super(base); 29 | setTheme(R.style.Snorlax); 30 | } 31 | 32 | @Override 33 | public Context getApplicationContext() { 34 | return this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/snorlax/SnorlaxContextFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.snorlax; 18 | 19 | import android.content.Context; 20 | import android.content.pm.PackageManager; 21 | 22 | import com.icecream.snorlax.BuildConfig; 23 | 24 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 25 | final class SnorlaxContextFactory { 26 | 27 | static SnorlaxContext create(Context from) throws PackageManager.NameNotFoundException { 28 | return new SnorlaxContext(from.createPackageContext(BuildConfig.SNORLAX_ID, Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE)); 29 | } 30 | 31 | private SnorlaxContextFactory() { 32 | throw new AssertionError("No instances"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/context/snorlax/SnorlaxContextModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.context.snorlax; 18 | 19 | import javax.inject.Singleton; 20 | 21 | import android.app.Application; 22 | import android.content.Context; 23 | import android.content.pm.PackageManager; 24 | import android.content.res.Resources; 25 | import android.view.LayoutInflater; 26 | 27 | import dagger.Module; 28 | import dagger.Provides; 29 | 30 | @Module 31 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 32 | public final class SnorlaxContextModule { 33 | 34 | @Provides 35 | @Snorlax 36 | @Singleton 37 | static Context provideContext(Application application) { 38 | try { 39 | return SnorlaxContextFactory.create(application); 40 | } 41 | catch (PackageManager.NameNotFoundException e) { 42 | throw new RuntimeException("Snorlax package not found... Cannot continue"); 43 | } 44 | } 45 | 46 | @Provides 47 | @Snorlax 48 | @Singleton 49 | static Resources provideResources(@Snorlax Context context) { 50 | return context.getResources(); 51 | } 52 | 53 | @Provides 54 | @Snorlax 55 | @Singleton 56 | static LayoutInflater provideLayoutInflater(@Snorlax Context context) { 57 | return LayoutInflater.from(context); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature; 18 | 19 | public interface Feature { 20 | 21 | void subscribe() throws Exception; 22 | 23 | void unsubscribe() throws Exception; 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/FeatureHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature; 18 | 19 | import com.icecream.snorlax.module.Log; 20 | 21 | import rx.Observable; 22 | 23 | public final class FeatureHelper { 24 | 25 | public static void subscribe(Feature... features) { 26 | Observable 27 | .from(features) 28 | .filter(feature -> feature != null) 29 | .subscribe(feature -> { 30 | try { 31 | feature.subscribe(); 32 | } 33 | catch (Exception exception) { 34 | Log.e(exception, "Cannot subscribe to feature"); 35 | } 36 | }); 37 | } 38 | 39 | public static void unsubscribe(Feature... features) { 40 | Observable 41 | .from(features) 42 | .filter(feature -> feature != null) 43 | .subscribe(feature -> { 44 | try { 45 | feature.unsubscribe(); 46 | } 47 | catch (Exception exception) { 48 | Log.e(exception, "Cannot unsubscribe to feature"); 49 | } 50 | }); 51 | } 52 | 53 | private FeatureHelper() { 54 | throw new AssertionError("No instances"); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/capture/Capture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.capture; 18 | 19 | import java.util.List; 20 | import java.util.Locale; 21 | 22 | import javax.inject.Inject; 23 | import javax.inject.Singleton; 24 | 25 | import com.google.protobuf.ByteString; 26 | import com.google.protobuf.InvalidProtocolBufferException; 27 | import com.icecream.snorlax.common.rx.RxBus; 28 | import com.icecream.snorlax.common.rx.RxFuncitons; 29 | import com.icecream.snorlax.module.Log; 30 | import com.icecream.snorlax.module.feature.Feature; 31 | import com.icecream.snorlax.module.feature.mitm.MitmRelay; 32 | 33 | import POGOProtos.Networking.Requests.RequestTypeOuterClass; 34 | import rx.Observable; 35 | import rx.Subscription; 36 | 37 | import static POGOProtos.Networking.Requests.RequestOuterClass.Request; 38 | import static POGOProtos.Networking.Requests.RequestTypeOuterClass.RequestType; 39 | import static POGOProtos.Networking.Responses.CatchPokemonResponseOuterClass.CatchPokemonResponse; 40 | 41 | @Singleton 42 | public final class Capture implements Feature { 43 | 44 | private final MitmRelay mMitmRelay; 45 | private final CapturePreferences mPreferences; 46 | private final CaptureNotification mCaptureNotification; 47 | private final RxBus mRxBus; 48 | 49 | private Subscription mSubscription; 50 | 51 | @Inject 52 | Capture(MitmRelay mitmRelay, CapturePreferences preferences, CaptureNotification captureNotification, RxBus rxBus) { 53 | mMitmRelay = mitmRelay; 54 | mPreferences = preferences; 55 | mCaptureNotification = captureNotification; 56 | mRxBus = rxBus; 57 | } 58 | 59 | private void onCapture(ByteString bytes) { 60 | try { 61 | CatchPokemonResponse response = CatchPokemonResponse.parseFrom(bytes); 62 | 63 | final CatchPokemonResponse.CatchStatus status = response.getStatus(); 64 | 65 | if (mPreferences.isEnabled() && !status.equals(CatchPokemonResponse.CatchStatus.CATCH_MISSED)) { 66 | mCaptureNotification.show(formatCapture(response.getStatus().name())); 67 | } 68 | mRxBus.post(new CaptureEvent(status)); 69 | } 70 | catch (InvalidProtocolBufferException e) { 71 | Log.d("CatchPokemonResponse failed: %s" + e.getMessage()); 72 | Log.e(e); 73 | } 74 | } 75 | 76 | private String formatCapture(String status) { 77 | StringBuilder builder = new StringBuilder(); 78 | for (String part : status.split("_")) { 79 | builder 80 | .append(part.charAt(0)) 81 | .append(part.substring(1).toLowerCase(Locale.US)) 82 | .append(" "); 83 | } 84 | return builder.toString().trim(); 85 | } 86 | 87 | @Override 88 | public void subscribe() { 89 | unsubscribe(); 90 | 91 | mSubscription = mMitmRelay 92 | .getObservable() 93 | .flatMap(envelope -> { 94 | List requests = envelope.getRequest().getRequestsList(); 95 | 96 | for (int i = 0; i < requests.size(); i++) { 97 | RequestTypeOuterClass.RequestType type = requests.get(i).getRequestType(); 98 | 99 | if (type == RequestType.CATCH_POKEMON) { 100 | return Observable.just(envelope.getResponse().getReturns(i)); 101 | } 102 | } 103 | return Observable.empty(); 104 | }) 105 | .subscribe(this::onCapture, Log::e); 106 | } 107 | 108 | @Override 109 | public void unsubscribe() { 110 | RxFuncitons.unsubscribe(mSubscription); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/capture/CaptureEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.capture; 18 | 19 | import static POGOProtos.Networking.Responses.CatchPokemonResponseOuterClass.CatchPokemonResponse.CatchStatus; 20 | 21 | public final class CaptureEvent { 22 | 23 | private final CatchStatus mCatchStatus; 24 | 25 | CaptureEvent(CatchStatus catchStatus) { 26 | mCatchStatus = catchStatus; 27 | } 28 | 29 | public CatchStatus getCatchStatus() { 30 | return mCatchStatus; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/capture/CaptureNotification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.capture; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.Context; 23 | import android.os.Handler; 24 | import android.os.Looper; 25 | import android.widget.Toast; 26 | 27 | import com.icecream.snorlax.module.context.pokemongo.PokemonGo; 28 | 29 | @Singleton 30 | final class CaptureNotification { 31 | 32 | private final Context mContext; 33 | 34 | @Inject 35 | CaptureNotification(@PokemonGo Context context) { 36 | mContext = context; 37 | } 38 | 39 | void show(final String message) { 40 | new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/capture/CapturePreferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.capture; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.res.Resources; 23 | 24 | import com.icecream.snorlax.R; 25 | import com.icecream.snorlax.module.context.snorlax.Snorlax; 26 | 27 | import de.robv.android.xposed.XSharedPreferences; 28 | 29 | @Singleton 30 | final class CapturePreferences { 31 | 32 | private final Resources mResources; 33 | private final XSharedPreferences mPreferences; 34 | 35 | @Inject 36 | CapturePreferences(@Snorlax Resources resources, XSharedPreferences preferences) { 37 | mResources = resources; 38 | mPreferences = preferences; 39 | } 40 | 41 | boolean isEnabled() { 42 | mPreferences.reload(); 43 | final boolean expected = getPreferenceDefaultValue(); 44 | return expected == getPreference(expected); 45 | } 46 | 47 | private boolean getPreferenceDefaultValue() { 48 | return mResources.getBoolean(R.bool.preference_catch_notification_enable); 49 | } 50 | 51 | private boolean getPreference(boolean defaultValue) { 52 | return mPreferences.getBoolean(mResources.getString(R.string.preference_catch_notification_enable_key), defaultValue); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/encounter/EncounterPreferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.encounter; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.res.Resources; 23 | 24 | import com.icecream.snorlax.R; 25 | import com.icecream.snorlax.module.context.snorlax.Snorlax; 26 | 27 | import de.robv.android.xposed.XSharedPreferences; 28 | import rx.Observable; 29 | 30 | @Singleton 31 | final class EncounterPreferences { 32 | 33 | private final Resources mResources; 34 | private final XSharedPreferences mPreferences; 35 | 36 | @Inject 37 | EncounterPreferences(@Snorlax Resources resources, XSharedPreferences preferences) { 38 | mResources = resources; 39 | mPreferences = preferences; 40 | } 41 | 42 | Observable.Transformer isDismissEnabled() { 43 | return observable -> observable 44 | .doOnNext(t -> mPreferences.reload()) 45 | .filter(t -> { 46 | final boolean expected = mResources.getBoolean(R.bool.preference_encounter_dismiss_notification_enable); 47 | return expected == mPreferences.getBoolean(mResources.getString(R.string.preference_encounter_dismiss_notification_enable_key), expected); 48 | }); 49 | } 50 | 51 | Observable.Transformer isEnabled() { 52 | return observable -> observable 53 | .doOnNext(t -> mPreferences.reload()) 54 | .filter(t -> { 55 | final boolean expected = getPreferenceDefaultValue(); 56 | return expected == getPreference(expected); 57 | }); 58 | } 59 | 60 | private boolean getPreferenceDefaultValue() { 61 | return mResources.getBoolean(R.bool.preference_encounter_notification_enable); 62 | } 63 | 64 | private boolean getPreference(boolean defaultValue) { 65 | return mPreferences.getBoolean(mResources.getString(R.string.preference_encounter_notification_enable_key), defaultValue); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/Mitm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.io.InputStream; 20 | import java.io.OutputStream; 21 | 22 | import javax.inject.Inject; 23 | import javax.inject.Singleton; 24 | 25 | import android.os.Build; 26 | 27 | import com.icecream.snorlax.module.Log; 28 | import com.icecream.snorlax.module.feature.Feature; 29 | 30 | import de.robv.android.xposed.XC_MethodHook; 31 | import de.robv.android.xposed.XposedHelpers; 32 | 33 | @Singleton 34 | public final class Mitm implements Feature { 35 | 36 | private final ClassLoader mClassLoader; 37 | private final MitmInputStreamFactory mMitmInputStreamFactory; 38 | private final MitmOutputStreamFactory mMitmOutputStreamFactory; 39 | 40 | private XC_MethodHook.Unhook mUnhookInputStream; 41 | private XC_MethodHook.Unhook mUnhookOutputStream; 42 | 43 | @Inject 44 | Mitm(ClassLoader classLoader, MitmInputStreamFactory mitmInputStreamFactory, MitmOutputStreamFactory mitmOutputStreamFactory) { 45 | mClassLoader = classLoader; 46 | mMitmInputStreamFactory = mitmInputStreamFactory; 47 | mMitmOutputStreamFactory = mitmOutputStreamFactory; 48 | } 49 | 50 | @Override 51 | public void subscribe() throws Exception { 52 | final Class http = XposedHelpers.findClass(getHttpUrlConnection(), mClassLoader); 53 | if (http == null) { 54 | Log.e("Cannot find HttpURLConnection implementation class"); 55 | return; 56 | } 57 | 58 | mUnhookInputStream = XposedHelpers.findAndHookMethod(http, "getInputStream", new XC_MethodHook() { 59 | @Override 60 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 61 | param.setResult(mMitmInputStreamFactory.create((InputStream) param.getResult())); 62 | } 63 | }); 64 | 65 | mUnhookOutputStream = XposedHelpers.findAndHookMethod(http, "getOutputStream", new XC_MethodHook() { 66 | @Override 67 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 68 | param.setResult(mMitmOutputStreamFactory.create((OutputStream) param.getResult())); 69 | } 70 | }); 71 | } 72 | 73 | private String getHttpUrlConnection() { 74 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 75 | return "com.android.okhttp.internal.huc.HttpURLConnectionImpl"; 76 | } 77 | else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 78 | return "com.android.okhttp.internal.http.HttpURLConnectionImpl"; 79 | } 80 | else { 81 | return "libcore.net.http.HttpURLConnectionImpl"; 82 | } 83 | } 84 | 85 | @Override 86 | public void unsubscribe() throws Exception { 87 | if (mUnhookInputStream != null) { 88 | mUnhookInputStream.unhook(); 89 | } 90 | 91 | if (mUnhookOutputStream != null) { 92 | mUnhookOutputStream.unhook(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmEnvelope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import com.google.auto.value.AutoValue; 20 | 21 | import static POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope; 22 | import static POGOProtos.Networking.Envelopes.ResponseEnvelopeOuterClass.ResponseEnvelope; 23 | 24 | @AutoValue 25 | @SuppressWarnings("WeakerAccess") 26 | public abstract class MitmEnvelope { 27 | 28 | static MitmEnvelope create(RequestEnvelope request, ResponseEnvelope response) { 29 | return new AutoValue_MitmEnvelope(request, response); 30 | } 31 | 32 | public abstract RequestEnvelope getRequest(); 33 | 34 | public abstract ResponseEnvelope getResponse(); 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.io.ByteArrayOutputStream; 20 | import java.io.IOException; 21 | import java.io.InputStream; 22 | import java.nio.ByteBuffer; 23 | 24 | import android.support.annotation.NonNull; 25 | 26 | final class MitmInputStream extends InputStream { 27 | 28 | private static final int sAverageSize = 4096; 29 | private final MitmProvider mMitmProvider; 30 | private boolean mMitmDone; 31 | private ByteBuffer mByteBuffer; 32 | 33 | MitmInputStream(InputStream inputStream, MitmProvider mitmProvider) { 34 | mMitmProvider = mitmProvider; 35 | mMitmDone = false; 36 | 37 | if (inputStream == null) { 38 | return; 39 | } 40 | 41 | ByteArrayOutputStream os = new ByteArrayOutputStream(sAverageSize); 42 | 43 | byte[] bytes = new byte[sAverageSize]; 44 | int bytesRead; 45 | 46 | try { 47 | while ((bytesRead = inputStream.read(bytes, 0, bytes.length)) != -1) { 48 | os.write(bytes, 0, bytesRead); 49 | } 50 | os.flush(); 51 | 52 | inputStream.close(); 53 | } 54 | catch (IOException e) { 55 | os.reset(); 56 | } 57 | 58 | mByteBuffer = ByteBuffer.wrap(os.toByteArray()); 59 | } 60 | 61 | @Override 62 | public int read() throws IOException { 63 | mitmStream(); 64 | 65 | if (!mByteBuffer.hasRemaining()) { 66 | return -1; 67 | } 68 | return mByteBuffer.get() & 0xFF; 69 | } 70 | 71 | @Override 72 | public int read(@NonNull byte[] bytes, int off, int len) throws IOException { 73 | mitmStream(); 74 | 75 | if (!mByteBuffer.hasRemaining()) { 76 | return -1; 77 | } 78 | 79 | len = Math.min(len, mByteBuffer.remaining()); 80 | mByteBuffer.get(bytes, off, len); 81 | return len; 82 | } 83 | 84 | @Override 85 | public int available() throws IOException { 86 | mitmStream(); 87 | 88 | if (!mByteBuffer.hasRemaining()) { 89 | return 0; 90 | } 91 | return mByteBuffer.remaining(); 92 | } 93 | 94 | @SuppressWarnings("unused") 95 | private void mitmStream() { 96 | if (mMitmDone) 97 | return; 98 | 99 | ByteBuffer fromMitm = mMitmProvider.processInboundPackage( 100 | mByteBuffer.asReadOnlyBuffer(), 101 | mByteBuffer.hasRemaining() 102 | ); 103 | 104 | if (fromMitm != null) { 105 | mByteBuffer = fromMitm; 106 | } 107 | mMitmDone = true; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmInputStreamFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.io.InputStream; 20 | 21 | import javax.inject.Inject; 22 | import javax.inject.Singleton; 23 | 24 | @Singleton 25 | final class MitmInputStreamFactory { 26 | 27 | private final MitmProvider mMitmProvider; 28 | 29 | @Inject 30 | MitmInputStreamFactory(MitmProvider mitmProvider) { 31 | mMitmProvider = mitmProvider; 32 | } 33 | 34 | MitmInputStream create(InputStream inputStream) { 35 | return new MitmInputStream(inputStream, mMitmProvider); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.util.List; 20 | 21 | import static POGOProtos.Networking.Envelopes.ResponseEnvelopeOuterClass.ResponseEnvelope; 22 | import static POGOProtos.Networking.Requests.RequestOuterClass.Request; 23 | 24 | @SuppressWarnings({"unused", "WeakerAccess", "FieldCanBeLocal"}) 25 | public interface MitmListener { 26 | 27 | ResponseEnvelope onMitm(List requests, ResponseEnvelope envelope); 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.io.ByteArrayOutputStream; 20 | import java.io.IOException; 21 | import java.io.OutputStream; 22 | import java.nio.ByteBuffer; 23 | 24 | final class MitmOutputStream extends ByteArrayOutputStream { 25 | 26 | private final MitmProvider mMitmProvider; 27 | private final OutputStream mOutputStream; 28 | 29 | MitmOutputStream(OutputStream outputStream, MitmProvider mitmProvider) { 30 | super(2048); 31 | mOutputStream = outputStream; 32 | mMitmProvider = mitmProvider; 33 | } 34 | 35 | @Override 36 | public void close() throws IOException { 37 | mitmStream(); 38 | mitmDone(); 39 | 40 | if (mOutputStream != null) { 41 | mOutputStream.close(); 42 | } 43 | super.close(); 44 | } 45 | 46 | @SuppressWarnings("unused") 47 | private void mitmStream() { 48 | ByteBuffer fromMitm = mMitmProvider.processOutboundPackage( 49 | ByteBuffer.wrap(buf, 0, count).asReadOnlyBuffer(), 50 | mOutputStream != null 51 | ); 52 | 53 | // Lets keep it read only for now 54 | /* 55 | if (fromMitm != null) { 56 | reset(); 57 | fromMitm.rewind(); 58 | write(fromMitm.array(), fromMitm.arrayOffset(), fromMitm.remaining()); 59 | } 60 | */ 61 | } 62 | 63 | private void mitmDone() throws IOException { 64 | if (mOutputStream != null) { 65 | writeTo(mOutputStream); 66 | } 67 | reset(); 68 | } 69 | 70 | @Override 71 | public void flush() throws IOException { 72 | mitmStream(); 73 | mitmDone(); 74 | 75 | if (mOutputStream != null) { 76 | mOutputStream.flush(); 77 | } 78 | super.flush(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmOutputStreamFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.io.OutputStream; 20 | 21 | import javax.inject.Inject; 22 | import javax.inject.Singleton; 23 | 24 | @Singleton 25 | final class MitmOutputStreamFactory { 26 | 27 | private final MitmProvider mMitmProvider; 28 | 29 | @Inject 30 | MitmOutputStreamFactory(MitmProvider mitmProvider) { 31 | mMitmProvider = mitmProvider; 32 | } 33 | 34 | MitmOutputStream create(OutputStream outputStream) { 35 | return new MitmOutputStream(outputStream, mMitmProvider); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.nio.ByteBuffer; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import javax.inject.Inject; 24 | import javax.inject.Singleton; 25 | 26 | import android.util.LongSparseArray; 27 | 28 | import com.google.protobuf.InvalidProtocolBufferException; 29 | import com.icecream.snorlax.module.Log; 30 | 31 | import static POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope; 32 | import static POGOProtos.Networking.Envelopes.ResponseEnvelopeOuterClass.ResponseEnvelope; 33 | import static POGOProtos.Networking.Requests.RequestOuterClass.Request; 34 | 35 | @Singleton 36 | @SuppressWarnings("unused") 37 | public final class MitmProvider { 38 | 39 | private final LongSparseArray> mRequests; 40 | private final List mListeners; 41 | 42 | @Inject 43 | MitmProvider(LongSparseArray> requests) { 44 | mRequests = requests; 45 | mListeners = new ArrayList<>(); 46 | } 47 | 48 | public void addListenerResponse(MitmListener listener) { 49 | if (listener != null) { 50 | mListeners.add(listener); 51 | } 52 | } 53 | 54 | public void removeListenerResponse(MitmListener listener) { 55 | if (listener != null) { 56 | mListeners.remove(listener); 57 | } 58 | } 59 | 60 | ByteBuffer processOutboundPackage(ByteBuffer roData, boolean connectionOk) { 61 | if (!connectionOk) 62 | return null; 63 | 64 | roData.rewind(); 65 | 66 | try { 67 | byte[] buffer = new byte[roData.remaining()]; 68 | roData.get(buffer); 69 | 70 | synchronized (MitmProvider.class) { 71 | RequestEnvelope envelope = RequestEnvelope.parseFrom(buffer); 72 | MitmRelay.getInstance().call(envelope); 73 | 74 | setRequests(envelope); 75 | } 76 | } 77 | catch (InvalidProtocolBufferException ignored) { 78 | } 79 | catch (Throwable throwable) { 80 | Log.e(throwable); 81 | } 82 | 83 | return null; 84 | } 85 | 86 | private void setRequests(RequestEnvelope envelope) { 87 | mRequests.put( 88 | envelope.getRequestId(), 89 | envelope.getRequestsList() 90 | ); 91 | } 92 | 93 | ByteBuffer processInboundPackage(ByteBuffer roData, boolean connectionOk) { 94 | if (!connectionOk) 95 | return null; 96 | 97 | roData.rewind(); 98 | 99 | try { 100 | byte[] buffer = new byte[roData.remaining()]; 101 | roData.get(buffer); 102 | 103 | synchronized (MitmProvider.class) { 104 | ResponseEnvelope envelope = ResponseEnvelope.parseFrom(buffer); 105 | MitmRelay.getInstance().call(envelope); 106 | 107 | final List requests = getRequests(envelope); 108 | if (requests != null && mListeners.size() > 0) { 109 | for (MitmListener listener : mListeners) { 110 | ResponseEnvelope temp = listener.onMitm(requests, envelope); 111 | if (temp != null) { 112 | envelope = temp; 113 | } 114 | } 115 | return ByteBuffer.wrap(envelope.toByteArray()); 116 | } 117 | } 118 | } 119 | catch (InvalidProtocolBufferException ignored) { 120 | } 121 | catch (Throwable throwable) { 122 | Log.e(throwable); 123 | } 124 | 125 | return null; 126 | } 127 | 128 | private List getRequests(ResponseEnvelope envelope) { 129 | final long id = envelope.getRequestId(); 130 | List requests = mRequests.get(id); 131 | mRequests.remove(id); 132 | return requests; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mitm/MitmRelay.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mitm; 18 | 19 | import java.util.Objects; 20 | 21 | import com.jakewharton.rxrelay.PublishRelay; 22 | import com.jakewharton.rxrelay.SerializedRelay; 23 | 24 | import rx.Emitter; 25 | import rx.Observable; 26 | 27 | import static POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope; 28 | import static POGOProtos.Networking.Envelopes.ResponseEnvelopeOuterClass.ResponseEnvelope; 29 | 30 | public final class MitmRelay { 31 | 32 | private static volatile MitmRelay sInstance = null; 33 | 34 | public static MitmRelay getInstance() { 35 | if (sInstance == null) { 36 | synchronized (MitmRelay.class) { 37 | if (sInstance == null) { 38 | sInstance = new MitmRelay(); 39 | } 40 | } 41 | } 42 | return sInstance; 43 | } 44 | 45 | private final SerializedRelay mRelayRequest; 46 | private final SerializedRelay mRelayResponse; 47 | private final Observable mEnvelope; 48 | 49 | private MitmRelay() { 50 | mRelayRequest = PublishRelay.create().toSerialized(); 51 | mRelayResponse = PublishRelay.create().toSerialized(); 52 | 53 | mEnvelope = Observable 54 | .fromEmitter(emitter -> mRelayRequest.asObservable().subscribe(emitter::onNext), Emitter.BackpressureMode.BUFFER) 55 | .cast(RequestEnvelope.class) 56 | .flatMap(request -> Observable 57 | .fromEmitter(emitter -> mRelayResponse.asObservable().subscribe(emitter::onNext), Emitter.BackpressureMode.BUFFER) 58 | .cast(ResponseEnvelope.class) 59 | .filter(response -> Objects.equals(request.getRequestId(), response.getRequestId())) 60 | .map(response -> MitmEnvelope.create(request, response)) 61 | ) 62 | .share(); 63 | } 64 | 65 | void call(RequestEnvelope envelope) { 66 | mRelayRequest.call(envelope); 67 | } 68 | 69 | void call(ResponseEnvelope envelope) { 70 | mRelayResponse.call(envelope); 71 | } 72 | 73 | public Observable getObservable() { 74 | return mEnvelope; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/mock/MockPreferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.mock; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.res.Resources; 23 | 24 | import com.icecream.snorlax.R; 25 | import com.icecream.snorlax.module.context.snorlax.Snorlax; 26 | 27 | import de.robv.android.xposed.XSharedPreferences; 28 | 29 | @Singleton 30 | final class MockPreferences { 31 | 32 | private final Resources mResources; 33 | private final XSharedPreferences mPreferences; 34 | 35 | @Inject 36 | MockPreferences(@Snorlax Resources resources, XSharedPreferences preferences) { 37 | mResources = resources; 38 | mPreferences = preferences; 39 | } 40 | 41 | boolean isEnabled() { 42 | mPreferences.reload(); 43 | final boolean expected = getPreferenceDefaultValue(); 44 | return expected == getPreference(expected); 45 | } 46 | 47 | private boolean getPreferenceDefaultValue() { 48 | return mResources.getBoolean(R.bool.preference_general_mock_enable); 49 | } 50 | 51 | private boolean getPreference(boolean defaultValue) { 52 | return mPreferences.getBoolean(mResources.getString(R.string.preference_general_mock_enable_key), defaultValue); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/rename/Rename.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.rename; 18 | 19 | import java.util.List; 20 | 21 | import javax.inject.Inject; 22 | import javax.inject.Singleton; 23 | 24 | import com.google.protobuf.ByteString; 25 | import com.google.protobuf.InvalidProtocolBufferException; 26 | import com.icecream.snorlax.common.Strings; 27 | import com.icecream.snorlax.module.Log; 28 | import com.icecream.snorlax.module.feature.Feature; 29 | import com.icecream.snorlax.module.feature.mitm.MitmListener; 30 | import com.icecream.snorlax.module.feature.mitm.MitmProvider; 31 | 32 | import static POGOProtos.Data.PokemonDataOuterClass.PokemonData; 33 | import static POGOProtos.Enums.PokemonIdOuterClass.PokemonId; 34 | import static POGOProtos.Inventory.InventoryDeltaOuterClass.InventoryDelta; 35 | import static POGOProtos.Inventory.InventoryItemDataOuterClass.InventoryItemData; 36 | import static POGOProtos.Inventory.InventoryItemOuterClass.InventoryItem; 37 | import static POGOProtos.Networking.Envelopes.ResponseEnvelopeOuterClass.ResponseEnvelope; 38 | import static POGOProtos.Networking.Requests.RequestOuterClass.Request; 39 | import static POGOProtos.Networking.Requests.RequestTypeOuterClass.RequestType; 40 | import static POGOProtos.Networking.Responses.GetInventoryResponseOuterClass.GetInventoryResponse; 41 | 42 | @Singleton 43 | public final class Rename implements Feature, MitmListener { 44 | 45 | private final MitmProvider mMitmProvider; 46 | private final RenamePreferences mRenamePreferences; 47 | private final RenameFormat mRenameFormat; 48 | 49 | @Inject 50 | Rename(MitmProvider mitmProvider, RenamePreferences renamePreferences, RenameFormat renameFormat) { 51 | mMitmProvider = mitmProvider; 52 | mRenamePreferences = renamePreferences; 53 | mRenameFormat = renameFormat; 54 | } 55 | 56 | @Override 57 | public void subscribe() { 58 | unsubscribe(); 59 | mMitmProvider.addListenerResponse(this); 60 | } 61 | 62 | @Override 63 | public void unsubscribe() { 64 | mMitmProvider.removeListenerResponse(this); 65 | } 66 | 67 | @Override 68 | public ResponseEnvelope onMitm(List requests, ResponseEnvelope envelope) { 69 | if (!mRenamePreferences.isEnabled()) { 70 | return null; 71 | } 72 | 73 | for (int i = 0; i < requests.size(); i++) { 74 | if (requests.get(i).getRequestType() == RequestType.GET_INVENTORY) { 75 | try { 76 | ByteString processed = processInventory(GetInventoryResponse.parseFrom(envelope.getReturns(i))); 77 | 78 | if (processed != null) { 79 | envelope = envelope.toBuilder().setReturns(i, processed).build(); 80 | } 81 | } 82 | catch (InvalidProtocolBufferException ignored) { 83 | } 84 | } 85 | } 86 | return envelope; 87 | } 88 | 89 | private ByteString processInventory(GetInventoryResponse response) { 90 | if (!response.getSuccess() || !response.hasInventoryDelta()) { 91 | return null; 92 | } 93 | 94 | final boolean isFavoriteEnable = mRenamePreferences.isFavoriteEnabled(); 95 | final boolean isNicknamedEnable = mRenamePreferences.isNicknamedEnabled(); 96 | 97 | GetInventoryResponse.Builder inventory = response.toBuilder(); 98 | InventoryDelta.Builder delta = inventory.getInventoryDelta().toBuilder(); 99 | 100 | for (int i = 0; i < delta.getInventoryItemsCount(); i++) { 101 | 102 | InventoryItem.Builder item = delta.getInventoryItems(i).toBuilder(); 103 | InventoryItemData.Builder data = item.getInventoryItemData().toBuilder(); 104 | 105 | if (data.getPokemonData().getPokemonId() != PokemonId.MISSINGNO) { 106 | PokemonData.Builder pokemon = data.getPokemonData().toBuilder(); 107 | 108 | try { 109 | final boolean isFavorite = pokemon.getFavorite() == 1; 110 | final boolean isNickname = !Strings.isNullOrEmpty(pokemon.getNickname()); 111 | 112 | if ((isFavoriteEnable || !isFavorite) && (isNicknamedEnable || !isNickname)) { 113 | pokemon.setNickname(mRenameFormat.format(data.getPokemonData())); 114 | } 115 | } 116 | catch (NullPointerException | IllegalArgumentException e) { 117 | Log.d("Cannot process processNickname: %s", e.getMessage()); 118 | Log.e(e); 119 | } 120 | finally { 121 | data.setPokemonData(pokemon); 122 | } 123 | } 124 | item.setInventoryItemData(data); 125 | delta.setInventoryItems(i, item); 126 | } 127 | return inventory.setInventoryDelta(delta).build().toByteString(); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/rename/RenamePreferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.rename; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.res.Resources; 23 | 24 | import com.icecream.snorlax.R; 25 | import com.icecream.snorlax.module.context.snorlax.Snorlax; 26 | 27 | import de.robv.android.xposed.XSharedPreferences; 28 | 29 | @Singleton 30 | final class RenamePreferences { 31 | 32 | private final Resources mResources; 33 | private final XSharedPreferences mPreferences; 34 | 35 | @Inject 36 | RenamePreferences(@Snorlax Resources resources, XSharedPreferences preferences) { 37 | mResources = resources; 38 | mPreferences = preferences; 39 | } 40 | 41 | String getFormat() { 42 | mPreferences.reload(); 43 | 44 | return mPreferences.getString( 45 | mResources.getString(R.string.preference_rename_format_enable_key), 46 | mResources.getString(R.string.preference_rename_format_enable_default) 47 | ); 48 | } 49 | 50 | boolean isEnabled() { 51 | mPreferences.reload(); 52 | final boolean expected = mResources.getBoolean(R.bool.preference_rename_enable); 53 | return expected == mPreferences.getBoolean(mResources.getString(R.string.preference_rename_enable_key), expected); 54 | } 55 | 56 | boolean isFavoriteEnabled() { 57 | mPreferences.reload(); 58 | final boolean expected = mResources.getBoolean(R.bool.preference_rename_favorite_enable); 59 | return expected == mPreferences.getBoolean(mResources.getString(R.string.preference_rename_favorite_enable_key), expected); 60 | } 61 | 62 | boolean isNicknamedEnabled() { 63 | mPreferences.reload(); 64 | final boolean expected = mResources.getBoolean(R.bool.preference_rename_already_enable); 65 | return expected == mPreferences.getBoolean(mResources.getString(R.string.preference_rename_already_enable_key), expected); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/feature/ui/Ui.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.feature.ui; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.ContextWrapper; 23 | import android.view.LayoutInflater; 24 | import android.view.View; 25 | import android.widget.FrameLayout; 26 | import android.widget.Toast; 27 | 28 | import com.icecream.snorlax.R; 29 | import com.icecream.snorlax.module.Log; 30 | import com.icecream.snorlax.module.context.snorlax.Snorlax; 31 | import com.icecream.snorlax.module.feature.Feature; 32 | 33 | import de.robv.android.xposed.XC_MethodHook; 34 | import de.robv.android.xposed.XposedHelpers; 35 | 36 | @Singleton 37 | final class Ui implements Feature { 38 | 39 | private final ClassLoader mClassLoader; 40 | private final LayoutInflater mLayoutInflater; 41 | 42 | private XC_MethodHook.Unhook mUnhookUnity; 43 | 44 | @Inject 45 | Ui(ClassLoader classLoader, @Snorlax LayoutInflater layoutInflater) { 46 | mClassLoader = classLoader; 47 | mLayoutInflater = layoutInflater; 48 | } 49 | 50 | @Override 51 | public void subscribe() throws Exception { 52 | final Class unity = XposedHelpers.findClass("com.unity3d.player.UnityPlayer", mClassLoader); 53 | if (unity == null) { 54 | Log.e("Cannot find UnityPlayer class"); 55 | return; 56 | } 57 | 58 | mUnhookUnity = XposedHelpers.findAndHookConstructor(unity, ContextWrapper.class, new XC_MethodHook() { 59 | @Override 60 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 61 | final FrameLayout frameLayout = (FrameLayout) param.thisObject; 62 | 63 | FrameLayout ui = (FrameLayout) mLayoutInflater.inflate(R.layout.ui_feature, frameLayout, false); 64 | 65 | Log.d("Class %s", ui.findViewById(R.id.fab).getClass().getName()); 66 | 67 | View fab = ui.findViewById(R.id.fab); 68 | if (fab != null) { 69 | fab.setOnClickListener(v -> Toast.makeText(v.getContext(), "By igoticecream", Toast.LENGTH_LONG).show()); 70 | fab.setOnLongClickListener(v -> { 71 | frameLayout.removeView(ui); 72 | return true; 73 | }); 74 | } 75 | 76 | frameLayout.addView(ui); 77 | /* 78 | TextView textView = new TextView(frameLayout.getContext()); 79 | textView.setText("HOLAAAA!!!!"); 80 | textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20.0f); 81 | 82 | FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( 83 | ViewGroup.LayoutParams.WRAP_CONTENT, 84 | ViewGroup.LayoutParams.WRAP_CONTENT 85 | ); 86 | params.gravity = Gravity.CENTER; 87 | 88 | frameLayout.addView(textView, params); 89 | */ 90 | } 91 | }); 92 | } 93 | 94 | @Override 95 | public void unsubscribe() throws Exception { 96 | if (mUnhookUnity != null) { 97 | mUnhookUnity.unhook(); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/MovementType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import com.icecream.snorlax.common.Strings; 20 | 21 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 22 | public enum MovementType { 23 | PSYCHIC, 24 | FLYING, 25 | ELETRIC, 26 | NORMAL, 27 | HOVERING, 28 | JUMP, 29 | ELECTRIC; 30 | 31 | @Override 32 | public String toString() { 33 | return Strings.capitalize(name().split("_")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/Pokemon.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import static POGOProtos.Data.PokemonDataOuterClass.PokemonData; 20 | 21 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 22 | public final class Pokemon { 23 | 24 | private final String[] mNames; 25 | private final PokemonData mPokemonData; 26 | 27 | Pokemon(PokemonData pokemonData, String[] names) { 28 | mPokemonData = pokemonData; 29 | mNames = names; 30 | } 31 | 32 | public float getLevel() { 33 | if (mPokemonData.getIsEgg()) { 34 | return 0; 35 | } 36 | 37 | float level = 1; 38 | float cpMultiplier = mPokemonData.getCpMultiplier() + mPokemonData.getAdditionalCpMultiplier(); 39 | 40 | for (double currentCpM : PokemonCp.CpM) { 41 | if (Math.abs(cpMultiplier - currentCpM) < 0.0001) { 42 | return level; 43 | } 44 | level += 0.5; 45 | } 46 | return level; 47 | } 48 | 49 | public double getIv() { 50 | return ((double) (getAttack() + getDefense() + getStamina())) / 45.0; 51 | } 52 | 53 | public int getAttack() { 54 | return mPokemonData.getIndividualAttack(); 55 | } 56 | 57 | public int getDefense() { 58 | return mPokemonData.getIndividualDefense(); 59 | } 60 | 61 | public int getStamina() { 62 | return mPokemonData.getIndividualStamina(); 63 | } 64 | 65 | public int getCp() { 66 | return mPokemonData.getCp(); 67 | } 68 | 69 | public int getHp() { 70 | return mPokemonData.getStaminaMax(); 71 | } 72 | 73 | public String getName() { 74 | return mNames[getNumber() - 1]; 75 | } 76 | 77 | public int getNumber() { 78 | return PokemonMetaRegistry.getMeta(mPokemonData.getPokemonId()).getNumber(); 79 | } 80 | 81 | public PokemonMoveMeta getMoveFast() { 82 | return PokemonMoveMetaRegistry.getMeta(mPokemonData.getMove1()); 83 | } 84 | 85 | public PokemonMoveMeta getMoveCharge() { 86 | return PokemonMoveMetaRegistry.getMeta(mPokemonData.getMove2()); 87 | } 88 | 89 | public PokemonType getType1() { 90 | return PokemonMetaRegistry.getMeta(mPokemonData.getPokemonId()).getType1(); 91 | } 92 | 93 | public PokemonType getType2() { 94 | return PokemonMetaRegistry.getMeta(mPokemonData.getPokemonId()).getType2(); 95 | } 96 | 97 | public PokemonClass getPokemonClass() { 98 | return PokemonMetaRegistry.getMeta(mPokemonData.getPokemonId()).getPokemonClass(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/PokemonClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import com.icecream.snorlax.common.Strings; 20 | 21 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 22 | public enum PokemonClass { 23 | NONE, 24 | VERY_COMMON, 25 | COMMON, 26 | UNCOMMON, 27 | RARE, 28 | VERY_RARE, 29 | EPIC, 30 | LEGENDARY, 31 | MYTHIC; 32 | 33 | @Override 34 | public String toString() { 35 | return Strings.capitalize(name().split("_")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/PokemonCp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 20 | final class PokemonCp { 21 | 22 | static final double[] CpM = { 23 | 0.0939999967813492, 24 | 0.135137432089339, 25 | 0.166397869586945, 26 | 0.192650913155325, 27 | 0.215732470154762, 28 | 0.236572651424822, 29 | 0.255720049142838, 30 | 0.273530372106572, 31 | 0.290249884128571, 32 | 0.306057381389863, 33 | 0.321087598800659, 34 | 0.335445031996451, 35 | 0.349212676286697, 36 | 0.362457736609939, 37 | 0.375235587358475, 38 | 0.387592407713878, 39 | 0.399567276239395, 40 | 0.4111935532161, 41 | 0.422500014305115, 42 | 0.432926420512509, 43 | 0.443107545375824, 44 | 0.453059948165049, 45 | 0.46279838681221, 46 | 0.472336085311278, 47 | 0.481684952974319, 48 | 0.490855807179549, 49 | 0.499858438968658, 50 | 0.5087017489616, 51 | 0.517393946647644, 52 | 0.525942516110322, 53 | 0.534354329109192, 54 | 0.542635753803599, 55 | 0.550792694091797, 56 | 0.558830584490385, 57 | 0.566754519939423, 58 | 0.57456912814537, 59 | 0.582278907299042, 60 | 0.589887907888945, 61 | 0.597400009632111, 62 | 0.604823648665171, 63 | 0.61215728521347, 64 | 0.619404107958234, 65 | 0.626567125320435, 66 | 0.633649178748576, 67 | 0.6406529545784, 68 | 0.647580971386554, 69 | 0.654435634613037, 70 | 0.661219265805859, 71 | 0.667934000492096, 72 | 0.674581885647492, 73 | 0.681164920330048, 74 | 0.687684901255373, 75 | 0.694143652915955, 76 | 0.700542901033063, 77 | 0.706884205341339, 78 | 0.713169074873823, 79 | 0.719399094581604, 80 | 0.725575586915154, 81 | 0.731700003147125, 82 | 0.734741038550429, 83 | 0.737769484519958, 84 | 0.740785579737136, 85 | 0.743789434432983, 86 | 0.746781197247765, 87 | 0.749761044979095, 88 | 0.752729099732281, 89 | 0.75568550825119, 90 | 0.758630370209851, 91 | 0.761563837528229, 92 | 0.76448604959218, 93 | 0.767397165298462, 94 | 0.770297293677362, 95 | 0.773186504840851, 96 | 0.776064947064992, 97 | 0.778932750225067, 98 | 0.781790050767666, 99 | 0.784636974334717, 100 | 0.787473608513275, 101 | 0.790300011634827 102 | }; 103 | } 104 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/PokemonFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import android.content.res.Resources; 23 | 24 | import com.icecream.snorlax.R; 25 | import com.icecream.snorlax.module.context.snorlax.Snorlax; 26 | 27 | import static POGOProtos.Data.PokemonDataOuterClass.PokemonData; 28 | import static POGOProtos.Enums.PokemonIdOuterClass.PokemonId; 29 | 30 | @Singleton 31 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 32 | public final class PokemonFactory { 33 | 34 | private final String[] mNames; 35 | 36 | @Inject 37 | PokemonFactory(@Snorlax Resources resources) { 38 | mNames = resources.getStringArray(R.array.pokemon); 39 | } 40 | 41 | public Pokemon with(PokemonData pokemonData) throws NullPointerException, IllegalArgumentException { 42 | if (pokemonData == null) { 43 | throw new NullPointerException("PokemonData cannot be null"); 44 | } 45 | if (pokemonData.getPokemonId().equals(PokemonId.MISSINGNO) || pokemonData.getPokemonId().equals(PokemonId.UNRECOGNIZED)) { 46 | throw new IllegalArgumentException("Unrecognized Pokemon Id"); 47 | } 48 | return new Pokemon(pokemonData, mNames); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/PokemonMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import lombok.AccessLevel; 20 | import lombok.Getter; 21 | import lombok.Setter; 22 | import lombok.experimental.Accessors; 23 | 24 | import static POGOProtos.Enums.PokemonFamilyIdOuterClass.PokemonFamilyId; 25 | import static POGOProtos.Enums.PokemonIdOuterClass.PokemonId; 26 | import static POGOProtos.Enums.PokemonMoveOuterClass.PokemonMove; 27 | 28 | @Accessors(prefix = "m") 29 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 30 | public final class PokemonMeta { 31 | 32 | @Getter 33 | @Setter(AccessLevel.PACKAGE) 34 | private String mTemplateId; 35 | @Getter 36 | @Setter(AccessLevel.PACKAGE) 37 | private PokemonFamilyId mFamily; 38 | @Getter 39 | @Setter(AccessLevel.PACKAGE) 40 | private PokemonClass mPokemonClass; 41 | @Getter 42 | @Setter(AccessLevel.PACKAGE) 43 | private PokemonType mType2; 44 | @Getter 45 | @Setter(AccessLevel.PACKAGE) 46 | private double mPokedexHeightM; 47 | @Getter 48 | @Setter(AccessLevel.PACKAGE) 49 | private double mHeightStdDev; 50 | @Getter 51 | @Setter(AccessLevel.PACKAGE) 52 | private int mBaseStamina; 53 | @Getter 54 | @Setter(AccessLevel.PACKAGE) 55 | private double mCylRadiusM; 56 | @Getter 57 | @Setter(AccessLevel.PACKAGE) 58 | private double mBaseFleeRate; 59 | @Getter 60 | @Setter(AccessLevel.PACKAGE) 61 | private int mBaseAttack; 62 | @Getter 63 | @Setter(AccessLevel.PACKAGE) 64 | private double mDiskRadiusM; 65 | @Getter 66 | @Setter(AccessLevel.PACKAGE) 67 | private double mCollisionRadiusM; 68 | @Getter 69 | @Setter(AccessLevel.PACKAGE) 70 | private double mPokedexWeightKg; 71 | @Getter 72 | @Setter(AccessLevel.PACKAGE) 73 | private MovementType mMovementType; 74 | @Getter 75 | @Setter(AccessLevel.PACKAGE) 76 | private PokemonType mType1; 77 | @Getter 78 | @Setter(AccessLevel.PACKAGE) 79 | private double mCollisionHeadRadiusM; 80 | @Getter 81 | @Setter(AccessLevel.PACKAGE) 82 | private double mMovementTimerS; 83 | @Getter 84 | @Setter(AccessLevel.PACKAGE) 85 | private double mJumpTimeS; 86 | @Getter 87 | @Setter(AccessLevel.PACKAGE) 88 | private double mModelScale; 89 | @Getter 90 | @Setter(AccessLevel.PACKAGE) 91 | private String mUniqueId; 92 | @Getter 93 | @Setter(AccessLevel.PACKAGE) 94 | private int mBaseDefense; 95 | @Getter 96 | @Setter(AccessLevel.PACKAGE) 97 | private int mAttackTimerS; 98 | @Getter 99 | @Setter(AccessLevel.PACKAGE) 100 | private double mWeightStdDev; 101 | @Getter 102 | @Setter(AccessLevel.PACKAGE) 103 | private double mCylHeightM; 104 | @Getter 105 | @Setter(AccessLevel.PACKAGE) 106 | private int mCandyToEvolve; 107 | @Getter 108 | @Setter(AccessLevel.PACKAGE) 109 | private double mCollisionHeightM; 110 | @Getter 111 | @Setter(AccessLevel.PACKAGE) 112 | private double mShoulderModeScale; 113 | @Getter 114 | @Setter(AccessLevel.PACKAGE) 115 | private double mBaseCaptureRate; 116 | @Getter 117 | @Setter(AccessLevel.PACKAGE) 118 | private PokemonId mParentId; 119 | @Getter 120 | @Setter(AccessLevel.PACKAGE) 121 | private double mCylGroundM; 122 | @Getter 123 | @Setter(AccessLevel.PACKAGE) 124 | private PokemonMove[] mQuickMoves; 125 | @Getter 126 | @Setter(AccessLevel.PACKAGE) 127 | private PokemonMove[] mCinematicMoves; 128 | @Getter 129 | @Setter(AccessLevel.PACKAGE) 130 | private int mNumber; 131 | 132 | PokemonMeta() { 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/PokemonMoveMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import com.icecream.snorlax.common.Strings; 23 | 24 | import lombok.AccessLevel; 25 | import lombok.Getter; 26 | import lombok.Setter; 27 | import lombok.experimental.Accessors; 28 | 29 | import static POGOProtos.Enums.PokemonMoveOuterClass.PokemonMove; 30 | 31 | @Accessors(prefix = "m") 32 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 33 | public final class PokemonMoveMeta { 34 | 35 | @Getter 36 | @Setter(AccessLevel.PACKAGE) 37 | private PokemonMove mMove; 38 | @Getter 39 | @Setter(AccessLevel.PACKAGE) 40 | private PokemonType mType; 41 | @Getter 42 | @Setter(AccessLevel.PACKAGE) 43 | private int mPower; 44 | @Getter 45 | @Setter(AccessLevel.PACKAGE) 46 | private int mAccuracy; 47 | @Getter 48 | @Setter(AccessLevel.PACKAGE) 49 | private double mCriticalChance; 50 | @Getter 51 | @Setter(AccessLevel.PACKAGE) 52 | private int mTime; 53 | @Getter 54 | @Setter(AccessLevel.PACKAGE) 55 | private int mEnergy; 56 | 57 | PokemonMoveMeta() { 58 | } 59 | 60 | @Override 61 | public String toString() { 62 | List move = new ArrayList<>(); 63 | 64 | for (String string : getMove().name().split("_")) { 65 | if (!string.equalsIgnoreCase("FAST")) { 66 | move.add(string); 67 | } 68 | } 69 | return Strings.capitalize(move.toArray(new String[0])); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/PokemonType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon; 18 | 19 | import com.icecream.snorlax.common.Strings; 20 | 21 | public enum PokemonType { 22 | NONE, 23 | GRASS, 24 | FIRE, 25 | WATER, 26 | BUG, 27 | ELECTRIC, 28 | POISON, 29 | FAIRY, 30 | NORMAL, 31 | PSYCHIC, 32 | FIGHTING, 33 | DRAGON, 34 | FLYING, 35 | ICE, 36 | ROCK, 37 | GROUND, 38 | GHOST, 39 | STEEL, 40 | DARK; 41 | 42 | @Override 43 | public String toString() { 44 | return Strings.capitalize(name().split("_")); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/probability/PokemonProbability.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon.probability; 18 | 19 | import static POGOProtos.Data.Capture.CaptureProbabilityOuterClass.CaptureProbability; 20 | 21 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 22 | public final class PokemonProbability { 23 | 24 | private final CaptureProbability mCaptureProbability; 25 | 26 | PokemonProbability(CaptureProbability captureProbability) { 27 | mCaptureProbability = captureProbability; 28 | } 29 | 30 | public double getPokeball() { 31 | return getRate(0); 32 | } 33 | 34 | private double getRate(int index) { 35 | return Math.round(Math.min(100.0d, mCaptureProbability.getCaptureProbability(index) * 100d) * 100.0d) / 100.0d; 36 | } 37 | 38 | public double getGreatball() { 39 | return getRate(1); 40 | } 41 | 42 | public double getUltraball() { 43 | return getRate(2); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/icecream/snorlax/module/pokemon/probability/PokemonProbabilityFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016. Pedro Diaz 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.icecream.snorlax.module.pokemon.probability; 18 | 19 | import javax.inject.Inject; 20 | import javax.inject.Singleton; 21 | 22 | import static POGOProtos.Data.Capture.CaptureProbabilityOuterClass.CaptureProbability; 23 | 24 | @Singleton 25 | @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"}) 26 | public final class PokemonProbabilityFactory { 27 | 28 | @Inject 29 | PokemonProbabilityFactory() { 30 | } 31 | 32 | public PokemonProbability with(CaptureProbability captureProbability) throws NullPointerException { 33 | if (captureProbability == null) { 34 | throw new NullPointerException("CaptureProbability cannot be null"); 35 | } 36 | return new PokemonProbability(captureProbability); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/egg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/egg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pokeball.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_001.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_002.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_003.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_004.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_005.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_006.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_007.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_008.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_009.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_010.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_011.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_012.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_013.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_014.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_015.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_016.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_017.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_018.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_019.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_020.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_021.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_022.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_023.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_024.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_025.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_026.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_027.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_028.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_029.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_030.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_031.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_032.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_033.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_034.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_035.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_036.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_037.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_038.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_039.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_040.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_041.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_042.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_043.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_044.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_045.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_046.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_047.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_048.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_049.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_050.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_051.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_052.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_053.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_054.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_055.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_056.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_057.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_058.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_059.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_060.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_061.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_062.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_063.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_064.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_065.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_066.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_067.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_068.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_069.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_070.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_071.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_072.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_073.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_073.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_074.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_074.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_075.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_076.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_077.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_077.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_078.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_079.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_080.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_081.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_082.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_082.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_083.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_083.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_084.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_085.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_086.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_087.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_088.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_089.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_090.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_091.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_092.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_093.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_093.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_094.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_095.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_095.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_096.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_097.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_097.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_098.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_099.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_100.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_101.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_102.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_103.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_104.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_105.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_106.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_107.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_108.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_109.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_110.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_111.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_112.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_113.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_113.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_114.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_115.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_115.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_116.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_117.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_117.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_118.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_118.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_119.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_120.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_121.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_122.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_123.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_124.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_125.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_126.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_127.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_127.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_128.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_129.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_129.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_130.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_131.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_132.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_133.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_133.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_134.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_135.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_135.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_136.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_137.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_137.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_138.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_139.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_139.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_140.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_141.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_142.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_142.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_143.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_143.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_144.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_145.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_145.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_146.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_147.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_147.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_148.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_149.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_149.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_150.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pokemon_151.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/drawable/pokemon_151.png -------------------------------------------------------------------------------- /app/src/main/res/layout/about_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 27 | 28 | 36 | 37 | 46 | 47 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/res/layout/donation_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/home_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 18 | 19 | 27 | 28 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/src/main/res/layout/ui_feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 22 | 23 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igoticecream/Snorlax/a8d6becf8d3d0f44c0378393cf16e4dbcf3f82d3/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-de/pokemons.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bisasam 5 | Bisaknosp 6 | Bisaflor 7 | Glumanda 8 | Glutexo 9 | Glurak 10 | Schiggy 11 | Schillok 12 | Turtok 13 | Raupy 14 | Safcon 15 | Smettbo 16 | Hornliu 17 | Kokuna 18 | Bibor 19 | Taubsi 20 | Tauboga 21 | Tauboss 22 | Rattfratz 23 | Rattikarl 24 | Habitak 25 | Ibitak 26 | Rettan 27 | Arbok 28 | Pikachu 29 | Raichu 30 | Sandan 31 | Sandamer 32 | Nidoran♀ 33 | Nidorina 34 | Nidoqueen 35 | Nidoran♂ 36 | Nidorino 37 | Nidoking 38 | Piepi 39 | Pixi 40 | Vulpix 41 | Vulnona 42 | Pummeluff 43 | Knuddeluff 44 | Zubat 45 | Golbat 46 | Myrapla 47 | Duflor 48 | Giflor 49 | Paras 50 | Parasek 51 | Bluzuk 52 | Omot 53 | Digda 54 | Digdri 55 | Mauzi 56 | Snobilikat 57 | Enton 58 | Entoron 59 | Menki 60 | Rasaff 61 | Fukano 62 | Arkani 63 | Quapsel 64 | Quaputzi 65 | Quappo 66 | Abra 67 | Kadabra 68 | Simsala 69 | Machollo 70 | Maschock 71 | Machomei 72 | Knofensa 73 | Ultrigaria 74 | Sarzenia 75 | Tentacha 76 | Tentoxa 77 | Kleinstein 78 | Georok 79 | Geowaz 80 | Ponita 81 | Gallopa 82 | Flegmon 83 | Lahmus 84 | Magnetilo 85 | Magneton 86 | Porenta 87 | Dodu 88 | Dodri 89 | Jurob 90 | Jugong 91 | Sleima 92 | Sleimok 93 | Muschas 94 | Austos 95 | Nebulak 96 | Alpollo 97 | Gengar 98 | Onix 99 | Traumato 100 | Hypno 101 | Krabby 102 | Kingler 103 | Voltobal 104 | Lektrobal 105 | Owei 106 | Kokowei 107 | Tragosso 108 | Knogga 109 | Kicklee 110 | Nockchan 111 | Schlurp 112 | Smogon 113 | Smogmog 114 | Rihorn 115 | Rizeros 116 | Chaneira 117 | Tangela 118 | Kangama 119 | Seeper 120 | Seemon 121 | Goldini 122 | Golking 123 | Sterndu 124 | Starmie 125 | Pantimos 126 | Sichlor 127 | Rossana 128 | Elektek 129 | Magmar 130 | Pinsir 131 | Tauros 132 | Karpador 133 | Garados 134 | Lapras 135 | Ditto 136 | Evoli 137 | Aquana 138 | Blitza 139 | Flamara 140 | Porygon 141 | Amonitas 142 | Amoroso 143 | Kabuto 144 | Kabutops 145 | Aerodactyl 146 | Relaxo 147 | Arktos 148 | Zapdos 149 | Lavados 150 | Dratini 151 | Dragonir 152 | Dragoran 153 | Mewtu 154 | Mew 155 | 156 | -------------------------------------------------------------------------------- /app/src/main/res/values-fr/pokemons.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bulbizarre 5 | Herbizarre 6 | Florizarre 7 | Salamèche 8 | Reptincel 9 | Dracaufeu 10 | Carapuce 11 | Carabaffe 12 | Tortank 13 | Chenipan 14 | Chrysacier 15 | Papilusion 16 | Aspicot 17 | Coconfort 18 | Dardargnan 19 | Roucool 20 | Roucoups 21 | Roucarnage 22 | Rattata 23 | Rattatac 24 | Piafabec 25 | Rapasdepic 26 | Abo 27 | Arbok 28 | Pikachu 29 | Raichu 30 | Sabelette 31 | Sablaireau 32 | Nidoran♀ 33 | Nidorina 34 | Nidoqueen 35 | Nidoran♂ 36 | Nidorino 37 | Nidoking 38 | Mélofée 39 | Mélodelfe 40 | Goupix 41 | Feunard 42 | Rondoudou 43 | Grodoudou 44 | Nosferapti 45 | Nosferalto 46 | Mystherbe 47 | Ortide 48 | Rafflesia 49 | Paras 50 | Parasect 51 | Mimitoss 52 | Aéromite 53 | Taupiqueur 54 | Triopikeur 55 | Miaouss 56 | Persian 57 | Psykokwak 58 | Akwakwak 59 | Férosinge 60 | Colossinge 61 | Caninos 62 | Arcanin 63 | Ptitard 64 | Têtarte 65 | Tartard 66 | Abra 67 | Kadabra 68 | Alakazam 69 | Machoc 70 | Machopeur 71 | Mackogneur 72 | Chétiflor 73 | Boustiflor 74 | Empiflor 75 | Tentacool 76 | Tentacruel 77 | Racaillou 78 | Gravalanch 79 | Grolem 80 | Ponyta 81 | Galopa 82 | Ramoloss 83 | Flagadoss 84 | Magnéti 85 | Magnéton 86 | Canarticho 87 | Doduo 88 | Dodrio 89 | Otaria 90 | Lamantine 91 | Tadmorv 92 | Grotadmorv 93 | Kokiyas 94 | Crustabri 95 | Fantominus 96 | Spectrum 97 | Ectoplasma 98 | Onix 99 | Soporifik 100 | Hypnomade 101 | Krabby 102 | Krabboss 103 | Voltorbe 104 | Électrode 105 | Nœunœuf 106 | Noadkoko 107 | Osselait 108 | Ossatueur 109 | Kicklee 110 | Tygnon 111 | Excelangue 112 | Smogo 113 | Smogogo 114 | Rhinocorne 115 | Rhinoféros 116 | Leveinard 117 | Saquedeneu 118 | Kangourex 119 | Hypotrempe 120 | Hypocéan 121 | Poissirène 122 | Poissoroy 123 | Stari 124 | Staross 125 | M.Mime 126 | Insécateur 127 | Lippoutou 128 | Élektek 129 | Magmar 130 | Scarabrute 131 | Tauros 132 | Magicarpe 133 | Léviator 134 | Lokhlass 135 | Métamorph 136 | Évoli 137 | Aquali 138 | Voltali 139 | Pyroli 140 | Porygon 141 | Amonita 142 | Amonistar 143 | Kabuto 144 | Kabutops 145 | Ptéra 146 | Ronflex 147 | Artikodin 148 | Électhor 149 | Sulfura 150 | Minidraco 151 | Draco 152 | Dracolosse 153 | Mewtwo 154 | Mew 155 | 156 | -------------------------------------------------------------------------------- /app/src/main/res/values/bools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | true 6 | true 7 | true 8 | true 9 | true 10 | true 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16dp 6 | 16dp 7 | 8 | 9 | 4dp 10 | 6dp 11 | 12dp 12 | 16dp 13 | 24dp 14 | 15 | 16 | 64dp 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/drawables.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @drawable/ic_pokeball 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/pokemons.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bulbasaur 5 | Ivysaur 6 | Venusaur 7 | Charmander 8 | Charmeleon 9 | Charizard 10 | Squirtle 11 | Wartortle 12 | Blastoise 13 | Caterpie 14 | Metapod 15 | Butterfree 16 | Weedle 17 | Kakuna 18 | Beedrill 19 | Pidgey 20 | Pidgeotto 21 | Pidgeot 22 | Rattata 23 | Raticate 24 | Spearow 25 | Fearow 26 | Ekans 27 | Arbok 28 | Pikachu 29 | Raichu 30 | Sandshrew 31 | Sandslash 32 | Nidoran♀ 33 | Nidorina 34 | Nidoqueen 35 | Nidoran♂ 36 | Nidorino 37 | Nidoking 38 | Clefairy 39 | Clefable 40 | Vulpix 41 | Ninetales 42 | Jigglypuff 43 | Wigglytuff 44 | Zubat 45 | Golbat 46 | Oddish 47 | Gloom 48 | Vileplume 49 | Paras 50 | Parasect 51 | Venonat 52 | Venomoth 53 | Diglett 54 | Dugtrio 55 | Meowth 56 | Persian 57 | Psyduck 58 | Golduck 59 | Mankey 60 | Primeape 61 | Growlithe 62 | Arcanine 63 | Poliwag 64 | Poliwhirl 65 | Poliwrath 66 | Abra 67 | Kadabra 68 | Alakazam 69 | Machop 70 | Machoke 71 | Machamp 72 | Bellsprout 73 | Weepinbell 74 | Victreebel 75 | Tentacool 76 | Tentacruel 77 | Geodude 78 | Graveler 79 | Golem 80 | Ponyta 81 | Rapidash 82 | Slowpoke 83 | Slowbro 84 | Magnemite 85 | Magneton 86 | Farfetch\'d 87 | Doduo 88 | Dodrio 89 | Seel 90 | Dewgong 91 | Grimer 92 | Muk 93 | Shellder 94 | Cloyster 95 | Gastly 96 | Haunter 97 | Gengar 98 | Onix 99 | Drowzee 100 | Hypno 101 | Krabby 102 | Kingler 103 | Voltorb 104 | Electrode 105 | Exeggcute 106 | Exeggutor 107 | Cubone 108 | Marowak 109 | Hitmonlee 110 | Hitmonchan 111 | Lickitung 112 | Koffing 113 | Weezing 114 | Rhyhorn 115 | Rhydon 116 | Chansey 117 | Tangela 118 | Kangaskhan 119 | Horsea 120 | Seadra 121 | Goldeen 122 | Seaking 123 | Staryu 124 | Starmie 125 | Mr. Mime 126 | Scyther 127 | Jynx 128 | Electabuzz 129 | Magmar 130 | Pinsir 131 | Tauros 132 | Magikarp 133 | Gyarados 134 | Lapras 135 | Ditto 136 | Eevee 137 | Vaporeon 138 | Jolteon 139 | Flareon 140 | Porygon 141 | Omanyte 142 | Omastar 143 | Kabuto 144 | Kabutops 145 | Aerodactyl 146 | Snorlax 147 | Articuno 148 | Zapdos 149 | Moltres 150 | Dratini 151 | Dragonair 152 | Dragonite 153 | Mewtwo 154 | Mew 155 | 156 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 17 | 18 | 23 | 24 |