29 lines
1002 B
Bash
29 lines
1002 B
Bash
#!/vendor/bin/sh
|
|
|
|
# Create GPS data directory if it doesn't exist
|
|
if [ ! -d /data/vendor/gps ]; then
|
|
mkdir -p /data/vendor/gps
|
|
chmod 755 /data/vendor/gps
|
|
fi
|
|
|
|
# Create legacy gnss file for compatibility
|
|
if [ ! -f /data/vendor/gps/gnss ]; then
|
|
echo "LatitudeDegrees=30.281026818001678" > /data/vendor/gps/gnss
|
|
echo "LongitudeDegrees=120.01934876982831" >> /data/vendor/gps/gnss
|
|
echo "AltitudeMeters=1.60062531" >> /data/vendor/gps/gnss
|
|
echo "BearingDegrees=0" >> /data/vendor/gps/gnss
|
|
echo "SpeedMetersPerSec=0" >> /data/vendor/gps/gnss
|
|
chmod 644 /data/vendor/gps/gnss
|
|
fi
|
|
|
|
# Create custom location file for new JNI implementation
|
|
# This file uses simple "latitude,longitude" format
|
|
if [ ! -f /data/vendor/gps/custom_location.txt ]; then
|
|
echo "30.281026,120.019348" > /data/vendor/gps/custom_location.txt
|
|
chmod 644 /data/vendor/gps/custom_location.txt
|
|
fi
|
|
|
|
# Set proper ownership and permissions
|
|
chown -R system:system /data/vendor/gps/
|
|
chmod 644 /data/vendor/gps/*
|