Skip to content

Instantly share code, notes, and snippets.

View robUx4's full-sized avatar

Steve Lhomme robUx4

View GitHub Profile
@robUx4
robUx4 / gist:9034455
Created February 16, 2014 13:47
x264 stereo mode patch for Matroska
diff --git a/output/matroska.c b/output/matroska.c
index baa0f1c..f623a2f 100644
--- a/output/matroska.c
+++ b/output/matroska.c
@@ -33,6 +33,7 @@ typedef struct
int width, height, d_width, d_height;
int display_size_units;
+ int stereomode;
@robUx4
robUx4 / gist:9091435
Created February 19, 2014 12:57
Is it OK to discard crash reports that have XposedBridge in them ?
java.lang.NullPointerException: failed to get a view at 13 in LoadedTouitsHasMore{4208b368 LoadedTouitsVoid{4208b1b8 size=0}} of o{41f0aac0 list=TouitListDBTweets{421998a0 id=-805657377}}
at com.levelup.touiteur.touits.TouitListExpandableAdapter.getGroupView(SourceFile:86)
at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
at android.widget.AbsListView.obtainView(AbsListView.java:2240)
at android.widget.ListView.makeAndAddView(ListView.java:1790)
at android.widget.ListView.fillUp(ListView.java:725)
at android.widget.ListView.fillGap(ListView.java:664)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5136)
at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4247)
at android.os.Handler.handleCallback(Handler.java:733)
@robUx4
robUx4 / gist:9362413
Created March 5, 2014 06:54
Copy the Proguard mapping.txt next to the apk with a matching name
android.applicationVariants.all { variant ->
if (variant.buildType.runProguard) {
variant.assemble.doLast {
description "ProGuard mapping copy"
def mappingSource = new File(projectDir, "build/proguard/" + variant.buildType.name+"/mapping.txt")
def mappingDest = new File(variant.outputFile.parent)
copy {
from mappingSource
into mappingDest
@robUx4
robUx4 / gist:9362439
Created March 5, 2014 06:57
Output the APK in a "builds" folder outside of the source tree with specific names between buildtypes and versionCodes
android.applicationVariants.all { variant ->
if (variant.buildType.name == "release") {
variant.outputFile = new File(projectDir.parent + "/builds", archivesBaseName + "-" + versionName + ".apk")
} else if (variant.buildType.name == "kindle") {
variant.outputFile = new File(projectDir.parent + "/builds", "Kindle-" + versionName + ".apk")
} else {
variant.outputFile = new File(projectDir.parent + "/builds", archivesBaseName + "-" + variant.buildType.name + versionCode + ".apk")
}
}
@robUx4
robUx4 / gist:9594891
Created March 17, 2014 06:38
LG Optimus G running 4.1.2
java.lang.IllegalArgumentException: bad parameter
at org.apache.http.client.utils.URLEncodedUtils.parse(URLEncodedUtils.java:139)
at org.apache.http.client.utils.URLEncodedUtils.parse(URLEncodedUtils.java:76)
at android.webkit.AccessibilityInjector.getAxsUrlParameterValue(AccessibilityInjector.java:404)
at android.webkit.AccessibilityInjector.shouldInjectJavaScript(AccessibilityInjector.java:323)
at android.webkit.AccessibilityInjector.onPageFinished(AccessibilityInjector.java:282)
at android.webkit.WebViewClassic.onPageFinished(WebViewClassic.java:4371)
at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:334)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
@robUx4
robUx4 / gist:9909878
Created April 1, 2014 08:04
Samsung Galaxy S5/S3 running Android 4.4.2
java.lang.NullPointerException
at android.os.Parcel.readException(Parcel.java:1471)
at android.os.Parcel.readException(Parcel.java:1419)
at android.os.storage.IMountService$Stub$Proxy.mkdirs(IMountService.java:769)
at android.app.ContextImpl.ensureDirsExistOrFilter(ContextImpl.java:2627)
at android.app.ContextImpl.getExternalFilesDirs(ContextImpl.java:1197)
at android.app.ContextImpl.getExternalFilesDir(ContextImpl.java:1180)
at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:222)
at com.levelup.touiteur.pictures.levelup.LevelupCache.finishLoadingInMemory(SourceFile:98)
at st.gaw.db.AsynchronousDbHelper$1.handleMessage(SourceFile:98)
@robUx4
robUx4 / ActivityWithAds.java
Last active August 29, 2015 13:58
Block the Play Store from opening unexpectedly (from dubious ad networks)
package com.levelup.touiteur;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Instrumentation;
@robUx4
robUx4 / gist:10017997
Created April 7, 2014 10:34
Log.wtf() to be used only for unrecoverable states, as it seems in 4.4 there's a WtfHandler that can be set and might throw an Exception
android.util.Log$TerribleFailure: popping a database work that never started for m{42fbb7f0 olof_k} type:1
at android.util.Log.wtf(Log.java:290)
at android.util.Log.wtf(Log.java:256)
at com.levelup.logutils.FLog.wtf(SourceFile:152)
at com.levelup.logutils.FLogger.wtf(SourceFile:79)
at com.levelup.touiteur.c.a.wtf(SourceFile:133)
at com.levelup.touiteur.c.d.c(SourceFile:80)
at com.levelup.touiteur.stream.a.c(SourceFile:226)
at com.levelup.touiteur.stream.a.b.b(SourceFile:249)
at com.levelup.touiteur.stream.a.d.a(SourceFile:211)
@robUx4
robUx4 / tighter call
Last active August 29, 2015 13:59
Application.onCreate double call
0 | 00:00:00:040 | I/Plume_55902 Plume Oncreate
1 | 00:00:00:040 | I/Plume_55902 Startup: loggers logger:com.levelup.touiteur.c.c@41c209c8
2 | 00:00:00:125 | D/Plume_55902 clear PhotoCache memory
3 | 00:00:00:203 | D/Plume_55902 clear PhotoCache memory
4 | 00:00:00:988 | D/PlumeStream Start stream checker
5 | 00:00:01:017 | D/PlumeStream assertRunningStreams needs stream:true
6 | 00:00:01:017 | D/PlumeStream assertRunningStream mWantsStreamRunning:true
7 | 00:00:01:063 | D/PlumeStream run user streams needed:true instance:null
8 | 00:00:01:063 | I/PlumeStream attach b{41c5d400 connected:false} state was:OFFLINE
9 | 00:00:01:066 | D/PlumeStream m{41c42c38 kraatsie66} startListening isStreamStarted:false connected:false
@robUx4
robUx4 / gist:4a8a6f15c4e7d96021e3
Created July 8, 2014 13:33
Android InetSocketAddress source
/**
* Returns the hostname if known, or the result of {@code InetAddress.getHostAddress}.
* Unlike {@link #getHostName}, this method will never cause a DNS lookup.
* @since 1.7
* @hide 1.7 - remember to add a link in the getHostName documentation!
*/
public final String getHostString() {
return (hostname != null) ? hostname : addr.getHostAddress();
}