Archive for January, 2012

An exploration into how to use ProGuard for Android obfuscation

http://stackoverflow.com/questions/6542631/android-obfuscate-app-using-proguard-keeps-obfuscating-library-jars-or-is-it

Related

Using ProGuard with Android.
(Android) Proguard can’t find dynamically referenced class javax.swing.*
android: proguard obfuscating imported jars
Problem med space in path in Proguard parameter call
Android: What are the recommended configurations for Proguard?
android: proguard obfuscating problems
android: proguard obfuscating problem
android proguard, skip jars
Obfuscating Android app with CORBA
How to obfuscate my project using ProGuard tool?
How to suppress ‘Maybe this is program method’ warnings from ProGuard
How to prevent the Proguard obfuscation from destroying jdom.jar
Does using proguard makes the android app running slower?
Getting too many Proguard warnings
Android simplexml.jar proguard problem
Android – Proguard obfuscate not able to find android classes
Is using Proguard with Android worth the effort?
android:onClick not working with ProGuard
Using Proguard to Obfuscate Android App with Dropbox.com Libraries
Exclude some classes from Proguard’s keep rules
How to obfuscate an Android library (.jar file) using Proguard in Eclipse
Proguard in Android
Proguard and Android 😦
Weird behaviour while obfuscating a JAR with proguard
Error when proguard Android project

Tasks for learning today: Android GUI, Graphics, Rendering etc

What is Linear Layout:

http://developer.android.com/resources/tutorials/views/hello-linearlayout.html

What is added advantage of GLSurfaceView over ImageView:

http://developer.android.com/resources/articles/glsurfaceview.html

How to layout using Layout (XML rules):

http://developer.android.com/resources/articles/layout-tricks-efficiency.html

http://developer.android.com/resources/articles/layout-tricks-stubs.html

http://developer.android.com/resources/articles/layout-tricks-merge.html

What is the difference between Canvas and SurfaceView?

http://developer.android.com/reference/android/view/SurfaceView.html

http://developer.android.com/reference/android/graphics/Canvas.html

How to blur an image:

http://stackoverflow.com/questions/6743969/blur-a-image-at-android

http://stackoverflow.com/questions/7115790/alpha-channel-blur

http://stackoverflow.com/questions/8997109/making-linear-layout-translucent-and-blurry/8997964#8997964

my-kid-livewallpaper – Rotating names of my children as my live wallpaper

https://code.google.com/p/my-kid-livewallpaper/

How to compile the Android NDK examples using command line tools

Complete information is from http://developer.android.com/guide/developing/projects/projects-cmdline.html, here is summarized just the bare minimum (but entirely self-sufficient) to get everything compiled, if you are lazy to read the more complete document.

Necessary tools needed prior to compilation:

1. “ant” (http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html)

