Skip to content

Instantly share code, notes, and snippets.

View rafakob's full-sized avatar

Rafał Kobyłko rafakob

View GitHub Profile
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import com.amazon.device.messaging.ADMConstants;
import com.amazon.device.messaging.ADMMessageHandlerBase;
import javax.inject.Inject;
@rafakob
rafakob / release-android-debuggable.md
Created December 3, 2017 14:00 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@rafakob
rafakob / Test.md
Created December 1, 2017 11:35
Kotlin - casting
Condition Result
"test" is String true
"test" is String? true
null is String false
null is String? true
"test" as String ok
"test" as String? ok
123 as String throw
@PerActivity
class AccountPresenter @Inject constructor(val authData: AuthData,
val devicesData: DevicesData) : MvpPresenter<AccountView>() {
fun onStart() {
view.setUserName(authData.session().currentUser?.fullName)
view.setUserPhoto(authData.session().currentUser?.photoUrl)
}
fun onEditProfileClick() {
private void openGallery() {
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, "Select Photo"), REQUEST_GALLERY);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
task uploadFirebaseMapping {
def configPath = rootProject.rootDir.absolutePath;
switch (project.findProperty('variant')) {
case 'frog':
setProperty('FirebaseServiceAccountFilePath', configPath + getProperty('firebase.crash.frog'))
uploadFirebaseMapping.dependsOn('firebaseUploadFrogProguardMapping')
break
case 'smartearly':
setProperty('FirebaseServiceAccountFilePath', configPath + getProperty('firebase.crash.smartearly'))
@rafakob
rafakob / AllApis.java
Created September 23, 2016 10:41
JavaPoet
public class AllApis {
private final List<InterfaceElement> apis;
private final Filer filer;
private final Elements elements;
public AllApis(List<InterfaceElement> apis, Filer filer, Elements elements) {
this.apis = apis;
this.filer = filer;
this.elements = elements;
@rafakob
rafakob / Test.java
Last active June 14, 2016 10:45
test mockito
public class LoginPresenter extends MvpPresenter<LoginView> {
public void register() {
blablaMethod();
}
public void blablaMethod(){
}
}
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
# Built application files
/*/build/
@rafakob
rafakob / circle.yml
Created May 30, 2016 22:37 — forked from dazza5000/circle.yml
CircleCI Android Configuration Template - circle.yml
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/CriminalIntent/app/build/outputs/apk/
machine:
environment: