Posts

How to extract or backup apk from android system?

As an android developer, I always wanna hack awesome app to learn its design inside. The first step of that is to get the APK file itself, and the obvious way to do that is to extract it from our android phone. There are two ways to make that, both of them need no root privilege. 1. Use android adb backup command adb shell pm list packages adb backup -apk com.google.android.wearable.app dd if=backup.ab bs=1 skip=24 | python -c “import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))” | tar -xvf - 2. Use adb package management cmd  adb shell pm list packages  adb shell pm path com.google.android.wearable.app  adb pull /data/app/com.google.android.wearable.app-1.apk

Learning a new way to release and package python source code

Image
This article is one part of learning notebook after I read the youtube-dl 's source code, I learned a lot of knowledge from this software, I guess the most interesting part is found two porn website inside it, haha. The anther interesting thing, I learned from its source code, is a python packaging technology. It is a new way to release or publish python software. Before I learned this way, I always use the following two methods to publish python software. Just release the raw source code. Use the package management tools like setuptools or distutils But, youtube-dl release itself in a standalone executable single file. So I read its build script, it zipped all its source code into a package and it is its way to make an executable file. I guess python interpreter has the capacity of interpreting source code from the zip file. As usual, I wrote some sample code to illustrate how this way works, and you can browser sample code from the following site. https://githu...

A LAN server discovery web app

Image
A LAN server discovery web app Table of Contents Requirement Next movement how to deploy the service? 1 Requirement the purpose of this project: Many services were running in my desktop environment at the company LAN, but the IP address was always alternate after I reboot, so my initial intent to develop this app is to let my fellow colleagues detect my desktop's IP address much quickly. this solution is to run a HTTP server on my desktop, and the client must post request at least with a key/value pair: req=get_ip. Then a client scan all the LAN IP address with that request, my computer will response with {'status' : 0, 'ret':ip_address}. 2 Next movement Since I am studied a lot of certification and encryption knowledge recently, I guess the next target of this project is to add a certificate process to reject the fake one. The simple ways were to employ an asymmetry encryption algorithm like RSA, then client generate a random number...

Android's Package Management System

Image
Android's Package Management System Table of Contents How to resign an android app? How to install an android apk? android package management system. How to get an app's certification? 1 How to resign an android app? Android apk's digital signature strategy just employs the java's jar package method. So We can use java's keystore and jarsigner tools to sign an apk. And the first step is to generate a valid certification: make your own keystore keytool -genkey -v -keystore iboxpay.keystore -alias ibox -keyalg RSA -keysize 2048 -validity 100000 please remember the store password and key password, I always set them the same one. then before to resign an apk, I should remove its original signature first. remove apk's digital signature zip -d whatever.apk "META-INF/*" After that, I can sign that apk by our own certification. sign apk by jarsigner jarsigner -verbose -keystore iboxpay.keystore -storepass 123456 what...

Reverse Engineering Android apk

Image
Reverse Engineering Android apk Table of Contents Background Apktool dex2jar + JD-GUI 1 Background Here is my puzzle at this moment, my superior gave me a task to make Bluetooth Low Energy product which includes Android APP part, but there are no virtual designer and product manager, just myself as a software engineer. So, my first step is to found out a similar product and refer its design. Then, I need to decompile that app, some reverse engineering skills of Android app and java are necessary. I guess following two methods are enough to decompile an Android app. 2 Apktool ApkTool is a tool for reverse engineering Android apps, what it is pretty good at is to decode resources to nearly original form and rebuild them after some modification. But the java code part is decompiled into the smali format, which is not a good format to read and understand. 3 dex2jar + JD-GUI Apktool can not generate readable java source code, actually, there are no re...

Mobile APP development team composition

Image
Android APP development team composition Table of Contents Android APP team Exploration Stage Team Structure Acceleration Stage Team Structure Innovation Stage Team Structure 1 Android APP team Recently I have a job to develop an Android APP, this one is not a toy app anymore, it is a serious product. In the former time, When the superior dispatch an app task to me, most of the time, I did not worry about the user interface or UI design, I just need to finish the job by my way, just ignore the ugly interface, because most of the jobs are just test or research oriented. But this time is different, I need to develop a serious product. How can I make a product by myself? So I try to figure out the quality of the good team to make an awesome app. Then I found the following link to answer my question: http://www.slideshare.net/Mutual_Mobile/maturing-your-mobile-development-team This article provided three stages of Team structure, which can be a reference to ru...

Light_BLE - a practical APP tool to develop Bluetooth LE device

Image
Light BLE APP Table of Contents What is Light BLE APP? The Advantage of this APP Why I make above improvement? Source Code 1 What is Light BLE APP? It is an enhanced android app to communicate with Bluetooth LE peripheral. This app may be useful in Bluetooth Low Energy peripheral equipment development. It is based on an example in Android's SDK source code sample which located in sdk/samples/android-19/connectivity/BluetoothLeGatt/ , but that example sucks(yeah, Light BLE  sucks too, but much better than that sample). 2 The Advantage of this APP Following is what I improved based on that sample. Change the LocalService and Activity communication mechanism from broadcast intent into callback hooks. Add RSSI signal detects. Add write characteristic dialog(still need to improve). 3 Why I make above improvement? Broadcast Intents was not dependable, I guess that's the reason that I missed a lot of messages. So I studied the communicat...