This commit is contained in:
Mia Pilchová 2025-02-15 17:26:32 +01:00
parent 859dd1f99d
commit 014ed6e257
12 changed files with 328 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
kernel
release
releases
local

68
README.md Executable file
View File

@ -0,0 +1,68 @@
# Renault R-Link reverse-engineering
Collection of materials and scripts to attempt reverse engineering Renault R-Link. Very WIP.
## Note
Everything in here is for educational purposes and shall not be used for commercial gain. Be advised that using any of provided tools on your own R-Link is done at your own risk
and you may void your device's warranty. Moreover, these tools are not guaranteed to work. Beware that you may permanently brick your device and in some cases this damage is irrecoverable.
## Legend
- FW, SW, HW = firmware, software, hardware
- RL = R-Link
- TT = TomTom
- Strasbourg/Struttgart = R-Link HW (internal TT project name)
### Submodule
This repository includes some helpful submodules that are relevant to RL:
- [R-Link-RE](https://github.com/egonalter/R-Link-RE): Collection of scripts for unpacking TT FW updates and decompiling revealed APKs
- [R-Link-Evolution-Missing-Explorer](https://github.com/JV-conseil-Internet-Consulting/R-Link-Evolution-Missing-Explorer): Explorer for TOMTOM.XXX files
### Scripts (WIP)
There are several scripts in this repository. Note that for the scripts to work correctly you must launch them from the root directory of this repository, e.g. `./scripts/download_releases.sh`.
These scripts are currently available:
- `download_releases.sh` - Downloads open source software released by TT for all known RL releases and extracts them into the `local/releases/<version>` directory.
- `create_kernel_git.sh` - Creates a git repository containing commits with the modified kernel provided of each TT release. Easier to diff between every release. Requires `download_releases.sh` to be run first.
- `create_release_git.sh` - Same as `create_kernel_git` but with everything in the release TAR.
### Links and thoughts
References and sources for this repo. Also notes/thoughts for the future.
#### Software
- Currently, the R-Link-RE scripts that decompile the Java APKs must be modified to work properly. Might just be a platform issue.
- The decompiler fails to fully decompile all apps, it might need additional third party library references to decompile properly?
- <https://www.softpedia.com/get/Maps-GPS/R-Link-Explorer.shtml#download> - Windows alternative to R-Link-Evolution-Missing-Explorer, this download is not verified though (TODO)
<https://www.speakev.com/threads/new-r-link-update-v11-344-3198541.139034/>
- <http://download.tomtom.com/sweet/navcore/system-update_3198541_all.ttpkg>
- Example release download (note the id is the differentiator for most releases, except the most latest one has a different URL? (see `include/vars.sh`)): <https://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt3198541.tar.gz>
<https://github.com/egonalter/R-Link_kernel/blob/master/arch/arm/mach-omap2/board-strasbourg-whitelist.h>
- all allowed devices
#### Hardware
There are links to files that have also been copied to the files directory to preserve them if they were become unavailable.
- FCC: <https://fccid.io/S4L1ME09>
- Photos (internal): <https://fccid.io/S4L1ME09/Internal-Photos/Internal-Photos-2145434.pdf>
- Photos (external): <https://fccid.io/S4L1ME09/External-Photos/External-Photos-2145433.pdf>
- Unfortunately the cool stuff like schematics are confidential...
- ANATEL: <https://fccid.io/ANATEL/00355-14-09666>
- Certification Construction File: <https://fccid.io/ANATEL/00355-14-09666/Manual_1ME09_rev1/F2B1E423-3290-440A-99C1-0BD994D5C828/PDF>
- Additional photos: <https://www.dropbox.com/scl/fo/fe39tlljyd71ddn1fbaer/ABi6F6LmGpZwUGo2WHgPhMY?dl=0&rlkey=0jl2z9u37sfdnwc72resucz24>
#### Forum links
- <https://github.com/egonalter/R-Link_kernel/issues/1>
- <https://xdaforums.com/t/renault-r-link-developer-mode-need-help-android-tomtom.3456337/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

63
scripts/create_kernel_git.sh Executable file
View File

@ -0,0 +1,63 @@
source ./scripts/include/vars.sh
source ./scripts/include/sudo.sh
source ./scripts/include/utils.sh
# If directory kernel doesn't exist, initialize the git repo
if [ ! -d $KERNEL_GIT_DIR ]; then
mkdir $KERNEL_GIT_DIR
cd $KERNEL_GIT_DIR
git init
fi
# Go to the root directory
cd $ROOT_DIR
# Check if the releases directory exists
if [ ! -d $RELEASES_DIR ]; then
echo "No releases directory found. Exiting..."
exit 1
fi
# Iterate over all directories in the releases directory
for release_dir in $(ls $RELEASES_DIR); do
release_dir="$RELEASES_DIR/$release_dir"
echo "got release_dir: $release_dir"
cd $release_dir
# TODO: clean this mess up
get_platform_dir $release_dir
echo "got platform_dir: $platform_dir"
cd $platform_dir
# In the platform directory, there's either a directory android-2.6.32 or a directory kernel which has a subdirectory android-2.6.32, get the path to the android-2.6.32 directory
android_dir=$(ls | grep android-2.6.32)
# If there's no such directory, try kernel/android-2.6.32
if [ -z "$android_dir" ]; then
android_dir=$(ls | grep kernel)
if [ -z "$android_dir" ]; then
echo "No android-2.6.32 directory found. Exiting..."
exit 1
fi
android_dir="$android_dir/$(ls | grep android-2.6.32)"
fi
android_dir="$platform_dir/$android_dir"
echo "got android_dir: $android_dir"
sudo rm -rf $KERNEL_GIT_DIR/*
cd $KERNEL_GIT_DIR
echo "copying everything from $android_dir to $KERNEL_GIT_DIR ..."
sudo cp -r $android_dir/* $KERNEL_GIT_DIR
git add .
git commit -m "kernel: update version $release_dir"
cd $ROOT_DIR
done

View File

@ -0,0 +1,36 @@
source ./scripts/include/vars.sh
source ./scripts/include/sudo.sh
# If directory release doesn't exist, initialize the git repo
if [ ! -d $RELEASE_GIT_DIR ]; then
mkdir $RELEASE_GIT_DIR
cd $RELEASE_GIT_DIR
git init
fi
# Go to the root directory
cd $ROOT_DIR
# Check if the releases directory exists
if [ ! -d $RELEASES_DIR ]; then
echo "No releases directory found. Exiting..."
exit 1
fi
# Iterate over all directories in the releases directory
for release_dir in $(ls $RELEASES_DIR); do
release_dir="$RELEASES_DIR/$release_dir"
echo "got release_dir: $release_dir"
sudo rm -rf $RELEASE_GIT_DIR/*
cd $RELEASE_GIT_DIR
echo "copying everything from $release_dir to $RELEASE_GIT_DIR ..."
sudo cp -r $release_dir/* $RELEASE_GIT_DIR
git add .
git commit -m "release: update version $release_dir"
cd $ROOT_DIR
done

46
scripts/create_uboot_git.sh Executable file
View File

@ -0,0 +1,46 @@
source ./scripts/include/vars.sh
source ./scripts/include/sudo.sh
source ./scripts/include/utils.sh
cd $ROOT_DIR
if [ ! -d $RELEASES_DIR ]; then
echo "No releases directory found. Exiting..."
exit 1
fi
# If directory u-boot doesn't exist, clone base git repo
if [ ! -d $UBOOT_GIT_DIR ]; then
# mkdir $UBOOT_GIT_DIR
# cd $UBOOT_GIT_DIR
# git init
git clone git@github.com:u-boot/u-boot.git $UBOOT_GIT_DIR
cd $UBOOT_GIT_DIR
git checkout tags/v1.3.4
git checkout -B tomtom
fi
for release_dir in $(ls $RELEASES_DIR); do
release_dir="$RELEASES_DIR/$release_dir"
echo "got release_dir: $release_dir"
cd $release_dir
get_platform_dir $release_dir
echo "got platform_dir: $platform_dir"
get_uboot_dir $platform_dir
echo "got uboot_dir: $uboot_dir"
# later releases don't include the entire uboot so this breaks
# sudo rm -rf $UBOOT_GIT_DIR/*
cd $UBOOT_GIT_DIR
echo "copying everything from $uboot_dir to $UBOOT_GIT_DIR ..."
sudo cp -r $uboot_dir/* $UBOOT_GIT_DIR
git add .
git commit -m "u-boot: update version $release_dir"
cd $ROOT_DIR
done

52
scripts/download_releases.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
source ./scripts/include/vars.sh
source ./scripts/include/sudo.sh
echo "got ROOT_DIR: $ROOT_DIR"
if [ ! -d $RELEASES_DIR ]; then
mkdir -p $RELEASES_DIR
fi
for download_link in ${FW_VERSIONS[@]}; do
# Get base name of the file
tar_name=$(basename $download_link)
# Extract tt-<version> from the tar name
version=$(echo $tar_name | sed -n 's/.*tt\([0-9]*\).*/\1/p')
echo $tar_name
echo $version
echo $platform_tar_name
version_dir="$RELEASES_DIR/tt$version"
echo "got version_dir: $version_dir"
if [ ! -d $version_dir ]; then
echo "creating dir $version_dir ..."
mkdir $version_dir
cd $version_dir
echo "downloading the base tar ..."
wget $download_link &>>/dev/null
sudo tar -xvf $tar_name
rm -rf $tar_name
# Extract all .tar.gz files in their directory
for file in $(ls | grep .tar.gz); do
tar_dir=$(echo $file | sed -n 's/\.tar\.gz$//p')
echo "extracting $file in $tar_dir ..."
sudo mkdir $tar_dir
cd $tar_dir
sudo tar -xvf ../$file
cd ..
done
sudo rm *.tar.gz
fi
cd $ROOT_DIR
done

2
scripts/include/sudo.sh Normal file
View File

@ -0,0 +1,2 @@
# pre-authorize sudo
sudo echo "got sudo ..."

33
scripts/include/utils.sh Executable file
View File

@ -0,0 +1,33 @@
get_platform_dir () {
local release_dir=$1
local platform_dir_candidates=("platform_open_sources" "platform-release_open_sources" "platform_release_open_sources")
for candidate in "${platform_dir_candidates[@]}"; do
platform_dir=$(ls "$release_dir" | grep "$candidate")
if [ -n "$platform_dir" ]; then
break
fi
done
if [ -z "$platform_dir" ]; then
echo "No platform dir found. Exiting..."
exit 1
fi
platform_dir="$release_dir/$platform_dir"
}
get_uboot_dir () {
local platform_dir=$1
uboot_dir="$platform_dir/u-boot"
if [ ! -d "$uboot_dir" ]; then
uboot_dir="$platform_dir/bootable/bootloader/u-boot-1.3.4"
if [ ! -d "$uboot_dir" ]; then
echo "No uboot dir found. Exiting..."
exit 1
fi
fi
}

24
scripts/include/vars.sh Normal file
View File

@ -0,0 +1,24 @@
ROOT_DIR=$(pwd)
LOCAL_DIR="$ROOT_DIR/local"
RELEASES_DIR="$LOCAL_DIR/releases"
RELEASE_GIT_DIR="$LOCAL_DIR/release"
KERNEL_GIT_DIR="$LOCAL_DIR/kernel"
UBOOT_GIT_DIR="$LOCAL_DIR/u-boot"
FW_VERSIONS=(
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt1467818.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt1526528.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt1700774.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt1860562.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt1948529.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt2094591.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt2194669.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt2539977.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt2681682.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt2931893.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt3064886.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt3168853.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt3198541.tar.gz"
"http://download.tomtom.com/open/gpl/Renault_R-Link/release_open_sources-tt3206684.tar.gz"
"http://download.tomtom.com/open/gpl/release-open-sources-tt3272159.tar.gz"
)