Skip to content

Instantly share code, notes, and snippets.

Oleksandr OleksandrKucherenko

Block or report user

Report or block OleksandrKucherenko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@OleksandrKucherenko
OleksandrKucherenko / build.gradle
Last active Oct 22, 2019
repack AAR with different types of compatibility things, like: androidx vs support library, include/exclude/repackage aar during compilation
View build.gradle
/** Copyright: 2019-*, Oleksandr Kucherenko (olku@artfulbits.se) */
apply plugin: 'com.android.library'
android {
/* ... default android lib OR app configuration ... */
}
configurations {
repack { transitive = false }
compatibility { transitive = false }
View project-build.gradle
// Force Jacoco Agent version upgrade
subprojects {
configurations.all {
resolutionStrategy {
eachDependency { details ->
if ('org.jacoco' == details.requested.group) {
details.useVersion "${jacocoVersion}"
}
}
}
View root-project-build.gradle
buildscript {
ext {
jacocoVersion = project.JACOCO_VERSION
}
dependencies {
// To confirm JaCoCo version run: $ ./gradlew buildEnvironment
//region classpath "org.jacoco:org.jacoco.core:${jacocoVersion}"
// Resolves issue of incorrect version use in one of jacoco/android plugin inner tasks
classpath "org.jacoco:org.jacoco.core:${jacocoVersion}"
classpath "org.jacoco:org.jacoco.report:${jacocoVersion}"
View proguard-facebook.pro
#
# Facebook SDK
# https://github.com/facebook/facebook-android-sdk/blob/45482361eb182bb3392386182f8f4e6c4896c2b9/facebook/proguard-project.txt
# https://github.com/facebook/facebook-android-sdk/blob/master/facebook-core/proguard-rules.pro
# https://www.guardsquare.com/en/proguard/manual/examples#serializable
#
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
View facebook-crash.log
Fatal Exception: java.lang.InternalError
at java.io.ObjectStreamClass.(ObjectStreamClass.java)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:354)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1165)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at java.util.ArrayList.writeObject(ArrayList.java:734)
at java.lang.reflect.Method.invoke(Method.java)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:977)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1472)
View proguard-moshi.pro
# Moshi
-dontwarn okio.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-keepclasseswithmembers class * {
 @com.squareup.moshi.* <methods>;
}
@OleksandrKucherenko
OleksandrKucherenko / bitbucket-pipelines.yml
Created Mar 31, 2019
Bitbucket Pipelines For Android Builds (usual for docker based images thing)
View bitbucket-pipelines.yml
# fix android sdk licenses 
 - mkdir "$ANDROID_HOME/licenses" || true 
 - echo -e "\ncf461b4a7cc1448899002f845b02532d01783529" > "$ANDROID_HOME/licenses/android-sdk-license" 
 - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" >> "$ANDROID_HOME/licenses/android-sdk-license" 
 - echo -e "\n504667f4c0de7af1a06de9f4b1727b84351f2910" > "$ANDROID_HOME/licenses/android-sdk-preview-license" 
 - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" >> "$ANDROID_HOME/licenses/android-sdk-preview-license" 
 - echo -e "\nd975f751698a77b662f1254ddbeed3901e976f5a" > "$ANDROID_HOME/licenses/intel-android-extra-license" 
 # show default install SDK components 
 - android-sdk-linux/tools/bin/sdkmanager - list 
 # update installation from CANNERY channel 
@OleksandrKucherenko
OleksandrKucherenko / wait-online-device.gradle
Created Dec 3, 2018
Script force all 'installDebug' task wait 10 seconds for device attaching.
View wait-online-device.gradle
static isAnyDeviceOnline() {
def start = System.currentTimeMillis()
def firstTime = true
while (System.currentTimeMillis() - start < 10000) {
def out = new StringBuilder()
def process = 'adb devices -l'.execute()
process.consumeProcessOutput(out, null)
process.waitForOrKill(1000)
@OleksandrKucherenko
OleksandrKucherenko / KeyboardHelper.java
Last active Sep 18, 2019
Helper class that help to track opening/close of virtual keyboard in activity/fragment.
View KeyboardHelper.java
// Author: Oleksandr Kucherenko, 2016-present
package your.package.android.utils;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
@OleksandrKucherenko
OleksandrKucherenko / DebugViews.java
Last active Nov 1, 2018
Android View Hierarchy dump with transformation properties
View DebugViews.java
/** Author: Oleksandr Kucherenko, 2018-present */
package {your.package.name};
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.Matrix;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.util.Pair;
You can’t perform that action at this time.