From e3cdf429b0a06936ef465eb145aa87f4db93d836 Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Thu, 2 Aug 2012 11:13:53 -0700 Subject: [PATCH] first commit, need to get cpp working on b2g --- Makefile | 7 +++++++ SUTAgent.cpp | 16 ++++++++++++++++ run.sh | 9 +++++++++ setup-tools.sh | 7 +++++++ 4 files changed, 39 insertions(+) create mode 100644 Makefile create mode 100644 SUTAgent.cpp create mode 100755 run.sh create mode 100755 setup-tools.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6d7c719 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +AGPP=$(NDKPATH)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ +CFLAGS=--sysroot $(NDKPATH)/platforms/android-9/arch-arm -fPIC -mandroid -DANDROID -DOS_ANDROID -fno-short-enums -fno-exceptions -lstdc++ +FILES=SUTAgent.cpp +LDIRS=-L$(NDKPATH)/platforms/android-9/arch-arm/usr/lib + +agent: + $(AGPP) -v $(LDIRS) $(CFLAGS) $(FILES) -o agent diff --git a/SUTAgent.cpp b/SUTAgent.cpp new file mode 100644 index 0000000..dcd5328 --- /dev/null +++ b/SUTAgent.cpp @@ -0,0 +1,16 @@ +/* + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this file, + You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#include + +//using namespace std; + +int main(int argc, char **argv) { + + // std::cout << "Hello, world!" << std::endl; + + return 0; +} diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..c819e33 --- /dev/null +++ b/run.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +rm agent +make agent +$ADB shell "rm /data/local/agent" +$ADB shell "rm -rf /data/local/tests" +$ADB shell "rm -rf /data/local/tmp*" +$ADB push agent /data/local +$ADB shell "/data/local/agent" diff --git a/setup-tools.sh b/setup-tools.sh new file mode 100755 index 0000000..1c31268 --- /dev/null +++ b/setup-tools.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +wget http://busybox.net/downloads/binaries/1.19.0/busybox-armv6l +$ADB remount +$ADB push busybox-armv6l /system/bin/busybox + +$ADB shell 'cd /system/bin; chmod 555 busybox; for x in `./busybox --list`; do ln -s ./busybox $x; done'