-
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
2e831bb
commit bf9ffd4
Showing
9 changed files
with
141 additions
and
152 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,70 +1,70 @@ | ||
|
||
<img src="/readme/logo.png" align="left" | ||
width="150" hspace="10" vspace="10"> | ||
|
||
# TVS Navigator | ||
App to navigate Apache RTR using Google Maps notifications. | ||
<br/> | ||
## About | ||
|
||
The official application offered by TVS has navigation features. Unfortunately the map being used is MapMyIndia. There are limitations of using MapMyIndia like not having enough locations tagged and choosing route depending on live traffic. | ||
The app works by parsing the Google Maps notifications and creating the commands to be sent to the bike's console. | ||
I used bt-snoop logs and unpacked the official app to reverse engineer the instruction set. | ||
This is certainly not a replacement for official app offered by the manufacturer, there are many features missing which I may add in the future. | ||
I like to create solutions to the problems I face in real life using code, the quality of the code may not be perfect but hey as long as it works :) | ||
|
||
## Features | ||
|
||
The app lets you: | ||
- Send the Google Maps navigation directions to the bike's console | ||
- Displays the remaining distance and ETA time information | ||
- Displays information about people calling, also sends SMS to a contact with information like ETA and current location. | ||
|
||
## How It Works | ||
The Google Maps notifications are read by the GMapsParser. | ||
GMaps notification contains the direction as a bitmap, the direction is identified by comparing it with a repo of possible bitmaps (app\src\main\assets). | ||
|
||
#### TVS Apache RTR console instruction set | ||
The instructions are encoded in hexadecimal. | ||
Some sample instructions: | ||
| Instruction | Hexadecimal | | ||
| ------------- |:-------------:| | ||
| 50M TURN RIGHT |4e01f40003015455524e20524947485424| | ||
| REROUTING | 4e00000063015265726f7574696e6724 | | ||
|
||
Let's decode them: | ||
| N/O | Distance | Unit | Pictogram/MessageId | Multiline Flag | Text Message | $ | | ||
| --- | ------------- | ---- | ------------------- | -------------- | -------------------- | -- | | ||
| 4e | 01 f4 (050.0) | 00 | 03 (03) | 01 | 5455524e205249474854 (TURN RIGHT) | 24 | | ||
| 4e | 00 00 (000.0) | 00 | 63 (99) | 01 | 5265726f7574696e67 (REROUTING) | 24 | | ||
|
||
| Unit Values | Symbol | | ||
| ----------- | ------ | | ||
| 00 | M | | ||
| 01 | KM | | ||
|
||
- Multiline flags are used for big instructions are which sent in two parts separated by 100ms. | ||
- The pictogram id is a unique id for the images shown in the console. | ||
|
||
## Screenshots | ||
[<img src="/readme/screenshots/Screenshot_20210513-173948457.jpg" align="left" | ||
width="200" | ||
hspace="10" vspace="10">](/readme/screenshots/Screenshot_20210513-173948457.jpg) | ||
|
||
[<img src="/readme/screenshots/Screenshot_20210513-173945084.jpg" align="center" | ||
width="200" | ||
hspace="10" vspace="10">](/readme/screenshots/Screenshot_20210513-173945084.jpg) | ||
|
||
## Permissions | ||
|
||
Requires the following permissions: | ||
- Call logs - For displaying incoming call details. | ||
- Contacts - For showing who's calling. | ||
- Location - Used for BLE. | ||
- Phone - For displaying incoming call details. | ||
- SMS - For sending SMS to the contact in case of missed call. | ||
- Notification Access - To read GMaps notifications. | ||
|
||
## Libraries Used | ||
- [GMapsParser](https://github.com/3v1n0/GMapsParser) - used for reading Google Maps notification data | ||
|
||
<img src="/readme/logo.png" align="left" | ||
width="150" hspace="10" vspace="10"> | ||
|
||
# TVS Navigator | ||
App to navigate Apache RTR using Google Maps notifications. | ||
<br/> | ||
## About | ||
|
||
The official application offered by TVS has navigation features. Unfortunately the map being used is MapMyIndia. There are limitations of using MapMyIndia like not having enough locations tagged and choosing route depending on live traffic. | ||
The app works by parsing the Google Maps notifications and creating the commands to be sent to the bike's console. | ||
I used bt-snoop logs and unpacked the official app to reverse engineer the instruction set. | ||
This is certainly not a replacement for official app offered by the manufacturer, there are many features missing which I may add in the future. | ||
I like to create solutions to the problems I face in real life using code, the quality of the code may not be perfect but hey as long as it works :) | ||
|
||
## Features | ||
|
||
The app lets you: | ||
- Send the Google Maps navigation directions to the bike's console | ||
- Displays the remaining distance and ETA time information | ||
- Displays information about people calling, also sends SMS to a contact with information like ETA and current location. | ||
|
||
## How It Works | ||
The Google Maps notifications are read by the GMapsParser. | ||
GMaps notification contains the direction as a bitmap, the direction is identified by comparing it with a repo of possible bitmaps (app\src\main\assets). | ||
|
||
#### TVS Apache RTR console instruction set | ||
The instructions are encoded in hexadecimal. | ||
Some sample instructions: | ||
| Instruction | Hexadecimal | | ||
| ------------- |:-------------:| | ||
| 50M TURN RIGHT |4e01f40003015455524e20524947485424| | ||
| REROUTING | 4e00000063015265726f7574696e6724 | | ||
|
||
Let's decode them: | ||
| N/O | Distance | Unit | Pictogram/MessageId | Multiline Flag | Text Message | $ | | ||
| --- | ------------- | ---- | ------------------- | -------------- | -------------------- | -- | | ||
| 4e | 01 f4 (050.0) | 00 | 03 (03) | 01 | 5455524e205249474854 (TURN RIGHT) | 24 | | ||
| 4e | 00 00 (000.0) | 00 | 63 (99) | 01 | 5265726f7574696e67 (REROUTING) | 24 | | ||
|
||
| Unit Values | Symbol | | ||
| ----------- | ------ | | ||
| 00 | M | | ||
| 01 | KM | | ||
|
||
- Multiline flags are used for big instructions are which sent in two parts separated by 100ms. | ||
- The pictogram id is a unique id for the images shown in the console. | ||
|
||
## Screenshots | ||
[<img src="/readme/screenshots/Screenshot_20210513-173948457.jpg" align="left" | ||
width="200" | ||
hspace="10" vspace="10">](/readme/screenshots/Screenshot_20210513-173948457.jpg) | ||
|
||
[<img src="/readme/screenshots/Screenshot_20210513-173945084.jpg" align="center" | ||
width="200" | ||
hspace="10" vspace="10">](/readme/screenshots/Screenshot_20210513-173945084.jpg) | ||
|
||
## Permissions | ||
|
||
Requires the following permissions: | ||
- Call logs - For displaying incoming call details. | ||
- Contacts - For showing who's calling. | ||
- Location - Used for BLE. | ||
- Phone - For displaying incoming call details. | ||
- SMS - For sending SMS to the contact in case of missed call. | ||
- Notification Access - To read GMaps notifications. | ||
|
||
## Libraries Used | ||
- [GMapsParser](https://github.com/3v1n0/GMapsParser) - used for reading Google Maps notification data | ||
- [blessed-android](https://github.com/weliem/blessed-android) - used for BLE communications |
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="349.46616dp" | ||
android:height="281.544dp" | ||
android:viewportWidth="349.46616" | ||
android:viewportHeight="281.544"> | ||
<path | ||
android:pathData="m27.994,1.011c-1.055,-0.052 -1.838,0.083 -2.305,0.442 -6.442,4.948 -19.647,59.477 -24.537,86.879 -1.129,6.327 4.305,21.75 7.882,17.593 9.671,-11.237 26.356,-68.261 37.268,-70.034 10.912,-1.772 83.676,20.698 82.126,15.614 0,0 -2.094,-11.429 -4.978,-16.335 -0.756,-1.286 -23.83,-7.95 -46.796,-16.519 -20.489,-7.645 -41.277,-17.277 -48.659,-17.641zM321.472,1.011c-7.382,0.364 -28.17,9.996 -48.659,17.641 -22.966,8.569 -46.04,15.233 -46.796,16.519 -2.885,4.906 -4.985,16.335 -4.985,16.335 -1.55,5.083 71.221,-17.387 82.132,-15.614 10.912,1.773 27.591,58.797 37.261,70.034 3.577,4.157 9.018,-11.266 7.889,-17.593 -4.89,-27.403 -18.095,-81.931 -24.537,-86.879 -0.468,-0.359 -1.251,-0.494 -2.305,-0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m61.426,65.237c-7.997,15.687 -17.135,27.946 -22.816,48.265 10.467,11.642 21.858,24.317 34.317,32.473 16.89,1.131 32.565,2.306 50.795,2.768l15.574,11.813h33.29,2.149 2.149,33.29l15.574,-11.813c18.229,-0.462 33.905,-1.637 50.795,-2.768 12.459,-8.156 23.849,-20.832 34.316,-32.473 -5.681,-20.319 -14.819,-32.577 -22.816,-48.265 0,0 -37.971,10.66 -57.459,13.159 -17.762,2.278 -53.699,1.612 -53.699,1.612 0,0 -1.592,0.021 -2.149,0.028 -0.557,-0.007 -2.149,-0.028 -2.149,-0.028 0,0 -35.937,0.666 -53.699,-1.612 -19.488,-2.499 -57.459,-13.159 -57.459,-13.159z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#cccccc" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m133.983,166.459c-25.839,17.465 -52.368,31.464 -78.827,45.83 -1.589,0.863 5.932,28.637 17.022,36.622 4.523,3.256 46.898,24.816 73.257,30.066 9.447,1.882 28.855,1.544 28.855,1.544 0,0 0.426,-0 0.442,0 0.017,-0 0.442,0 0.442,0 0,0 19.409,0.338 28.855,-1.544 26.359,-5.25 68.735,-26.81 73.257,-30.066 11.09,-7.985 18.611,-35.759 17.022,-36.622 -26.459,-14.366 -52.988,-28.365 -78.827,-45.83h-40.308,-0.442 -0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
</vector> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="349.46616dp" | ||
android:height="281.544dp" | ||
android:viewportWidth="349.46616" | ||
android:viewportHeight="281.544"> | ||
<path | ||
android:pathData="m27.994,1.011c-1.055,-0.052 -1.838,0.083 -2.305,0.442 -6.442,4.948 -19.647,59.477 -24.537,86.879 -1.129,6.327 4.305,21.75 7.882,17.593 9.671,-11.237 26.356,-68.261 37.268,-70.034 10.912,-1.772 83.676,20.698 82.126,15.614 0,0 -2.094,-11.429 -4.978,-16.335 -0.756,-1.286 -23.83,-7.95 -46.796,-16.519 -20.489,-7.645 -41.277,-17.277 -48.659,-17.641zM321.472,1.011c-7.382,0.364 -28.17,9.996 -48.659,17.641 -22.966,8.569 -46.04,15.233 -46.796,16.519 -2.885,4.906 -4.985,16.335 -4.985,16.335 -1.55,5.083 71.221,-17.387 82.132,-15.614 10.912,1.773 27.591,58.797 37.261,70.034 3.577,4.157 9.018,-11.266 7.889,-17.593 -4.89,-27.403 -18.095,-81.931 -24.537,-86.879 -0.468,-0.359 -1.251,-0.494 -2.305,-0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m61.426,65.237c-7.997,15.687 -17.135,27.946 -22.816,48.265 10.467,11.642 21.858,24.317 34.317,32.473 16.89,1.131 32.565,2.306 50.795,2.768l15.574,11.813h33.29,2.149 2.149,33.29l15.574,-11.813c18.229,-0.462 33.905,-1.637 50.795,-2.768 12.459,-8.156 23.849,-20.832 34.316,-32.473 -5.681,-20.319 -14.819,-32.577 -22.816,-48.265 0,0 -37.971,10.66 -57.459,13.159 -17.762,2.278 -53.699,1.612 -53.699,1.612 0,0 -1.592,0.021 -2.149,0.028 -0.557,-0.007 -2.149,-0.028 -2.149,-0.028 0,0 -35.937,0.666 -53.699,-1.612 -19.488,-2.499 -57.459,-13.159 -57.459,-13.159z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#cccccc" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m133.983,166.459c-25.839,17.465 -52.368,31.464 -78.827,45.83 -1.589,0.863 5.932,28.637 17.022,36.622 4.523,3.256 46.898,24.816 73.257,30.066 9.447,1.882 28.855,1.544 28.855,1.544 0,0 0.426,-0 0.442,0 0.017,-0 0.442,0 0.442,0 0,0 19.409,0.338 28.855,-1.544 26.359,-5.25 68.735,-26.81 73.257,-30.066 11.09,-7.985 18.611,-35.759 17.022,-36.622 -26.459,-14.366 -52.988,-28.365 -78.827,-45.83h-40.308,-0.442 -0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
</vector> |
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="108dp" | ||
android:height="108dp" | ||
android:viewportWidth="108" | ||
android:viewportHeight="108"> | ||
<group android:scaleX="0.12979798" | ||
android:scaleY="0.12979798" | ||
android:translateX="31.32" | ||
android:translateY="35.72808"> | ||
<path | ||
android:pathData="m27.994,1.011c-1.055,-0.052 -1.838,0.083 -2.305,0.442 -6.442,4.948 -19.647,59.477 -24.537,86.879 -1.129,6.327 4.305,21.75 7.882,17.593 9.671,-11.237 26.356,-68.261 37.268,-70.034 10.912,-1.772 83.676,20.698 82.126,15.614 0,0 -2.094,-11.429 -4.978,-16.335 -0.756,-1.286 -23.83,-7.95 -46.796,-16.519 -20.489,-7.645 -41.277,-17.277 -48.659,-17.641zM321.472,1.011c-7.382,0.364 -28.17,9.996 -48.659,17.641 -22.966,8.569 -46.04,15.233 -46.796,16.519 -2.885,4.906 -4.985,16.335 -4.985,16.335 -1.55,5.083 71.221,-17.387 82.132,-15.614 10.912,1.773 27.591,58.797 37.261,70.034 3.577,4.157 9.018,-11.266 7.889,-17.593 -4.89,-27.403 -18.095,-81.931 -24.537,-86.879 -0.468,-0.359 -1.251,-0.494 -2.305,-0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m61.426,65.237c-7.997,15.687 -17.135,27.946 -22.816,48.265 10.467,11.642 21.858,24.317 34.317,32.473 16.89,1.131 32.565,2.306 50.795,2.768l15.574,11.813h33.29,2.149 2.149,33.29l15.574,-11.813c18.229,-0.462 33.905,-1.637 50.795,-2.768 12.459,-8.156 23.849,-20.832 34.316,-32.473 -5.681,-20.319 -14.819,-32.577 -22.816,-48.265 0,0 -37.971,10.66 -57.459,13.159 -17.762,2.278 -53.699,1.612 -53.699,1.612 0,0 -1.592,0.021 -2.149,0.028 -0.557,-0.007 -2.149,-0.028 -2.149,-0.028 0,0 -35.937,0.666 -53.699,-1.612 -19.488,-2.499 -57.459,-13.159 -57.459,-13.159z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#cccccc" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m133.983,166.459c-25.839,17.465 -52.368,31.464 -78.827,45.83 -1.589,0.863 5.932,28.637 17.022,36.622 4.523,3.256 46.898,24.816 73.257,30.066 9.447,1.882 28.855,1.544 28.855,1.544 0,0 0.426,-0 0.442,0 0.017,-0 0.442,0 0.442,0 0,0 19.409,0.338 28.855,-1.544 26.359,-5.25 68.735,-26.81 73.257,-30.066 11.09,-7.985 18.611,-35.759 17.022,-36.622 -26.459,-14.366 -52.988,-28.365 -78.827,-45.83h-40.308,-0.442 -0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
</group> | ||
</vector> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="108dp" | ||
android:height="108dp" | ||
android:viewportWidth="108" | ||
android:viewportHeight="108"> | ||
<group android:scaleX="0.12979798" | ||
android:scaleY="0.12979798" | ||
android:translateX="31.32" | ||
android:translateY="35.72808"> | ||
<path | ||
android:pathData="m27.994,1.011c-1.055,-0.052 -1.838,0.083 -2.305,0.442 -6.442,4.948 -19.647,59.477 -24.537,86.879 -1.129,6.327 4.305,21.75 7.882,17.593 9.671,-11.237 26.356,-68.261 37.268,-70.034 10.912,-1.772 83.676,20.698 82.126,15.614 0,0 -2.094,-11.429 -4.978,-16.335 -0.756,-1.286 -23.83,-7.95 -46.796,-16.519 -20.489,-7.645 -41.277,-17.277 -48.659,-17.641zM321.472,1.011c-7.382,0.364 -28.17,9.996 -48.659,17.641 -22.966,8.569 -46.04,15.233 -46.796,16.519 -2.885,4.906 -4.985,16.335 -4.985,16.335 -1.55,5.083 71.221,-17.387 82.132,-15.614 10.912,1.773 27.591,58.797 37.261,70.034 3.577,4.157 9.018,-11.266 7.889,-17.593 -4.89,-27.403 -18.095,-81.931 -24.537,-86.879 -0.468,-0.359 -1.251,-0.494 -2.305,-0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m61.426,65.237c-7.997,15.687 -17.135,27.946 -22.816,48.265 10.467,11.642 21.858,24.317 34.317,32.473 16.89,1.131 32.565,2.306 50.795,2.768l15.574,11.813h33.29,2.149 2.149,33.29l15.574,-11.813c18.229,-0.462 33.905,-1.637 50.795,-2.768 12.459,-8.156 23.849,-20.832 34.316,-32.473 -5.681,-20.319 -14.819,-32.577 -22.816,-48.265 0,0 -37.971,10.66 -57.459,13.159 -17.762,2.278 -53.699,1.612 -53.699,1.612 0,0 -1.592,0.021 -2.149,0.028 -0.557,-0.007 -2.149,-0.028 -2.149,-0.028 0,0 -35.937,0.666 -53.699,-1.612 -19.488,-2.499 -57.459,-13.159 -57.459,-13.159z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#cccccc" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
<path | ||
android:pathData="m133.983,166.459c-25.839,17.465 -52.368,31.464 -78.827,45.83 -1.589,0.863 5.932,28.637 17.022,36.622 4.523,3.256 46.898,24.816 73.257,30.066 9.447,1.882 28.855,1.544 28.855,1.544 0,0 0.426,-0 0.442,0 0.017,-0 0.442,0 0.442,0 0,0 19.409,0.338 28.855,-1.544 26.359,-5.25 68.735,-26.81 73.257,-30.066 11.09,-7.985 18.611,-35.759 17.022,-36.622 -26.459,-14.366 -52.988,-28.365 -78.827,-45.83h-40.308,-0.442 -0.442z" | ||
android:strokeLineJoin="miter" | ||
android:strokeWidth="3.48197" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#00000000" | ||
android:strokeLineCap="butt"/> | ||
</group> | ||
</vector> |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="ic_launcher_background">#1a1a1a</color> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="ic_launcher_background">#1a1a1a</color> | ||
</resources> |