Skip to content

Instantly share code, notes, and snippets.

View adumont's full-sized avatar
😃

Alexandre Dumont adumont

😃
View GitHub Profile
@adumont
adumont / archlinux_android
Created November 14, 2011 00:12
ArchLinux for building Android
pacman -Sy
pacman -S --needed python2 openjdk6 perl git gnupg flex bison gperf zip unzip sdl wxgtk squashfs-tools ncurses libpng zlib libusb libusb-compat readline inetutils
pacman -S --needed gcc-multilib gcc-libs-multilib binutils-multilib libtool-multilib lib32-libusb lib32-libusb-compat lib32-readline lib32-glibc bash-completion lib32-zlib
Install yaourt (& package-query):
add to /etc/pacman.conf:
[archlinuxfr]
Server = http://repo.archlinux.fr/$arch
@adumont
adumont / .gitconfig
Last active August 13, 2019 19:16
Git Global config (~/.gitconfig)
[color]
ui = auto
[user]
name = Alexandre Dumont
email = adumont@gmail.com
[alias]
st = status
ci = commit
br = branch
ba = branch -a
@adumont
adumont / ccache_help
Created December 6, 2011 10:29
Use ccache to reduce build time
Install ccache:
In Arch:
$ sudo pacman -S ccache
Or Ubuntu:
$ sudo apt-get install ccache
@adumont
adumont / gist:1600222
Created January 12, 2012 12:28
SuperOSR HTC Chacha - Camera.apk - Fix for 90º issue (temporal)
Here is my fix for the Camera.apk. For the moment it's getting the job done, but it's ugly, Later I'll put in place a system property for example and read from it.
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index d308d33..5399c7c 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -825,7 +825,7 @@ public class Camera extends BaseCamera implements View.OnClickListener,
info.orientation != 90) {
rotation = (info.orientation - mOrientation + 360) % 360;
} else { // back-facing camera (or acting like it)
@adumont
adumont / local_manifest.xml
Created January 18, 2012 12:18
local_manifest.xml (cm7)
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="github-https" fetch="https://github.com/" review="review.cyanogenmod.com" />
<remove-project path="prebuilt" name="CyanogenMod/android_prebuilt" />
<project path="prebuilt" name="dhacker29/android_prebuilt" />
<project path="device/htc/chacha" name="adumont/android_device_htc_chacha" />
<project path="vendor/htc/chacha" name="adumont/android_vendor_htc_chacha" />
@adumont
adumont / gsync.sh
Created March 26, 2012 22:49
gsync
#!/bin/bash
# Copyright (C) 2011 SuperTeam.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@adumont
adumont / unpack.nvsbl.v3.sh
Created July 24, 2012 19:54
Unpack NVSBL v3 boot.img
#!/bin/bash
BOOTIMG=$1
dd if=$BOOTIMG ibs=1 skip=64 > Image.lzma
lzma -cd Image.lzma > Image
INICIO=$( grep -P -a -b -m 1 --only-matching $'\x42\x5a\x68\x39' Image | cut -d: -f1 )
@adumont
adumont / repack.nvsbl.v3.sh
Created July 24, 2012 20:51
Repack NVSBL v3 boot.img
#!/bin/bash
# we need out/host/linux-x86/bin/mkbootfs in the path
mkbootfs initramfs > initramfs.new.cpio
bzip2 -1 < initramfs.new.cpio > initramfs.new.cpio.bz2
OLDSIZE=$( wc -c < initramfs.cpio.bz2 )
NEWSIZE=$( wc -c < initramfs.new.cpio.bz2 )
@adumont
adumont / gnex.xml
Created December 11, 2013 00:27
local_manifest for Galaxy Nexus including blobs. for cm-11.0
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="cm-11.0" />
<project name="TheMuppets/proprietary_vendor_imgtec" path="vendor/imgtec" remote="github" revision="cm-11.0" />
<project name="TheMuppets/proprietary_vendor_broadcom" path="vendor/broadcom" remote="github" revision="cm-11.0" />
<project name="TheMuppets/proprietary_vendor_invensense" path="vendor/invensense" remote="github" revision="cm-11.0" />
<project name="TheMuppets/proprietary_vendor_widevine" path="vendor/widevine" remote="github" revision="cm-11.0" />
<project name="TheMuppets/proprietary_vendor_nxp" path="vendor/nxp" remote="github" revision="cm-11.0" />
<project name="CyanogenMod/android_device_samsung_maguro" path="device/samsung/maguro" remote="github" />
<project name="CyanogenMod/android_kernel_samsung_tuna" path="kernel/samsung/tuna" remote="github" />
@adumont
adumont / gist:8040008
Created December 19, 2013 14:34
Send an (text) email to recipient@gmail.com via Gmail from command line [root]
This will send an (text) email to recipient@gmail.com by calling a Gmail activity. Root is needed.
root# am start -a android.intent.action.SEND -t "text/plain" -c android.intent.category.DEFAULT -e to recipient@gmail.com -e android.intent.extra.SUBJECT Test -e android.intent.extra.TEXT "body" -n com.google.android.gm/.AutoSendActivity com.google.android.gm
- Send an attachement: --> see at the end (Not working at the moment) -e android.intent.extra.STREAM /sdcard/map.png
More info:
Action: android.intent.action.SEND