Skip to content

Geo Asset Management

v2rayroot edited this page Jun 14, 2026 · 1 revision

Geo Asset Management

UpdateGeoAssets

char *UpdateGeoAssets(char *assetPath);

Downloads geosite.dat and geoip.dat from the latest Loyalsoldier/v2ray-rules-dat release.

When assetPath is empty, files are stored in Resources beside the host executable.

Success example:

{
  "geosite.dat":"geosite.dat",
  "geoip.dat":"geoip.dat"
}

Partial failures are reported per file.

Operational Guidance

  • Run updates off the UI thread.
  • Do not update assets on every startup.
  • Ensure the directory is writable.
  • Protect files from untrusted modification.
  • For transactional replacement, use an application-owned updater.

Supplying a valid geo path to parser/runtime options sets the process-wide XRAY_LOCATION_ASSET environment variable.

Clone this wiki locally