2. Android SDK (http://developer.android.com/sdk/index.html)

3. Android NDK (http://developer.android.com/sdk/ndk/index.html)

And the steps are as follows:

a. Due to the “awk” utility as provided by Android NDK is a 64-bit binary, it is necessary to first rename or delete it first (http://stackoverflow.com/questions/8116113/problems-with-android-ndk-7-and-awk).

b. Then traverse to the NDK’s samples directory, and further cd to any of the samples.

c. Then issue “../../ndk-build” to execute the ndk-build as provided by Android NDK.

d. Then issue the “android update” command (here my Android SDK is installed in the /opt directory):

/opt/android-sdk-linux/tools/android update project –path . –target android-10

The target to choose should match the Android version of the your phone: http://developer.android.com/guide/appendix/api-levels.html

For example, my Sony Ericsson Arc S is Android 2.3.4, so the target is “android-10” as above.

e. Next compile a debug version (you can compile a release version too, but that will require you to sign the application. (Please refer to http://developer.android.com/guide/publishing/app-signing.html for more info).

ant debug

f. Then after connecting the phone to the computer via USB, issue the following command to install the debug apk:

/opt/android-sdk-linux/platform-tools/adb install -r bin/xxxxxxx-debug.apk

where bin/xxxxxxx-debug.apk is the name of the apk generated in the “bin” subdirectory.

The full verbose output as follow:

../../ndk-build
+ dirname ../../ndk-build
+ PROGDIR=../..
+ cd ../..
+ pwd
+ PROGDIR=/opt/android-ndk-r7
+ [ -n /opt/android-ndk-r7/prebuilt/linux-x86/bin/make ]
+ which /opt/android-ndk-r7/prebuilt/linux-x86/bin/make
+ ABS_GNUMAKE=/opt/android-ndk-r7/prebuilt/linux-x86/bin/make
+ [ 0 != 0 ]
+ GNUMAKE=/opt/android-ndk-r7/prebuilt/linux-x86/bin/make
+ [ = cygwin ]
+ /opt/android-ndk-r7/prebuilt/linux-x86/bin/make -f /opt/android-ndk-r7/build/core/build-local.mk
Compile thumb : sanangeles <= importgl.c
Compile thumb : sanangeles <= demo.c
Compile thumb : sanangeles libs/armeabi/libsanangeles.so

+ /opt/android-sdk-linux/tools/android update project –path . –target android-10
Updated project.properties
Updated local.properties
Updated file ./proguard.cfg
+ ant debug
Buildfile: /opt/android-ndk-r7/samples/san-angeles/build.xml

-set-mode-check:

-set-debug-files:

-set-debug-mode:

-debug-obfuscation-check:

-setup:
[echo] Gathering info for DemoActivity…
[setup] Android SDK Tools Revision 16
[setup] Project Target: Android 2.3.3
[setup] API level: 10
[setup]
[setup] ——————
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ——————
[setup]
[setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (4) is lower than the project target API level (10)

-build-setup:
[echo] Creating output directories if needed…

-pre-build:

-code-gen:
[echo] ———-
[echo] Handling aidl files…
[aidl] No AIDL files to compile.
[echo] ———-
[echo] Handling RenderScript files…
[renderscript] No RenderScript files to compile.
[echo] ———-
[echo] Handling Resources…
[aapt] No changed resources. R.java and Manifest.java untouched.

-pre-compile:

-compile:

-post-compile:

-obfuscate:

-dex:
[dex] No new compiled code. No need to convert bytecode to dalvik format.

-crunch:
[crunch] Crunching PNG Files in source dir: /opt/android-ndk-r7/samples/san-angeles/res
[crunch] To destination dir: /opt/android-ndk-r7/samples/san-angeles/bin/res
[crunch] Crunched 0 PNG files to update cache

-package-resources:
[aapt] No changed resources or assets. DemoActivity.ap_ remains untouched

-package:
[apkbuilder] No changes. No need to create apk.

-do-debug:
[zipalign] No changes. No need to run zip-align on the apk.
[echo] Debug Package: /opt/android-ndk-r7/samples/san-angeles/bin/DemoActivity-debug.apk

debug:
[propertyfile] Updating property file: /opt/android-ndk-r7/samples/san-angeles/bin/build.prop
[propertyfile] Updating property file: /opt/android-ndk-r7/samples/san-angeles/bin/build.prop
[propertyfile] Updating property file: /opt/android-ndk-r7/samples/san-angeles/bin/build.prop
[propertyfile] Updating property file: /opt/android-ndk-r7/samples/san-angeles/bin/build.prop

BUILD SUCCESSFUL
Total time: 1 second
+ /opt/android-sdk-linux/platform-tools/adb install -r bin/DemoActivity-debug.apk
453 KB/s (19858 bytes in 0.042s)
pkg: /data/local/tmp/DemoActivity-debug.apk
Success

Where to get ramdisk, kernel source, Android OS source, and general utilities like blktrace for Xperia Arc S (Or any Xperia series from Sony Ericsson)?

https://github.com/DooMLoRD/Xperia-2011-Official-Ramdisks/tree/master/ARC-S http://forum.xda-developers.com/showthread.php?t=1312692 This is one place to get all the kernel source and ramdisk image, in addition to that from Sony Ericsson: http://developer.sonyericsson.com/wp/2011/05/06/how-to-build-a-linux-kernel/ (where I can find kernel source, Android source, and many general utilities like blktrace, but not ramdisk?) 
Vickblöm

Research scattered with thoughts, ideas, and dreams

Penetration Testing Lab

Offensive Techniques & Methodologies

Astr0baby's not so random thoughts _____ rand() % 100;

@astr0baby on Twitter for fresh randomness

The Data Explorer

playing around with open data to learn some cool stuff about data analysis and the world

Conorsblog

Data | ML | NLP | Python | R

quyv

Just a thought

IFT6266 - H2017 Deep Learning

A Graduate Course Offered at Université de Montréal

Deep Learning IFT6266-H2017 UdeM

Philippe Paradis - My solutions to the image inpainting problem

IFT6266 – H2017 DEEP LEARNING

Pulkit's thoughts on the course project

Thomas Dinsmore's Blog

No man but a blockhead ever wrote except for money -- Samuel Johnson

the morning paper

a random walk through Computer Science research, by Adrian Colyer

The Spectator

Shakir's Machine Learning Blog