Skip to content

Instantly share code, notes, and snippets.

View paour's full-sized avatar

Pierre-Luc Paour paour

View GitHub Profile
@paour
paour / gist:b2a69bc46e9cb34f455c
Created May 15, 2014 12:03
Gradle new manifest merge error
11:51:03.534 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :processGoogleReleaseManifest (Thread[Daemon,5,main]) completed. Took 0.209 secs.
11:51:03.534 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon,5,main]] finished, busy: 2.098 secs, idle: 0.021 secs
11:51:03.541 [ERROR] [org.gradle.BuildExceptionReporter]
11:51:03.545 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:51:03.546 [ERROR] [org.gradle.BuildExceptionReporter]
11:51:03.547 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:51:03.547 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':processGoogleReleaseManifest'.
11:51:03.548 [ERROR] [org.gradle.BuildExceptionReporter] > No enum constant com.android.manifmerger.AttributeOperationType.IGNORE
11:51:03.553 [ERROR] [org.gradle.BuildExceptionReporter]
11:51:03.554 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
package com.frogsparks.mytrails.util;
import android.os.Environment;
import com.frogsparks.mytrails.MyTrails;
import java.io.File;
import java.util.*;
// http://stackoverflow.com/a/15612964/304876
#! /usr/bin/python
import argparse
import os.path
import glob
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='''\
Replacing values in arrays.xml with @string/ links. Generates three new files for each locale:
@paour
paour / shell dump
Last active August 29, 2015 13:57
Tasker CPU Control
root@m0:/ # which su
/system/bin/su
root@m0:/ # ls -la `which su`
lrwxrwxrwx root root 2014-02-12 10:02 su -> ../xbin/su
root@m0:/ # ls -la /system/app
-rw-r--r-- root root 1573262 2008-08-01 14:00 Apollo.apk
-rw-r--r-- root root 32941 2008-08-01 14:00 BasicDreams.apk
-rw-r--r-- root root 1951013 2008-08-01 14:00 Bluetooth.apk
-rw-r--r-- root root 154371 2008-08-01 14:00 BluetoothExt.apk
-rw-r--r-- root root 2645747 2008-08-01 14:00 Browser.apk
@paour
paour / MyTrails.java
Created February 27, 2014 12:30
Easy send attachment via email
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
bw.write(sb.toString());
bw.close();
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "MyTrails state dump");
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"support@frogsparks.com"});
sendIntent.putExtra(Intent.EXTRA_TEXT, "See attachment");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + file.getAbsolutePath()));
sendIntent.setType("text/plain");
@paour
paour / build_extras.gradle
Last active October 5, 2016 12:04
A simpler and more fool-proof way to handle search providers in Android Gradle builds
def overrideProviderAuthority(packageName, inFile, outFile) {
def xml = new XmlParser().parse(inFile)
xml.findAll{it.name() == 'string'}.each{item ->
if (!item.value().isEmpty() && item.value()[0] instanceof String && item.value()[0].startsWith(".res-auto")) {
item.value()[0] = item.value()[0].replace(".res-auto", packageName)
}
}
saveXML(outFile, xml)
@paour
paour / AndroidManifest.xml
Last active January 3, 2016 14:28 — forked from cmelchior/AndroidManifest.xml
Prevent exceptions for cases like <string name="with_markup"><b>Warning</b>This will crash the build</string>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.trifork.example"
android:installLocation="auto"
android:versionName="@string/client_info" >
<!-- ... -->
<application
android:hardwareAccelerated="true"
@paour
paour / button_bar_layout.xml
Created April 11, 2012 06:16 — forked from romannurik/button_bar_layout.xml
How to make a proper button bar on ICS
<!--
A button bar is a set of buttons at the bottom of an activity.
An example is an AlertDialog with OK/Cancel buttons.
Note that something similar can be accomplished using a
split action bar and text-only action buttons, but this is an
alternate presentation that's often preferred.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"