forked from mikereidis/headunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad4946f
commit 01ad989
Showing
124 changed files
with
48,645 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="ca.yyx.hu" | ||
android:versionCode="6" | ||
android:versionName="2015_06_20" > | ||
|
||
<uses-feature android:name="android.hardware.usb.host" android:required="false"/> | ||
<uses-feature android:name="android.hardware.screen.landscape" android:required="false"/> | ||
<uses-feature android:name="android.hardware.wifi" android:required="false"/> | ||
|
||
<uses-sdk android:minSdkVersion="16" /> | ||
|
||
|
||
<!-- | ||
<supports-screens android:smallScreens="false" | ||
android:normalScreens="false" | ||
android:largeScreens="true" | ||
android:xlargeScreens="true"/> | ||
--> | ||
|
||
|
||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission> | ||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> | ||
<uses-permission android:name="android.permission.BROADCAST_STICKY"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> | ||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
<uses-permission android:name="android.permission.WRITE_SETTINGS" /> | ||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> | ||
|
||
|
||
<application android:label="Headunit" | ||
android:icon="@drawable/hu_icon_256" | ||
android:hardwareAccelerated="true"> | ||
|
||
<!-- | ||
<application android:label="@string/app_name" | ||
android:icon="@drawable/ic_app" | ||
android:hardwareAccelerated="true"> | ||
--> | ||
|
||
<!-- | ||
android:theme="@android:style/Theme.Holo" | ||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" | ||
android:screenOrientation="landscape" | ||
android:screenOrientation="portrait" | ||
--> | ||
<activity android:name=".hu_act" | ||
android:label="Headunit" | ||
android:launchMode="singleInstance" | ||
|
||
android:screenOrientation="landscape" | ||
|
||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" | ||
> | ||
<intent-filter> | ||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<!-- | ||
--> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
|
||
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" | ||
android:resource="@xml/usb_device_filter"/> | ||
<!-- | ||
--> | ||
|
||
<!-- | ||
--> | ||
</activity> | ||
|
||
</application> | ||
</manifest> | ||
<!-- | ||
--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
Headunit for Android Auto (tm) is a software based headunit compatible with Android Auto. | ||
|
||
You accept all liability for any reason by using, distributing, doing, or not doing anything else in respect of this software. | ||
|
||
This software is experimental and may be distracting. Use it only for testing at this time. Do NOT use this software while operating a vehicle of any sort. | ||
|
||
Please drive, cycle, walk, boat, fly and operate every other transport safely. | ||
|
||
|
||
Headunit for Android Auto is Copyright 2011-2015 Michael A. Reid ([email protected]). All rights are reserved. | ||
|
||
Please contact [email protected] to license for commercial use. | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
Android Auto is a trademark of Google Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
Headunit for Android Auto (tm) is a software based headunit compatible with Android Auto. Android Auto is a trademark of Google Inc. | ||
|
||
Headunit for Android Auto is Copyright 2011-2015 Michael A. Reid ([email protected]). All rights are reserved. | ||
|
||
Please contact [email protected] to license for commercial use. | ||
|
||
See COPYRIGHT_MICHAEL_REID_GPLv3AFFERO.txt file for the standard GPLv3 AFFERO licensing notice and more. | ||
|
||
|
||
|
||
Saturday June 20, 2015: | ||
|
||
Hello from Canada... :) | ||
|
||
See the build_headunit bash script to build from Linux. Edit the first few lines for your environment. | ||
|
||
Besides the Android ant build for the Java code, the Android NDK is needed. | ||
|
||
Please forgive all the usual transgressions; this code, like all real world code, has plenty of flaws and "character". | ||
|
||
Real life coding, trying to solve real problems of people, often requires compromise, and hasty and messy coding is one such. | ||
|
||
At this time, I'll mostly blame the fact that I've only put 200 hours or so into coding this app; at least 450 hours were spent doing painstaking reverse engineering, and much more is still needed. | ||
|
||
I will fix and re-organize the code a lot, because that's best in the long run. | ||
|
||
About me: I've been developing, and building electronics and computer equipment since I became a teen in the mid 1970's, on the first microprocessors, before even assemblers, | ||
hacking "machine language" in binary, hex, or even octal on the front panel switches of the PDP-11/05 that I wire-wrapped and built a 40x12 Unibus display peripheral for.... :) | ||
|
||
|
||
I'm not too experienced with Git and open source so please excuse related idiosyncracies. | ||
|
||
Feel free to share any thoughts to [email protected] or on my Headunit thread on XDA forum: forum.xda-developers.com/general/paid-software/android-4-1-headunit-android-auto-t3125252/ | ||
|
||
|
||
Spirit is my full time job, but I'm sorry to say I still make less than half of my corporate salaries, and work about twice the hours, for the last almost 4 years, from early 2011. | ||
|
||
I appreciate the financial support of people buying my apps, Spirit2: https://play.google.com/store/apps/details?id=fm.a2d.s2 and the older Spirit1: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock | ||
|
||
I am also happy to accept Paypal "donations" to my [email protected] address : https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mikereidis%40gmail%2ecom&lc=CA&item_name=Spirit%20FM%20%2d%20Mike%20Reid¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted | ||
|
||
The commercial Spirit2 has many features that are not in this Spirit2 Free app. As time goes by, I may move paid features to the Free version. The closer I can get to a "normal" salary, the more willing I will be to do so. | ||
|
||
|
||
Thanks ! :) | ||
Mike Reid. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project name="hu" default="help"> | ||
|
||
<!-- The local.properties file is created and updated by the 'android' tool. | ||
It contains the path to the SDK. It should *NOT* be checked into | ||
Version Control Systems. --> | ||
<property file="local.properties" /> | ||
|
||
<!-- The ant.properties file can be created by you. It is only edited by the | ||
'android' tool to add properties to it. | ||
This is the place to change some Ant specific build properties. | ||
Here are some properties you may want to change/update: | ||
source.dir | ||
The name of the source directory. Default is 'src'. | ||
out.dir | ||
The name of the output directory. Default is 'bin'. | ||
For other overridable properties, look at the beginning of the rules | ||
files in the SDK, at tools/ant/build.xml | ||
Properties related to the SDK location or the project target should | ||
be updated using the 'android' tool with the 'update' action. | ||
This file is an integral part of the build system for your | ||
application and should be checked into Version Control Systems. | ||
--> | ||
<property file="ant.properties" /> | ||
|
||
<!-- if sdk.dir was not set from one of the property file, then | ||
get it from the ANDROID_HOME env var. | ||
This must be done before we load project.properties since | ||
the proguard config can use sdk.dir --> | ||
<property environment="env" /> | ||
<condition property="sdk.dir" value="${env.ANDROID_HOME}"> | ||
<isset property="env.ANDROID_HOME" /> | ||
</condition> | ||
|
||
<!-- The project.properties file is created and updated by the 'android' | ||
tool, as well as ADT. | ||
This contains project specific properties such as project target, and library | ||
dependencies. Lower level build properties are stored in ant.properties | ||
(or in .classpath for Eclipse projects). | ||
This file is an integral part of the build system for your | ||
application and should be checked into Version Control Systems. --> | ||
<loadproperties srcFile="project.properties" /> | ||
|
||
<!-- quick check on sdk.dir --> | ||
<fail | ||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." | ||
unless="sdk.dir" | ||
/> | ||
|
||
<!-- | ||
Import per project custom build rules if present at the root of the project. | ||
This is the place to put custom intermediary targets such as: | ||
-pre-build | ||
-pre-compile | ||
-post-compile (This is typically used for code obfuscation. | ||
Compiled code location: ${out.classes.absolute.dir} | ||
If this is not done in place, override ${out.dex.input.absolute.dir}) | ||
-post-package | ||
-post-build | ||
-pre-clean | ||
--> | ||
<import file="custom_rules.xml" optional="true" /> | ||
|
||
<!-- Import the actual build file. | ||
To customize existing targets, there are two options: | ||
- Customize only one target: | ||
- copy/paste the target into this file, *before* the | ||
<import> task. | ||
- customize it to your needs. | ||
- Customize the whole content of build.xml | ||
- copy/paste the content of the rules files (minus the top node) | ||
into this file, replacing the <import> task. | ||
- customize to your needs. | ||
*********************** | ||
****** IMPORTANT ****** | ||
*********************** | ||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer, | ||
in order to avoid having your file be overridden by tools such as "android update project" | ||
--> | ||
<!-- version-tag: 1 --> | ||
<import file="${sdk.dir}/tools/ant/build.xml" /> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
export MY_KEYSTORE_FILE="/home/mike/dev/key/headunit_key" | ||
export MY_KEYSTORE_PASS="password" | ||
export MY_KEY_NAME="mikereidis_key" | ||
export WS="/home/mike/dev" | ||
export PROJ="hu" | ||
cd $WS/$PROJ | ||
|
||
rm -rf obj # obj/local/armeabi/* | ||
rm -rf libs # libs/armeabi/ | ||
|
||
mkdir libs | ||
|
||
android update project --target android-21 --path . --name $PROJ | ||
|
||
echo ndk-build start | ||
time ndk-build # 2>&1 |grep -i error | ||
|
||
ant -q clean release | ||
|
||
jarsigner -storepass $MY_KEYSTORE_PASS -sigalg MD5withRSA -digestalg SHA1 -keystore $MY_KEYSTORE_FILE -signedjar bin/$PROJ-release-unaligned.apk bin/$PROJ-release-unsigned.apk $MY_KEY_NAME | ||
zipalign -f 4 bin/$PROJ-release-unaligned.apk bin/$PROJ-release.apk | ||
|
||
#adb install -r bin/$PROJ-release.apk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
## | ||
LOCAL_PATH:= $(call my-dir) | ||
|
||
#include $(call all-subdir-makefiles) | ||
|
||
# lul / libusb std linux | ||
# lua / libusb std android libusbnok: https://github.com/Gritzman/libusb | ||
# luh / libusbhost google | ||
|
||
# JNI utilities | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE := hu_jni | ||
|
||
LOCAL_CFLAGS := -fvisibility=hidden | ||
|
||
LOCAL_SRC_FILES := hu_jni.c hu_usb.c hu_aap.c hu_ssl.c hu_aad.c hu_uti.c | ||
|
||
#LOCAL_LDLIBS := -llog -l/home/m/dev/hu/jni/libs/libssl.so -l/home/m/dev/hu/jni/libs/libcrypto.so -l/home/m/dev/hu/jni/libs/libusbnok.so | ||
LOCAL_LDLIBS := -llog -l/home/m/dev/hu/jni/libs/libssl.a -l/home/m/dev/hu/jni/libs/libcrypto.a -l/home/m/dev/hu/jni/libs/libusbnok.a | ||
|
||
|
||
#LOCAL_SHARED_LIBRARIES := libs/libusbnok.a | ||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
include $(CLEAR_VARS) | ||
LOCAL_MODULE := usb_reset | ||
LOCAL_SRC_FILES := usb_reset.c | ||
LOCAL_LDLIBS := -llog | ||
##include $(BUILD_EXECUTABLE) | ||
|
||
# hu_usb AA Test for Linux with exist libusb std: lul / libusb std linux ~/b/ba | ||
# hu_usb AA Test for Android with built libusb nok: lua / libusb std android ndk-build | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE := hu | ||
LOCAL_SRC_FILES := hu_mai.c hu_usb.c hu_aap.c hu_ssl.c hu_aad.c hu_uti.c | ||
LOCAL_LDLIBS := -llog -l/home/m/dev/hu/jni/libs/libssl.so -l/home/m/dev/hu/jni/libs/libcrypto.so -l/home/m/dev/hu/jni/libs/libusbnok.so | ||
#LOCAL_SHARED_LIBRARIES := /home/m/dev/hu/jni/libs/libusbnok.a | ||
#LOCAL_SHARED_LIBRARIES := liblog | ||
#LOCAL_STATIC_LIBRARIES | ||
#include $(BUILD_EXECUTABLE) | ||
|
||
|
||
# SSL wrapper: | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE:= sslwrapper_jni | ||
LOCAL_SRC_FILES:= sslwrapper_jni.c hu_aad.c hu_uti.c | ||
LOCAL_LDLIBS := -llog | ||
#LOCAL_SHARED_LIBRARIES := liblog | ||
#include $(BUILD_SHARED_LIBRARY) | ||
|
||
|
||
|
||
# hu_ush AA Test for Android with exist libusbhost: luh / libusbhost google ndk-build | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE := hu_ush | ||
LOCAL_SRC_FILES := hu_ush.c hu_aad.c hu_uti.c | ||
LOCAL_LDLIBS := -llog -l/home/m/dev/hu/jni/libs/libcrypto.a -l/home/m/dev/hu/jni/libs/libssl.a -l/home/m/dev/hu/jni/libs/libusbhost.so | ||
#LOCAL_SHARED_LIBRARIES := liblog | ||
#include $(BUILD_EXECUTABLE) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
APP_ABI := armeabi | ||
#APP_ABI := all | ||
|
||
#APP_PLATFORM := android-16 | ||
|
||
APP_PIE := true | ||
|
||
#Always release ? | ||
#APP_OPTIM := release # ndk-build NDK_DEBUG=0 | ||
#APP_OPTIM := debug # ndk-build NDK_DEBUG=1 | ||
|
Oops, something went wrong.