Compare commits

..

9 commits

Author SHA1 Message Date
253f6095d9 Regenerate 2023-12-03 12:17:05 +02:00
095063cbea Fix outdoors footways labels 2023-12-03 12:14:25 +02:00
ccee04417b WIP [styles] Adjust POIs visibilities
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:57:25 +02:00
bf1d67e5b2 [styles] Add icons
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:57:06 +02:00
b3514dcf93 WIP [styles] Raise visibility of cycle/bridle/foot-ways in outdoors
Add routes to bridleways and footways

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:55:19 +02:00
2d7822d291 WIP [styles] Highlight routed hiking trails
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:39:45 +02:00
ac7117dc10 WIP [classif] Add marked routes
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:38:40 +02:00
ab3bc16613 [generator] Pull route=hiking tag and trail names from relations
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:37:54 +02:00
c3f3f5918b WIP [classif] Add footway crossings and sidewalks
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2023-12-03 11:20:24 +02:00
8303 changed files with 945275 additions and 865526 deletions

View file

@ -21,7 +21,7 @@ IndentCaseLabels: false
NamespaceIndentation: None
PointerAlignment: Middle
SortIncludes: true
Standard: c++20
Standard: c++17
IncludeBlocks: Regroup
IncludeCategories:
# Tests --------------------------------------------------------------------------------------------
@ -163,6 +163,8 @@ IncludeCategories:
- Regex: '^"openlr/openlr_stat/'
Priority: 19400
- Regex: '^"mapshot/'
Priority: 19500
- Regex: '^"search/search_quality/booking_dataset_generator/'
Priority: 19707
@ -258,6 +260,9 @@ IncludeCategories:
- Regex: '^"editor/'
Priority: 48310
- Regex: '^"software_renderer/'
Priority: 48400
- Regex: '^"drape_frontend/'
Priority: 48500

View file

@ -1,4 +1,3 @@
6aa73face8b5eb8e026cfafa40d1983d4a0502c0
480fa6c2fcf53be296504ac6ba8e6b3d70f92b42
a6ede2b1466f0c9d8a443600ef337ba6b5832e58
1377b81bf1cac72bb6da192da7fed6696d5d5281

78
.github/CODEOWNERS vendored
View file

@ -1,69 +1,9 @@
# All non-assigned.
* @organicmaps/mergers
# Visual design.
/android/app/src/main/res/drawable*/ @organicmaps/design
/android/app/src/main/res/font/ @organicmaps/design
/android/app/src/main/res/mipmap*/ @organicmaps/design
/data/*.ttf @organicmaps/design
/data/resources-svg/ @organicmaps/design
/data/search-icons/ @organicmaps/design
/iphone/Maps/Images.xcassets/ @organicmaps/design
# Android.
/android/ @organicmaps/android
/android/app/src/main/java/app/organicmaps/car/ @organicmaps/android-auto
/docs/ANDROID_LOCATION_TEST.md @organicmaps/android
/docs/JAVA_STYLE.md @organicmaps/android
# no owner for translation changes
/android/app/src/main/res/values*/strings.xml
# iOS.
/iphone/ @organicmaps/ios
/xcode/ @organicmaps/ios
/docs/OBJC_STYLE.md @organicmaps/ios
# no owner for translation changes
/iphone/plist.txt
/iphone/Maps/LocalizedStrings/
# Qt
/qt/ @organicmaps/qt
# Rendering
/drape/ @organicmaps/rendering
/drape_frontend/ @organicmaps/rendering
# Map Data.
/tools/python/maps_generator/ @organicmaps/data
/generator/ @organicmaps/data
/topography_generator/ @organicmaps/data
/data/borders/ @organicmaps/data
/data/conf/isolines/ @organicmaps/data
/docs/SUBWAY_GENERATION.md @organicmaps/data
/docs/MAPS.md @organicmaps/data
/docs/EXPERIMENTAL_PUBLIC_TRANSPORT_SUPPORT.md @organicmaps/data
# no owner (changed often to add a new POI)
/generator/generator_tests/osm_type_test.cpp
# Map Styles.
/data/styles/ @organicmaps/styles
/data/types.txt @organicmaps/styles
/data/visibility.txt @organicmaps/styles
/data/mapcss-mapping.csv @organicmaps/styles
/data/replaced_tags.txt @organicmaps/styles
/data/classificator.txt @organicmaps/styles
/data/drules_* @organicmaps/styles
/docs/STYLES.md
/tools/kothic/ @organicmaps/styles
# DevOps.
/.github/workflows @organicmaps/devops
/android/*gradle* @organicmaps/devops
/docs/RELEASE_MANAGEMENT.md @organicmaps/devops
/xcode/fastlane/ @organicmaps/devops
# Growth.
README.md @organicmaps/growth
/.github/FUNDING.yml @organicmaps/growth
/android/app/src/fdroid/play/ @organicmaps/growth
/android/app/src/google/play/ @organicmaps/growth
/iphone/metadata/ @organicmaps/growth
# Legal.
LEGAL @organicmaps/legal
LICENSE @organicmaps/legal
NOTICE @organicmaps/legal
CONTRIBUTORS @organicmaps/legal
/docs/CODE_OF_CONDUCT.md @organicmaps/legal
/docs/DCO.md @organicmaps/legal
/docs/GOVERNANCE.md @organicmaps/legal
# Require legal approval for all new graphics
android/app/src/main/res/drawable*/ @organicmaps/legal
android/app/src/main/res/fonts/ @organicmaps/legal
android/app/src/main/res/mipmap*/ @organicmaps/legal
data/*.ttf @organicmaps/legal
data/resources*/ @organicmaps/legal
data/search-icons/ @organicmaps/legal
data/styles/clear/style-*/ @organicmaps/legal
iphone/Maps/Images.xcassets/ @organicmaps/legal

3
.github/FUNDING.yml vendored
View file

@ -1,4 +1,3 @@
github: organicmaps
liberapay: OrganicMaps
open_collective: organicmaps
custom: ["https://organicmaps.app/donate/", "https://donate.organicmaps.app/"]
custom: ["https://organicmaps.app/donate"]

View file

@ -7,8 +7,6 @@ assignees: ''
---
⚠ Have you searched for similar, already existing issues?
**Describe the issue**
Please write a clear and concise description of the issue here.
@ -30,7 +28,7 @@ If applicable, add screenshots or screen recordings to help explain your problem
**System information:**
- Operating system and its version: [iOS 12, Android 10, Ubuntu 22, MacOS Big Sur, etc.]
- Organic Maps version: [you can find it by tapping the button with the green Organic Maps logo]
- Organic Maps version: [you can find it by tapping the button with the green Organic Maps logo, bottom left of the main screen on Android, or the `?` button on iOS]
- Device Model: [e.g. iPhone 6, Samsung S22]

View file

@ -2,13 +2,11 @@
name: Feature Request
about: Suggest an idea for Organic Maps
title: ''
labels: []
labels: [Enhancement]
assignees: ''
---
⚠ Have you searched for similar, already existing issues?
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. For example:
I'm always frustrated when [...]

View file

@ -56,24 +56,19 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Restore beta keys
- name: Checkout private keys
uses: actions/checkout@v4
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: private.git
- name: Configure repo with private keys
shell: bash
run: |
echo "$PRIVATE_H" | base64 -d > private.h
echo "$FIREBASE_APP_DISTRIBUTION_JSON" | base64 -d > android/app/firebase-app-distribution.json
echo "$GOOGLE_SERVICES_JSON" | base64 -d > android/app/google-services.json
echo "$SECURE_PROPERTIES" | base64 -d > android/app/secure.properties
echo "$RELEASE_KEYSTORE" | base64 -d > android/app/release.keystore
env:
PRIVATE_H: ${{ secrets.PRIVATE_H }}
FIREBASE_APP_DISTRIBUTION_JSON: ${{ secrets.FIREBASE_APP_DISTRIBUTION_JSON }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
SECURE_PROPERTIES: ${{ secrets.SECURE_PROPERTIES }}
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
- name: Configure repository
shell: bash
run: ./configure.sh
./configure.sh ./private.git
rm -rf ./private.git
- name: Compile
shell: bash
@ -81,7 +76,7 @@ jobs:
run: |
cmake --version
ninja --version
./gradlew -Pfirebase assembleGoogleBeta uploadCrashlyticsSymbolFileGoogleBeta uploadCrashlyticsMappingFileGoogleBeta
./gradlew -Pfirebase -x lint -x lintVitalGoogleBeta assembleGoogleBeta uploadCrashlyticsSymbolFileGoogleBeta uploadCrashlyticsMappingFileGoogleBeta
- name: Upload beta apk to App Distribution
shell: bash

View file

@ -15,11 +15,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
android
tools/python/check_store_metadata.py
- name: Check metadata
run: ./tools/python/check_store_metadata.py android

View file

@ -23,10 +23,10 @@ on:
- packaging/**
- platform/*apple*
- platform/*_ios*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- pyhelpers/**
- qt*/**
- skin_generator/**
@ -51,7 +51,7 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure repository
- name: Configure in Open Source mode
shell: bash
run: ./configure.sh
@ -66,12 +66,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flavor: [WebDebug, FdroidDebug]
include:
- flavor: WebDebug
arch: arm64
- flavor: FdroidDebug
arch: arm32
flavor: [WebDebug, FdroidBeta]
# Cancels previous jobs if the same branch or PR was updated again.
concurrency:
group: ${{ github.workflow }}-${{ matrix.flavor }}-${{ github.event.pull_request.number || github.ref }}
@ -93,7 +88,7 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure repository
- name: Configure in Open Source mode
shell: bash
run: ./configure.sh
@ -111,11 +106,11 @@ jobs:
run: |
cmake --version
ninja --version
./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }}
./gradlew -Parm64 assemble${{ matrix.flavor }}
- name: Upload ${{ matrix.flavor }} apk
uses: actions/upload-artifact@v4
- name: Upload arm64-v8a ${{ matrix.flavor }} apk
uses: actions/upload-artifact@v3
with:
name: android-${{ matrix.flavor }}
name: android-arm64-v8a-${{ matrix.flavor }}
path: android/app/build/outputs/apk/**/OrganicMaps-*.apk
if-no-files-found: error

View file

@ -2,7 +2,7 @@ name: Android Monkey
on:
workflow_dispatch: # Manual trigger
schedule:
- cron: '0 5 * * 0' # Once per week at 05:00 UTC
- cron: '0 5 * * *' # Once per day at 05:00 UTC
env:
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
@ -13,7 +13,7 @@ jobs:
name: Check preconditions
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: 1000 # fetch month or so
@ -31,8 +31,8 @@ jobs:
outputs:
updated: ${{ steps.check.outputs.updated }}
android-google-beta:
name: Android Google Beta
android-google-debug:
name: Android Google Debug
runs-on: ubuntu-latest
needs: precondition
if: ${{ needs.precondition.outputs.updated != '' }}
@ -56,26 +56,19 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Restore beta keys
- name: Checkout private keys
uses: actions/checkout@v4
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: private.git
- name: Configure repo with private keys
shell: bash
run: |
echo "$PRIVATE_H" | base64 -d > private.h
echo "$FIREBASE_TEST_LAB_JSON" | base64 -d > android/app/firebase-test-lab.json
echo "$FIREBASE_APP_DISTRIBUTION_JSON" | base64 -d > android/app/firebase-app-distribution.json
echo "$GOOGLE_SERVICES_JSON" | base64 -d > android/app/google-services.json
echo "$SECURE_PROPERTIES" | base64 -d > android/app/secure.properties
echo "$RELEASE_KEYSTORE" | base64 -d > android/app/release.keystore
env:
PRIVATE_H: ${{ secrets.PRIVATE_H }}
FIREBASE_TEST_LAB_JSON: ${{ secrets.FIREBASE_TEST_LAB_JSON }}
FIREBASE_APP_DISTRIBUTION_JSON: ${{ secrets.FIREBASE_APP_DISTRIBUTION_JSON }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
SECURE_PROPERTIES: ${{ secrets.SECURE_PROPERTIES }}
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
- name: Configure repository
shell: bash
run: ./configure.sh
./configure.sh ./private.git
rm -rf ./private.git
- name: Compile
shell: bash
@ -83,20 +76,25 @@ jobs:
run: |
cmake --version
ninja --version
./gradlew -Pfirebase -Parm64 -Parmeabi-v7a assembleGoogleBeta uploadCrashlyticsSymbolFileGoogleBeta uploadCrashlyticsMappingFileGoogleBeta
./gradlew -Pfirebase -Parm64-v8a -Parmeabi-v7a -Px86_64 assembleGoogleDebug uploadCrashlyticsSymbolFileGoogleDebug
- name: Run monkey
run: |
gcloud auth activate-service-account --key-file android/app/firebase-test-lab.json
gcloud config set project omapsapp
gcloud firebase test android run --app ./android/app/build/outputs/apk/google/beta/OrganicMaps-*-google-beta.apk \
gcloud firebase test android run --app ./android/app/build/outputs/apk/google/debug/OrganicMaps-*-google-debug.apk \
--device model=husky,version=34 \
--device model=tangorpro,version=33,orientation=landscape \
--device model=cheetah,version=33 \
--device model=bluejay,version=32 \
--device model=a51,version=31 \
--device model=f2q,version=30,orientation=landscape \
--device model=a10,version=29,orientation=landscape \
--device model=cactus,version=27 \
--device model=sailfish,version=25 \
--device model=harpia,version=23 \
--device model=f2q,version=30 \
--device model=a10,version=29 \
--device model=Pixel2.arm,version=30 \
--device model=MediumPhone.arm,version=29 \
--device model=MediumPhone.arm,version=28 \
--device model=MediumPhone.arm,version=27 \
--device model=Pixel2.arm,version=26,orientation=landscape \
--device model=Nexus6,version=25 \
--device model=NexusLowRes,version=24 \
--device model=NexusLowRes,version=23,orientation=landscape \
--timeout 15m

View file

@ -12,7 +12,7 @@ jobs:
environment: production
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Parallel submodules checkout
shell: bash
@ -26,14 +26,19 @@ jobs:
ref: master
path: screenshots
- name: Restore release keys
- name: Checkout private keys
uses: actions/checkout@v4
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: private.git
- name: Configure repo with private keys
shell: bash
run: |
echo "$PRIVATE_H" | base64 -d > private.h
echo "$GOOGLE_PLAY_JSON" | base64 -d > android/app/google-play.json
env:
PRIVATE_H: ${{ secrets.PRIVATE_H }}
GOOGLE_PLAY_JSON: ${{ secrets.GOOGLE_PLAY_JSON }}
./configure.sh ./private.git
rm -rf ./private.git
- name: Upload
shell: bash

View file

@ -29,7 +29,7 @@ jobs:
version=$(tools/unix/version.sh ios_version)
# +1 because below a "Bump versions" commit is created.
# TODO: Find a way to refactor FDroid versioning without that additional commit.
build=$(($(tools/unix/version.sh count) + 1))
build=$(($(tools/unix/version.sh ios_build) + 1))
code=$(($(tools/unix/version.sh android_code) + 1))
tag=$version-$build-android
echo "::set-output name=version::$version"
@ -100,30 +100,23 @@ jobs:
ref: master
path: screenshots
- name: Restore release keys
- name: Checkout private keys
uses: actions/checkout@v4
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: private.git
- name: Configure repo with private keys
shell: bash
run: |
echo "$PRIVATE_H" | base64 -d > private.h
echo "$GOOGLE_PLAY_JSON" | base64 -d > android/app/google-play.json
echo "$HUAWEI_APPGALLERY_JSON" | base64 -d > android/app/huawei-appgallery.json
echo "$AGCONNECT_SERVICES_JSON" | base64 -d > android/app/agconnect-services.json
echo "$SECURE_PROPERTIES" | base64 -d > android/app/secure.properties
echo "$RELEASE_KEYSTORE" | base64 -d > android/app/release.keystore
env:
PRIVATE_H: ${{ secrets.PRIVATE_H }}
GOOGLE_PLAY_JSON: ${{ secrets.GOOGLE_PLAY_JSON }}
HUAWEI_APPGALLERY_JSON: ${{ secrets.HUAWEI_APPGALLERY_JSON }}
AGCONNECT_SERVICES_JSON: ${{ secrets.AGCONNECT_SERVICES_JSON }}
SECURE_PROPERTIES: ${{ secrets.SECURE_PROPERTIES }}
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
- name: Configure repository
shell: bash
run: ./configure.sh
./configure.sh ./private.git
rm -rf ./private.git
- name: Set up SDK
shell: bash
run: echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties
run: (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT)
- name: Compile and upload to Google Play
shell: bash
@ -151,16 +144,14 @@ jobs:
if: ${{ matrix.flavor == 'web' }}
shell: bash
run: |
(cd ./android/app/build/outputs/apk/web/release/ && sha256sum OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk > OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum)
{
cat ${{ env.RELEASE_NOTES }}
echo ""
echo "See [a detailed announce](https://organicmaps.app/news/) on our website when app updates are published in all stores."
echo "You can get automatic app updates from GitHub [using Obtainium](https://github.com/organicmaps/organicmaps/wiki/Installing-Organic-Maps-from-GitHub-using-Obtainium)."
echo "See [more details](https://organicmaps.app/news/) on our website when apps are published."
echo ""
echo "sha256sum:"
echo -e '\n```'
tr -d '\n' < ./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum
(cd ./android/app/build/outputs/apk/web/release/ && sha256sum OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk) | tr -d '\n'
echo -e '\n```'
} > ${{ runner.temp }}/release-notes.txt
@ -173,8 +164,5 @@ jobs:
name: ${{ needs.tag.outputs.tag }}
tag_name: ${{ needs.tag.outputs.tag }}
discussion_category_name: 'Announcements'
prerelease: true
files: |
./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk
./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum
files: ./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk
fail_on_unmatched_files: true

View file

@ -9,32 +9,21 @@ on:
jobs:
validate-appstream:
name: Validate appstream metadata xml
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
packaging/app.organicmaps.desktop.metainfo.xml
- name: Install appstream validator and flatpak Builder
- name: Install appstream validator
shell: bash
run: |
sudo apt update -y
sudo apt install -y \
flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install -y org.freedesktop.appstream-glib org.flatpak.Builder
# We get it from flathub to ensure we have a recent version
sudo flatpak install -y org.freedesktop.appstream-glib
- name: Validate appstream data
shell: bash
run: flatpak run org.freedesktop.appstream-glib validate --nonet packaging/app.organicmaps.desktop.metainfo.xml
- name: Lint appstream data with flatpak Builder
shell: bash
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream packaging/app.organicmaps.desktop.metainfo.xml
- name: Run appstreamcli in pedantic mode
shell: bash
run: flatpak run --command=appstreamcli org.flatpak.Builder validate --pedantic packaging/app.organicmaps.desktop.metainfo.xml

View file

@ -9,18 +9,22 @@ jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cleanup
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR

View file

@ -7,23 +7,6 @@ on:
- synchronize
- labeled
- unlabeled
paths-ignore:
- .gitignore
- CONTRIBUTORS
- LICENSE
- NOTICE
- README.md
- docs/**
- packaging/**
- platform/*apple*
- platform/*_android*
- platform/*_ios*
- platform/*_mac*
- platform/*_win*
- pyhelpers/**
- tools/**
- '!tools/python/test_server/**'
- xcode/**
# Cancels previous jobs if the same branch or PR was updated again.
concurrency:
@ -33,7 +16,7 @@ concurrency:
jobs:
should-run-check:
name: Should run coverage
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
outputs:
run-from-pr: ${{ steps.run-from-pr.outputs.run-from-pr }}
manually-triggered: ${{ steps.manually-triggered.outputs.manually-triggered }}
@ -59,7 +42,7 @@ jobs:
coverage:
needs: should-run-check
name: Generate coverage report
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
if: ${{ needs.should-run-check.outputs.run-from-pr == 'true' || needs.should-run-check.outputs.manually-triggered == 'true'}}
steps:
- name: Free disk space by removing .NET, Android and Haskell
@ -85,16 +68,14 @@ jobs:
libgl1-mesa-dev \
libglvnd-dev \
qt6-base-dev \
libfreetype-dev \
libharfbuzz-dev \
libqt6svg6-dev \
qt6-positioning-dev \
libqt6positioning6-plugins \
libqt6positioning6 \
llvm \
gcovr
llvm
pip install gcovr
- name: Configure repository
- name: Configure
shell: bash
run: ./configure.sh
@ -106,8 +87,8 @@ jobs:
- name: CMake
shell: bash
env:
CC: clang-18
CXX: clang++-18
CC: clang-14
CXX: clang++-14
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
# -g1 should slightly reduce build time.
@ -124,14 +105,14 @@ jobs:
shell: bash
working-directory: build
env:
QT_QPA_PLATFORM: "offscreen"
# drape_tests - requires X Window
# generator_integration_tests - https://github.com/organicmaps/organicmaps/issues/225
# opening_hours_integration_tests - https://github.com/organicmaps/organicmaps/issues/219
# opening_hours_supported_features_tests - https://github.com/organicmaps/organicmaps/issues/219
# routing_integration_tests - https://github.com/organicmaps/organicmaps/issues/221
# shaders_tests - https://github.com/organicmaps/organicmaps/issues/223
# world_feed_integration_tests - https://github.com/organicmaps/organicmaps/issues/215
CTEST_EXCLUDE_REGEX: "generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests"
CTEST_EXCLUDE_REGEX: "drape_tests|generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests"
run: |
sudo locale-gen en_US
sudo locale-gen en_US.UTF-8
@ -156,7 +137,7 @@ jobs:
run: zip -r coverage_report.zip html/
- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: build/coverage_report/coverage_report.zip

View file

@ -1,30 +0,0 @@
name: Validate .desktop file
on:
workflow_dispatch: # Manual trigger
pull_request:
paths:
- qt/res/app.organicmaps.desktop.desktop
- .github/workflows/desktop-file-check.yaml # Run check on self change
jobs:
validate-desktop-file:
name: Validate .desktop file
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
qt/res/app.organicmaps.desktop.desktop
- name: Install desktop-file-validate tool
shell: bash
run: |
sudo apt update -y
sudo apt install -y \
desktop-file-utils
- name: Validate desktop file
shell: bash
run: desktop-file-validate qt/res/app.organicmaps.desktop.desktop && echo "Successfully validated .desktop file"

View file

@ -20,10 +20,10 @@ on:
- generator/**
- packaging/**
- platform/*_android*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- pyhelpers/**
- qt*/**
- skin_generator/**
@ -33,9 +33,9 @@ on:
jobs:
ios-beta:
name: Apple TestFlight
runs-on: macos-15
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
LANG: en_US.UTF-8 # Fastlane complains that the terminal is using ASCII.
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
@ -52,34 +52,29 @@ jobs:
- name: Parallel submodules checkout
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20))
- name: Restore beta keys
shell: bash
run: |
mkdir -p xcode/keys
echo "$PRIVATE_H" | base64 -d > private.h
echo "$APPSTORE_JSON" | base64 -d > xcode/keys/appstore.json
echo "$CERTIFICATES_DEV_P12" | base64 -d > xcode/keys/CertificatesDev.p12
echo "$CERTIFICATES_DISTR_P12" | base64 -d > xcode/keys/CertificatesDistr.p12
env:
PRIVATE_H: ${{ secrets.PRIVATE_H }}
APPSTORE_JSON: ${{ secrets.APPSTORE_JSON }}
CERTIFICATES_DEV_P12: ${{ secrets.CERTIFICATES_DEV_P12 }}
CERTIFICATES_DISTR_P12: ${{ secrets.CERTIFICATES_DISTR_P12 }}
- name: Checkout private keys
uses: actions/checkout@v4
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: private.git
- name: Configure repository
shell: bash
run: ./configure.sh
- name: Configure repo with private keys
run: |
./configure.sh ./private.git
rm -rf ./private.git
- name: Compile and upload to TestFlight
run: |
echo "IOS_VERSION=$(../tools/unix/version.sh ios_version)-$(../tools/unix/version.sh ios_build)" >> "$GITHUB_ENV"
echo "IOS_VERSION=$(tools/unix/version.sh ios_version)-$(tools/unix/version.sh ios_build)" >> "$GITHUB_ENV"
./fastlane.sh upload_testflight
env:
APPSTORE_CERTIFICATE_PASSWORD: '${{ secrets.APPSTORE_CERTIFICATE_PASSWORD }}'
working-directory: xcode
- name: Upload ipa and DSYMs artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: ipa and DSYM archive ${{ env.IOS_VERSION }}
path: xcode/build/*

View file

@ -14,11 +14,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
iphone/metadata
tools/python/check_store_metadata.py
- name: Check metadata
run: ./tools/python/check_store_metadata.py ios

View file

@ -22,10 +22,10 @@ on:
- iphone/metadata/**
- packaging/**
- platform/*_android*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- pyhelpers/**
- qt*/**
- skin_generator/**
@ -35,13 +35,12 @@ on:
jobs:
ios-check:
name: Build iOS
runs-on: macos-15
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
LANG: en_US.UTF-8 # Fastlane complains that the terminal is using ASCII.
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
TEST_RESULTS_BUNDLE_NAME: OMaps-Test-Results
strategy:
fail-fast: false
matrix:
@ -59,48 +58,24 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20))
- name: Configure repository
- name: Configure
shell: bash
run: ./configure.sh
- name: Configure XCode cache
uses: irgaly/xcode-cache@v1
- name: Configure ccache
uses: mikehardy/buildcache-action@v2.1.0
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.buildType }}-${{ github.sha }}
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.buildType }}
cache_key: ${{ github.workflow }}-${{ matrix.buildType }}
- name: Build and Run Tests (Debug)
if: matrix.buildType == 'Debug'
- name: Compile
shell: bash
# Check for compilation errors.
run: |
xcodebuild test \
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-workspace xcode/omim.xcworkspace \
-scheme OMaps \
-configuration Debug \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro Max,OS=latest' \
-quiet \
-resultBundlePath ${{ env.TEST_RESULTS_BUNDLE_NAME }}.xcresult \
-configuration ${{ matrix.buildType }} build \
'generic/platform=iOS' \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
- name: Upload Test Results On Failure (Debug)
if: ${{ matrix.buildType == 'Debug' && failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_RESULTS_BUNDLE_NAME }}-${{ github.run_number }}.xcresult
path: ${{ env.TEST_RESULTS_BUNDLE_NAME }}.xcresult
if-no-files-found: error
- name: Build (Release)
if: matrix.buildType == 'Release'
shell: bash
run: |
xcodebuild build \
-workspace xcode/omim.xcworkspace \
-scheme OMaps \
-configuration Release \
-destination 'generic/platform=iOS' \
-quiet \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO

View file

@ -5,24 +5,31 @@ on:
jobs:
ios-release:
name: iOS Release
runs-on: macos-15
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
LANG: en_US.UTF-8 # Fastlane complains that the terminal is using ASCII.
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Restore release keys
- name: Checkout private keys
uses: actions/checkout@v4
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: ./private.git
- name: Configure repo with private keys
shell: bash
run: |
mkdir -p xcode/keys
echo "$APPSTORE_JSON" | base64 -d > xcode/keys/appstore.json
env:
APPSTORE_JSON: ${{ secrets.APPSTORE_JSON }}
mkdir -p xcode/keys/
cp -p ./private.git/xcode/keys/appstore.json xcode/keys/
rm -rf ./private.git
- name: Checkout screenshots
uses: actions/checkout@v4

View file

@ -20,9 +20,9 @@ on:
- packaging/**
- platform/*apple*
- platform/*_android*
- platform/*_ios*
- platform/*_mac*
- platform/*_win*
- platform/*_ios*
- platform/*_mac*
- platform/*_win*
- pyhelpers/**
- tools/**
- '!tools/python/test_server/**'
@ -31,7 +31,7 @@ on:
jobs:
linux-no-unity:
name: Linux no unity build
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
# Cancels previous jobs if the same branch or PR was updated again.
concurrency:
group: ${{ github.workflow }}-no-unity-${{ github.event.pull_request.number || github.ref }}
@ -60,18 +60,13 @@ jobs:
ninja-build \
libgl1-mesa-dev \
libglvnd-dev \
libharfbuzz-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
qt6-base-dev \
libqt6svg6-dev \
qt6-positioning-dev \
libqt6positioning6-plugins \
libqt6positioning6
- name: Configure repository
- name: Configure
shell: bash
run: ./configure.sh
@ -83,8 +78,8 @@ jobs:
- name: CMake
shell: bash
env:
CC: clang-18
CXX: clang++-18
CC: clang-14
CXX: clang++-14
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
# -g1 should slightly reduce build time.
@ -99,11 +94,11 @@ jobs:
linux-matrix:
name: Linux builds and tests
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [{ CXX: g++-14, CC: gcc-14 }, { CXX: clang++-18, CC: clang-18 }]
compiler: [{ CXX: g++-12, CC: gcc-12 }, { CXX: clang++-14, CC: clang-14 }]
CMAKE_BUILD_TYPE: [Debug, RelWithDebInfo]
# Cancels previous jobs if the same branch or PR was updated again.
concurrency:
@ -128,21 +123,18 @@ jobs:
run: |
sudo apt update -y
sudo apt install -y \
g++-12 \
gcc-12 \
ninja-build \
libgl1-mesa-dev \
libglvnd-dev \
libharfbuzz-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
qt6-base-dev \
libqt6svg6-dev \
qt6-positioning-dev \
libqt6positioning6-plugins \
libqt6positioning6
- name: Configure repository
- name: Configure
shell: bash
run: ./configure.sh
@ -173,14 +165,14 @@ jobs:
shell: bash
working-directory: build
env:
QT_QPA_PLATFORM: "offscreen"
# drape_tests - requires X Window
# generator_integration_tests - https://github.com/organicmaps/organicmaps/issues/225
# opening_hours_integration_tests - https://github.com/organicmaps/organicmaps/issues/219
# opening_hours_supported_features_tests - https://github.com/organicmaps/organicmaps/issues/219
# routing_integration_tests - https://github.com/organicmaps/organicmaps/issues/221
# shaders_tests - https://github.com/organicmaps/organicmaps/issues/223
# world_feed_integration_tests - https://github.com/organicmaps/organicmaps/issues/215
CTEST_EXCLUDE_REGEX: "generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests"
CTEST_EXCLUDE_REGEX: "drape_tests|generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests"
run: |
sudo locale-gen en_US
sudo locale-gen en_US.UTF-8

View file

@ -20,8 +20,8 @@ on:
- packaging/**
- platform/*_android*
- platform/*_ios*
- platform/*_linux*
- platform/*_win*
- platform/*_linux*
- platform/*_win*
- pyhelpers/**
- tools/**
- '!tools/python/test_server/**'
@ -30,9 +30,9 @@ on:
jobs:
macos-matrix:
name: macOS builds and tests
runs-on: macos-15
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
strategy:
@ -55,9 +55,9 @@ jobs:
- name: Install build tools and dependencies
shell: bash
run: |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install ninja qt@6
brew install ninja qt@6
- name: Configure repository
- name: Configure
shell: bash
run: ./configure.sh

View file

@ -1,22 +0,0 @@
name: Close stale PRs
on:
schedule:
- cron: "0 0 * * *" # Runs every day at midnight
jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-pr-stale: 180 # 6 months before warning
days-before-pr-close: 365 # Closed after 12 months
stale-pr-label: "stale"
stale-pr-message: "Hi! This PR has been inactive for 6 months. If it's still relevant, please update it to let us know youd like to keep it open 😊"
close-pr-message: "This PR has been automatically closed after 12 months of inactivity."
days-before-issue-stale: -1 # Issues are never stale
days-before-issue-close: -1 # Issues are never closed
remove-stale-when-updated: true

26
.github/workflows/strings-check.yaml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Validate translation strings
on:
workflow_dispatch: # Manual trigger
pull_request:
paths:
- .github/workflows/strings-check.yaml # Run check on self change
- data/countries_names.txt
- data/strings/*
- tools/python/strings_utils.py
jobs:
validate-translation-strings:
name: Validate translation strings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3'
- name: Validate strings.txt and types_strings.txt files
shell: bash
run: |
./tools/python/strings_utils.py --validate
./tools/python/strings_utils.py --types-strings --validate

10
.gitignore vendored
View file

@ -16,11 +16,10 @@ screenlog.0
data/styles/*/*/out/*
data/resources-*_design/*
data/drules_proto_default_design.bin
data/drules_proto_design.bin
data/colors_design.txt
data/patterns_design.txt
data/bookmarks
data/edits.xml
# Compiled Python
*.pyc
@ -85,7 +84,7 @@ data/[0-9][0-9][0-9][0-9][0-9][0-9]
data/gps_track.dat
# temporary files for downloader
data/settings.ini
data/test_data/world_feed_integration_tests_data
data/world_feed_integration_tests_data
# benchmark results
data/benchmarks/*.trace
@ -124,7 +123,6 @@ tizen/*/.*
tizen/*/crash-info/*
.idea/*
.idea
!android/.idea/icon.svg
# Private repository files.
.private_repository_url
@ -147,7 +145,6 @@ iphone/Maps/app.omaps/
*.autosave
# CMake
cmake-build-*
build/
@ -178,9 +175,6 @@ tools/python/routing/etc/*.ini
/node_modules/
/package-lock.json
# Visual Studio
.vs
# VS Code
.vscode

51
.gitmodules vendored
View file

@ -1,67 +1,64 @@
[submodule "tools/osmctools"]
path = tools/osmctools
url = ../osmctools.git
url = https://github.com/organicmaps/osmctools.git
[submodule "tools/kothic"]
path = tools/kothic
url = ../kothic.git
url = https://github.com/organicmaps/kothic.git
[submodule "tools/macdeployqtfix"]
path = tools/macdeployqtfix
url = https://github.com/aurelien-rainone/macdeployqtfix.git
[submodule "3party/protobuf/protobuf"]
path = 3party/protobuf/protobuf
url = ../protobuf.git
url = https://github.com/organicmaps/protobuf.git
[submodule "tools/twine"]
path = tools/twine
url = https://github.com/organicmaps/twine.git
[submodule "3party/Vulkan-Headers"]
path = 3party/Vulkan-Headers
url = ../Vulkan-Headers.git
url = https://github.com/KhronosGroup/Vulkan-Headers.git
[submodule "3party/boost"]
path = 3party/boost
url = ../boost.git
url = https://github.com/boostorg/boost.git
branch = boost-1.76.0
ignore = dirty
[submodule "3party/just_gtfs"]
path = 3party/just_gtfs
url = ../just_gtfs.git
url = https://github.com/organicmaps/just_gtfs.git
branch = for-usage-as-submodule
[submodule "3party/expat"]
path = 3party/expat
url = ../libexpat.git
url = https://github.com/libexpat/libexpat.git
branch = R_2_2_9
[submodule "3party/glm"]
path = 3party/glm
url = ../glm.git
url = https://github.com/g-truc/glm.git
[submodule "3party/icu/icu"]
path = 3party/icu/icu
url = ../icu.git
url = https://github.com/unicode-org/icu.git
[submodule "3party/freetype/freetype"]
path = 3party/freetype/freetype
url = ../freetype.git
url = https://github.com/organicmaps/freetype.git
[submodule "3party/googletest"]
path = 3party/googletest
url = ../googletest.git
url = https://github.com/google/googletest.git
[submodule "3party/fast_double_parser"]
path = 3party/fast_double_parser
url = ../fast_double_parser.git
url = https://github.com/lemire/fast_double_parser.git
[submodule "3party/pugixml/pugixml"]
path = 3party/pugixml/pugixml
url = ../pugixml.git
url = https://github.com/zeux/pugixml.git
[submodule "3party/jansson/jansson"]
path = 3party/jansson/jansson
url = ../jansson.git
url = https://github.com/akheron/jansson.git
[submodule "3party/gflags"]
path = 3party/gflags
url = ../gflags
url = https://github.com/gflags/gflags
[submodule "3party/fast_obj"]
path = 3party/fast_obj
url = ../fast_obj
url = https://github.com/thisistherk/fast_obj
[submodule "3party/harfbuzz/harfbuzz"]
path = 3party/harfbuzz/harfbuzz
url = ../harfbuzz.git
url = https://github.com/harfbuzz/harfbuzz.git
[submodule "3party/utfcpp"]
path = 3party/utfcpp
url = ../utfcpp.git
[submodule "3party/glfw"]
path = 3party/glfw
url = ../glfw.git
[submodule "3party/CMake-MetalShaderSupport"]
path = 3party/CMake-MetalShaderSupport
url = ../CMake-MetalShaderSupport.git
[submodule "3party/imgui/imgui"]
path = 3party/imgui/imgui
url = ../imgui.git
url = https://github.com/nemtrif/utfcpp.git

@ -1 +0,0 @@
Subproject commit 989857d2e5e54869c35ad06fb21a67d12a2dbc67

View file

@ -3,14 +3,10 @@
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
# Suppress "Policy CMP0077 is not set: option() honors normal variables"
# for the freetype, expat and jansson options.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
# Suppress "Policy CMP0063 is not set: Honor visibility properties for all target types."
# for jansson
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
# Configure expat library.
# Suppress "Policy CMP0077 is not set: option() honors normal variables"
# for the expat options below.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(EXPAT_BUILD_TOOLS OFF)
set(EXPAT_BUILD_EXAMPLES OFF)
set(EXPAT_BUILD_TESTS OFF)
@ -18,9 +14,6 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
set(EXPAT_BUILD_PKGCONFIG OFF)
set(EXPAT_ENABLE_INSTALL OFF)
set(EXPAT_SHARED_LIBS OFF)
set(EXPAT_GE OFF)
set(EXPAT_DTD OFF)
set(EXPAT_NS ON)
add_subdirectory(expat/expat)
# Configure Jansson library.
@ -31,7 +24,6 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
set(JANSSON_WITHOUT_TESTS ON)
add_subdirectory(jansson/jansson/)
target_include_directories(jansson INTERFACE "${PROJECT_BINARY_DIR}/3party/jansson/jansson/include")
add_library(jansson::jansson ALIAS jansson)
# Add gflags library.
add_subdirectory(gflags)
@ -42,23 +34,22 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
# Add protobuf library.
add_subdirectory(protobuf)
if (NOT PLATFORM_LINUX)
add_subdirectory(freetype)
add_subdirectory(icu)
add_subdirectory(harfbuzz)
endif()
add_library(utf8cpp INTERFACE)
add_library(utf8cpp::utf8cpp ALIAS utf8cpp)
target_include_directories(utf8cpp INTERFACE "${OMIM_ROOT}/3party/utfcpp/source")
endif()
add_subdirectory(agg)
add_subdirectory(bsdiff-courgette)
if (NOT LINUX_DETECTED)
add_subdirectory(freetype)
add_subdirectory(icu)
endif()
add_subdirectory(harfbuzz)
add_subdirectory(liboauthcpp)
add_subdirectory(minizip)
add_subdirectory(open-location-code)
add_subdirectory(opening_hours)
add_subdirectory(sdf_image)
add_subdirectory(stb_image)
add_subdirectory(succinct)
@ -66,19 +57,4 @@ add_subdirectory(vulkan_wrapper)
if (PLATFORM_DESKTOP)
add_subdirectory(libtess2)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "")
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "")
set(GLFW_INSTALL OFF CACHE BOOL "")
set(GLFW_VULKAN_STATIC OFF CACHE BOOL "")
set(GLFW_BUILD_WAYLAND OFF CACHE BOOL "")
# Disable ARC for glfw and re-enable after it because it's globally set in the root CMakeLists.txt
set(CMAKE_OBJC_FLAGS "")
add_subdirectory(glfw)
set_target_properties(glfw PROPERTIES UNITY_BUILD OFF)
set_target_properties(glfw PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC NO)
set(CMAKE_OBJC_FLAGS -fobjc-arc)
add_subdirectory(imgui)
endif()

@ -1 +1 @@
Subproject commit 595c8d4794410a4e64b98dc58d27c0310d7ea2fd
Subproject commit 83e1a9ed8ce289cebb1c02c8167d663dc1befb24

@ -1 +1 @@
Subproject commit ab7968a0bbcf574a7859240d1d8443f58ed6f6cf
Subproject commit 564e2ac16907019696cdaba8a93e3588ec596062

@ -1 +1 @@
Subproject commit a0dc7d5efacbe2b744211289c276e2b9168bd4ae
Subproject commit 654d2de0da85662fcc7644a7acd7c2dd2cfb21f0

@ -1 +1 @@
Subproject commit 252029ddac664370bdda3f0761675785d92a1573
Subproject commit efec03532ef65984786e5e32dbc81f6e6a55a115

@ -1 +1 @@
Subproject commit 42629f744269e004907a6fb4f16c6c7f69acc586
Subproject commit 1a8060257a96401a9555a476bd13c3a87502c9b5

@ -1 +1 @@
Subproject commit 97069edd163b66ce11e8152bee3055b2fa627e15
Subproject commit e4586d960f339cf75e2e0b34aee30a0ed8353c0d

@ -1 +0,0 @@
Subproject commit 21fea01161e0d6b70c0c5c1f52dc8e7a7df14a50

View file

@ -17,7 +17,6 @@ target_compile_options(${PROJECT_NAME}
-fno-rtti
-fno-exceptions
-fno-threadsafe-statics
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-format-pedantic>
)
target_compile_definitions(${PROJECT_NAME}
@ -37,5 +36,3 @@ target_compile_definitions(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME} Freetype::Freetype)
add_library(harfbuzz::harfbuzz ALIAS harfbuzz)

@ -1 +1 @@
Subproject commit 788b469ad5e5f78611f665b6eb17afd0eb040f21
Subproject commit e8eb1dc5ff695427abc137d3d15c4eec64ab6c78

View file

@ -32,13 +32,10 @@ add_library(icuuc
icu/icu4c/source/common/locbased.h
icu/icu4c/source/common/locid.cpp
icu/icu4c/source/common/loclikely.cpp
icu/icu4c/source/common/loclikelysubtags.cpp
icu/icu4c/source/common/loclikelysubtags.h
icu/icu4c/source/common/locmap.cpp
icu/icu4c/source/common/locutil.cpp
icu/icu4c/source/common/locutil.h
icu/icu4c/source/common/lsr.h
icu/icu4c/source/common/lsr.cpp
icu/icu4c/source/common/messageimpl.h
icu/icu4c/source/common/msvcres.h
icu/icu4c/source/common/mutex.h

@ -1 +1 @@
Subproject commit 7750081bda4b3bc1768ae03849ec70f67ea10625
Subproject commit 680f521746a3bd6a86f25f25ee50a62d88b489cf

View file

@ -1,16 +0,0 @@
project(imgui)
set(SRC
imgui/imgui_draw.cpp
imgui/imgui_tables.cpp
imgui/imgui_widgets.cpp
imgui/imgui.cpp
imgui/backends/imgui_impl_glfw.cpp
)
add_library(${PROJECT_NAME} ${SRC})
target_include_directories(${PROJECT_NAME}
PRIVATE ${OMIM_ROOT}/3party/glfw/include
PUBLIC ${OMIM_ROOT}/3party/imgui/imgui
PUBLIC .
)

@ -1 +0,0 @@
Subproject commit 6982ce43f5b143c5dce5fab0ce07dd4867b705ae

@ -1 +1 @@
Subproject commit 61fc3d0e28e1a35410af42e329cd977095ec32d2
Subproject commit e23f5580072cb64ce3ab27de2b5110d7ac252424

9
3party/liboauthcpp/.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
# Build (by)products
build/CMakeCache.txt
build/CMakeFiles
build/Makefile
build/cmake_install.cmake
build/liboauthcpp.a
build/simple_auth
build/simple_request
build/tests

View file

@ -0,0 +1,21 @@
project(oauthcpp)
set(SRC
include/liboauthcpp/liboauthcpp.h
src/base64.cpp
src/HMAC_SHA1.cpp
src/SHA1.cpp
src/urlencode.cpp
src/liboauthcpp.cpp
)
add_library(${PROJECT_NAME} ${SRC})
target_include_directories(${PROJECT_NAME}
PRIVATE src
PUBLIC include
)
target_compile_options(${PROJECT_NAME}
PRIVATE $<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-shorten-64-to-32>
)

View file

@ -0,0 +1,21 @@
Copyright (c) 2011 Stanford University (liboauthcpp)
Copyright (C) 2011 by swatkat (swatkat.thinkdigitATgmailDOTcom) (libtwitcurl)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,172 @@
liboauthcpp
-----------
liboauthcpp is a pure C++ library for performing OAuth requests. It
doesn't contain any networking code -- you provide for performing HTTP
requests yourself, however you like -- instead focusing on performing
OAuth-specific functionality and providing a nice interface for it.
If you already have infrastructure for making HTTP requests and are
looking to add OAuth support, liboauthcpp is for you.
liboauthcpp currently implements OAuth 1.0a (see
http://tools.ietf.org/html/rfc5849).
Buildbot
--------
[![Build Status](https://secure.travis-ci.org/sirikata/liboauthcpp.png)](http://travis-ci.org/sirikata/liboauthcpp)
Requirements
------------
You should only need:
* CMake
* A C++ compiler for your platform (e.g. g++, Microsoft Visual C++)
Compiling
---------
The build process is simple:
cd liboauthcpp
cd build
cmake .
make # or open Visual Studio and build the solution
If your own project uses CMake you can also include
build/CMakeLists.txt directly into your project and reference the
target "oauthcpp", a static library, in your project.
Percent (URL) Encoding
----------------------
To get correct results, you need to pass your URL properly encoded to
liboauthcpp. If you are not at all familiar, you should probably start
by reading the [URI Spec](http://tools.ietf.org/html/rfc3986), especially
Section 2. Alternatively,
[this article](http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding)
gives a more readable overview.
The basic idea is that there are 3 classes of characters: reserved,
unreserved, and other. Reserved characters are special characters that
are used in the URI syntax itself, e.g. ':' (after the scheme), '/'
(the hierarchical path separator), and '?' (prefixing the query
string). Unreserved characters are characters that are always safe to
include unencoded, e.g. the alphanumerics. Other characters must
always be encoded, mainly covering special characters like ' ', '<' or
'>', and '{' or '}'.
The basic rule is that reserved characters must be encoded if they
appear in any part of the URI when not being used as a
separator. Unreserved characters are always safe. And the other
characters they didn't know if they would be safe or not so they must
always be encoded.
Unfortunately, the reserved set is a bit more complicated. They are
broken down into 'general delimiters' and 'sub delimiters'. The ones
already mentioned, like ':', can appear in many forms of URIs (say,
http, ftp, about, gopher, mailto, etc. Those are called general
delimiters. Others (e.g. '(', ')', '!', '$', '+', ',', '=', and more)
are called subdelimiters because their use depends on the URI
scheme. Worse, their use depends on the *part of the URI*. Depending
on the particular URI scheme, these may or may not have to be encoded,
and it might also depend on where they appear. (As an example, an '&'
in an http URI isn't an issue if it appears in the path -- before the
query string -- i.e. before a '?' appears. Worse, '=' can appear unencoded in
the path, or in a query parameter value, but not in a query parameter key since
it would be interpreted as the end of the key.)
*Additionally*, in many cases it is permitted to encode a character
unnecessarily and the result is supposed to be the same. This means
that it's possible to percent encode some URLs in multiple ways
(e.g. encoding the unreserved set unnecessarily). It is possible, but not
guaranteed, that if you pass *exactly* the same URI to liboauthcpp and the
OAuth server, it will handle it regardless of the variant of encoding, so long
as it is a valid encoding.
The short version: percent encoding a URL properly is non-trivial and
you can even encode the same URL multiple ways, but has to be done
correctly so that the OAuth signature can be computed. Sadly,
"correctly" in this case really means "in whatever way the server your
interacting with wants it encoded".
Internally, liboauthcpp needs to do another step of percent encoding,
but the OAuth spec is very precise about how that works (none of these
scheme-dependent issues). liboauth applies this percent encoding, but
assumes that you have encoded your URLs properly. This assumption
makes sense since the actual request is made separately, and the URI
has to be specified in it, so you should already have a form which the
server will accept.
However, in order to aid you, a very simple percent encoding API is exposed. It
should help you encode URLs minimally and in a way that many services accept. In
most cases you should use `HttpPercentEncodePath()`,
`HttpPercentEncodeQueryKey()`, and `HttpPercentEncodeQueryValue()` to encode
those parts of your http URL, then combine them and pass them to liboauthcpp for
signing.
Thread Safety
-------------
liboauthcpp doesn't provide any thread safety guarantees. That said, there is
very little shared state, and some classes (e.g. Consumer) are naturally
immutable and therefore thread safe. Similarly, nearly the entire library uses
no static/shared state, so as long as you create separate objects for separate
threads, you should be safe.
The one exception is nonces: the Client class needs to generate a nonce for
authorization. To do so, the random number generator needs to be seeded. We do
this with the current time, but fast, repeated use of the Client class from
different threads could result in the same nonce. To avoid requiring an entire
thread library just for this one case, you can call Client::initialize()
explicitly before using the Client from multiple threads. For single-threaded
use, you are not required to call it.
Demos
-----
There are two demos included in the demos/ directory, and they are built by
default with the instructions above. In both, you enter key/secret information
and it generates URLs for you to visit (in a browser) and copy data back into
the program.
simple_auth should be executed first. It starts with only a consumer key and
secret and performs 3-legged auth: you enter in consumer keys, it generates URLs
to authenticate the user and generate access tokens. It requires 3 steps:
request_token, authorize, and access_token (which correspond the URLs
accessed). At the end of this process, you'll be provided an access key/secret
pair which you can use to access actual resources.
simple_request actually does something useful now that your application is
authorized. Enter your consumer key/secret and the access key/secret from
simple_auth (or which you've generated elsewhere) and it will generate a URL you
can use to access your home timeline in JSON format. It adds a parameter to ask
for only 5 entries (demonstrating that signing works properly over additional
query parameters). This is a one-step process -- it just gives you the URL and
you get the results in your browser.
In both, the URLs accessed are specified at the top of the demo
files. simple_auth requires URLs for request_token, authorize_url, and
access_token. Some providers require additional parameters (notably an
oauth_callback for Twitter, even if its out of band, or oob), which you can also
specify in that location. simple_request only needs the URL of the resource
being accessed (i.e. the URL for the home_timeline JSON data used by default in
the demo), with optional parameters stored as a query string.
Both demos only use GET requests with query strings, but all HTTP methods
(e.g. POST, PUT, DELETE) and approaches to sending parameters (e.g. HTTP
headers, url-encoded body) should be supported in the API.
License
-------
liboauthcpp is MIT licensed. See the LICENSE file for more details.
liboauthcpp is mostly taken from libtwitcurl
(http://code.google.com/p/twitcurl/), which is similarly licensed. It
mostly serves to isolate the OAuth code from libtwitcurl's Twitter and
cURL specific code.
libtwitcurl also borrowed code from other projects:
twitcurl uses HMAC_SHA1 from http://www.codeproject.com/KB/recipes/HMACSHA1class.aspx
twitcurl uses base64 from http://www.adp-gmbh.ch/cpp/common/base64.html

View file

@ -0,0 +1,286 @@
#ifndef __LIBOAUTHCPP_LIBOAUTHCPP_H__
#define __LIBOAUTHCPP_LIBOAUTHCPP_H__
#include <string>
#include <list>
#include <map>
#include <stdexcept>
#include <ctime>
namespace OAuth {
namespace Http {
typedef enum _RequestType
{
Invalid = 0,
Head,
Get,
Post,
Delete,
Put
} RequestType;
} // namespace Http
typedef std::list<std::string> KeyValueList;
typedef std::multimap<std::string, std::string> KeyValuePairs;
typedef enum _LogLevel
{
LogLevelNone = 0,
LogLevelDebug = 1
} LogLevel;
/** Set the log level. Log messages are sent to stderr. Currently, and for the
* foreseeable future, logging only consists of debug messages to help track
* down protocol implementation issues.
*/
void SetLogLevel(LogLevel lvl);
/** Deprecated. Complete percent encoding of URLs. Equivalent to
* PercentEncode.
*/
std::string URLEncode(const std::string& decoded);
/** Percent encode a string value. This version is *thorough* about
* encoding: it encodes all reserved characters (even those safe in
* http URLs) and "other" characters not specified by the URI
* spec. If you're looking to encode http:// URLs, see the
* HttpEncode* functions.
*/
std::string PercentEncode(const std::string& decoded);
/** Percent encodes the path portion of an http URL (i.e. the /foo/bar
* in http://foo/bar?a=1&b=2). This encodes minimally, so reserved
* subdelimiters that have no meaning in the path are *not* encoded.
*/
std::string HttpEncodePath(const std::string& decoded);
/** Percent encodes a query string key in an http URL (i.e. 'a', 'b' in
* http://foo/bar?a=1&b=2). This encodes minimally, so reserved subdelimiters
* that have no meaning in the query string are *not* encoded.
*/
std::string HttpEncodeQueryKey(const std::string& decoded);
/** Percent encodes a query string value in an http URL (i.e. '1', '2' in
* http://foo/bar?a=1&b=2). This encodes minimally, so reserved subdelimiters
* that have no meaning in the query string are *not* encoded.
*/
std::string HttpEncodeQueryValue(const std::string& decoded);
/** Parses key value pairs into a map.
* \param encoded the encoded key value pairs, i.e. the url encoded parameters
* \returns a map of string keys to string values
* \throws ParseError if the encoded data cannot be decoded
*/
KeyValuePairs ParseKeyValuePairs(const std::string& encoded);
class ParseError : public std::runtime_error {
public:
ParseError(const std::string msg)
: std::runtime_error(msg)
{}
};
class MissingKeyError : public std::runtime_error {
public:
MissingKeyError(const std::string msg)
: std::runtime_error(msg)
{}
};
/** A consumer of OAuth-protected services. It is the client to an
* OAuth service provider and is usually registered with the service
* provider, resulting in a consumer *key* and *secret* used to
* identify the consumer. The key is included in all requests and the
* secret is used to *sign* all requests. Signed requests allow the
* consumer to securely perform operations, including kicking off
* three-legged authentication to enable performing operations on
* behalf of a user of the service provider.
*/
class Consumer {
public:
Consumer(const std::string& key, const std::string& secret);
const std::string& key() const { return mKey; }
const std::string& secret() const { return mSecret; }
private:
const std::string mKey;
const std::string mSecret;
};
/** An OAuth credential used to request authorization or a protected
* resource.
*
* Tokens in OAuth comprise a *key* and a *secret*. The key is
* included in requests to identify the token being used, but the
* secret is used only in the signature, to prove that the requester
* is who the server gave the token to.
*
* When first negotiating the authorization, the consumer asks for a
* *request token* that the live user authorizes with the service
* provider. The consumer then exchanges the request token for an
* *access token* that can be used to access protected resources.
*/
class Token {
public:
Token(const std::string& key, const std::string& secret);
Token(const std::string& key, const std::string& secret, const std::string& pin);
/** Construct a token, extracting the key and secret from a set of
* key-value pairs (e.g. those parsed from an request or access
* token request).
*/
static Token extract(const KeyValuePairs& response);
/** Construct a token, extracting the key and secret from a raw,
* encoded response.
*/
static Token extract(const std::string& requestTokenResponse);
const std::string& key() const { return mKey; }
const std::string& secret() const { return mSecret; }
const std::string& pin() const { return mPin; }
void setPin(const std::string& pin_) { mPin = pin_; }
private:
const std::string mKey;
const std::string mSecret;
std::string mPin;
};
class Client {
public:
/** Perform static initialization. This will be called automatically, but
* you can call it explicitly to ensure thread safety. If you do not call
* this explicitly before using the Client class, the same nonce may be
* generated twice.
*/
static void initialize();
/** Alternative initialize method which lets you specify the seed and
* control the timestamp used in generating signatures. This only exists
* for testing purposes and should not be used in practice.
*/
static void initialize(int nonce, time_t timestamp);
/** Exposed for testing only.
*/
static void __resetInitialize();
/** Construct an OAuth Client using only a consumer key and
* secret. You can use this to start a three-legged
* authentication (to acquire an access token for a user) or for
* simple two-legged authentication (signing with empty access
* token info).
*
* \param consumer Consumer information. The caller must ensure
* it remains valid during the lifetime of this object
*/
Client(const Consumer* consumer);
/** Construct an OAuth Client with consumer key and secret (yours)
* and access token key and secret (acquired and stored during
* three-legged authentication).
*
* \param consumer Consumer information. The caller must ensure
* it remains valid during the lifetime of this object
* \param token Access token information. The caller must ensure
* it remains valid during the lifetime of this object
*/
Client(const Consumer* consumer, const Token* token);
~Client();
/** Build an OAuth HTTP header for the given request. This version provides
* only the field value.
*
* \param eType the HTTP request type, e.g. GET or POST
* \param rawUrl the raw request URL (should include query parameters)
* \param rawData the raw HTTP request data (can be empty)
* \param includeOAuthVerifierPin if true, adds oauth_verifier parameter
* \returns a string containing the HTTP header
*/
std::string getHttpHeader(const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData = "",
const bool includeOAuthVerifierPin = false);
/** Build an OAuth HTTP header for the given request. This version gives a
* fully formatted header, i.e. including the header field name.
*
* \param eType the HTTP request type, e.g. GET or POST
* \param rawUrl the raw request URL (should include query parameters)
* \param rawData the raw HTTP request data (can be empty)
* \param includeOAuthVerifierPin if true, adds oauth_verifier parameter
* \returns a string containing the HTTP header
*/
std::string getFormattedHttpHeader(const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData = "",
const bool includeOAuthVerifierPin = false);
/** Build an OAuth HTTP header for the given request.
*
* \param eType the HTTP request type, e.g. GET or POST
* \param rawUrl the raw request URL (should include query parameters)
* \param rawData the raw HTTP request data (can be empty)
* \param includeOAuthVerifierPin if true, adds oauth_verifier parameter
* \returns a string containing the query string, including the query
* parameters in the rawUrl
*/
std::string getURLQueryString(const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData = "",
const bool includeOAuthVerifierPin = false);
private:
/** Disable default constructur -- must provide consumer
* information.
*/
Client();
static bool initialized;
static int testingNonce;
static time_t testingTimestamp;
/* OAuth data */
const Consumer* mConsumer;
const Token* mToken;
std::string m_nonce;
std::string m_timeStamp;
/* OAuth related utility methods */
bool buildOAuthTokenKeyValuePairs( const bool includeOAuthVerifierPin, /* in */
const std::string& rawData, /* in */
const std::string& oauthSignature, /* in */
KeyValuePairs& keyValueMap /* out */,
const bool urlEncodeValues /* in */,
const bool generateTimestamp /* in */);
bool getStringFromOAuthKeyValuePairs( const KeyValuePairs& rawParamMap, /* in */
std::string& rawParams, /* out */
const std::string& paramsSeperator /* in */ );
typedef enum _ParameterStringType {
QueryStringString,
AuthorizationHeaderString
} ParameterStringType;
// Utility for building OAuth HTTP header or query string. The string type
// controls the separator and also filters parameters: for query strings,
// all parameters are included. For HTTP headers, only auth parameters are
// included.
std::string buildOAuthParameterString(
ParameterStringType string_type,
const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData,
const bool includeOAuthVerifierPin);
bool getSignature( const Http::RequestType eType, /* in */
const std::string& rawUrl, /* in */
const KeyValuePairs& rawKeyValuePairs, /* in */
std::string& oAuthSignature /* out */ );
void generateNonceTimeStamp();
};
} // namespace OAuth
#endif // __LIBOAUTHCPP_LIBOAUTHCPP_H__

View file

@ -0,0 +1,59 @@
//******************************************************************************
//* HMAC_SHA1.cpp : Implementation of HMAC SHA1 algorithm
//* Comfort to RFC 2104
//*
//******************************************************************************
#include "HMAC_SHA1.h"
#include <iostream>
#include <memory>
void CHMAC_SHA1::HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest)
{
memset(SHA1_Key, 0, SHA1_BLOCK_SIZE);
/* repeated 64 times for values in ipad and opad */
memset(m_ipad, 0x36, sizeof(m_ipad));
memset(m_opad, 0x5c, sizeof(m_opad));
/* STEP 1 */
if (key_len > SHA1_BLOCK_SIZE)
{
CSHA1::Reset();
CSHA1::Update((UINT_8 *)key, key_len);
CSHA1::Final();
CSHA1::GetHash((UINT_8 *)SHA1_Key);
}
else
memcpy(SHA1_Key, key, key_len);
/* STEP 2 */
for (int i=0; i<(int)sizeof(m_ipad); i++)
{
m_ipad[i] ^= SHA1_Key[i];
}
/* STEP 4 */
CSHA1::Reset();
CSHA1::Update((UINT_8 *)m_ipad, sizeof(m_ipad));
CSHA1::Update((UINT_8 *)text, text_len);
CSHA1::Final();
char szReport[SHA1_DIGEST_LENGTH];
CSHA1::GetHash((UINT_8 *)szReport);
/* STEP 5 */
for (int j=0; j<(int)sizeof(m_opad); j++)
{
m_opad[j] ^= SHA1_Key[j];
}
/*STEP 7 */
CSHA1::Reset();
CSHA1::Update((UINT_8 *)m_opad, sizeof(m_opad));
CSHA1::Update((UINT_8 *)szReport, SHA1_DIGEST_LENGTH);
CSHA1::Final();
CSHA1::GetHash((UINT_8 *)digest);
}

View file

@ -0,0 +1,37 @@
/*
100% free public domain implementation of the HMAC-SHA1 algorithm
by Chien-Chung, Chung (Jim Chung) <jimchung1221@gmail.com>
*/
#ifndef __HMAC_SHA1_H__
#define __HMAC_SHA1_H__
#include "SHA1.h"
typedef unsigned char BYTE ;
class CHMAC_SHA1 : public CSHA1
{
public:
enum {
SHA1_DIGEST_LENGTH = 20,
SHA1_BLOCK_SIZE = 64
} ;
private:
BYTE m_ipad[SHA1_BLOCK_SIZE];
BYTE m_opad[SHA1_BLOCK_SIZE];
// This holds one SHA1 block's worth of data, zero padded if necessary.
char SHA1_Key[SHA1_BLOCK_SIZE];
public:
CHMAC_SHA1() {}
void HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest);
};
#endif /* __HMAC_SHA1_H__ */

View file

@ -0,0 +1,277 @@
/*
100% free public domain implementation of the SHA-1 algorithm
by Dominik Reichl <dominik.reichl@t-online.de>
Web: http://www.dominik-reichl.de/
Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches)
- You can set the endianness in your files, no need to modify the
header file of the CSHA1 class any more
- Aligned data support
- Made support/compilation of the utility functions (ReportHash
and HashFile) optional (useful, if bytes count, for example in
embedded environments)
Version 1.5 - 2005-01-01
- 64-bit compiler compatibility added
- Made variable wiping optional (define SHA1_WIPE_VARIABLES)
- Removed unnecessary variable initializations
- ROL32 improvement for the Microsoft compiler (using _rotl)
======== Test Vectors (from FIPS PUB 180-1) ========
SHA1("abc") =
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") =
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
SHA1(A million repetitions of "a") =
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
#include "SHA1.h"
#include <cassert>
#ifdef SHA1_UTILITY_FUNCTIONS
#define SHA1_MAX_FILE_BUFFER 8000
#endif
// Rotate x bits to the left
#ifndef ROL32
#ifdef _MSC_VER
#define ROL32(_val32, _nBits) _rotl(_val32, _nBits)
#else
#define ROL32(_val32, _nBits) (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits))))
#endif
#endif
#ifdef SHA1_LITTLE_ENDIAN
#define SHABLK0(i) (m_block->l[i] = \
(ROL32(m_block->l[i],24) & 0xFF00FF00) | (ROL32(m_block->l[i],8) & 0x00FF00FF))
#else
#define SHABLK0(i) (m_block->l[i])
#endif
#define SHABLK(i) (m_block->l[i&15] = ROL32(m_block->l[(i+13)&15] ^ m_block->l[(i+8)&15] \
^ m_block->l[(i+2)&15] ^ m_block->l[i&15],1))
// SHA-1 rounds
#define _R0(v,w,x,y,z,i) { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
#define _R1(v,w,x,y,z,i) { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
#define _R2(v,w,x,y,z,i) { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }
#define _R3(v,w,x,y,z,i) { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }
#define _R4(v,w,x,y,z,i) { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }
CSHA1::CSHA1()
{
m_block = (SHA1_WORKSPACE_BLOCK *)m_workspace;
Reset();
}
CSHA1::~CSHA1()
{
Reset();
}
void CSHA1::Reset()
{
// SHA1 initialization constants
m_state[0] = 0x67452301;
m_state[1] = 0xEFCDAB89;
m_state[2] = 0x98BADCFE;
m_state[3] = 0x10325476;
m_state[4] = 0xC3D2E1F0;
m_count[0] = 0;
m_count[1] = 0;
}
void CSHA1::Transform(UINT_32 *state, UINT_8 *buffer)
{
// Copy state[] to working vars
UINT_32 a = state[0], b = state[1], c = state[2], d = state[3], e = state[4];
memcpy(m_block, buffer, 64);
// 4 rounds of 20 operations each. Loop unrolled.
_R0(a,b,c,d,e, 0); _R0(e,a,b,c,d, 1); _R0(d,e,a,b,c, 2); _R0(c,d,e,a,b, 3);
_R0(b,c,d,e,a, 4); _R0(a,b,c,d,e, 5); _R0(e,a,b,c,d, 6); _R0(d,e,a,b,c, 7);
_R0(c,d,e,a,b, 8); _R0(b,c,d,e,a, 9); _R0(a,b,c,d,e,10); _R0(e,a,b,c,d,11);
_R0(d,e,a,b,c,12); _R0(c,d,e,a,b,13); _R0(b,c,d,e,a,14); _R0(a,b,c,d,e,15);
_R1(e,a,b,c,d,16); _R1(d,e,a,b,c,17); _R1(c,d,e,a,b,18); _R1(b,c,d,e,a,19);
_R2(a,b,c,d,e,20); _R2(e,a,b,c,d,21); _R2(d,e,a,b,c,22); _R2(c,d,e,a,b,23);
_R2(b,c,d,e,a,24); _R2(a,b,c,d,e,25); _R2(e,a,b,c,d,26); _R2(d,e,a,b,c,27);
_R2(c,d,e,a,b,28); _R2(b,c,d,e,a,29); _R2(a,b,c,d,e,30); _R2(e,a,b,c,d,31);
_R2(d,e,a,b,c,32); _R2(c,d,e,a,b,33); _R2(b,c,d,e,a,34); _R2(a,b,c,d,e,35);
_R2(e,a,b,c,d,36); _R2(d,e,a,b,c,37); _R2(c,d,e,a,b,38); _R2(b,c,d,e,a,39);
_R3(a,b,c,d,e,40); _R3(e,a,b,c,d,41); _R3(d,e,a,b,c,42); _R3(c,d,e,a,b,43);
_R3(b,c,d,e,a,44); _R3(a,b,c,d,e,45); _R3(e,a,b,c,d,46); _R3(d,e,a,b,c,47);
_R3(c,d,e,a,b,48); _R3(b,c,d,e,a,49); _R3(a,b,c,d,e,50); _R3(e,a,b,c,d,51);
_R3(d,e,a,b,c,52); _R3(c,d,e,a,b,53); _R3(b,c,d,e,a,54); _R3(a,b,c,d,e,55);
_R3(e,a,b,c,d,56); _R3(d,e,a,b,c,57); _R3(c,d,e,a,b,58); _R3(b,c,d,e,a,59);
_R4(a,b,c,d,e,60); _R4(e,a,b,c,d,61); _R4(d,e,a,b,c,62); _R4(c,d,e,a,b,63);
_R4(b,c,d,e,a,64); _R4(a,b,c,d,e,65); _R4(e,a,b,c,d,66); _R4(d,e,a,b,c,67);
_R4(c,d,e,a,b,68); _R4(b,c,d,e,a,69); _R4(a,b,c,d,e,70); _R4(e,a,b,c,d,71);
_R4(d,e,a,b,c,72); _R4(c,d,e,a,b,73); _R4(b,c,d,e,a,74); _R4(a,b,c,d,e,75);
_R4(e,a,b,c,d,76); _R4(d,e,a,b,c,77); _R4(c,d,e,a,b,78); _R4(b,c,d,e,a,79);
// Add the working vars back into state
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
state[4] += e;
// Wipe variables
#ifdef SHA1_WIPE_VARIABLES
a = b = c = d = e = 0;
#endif
}
// Use this function to hash in binary data and strings
void CSHA1::Update(UINT_8 *data, UINT_32 len)
{
UINT_32 i, j;
j = (m_count[0] >> 3) & 63;
if((m_count[0] += len << 3) < (len << 3)) m_count[1]++;
m_count[1] += (len >> 29);
if((j + len) > 63)
{
i = 64 - j;
memcpy(&m_buffer[j], data, i);
Transform(m_state, m_buffer);
for(; i + 63 < len; i += 64) Transform(m_state, &data[i]);
j = 0;
}
else i = 0;
memcpy(&m_buffer[j], &data[i], len - i);
}
#ifdef SHA1_UTILITY_FUNCTIONS
// Hash in file contents
bool CSHA1::HashFile(char *szFileName)
{
unsigned long ulFileSize, ulRest, ulBlocks;
unsigned long i;
UINT_8 uData[SHA1_MAX_FILE_BUFFER];
FILE *fIn;
if(szFileName == NULL) return false;
fIn = fopen(szFileName, "rb");
if(fIn == NULL) return false;
fseek(fIn, 0, SEEK_END);
ulFileSize = (unsigned long)ftell(fIn);
fseek(fIn, 0, SEEK_SET);
if(ulFileSize != 0)
{
ulBlocks = ulFileSize / SHA1_MAX_FILE_BUFFER;
ulRest = ulFileSize % SHA1_MAX_FILE_BUFFER;
}
else
{
ulBlocks = 0;
ulRest = 0;
}
for(i = 0; i < ulBlocks; i++)
{
size_t nread = fread(uData, 1, SHA1_MAX_FILE_BUFFER, fIn);
assert(nread == SHA1_MAX_FILE_BUFFER);
Update((UINT_8 *)uData, SHA1_MAX_FILE_BUFFER);
}
if(ulRest != 0)
{
size_t nread = fread(uData, 1, ulRest, fIn);
assert(nread == ulRest);
Update((UINT_8 *)uData, ulRest);
}
fclose(fIn); fIn = NULL;
return true;
}
#endif
void CSHA1::Final()
{
UINT_32 i;
UINT_8 finalcount[8];
for(i = 0; i < 8; i++)
finalcount[i] = (UINT_8)((m_count[((i >= 4) ? 0 : 1)]
>> ((3 - (i & 3)) * 8) ) & 255); // Endian independent
Update((UINT_8 *)"\200", 1);
while ((m_count[0] & 504) != 448)
Update((UINT_8 *)"\0", 1);
Update(finalcount, 8); // Cause a SHA1Transform()
for(i = 0; i < 20; i++)
{
m_digest[i] = (UINT_8)((m_state[i >> 2] >> ((3 - (i & 3)) * 8) ) & 255);
}
// Wipe variables for security reasons
#ifdef SHA1_WIPE_VARIABLES
i = 0;
memset(m_buffer, 0, 64);
memset(m_state, 0, 20);
memset(m_count, 0, 8);
memset(finalcount, 0, 8);
Transform(m_state, m_buffer);
#endif
}
#ifdef SHA1_UTILITY_FUNCTIONS
// Get the final hash as a pre-formatted string
void CSHA1::ReportHash(char *szReport, unsigned char uReportType)
{
unsigned char i;
char szTemp[16];
if(szReport == NULL) return;
if(uReportType == REPORT_HEX)
{
snprintf(szTemp, sizeof(szTemp), "%02X", m_digest[0]);
strcat(szReport, szTemp);
for(i = 1; i < 20; i++)
{
snprintf(szTemp, sizeof(szTemp), " %02X", m_digest[i]);
strcat(szReport, szTemp);
}
}
else if(uReportType == REPORT_DIGIT)
{
snprintf(szTemp, sizeof(szTemp), "%u", m_digest[0]);
strcat(szReport, szTemp);
for(i = 1; i < 20; i++)
{
snprintf(szTemp, sizeof(szTemp), " %u", m_digest[i]);
strcat(szReport, szTemp);
}
}
else strcpy(szReport, "Error: Unknown report type!");
}
#endif
// Get the raw message digest
void CSHA1::GetHash(UINT_8 *puDest)
{
memcpy(puDest, m_digest, 20);
}

View file

@ -0,0 +1,148 @@
/*
100% free public domain implementation of the SHA-1 algorithm
by Dominik Reichl <dominik.reichl@t-online.de>
Web: http://www.dominik-reichl.de/
Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches)
- You can set the endianness in your files, no need to modify the
header file of the CSHA1 class any more
- Aligned data support
- Made support/compilation of the utility functions (ReportHash
and HashFile) optional (useful, if bytes count, for example in
embedded environments)
Version 1.5 - 2005-01-01
- 64-bit compiler compatibility added
- Made variable wiping optional (define SHA1_WIPE_VARIABLES)
- Removed unnecessary variable initializations
- ROL32 improvement for the Microsoft compiler (using _rotl)
======== Test Vectors (from FIPS PUB 180-1) ========
SHA1("abc") =
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") =
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
SHA1(A million repetitions of "a") =
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
#ifndef ___SHA1_HDR___
#define ___SHA1_HDR___
#if !defined(SHA1_UTILITY_FUNCTIONS) && !defined(SHA1_NO_UTILITY_FUNCTIONS)
#define SHA1_UTILITY_FUNCTIONS
#endif
#include <memory.h> // Needed for memset and memcpy
#ifdef SHA1_UTILITY_FUNCTIONS
#include <stdio.h> // Needed for file access and sprintf
#include <string.h> // Needed for strcat and strcpy
#endif
#ifdef _MSC_VER
#include <stdlib.h>
#endif
// You can define the endian mode in your files, without modifying the SHA1
// source files. Just #define SHA1_LITTLE_ENDIAN or #define SHA1_BIG_ENDIAN
// in your files, before including the SHA1.h header file. If you don't
// define anything, the class defaults to little endian.
#if !defined(SHA1_LITTLE_ENDIAN) && !defined(SHA1_BIG_ENDIAN)
#define SHA1_LITTLE_ENDIAN
#endif
// Same here. If you want variable wiping, #define SHA1_WIPE_VARIABLES, if
// not, #define SHA1_NO_WIPE_VARIABLES. If you don't define anything, it
// defaults to wiping.
#if !defined(SHA1_WIPE_VARIABLES) && !defined(SHA1_NO_WIPE_VARIABLES)
#define SHA1_WIPE_VARIABLES
#endif
/////////////////////////////////////////////////////////////////////////////
// Define 8- and 32-bit variables
#ifndef UINT_32
#ifdef _MSC_VER
#define UINT_8 unsigned __int8
#define UINT_32 unsigned __int32
#else
#define UINT_8 unsigned char
#if (ULONG_MAX == 0xFFFFFFFF && UINT_MAX < ULONG_MAX)
#define UINT_32 unsigned long
#else
#define UINT_32 unsigned int
#endif
#endif
#endif
/////////////////////////////////////////////////////////////////////////////
// Declare SHA1 workspace
typedef union
{
UINT_8 c[64];
UINT_32 l[16];
} SHA1_WORKSPACE_BLOCK;
class CSHA1
{
public:
#ifdef SHA1_UTILITY_FUNCTIONS
// Two different formats for ReportHash(...)
enum
{
REPORT_HEX = 0,
REPORT_DIGIT = 1
};
#endif
// Constructor and Destructor
CSHA1();
~CSHA1();
UINT_32 m_state[5];
UINT_32 m_count[2];
UINT_32 __reserved1[1];
UINT_8 m_buffer[64];
UINT_8 m_digest[20];
UINT_32 __reserved2[3];
void Reset();
// Update the hash value
void Update(UINT_8 *data, UINT_32 len);
#ifdef SHA1_UTILITY_FUNCTIONS
bool HashFile(char *szFileName);
#endif
// Finalize hash and report
void Final();
// Report functions: as pre-formatted and raw data
#ifdef SHA1_UTILITY_FUNCTIONS
void ReportHash(char *szReport, unsigned char uReportType = REPORT_HEX);
#endif
void GetHash(UINT_8 *puDest);
private:
// Private SHA-1 transformation
void Transform(UINT_32 *state, UINT_8 *buffer);
// Member variables
UINT_8 m_workspace[64];
SHA1_WORKSPACE_BLOCK *m_block; // SHA1 pointer to the byte array above
};
#endif

View file

@ -0,0 +1,123 @@
/*
base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include "base64.h"
#include <iostream>
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
static inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == '+') || (c == '/'));
}
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
std::string ret;
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];
while (in_len--) {
char_array_3[i++] = *(bytes_to_encode++);
if (i == 3) {
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for(i = 0; (i <4) ; i++)
ret += base64_chars[char_array_4[i]];
i = 0;
}
}
if (i)
{
for(j = i; j < 3; j++)
char_array_3[j] = '\0';
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (j = 0; (j < i + 1); j++)
ret += base64_chars[char_array_4[j]];
while((i++ < 3))
ret += '=';
}
return ret;
}
std::string base64_decode(std::string const& encoded_string) {
int in_len = encoded_string.size();
int i = 0;
int j = 0;
int in_ = 0;
unsigned char char_array_4[4], char_array_3[3];
std::string ret;
while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
char_array_4[i++] = encoded_string[in_]; in_++;
if (i ==4) {
for (i = 0; i <4; i++)
char_array_4[i] = base64_chars.find(char_array_4[i]);
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
for (i = 0; (i < 3); i++)
ret += char_array_3[i];
i = 0;
}
}
if (i) {
for (j = i; j <4; j++)
char_array_4[j] = 0;
for (j = 0; j <4; j++)
char_array_4[j] = base64_chars.find(char_array_4[j]);
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
}
return ret;
}

View file

@ -0,0 +1,4 @@
#include <string>
std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s);

View file

@ -0,0 +1,621 @@
#include <liboauthcpp/liboauthcpp.h>
#include "HMAC_SHA1.h"
#include "base64.h"
#include "urlencode.h"
#include <cstdlib>
#include <vector>
#include <cassert>
namespace OAuth {
namespace Defaults
{
/* Constants */
const int BUFFSIZE = 1024;
const int BUFFSIZE_LARGE = 1024;
const std::string CONSUMERKEY_KEY = "oauth_consumer_key";
const std::string CALLBACK_KEY = "oauth_callback";
const std::string VERSION_KEY = "oauth_version";
const std::string SIGNATUREMETHOD_KEY = "oauth_signature_method";
const std::string SIGNATURE_KEY = "oauth_signature";
const std::string TIMESTAMP_KEY = "oauth_timestamp";
const std::string NONCE_KEY = "oauth_nonce";
const std::string TOKEN_KEY = "oauth_token";
const std::string TOKENSECRET_KEY = "oauth_token_secret";
const std::string VERIFIER_KEY = "oauth_verifier";
const std::string AUTHHEADER_FIELD = "Authorization: ";
const std::string AUTHHEADER_PREFIX = "OAuth ";
};
/** std::string -> std::string conversion function */
typedef std::string(*StringConvertFunction)(const std::string&);
LogLevel gLogLevel = LogLevelNone;
void SetLogLevel(LogLevel lvl) {
gLogLevel = lvl;
}
#define LOG(lvl, msg) \
do { \
if (lvl <= gLogLevel) std::cerr << "OAUTH: " << msg << std::endl; \
} while(0)
std::string PercentEncode(const std::string& decoded) {
return urlencode(decoded, URLEncode_Everything);
}
std::string URLEncode(const std::string& decoded) {
return PercentEncode(decoded);
}
std::string HttpEncodePath(const std::string& decoded) {
return urlencode(decoded, URLEncode_Path);
}
std::string HttpEncodeQueryKey(const std::string& decoded) {
return urlencode(decoded, URLEncode_QueryKey);
}
std::string HttpEncodeQueryValue(const std::string& decoded) {
return urlencode(decoded, URLEncode_QueryValue);
}
namespace {
std::string PassThrough(const std::string& decoded) {
return decoded;
}
std::string RequestTypeString(const Http::RequestType rt) {
switch(rt) {
case Http::Invalid: return "Invalid Request Type"; break;
case Http::Head: return "HEAD"; break;
case Http::Get: return "GET"; break;
case Http::Post: return "POST"; break;
case Http::Delete: return "DELETE"; break;
case Http::Put: return "PUT"; break;
default: return "Unknown Request Type"; break;
}
return "";
}
}
// Parse a single key-value pair
static std::pair<std::string, std::string> ParseKeyValuePair(const std::string& encoded) {
std::size_t eq_pos = encoded.find("=");
if (eq_pos == std::string::npos)
throw ParseError("Failed to find '=' in key-value pair.");
return std::pair<std::string, std::string>(
encoded.substr(0, eq_pos),
encoded.substr(eq_pos+1)
);
}
KeyValuePairs ParseKeyValuePairs(const std::string& encoded) {
KeyValuePairs result;
if (encoded.length() == 0) return result;
// Split by &
std::size_t last_amp = 0;
// We can bail when the last one "found" was the end of the string
while(true) {
std::size_t next_amp = encoded.find('&', last_amp+1);
std::string keyval =
(next_amp == std::string::npos) ?
encoded.substr(last_amp) :
encoded.substr(last_amp, next_amp-last_amp);
result.insert(ParseKeyValuePair(keyval));
// Track spot after the & so the first iteration works without dealing
// with -1 index
last_amp = next_amp+1;
// Exit condition
if (next_amp == std::string::npos) break;
}
return result;
}
// Helper for parameters in key-value pair lists that should only appear
// once. Either replaces an existing entry or adds a new entry.
static void ReplaceOrInsertKeyValuePair(KeyValuePairs& kvp, const std::string& key, const std::string& value) {
assert(kvp.count(key) <= 1);
KeyValuePairs::iterator it = kvp.find(key);
if (it != kvp.end())
it->second = value;
else
kvp.insert(KeyValuePairs::value_type(key, value));
}
Consumer::Consumer(const std::string& key, const std::string& secret)
: mKey(key), mSecret(secret)
{
}
Token::Token(const std::string& key, const std::string& secret)
: mKey(key), mSecret(secret)
{
}
Token::Token(const std::string& key, const std::string& secret, const std::string& pin)
: mKey(key), mSecret(secret), mPin(pin)
{
}
Token Token::extract(const std::string& response) {
return Token::extract(ParseKeyValuePairs(response));
}
Token Token::extract(const KeyValuePairs& response) {
std::string token_key, token_secret;
KeyValuePairs::const_iterator it = response.find(Defaults::TOKEN_KEY);
if (it == response.end())
throw MissingKeyError("Couldn't find oauth_token in response");
token_key = it->second;
it = response.find(Defaults::TOKENSECRET_KEY);
if (it == response.end())
throw MissingKeyError("Couldn't find oauth_token_secret in response");
token_secret = it->second;
return Token(token_key, token_secret);
}
bool Client::initialized = false;
int Client::testingNonce = 0;
time_t Client::testingTimestamp = 0;
void Client::initialize() {
if(!initialized) {
srand( time( NULL ) );
initialized = true;
}
}
void Client::initialize(int nonce, time_t timestamp) {
if(!initialized) {
testingNonce = nonce;
testingTimestamp = timestamp;
initialized = true;
}
}
void Client::__resetInitialize() {
testingNonce = 0;
testingTimestamp = 0;
initialized = false;
}
Client::Client(const Consumer* consumer)
: mConsumer(consumer),
mToken(NULL)
{
}
Client::Client(const Consumer* consumer, const Token* token)
: mConsumer(consumer),
mToken(token)
{
}
Client::~Client()
{
}
/*++
* @method: Client::generateNonceTimeStamp
*
* @description: this method generates nonce and timestamp for OAuth header
*
* @input: none
*
* @output: none
*
* @remarks: internal method
*
*--*/
void Client::generateNonceTimeStamp()
{
// Make sure the random seed has been initialized
Client::initialize();
char szTime[Defaults::BUFFSIZE];
char szRand[Defaults::BUFFSIZE];
memset( szTime, 0, Defaults::BUFFSIZE );
memset( szRand, 0, Defaults::BUFFSIZE );
// Any non-zero timestamp triggers testing mode with fixed values. Fixing
// both values makes life easier because generating a signature is
// idempotent -- otherwise using macros can cause double evaluation and
// incorrect results because of repeated calls to rand().
snprintf( szRand, sizeof(szRand), "%x", ((testingTimestamp != 0) ? testingNonce : rand()) );
snprintf( szTime, sizeof(szTime), "%ld", ((testingTimestamp != 0) ? testingTimestamp : time( NULL )) );
m_nonce.assign( szTime );
m_nonce.append( szRand );
m_timeStamp.assign( szTime );
}
/*++
* @method: Client::buildOAuthTokenKeyValuePairs
*
* @description: this method prepares key-value pairs required for OAuth header
* and signature generation.
*
* @input: includeOAuthVerifierPin - flag to indicate whether oauth_verifer key-value
* pair needs to be included. oauth_verifer is only
* used during exchanging request token with access token.
* rawData - url encoded data. this is used during signature generation.
* oauthSignature - base64 and url encoded OAuth signature.
* generateTimestamp - If true, then generate new timestamp for nonce.
*
* @input: urlEncodeValues - if true, URLEncode the values inserted into the
* output keyValueMap
* @output: keyValueMap - map in which key-value pairs are populated
*
* @remarks: internal method
*
*--*/
bool Client::buildOAuthTokenKeyValuePairs( const bool includeOAuthVerifierPin,
const std::string& rawData,
const std::string& oauthSignature,
KeyValuePairs& keyValueMap,
const bool urlEncodeValues,
const bool generateTimestamp )
{
// Encodes value part of key-value pairs depending on type of output (query
// string vs. HTTP headers.
StringConvertFunction value_encoder = (urlEncodeValues ? HttpEncodeQueryValue : PassThrough);
/* Generate nonce and timestamp if required */
if( generateTimestamp )
{
generateNonceTimeStamp();
}
/* Consumer key and its value */
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::CONSUMERKEY_KEY, value_encoder(mConsumer->key()));
/* Nonce key and its value */
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::NONCE_KEY, value_encoder(m_nonce));
/* Signature if supplied */
if( oauthSignature.length() )
{
// Signature is exempt from encoding. The procedure for
// computing it already percent-encodes it as required by the
// spec for both query string and Auth header
// methods. Therefore, it's pass-through in both cases.
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::SIGNATURE_KEY, oauthSignature);
}
/* Signature method, only HMAC-SHA1 as of now */
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::SIGNATUREMETHOD_KEY, std::string( "HMAC-SHA1" ));
/* Timestamp */
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::TIMESTAMP_KEY, value_encoder(m_timeStamp));
/* Token */
if( mToken && mToken->key().length() )
{
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::TOKEN_KEY, value_encoder(mToken->key()));
}
/* Verifier */
if( includeOAuthVerifierPin && mToken && mToken->pin().length() )
{
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::VERIFIER_KEY, value_encoder(mToken->pin()));
}
/* Version */
ReplaceOrInsertKeyValuePair(keyValueMap, Defaults::VERSION_KEY, std::string( "1.0" ));
/* Data if it's present */
if( rawData.length() )
{
/* Data should already be urlencoded once */
std::string dummyStrKey;
std::string dummyStrValue;
size_t nPos = rawData.find_first_of( "=" );
if( std::string::npos != nPos )
{
dummyStrKey = rawData.substr( 0, nPos );
dummyStrValue = rawData.substr( nPos + 1 );
ReplaceOrInsertKeyValuePair(keyValueMap, dummyStrKey, dummyStrValue);
}
}
return ( keyValueMap.size() ) ? true : false;
}
/*++
* @method: Client::getSignature
*
* @description: this method calculates HMAC-SHA1 signature of OAuth header
*
* @input: eType - HTTP request type
* rawUrl - raw url of the HTTP request
* rawKeyValuePairs - key-value pairs containing OAuth headers and HTTP data
*
* @output: oAuthSignature - base64 and url encoded signature
*
* @remarks: internal method
*
*--*/
bool Client::getSignature( const Http::RequestType eType,
const std::string& rawUrl,
const KeyValuePairs& rawKeyValuePairs,
std::string& oAuthSignature )
{
std::string rawParams;
std::string paramsSeperator;
std::string sigBase;
/* Initially empty signature */
oAuthSignature.assign( "" );
/* Build a string using key-value pairs */
paramsSeperator = "&";
getStringFromOAuthKeyValuePairs( rawKeyValuePairs, rawParams, paramsSeperator );
LOG(LogLevelDebug, "Normalized parameters: " << rawParams);
/* Start constructing base signature string. Refer http://dev.twitter.com/auth#intro */
switch( eType )
{
case Http::Head:
{
sigBase.assign( "HEAD&" );
}
break;
case Http::Get:
{
sigBase.assign( "GET&" );
}
break;
case Http::Post:
{
sigBase.assign( "POST&" );
}
break;
case Http::Delete:
{
sigBase.assign( "DELETE&" );
}
break;
case Http::Put:
{
sigBase.assign( "PUT&" );
}
break;
default:
{
return false;
}
break;
}
sigBase.append( PercentEncode( rawUrl ) );
sigBase.append( "&" );
sigBase.append( PercentEncode( rawParams ) );
LOG(LogLevelDebug, "Signature base string: " << sigBase);
/* Now, hash the signature base string using HMAC_SHA1 class */
CHMAC_SHA1 objHMACSHA1;
std::string secretSigningKey;
unsigned char strDigest[Defaults::BUFFSIZE_LARGE];
memset( strDigest, 0, Defaults::BUFFSIZE_LARGE );
/* Signing key is composed of consumer_secret&token_secret */
secretSigningKey.assign( PercentEncode(mConsumer->secret()) );
secretSigningKey.append( "&" );
if( mToken && mToken->secret().length() )
{
secretSigningKey.append( PercentEncode(mToken->secret()) );
}
objHMACSHA1.HMAC_SHA1( (unsigned char*)sigBase.c_str(),
sigBase.length(),
(unsigned char*)secretSigningKey.c_str(),
secretSigningKey.length(),
strDigest );
/* Do a base64 encode of signature */
std::string base64Str = base64_encode( strDigest, 20 /* SHA 1 digest is 160 bits */ );
LOG(LogLevelDebug, "Signature: " << base64Str);
/* Do an url encode */
oAuthSignature = PercentEncode( base64Str );
LOG(LogLevelDebug, "Percent-encoded Signature: " << oAuthSignature);
return ( oAuthSignature.length() ) ? true : false;
}
std::string Client::getHttpHeader(const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData,
const bool includeOAuthVerifierPin)
{
return Defaults::AUTHHEADER_PREFIX + buildOAuthParameterString(AuthorizationHeaderString, eType, rawUrl, rawData, includeOAuthVerifierPin);
}
std::string Client::getFormattedHttpHeader(const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData,
const bool includeOAuthVerifierPin)
{
return Defaults::AUTHHEADER_FIELD + Defaults::AUTHHEADER_PREFIX + buildOAuthParameterString(AuthorizationHeaderString, eType, rawUrl, rawData, includeOAuthVerifierPin);
}
std::string Client::getURLQueryString(const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData,
const bool includeOAuthVerifierPin)
{
return buildOAuthParameterString(QueryStringString, eType, rawUrl, rawData, includeOAuthVerifierPin);
}
std::string Client::buildOAuthParameterString(
ParameterStringType string_type,
const Http::RequestType eType,
const std::string& rawUrl,
const std::string& rawData,
const bool includeOAuthVerifierPin)
{
KeyValuePairs rawKeyValuePairs;
std::string rawParams;
std::string oauthSignature;
std::string paramsSeperator;
std::string pureUrl( rawUrl );
LOG(LogLevelDebug, "Signing request " << RequestTypeString(eType) << " " << rawUrl << " " << rawData);
std::string separator;
bool do_urlencode;
if (string_type == AuthorizationHeaderString) {
separator = ",";
do_urlencode = false;
}
else { // QueryStringString
separator = "&";
do_urlencode = true;
}
/* Clear header string initially */
rawKeyValuePairs.clear();
/* If URL itself contains ?key=value, then extract and put them in map */
size_t nPos = rawUrl.find_first_of( "?" );
if( std::string::npos != nPos )
{
/* Get only URL */
pureUrl = rawUrl.substr( 0, nPos );
/* Get only key=value data part */
std::string dataPart = rawUrl.substr( nPos + 1 );
rawKeyValuePairs = ParseKeyValuePairs(dataPart);
}
// NOTE: We always request URL encoding on the first pass so that the
// signature generation works properly. This *relies* on
// buildOAuthTokenKeyValuePairs overwriting values when we do the second
// pass to get the values in the form we actually want. The signature and
// rawdata are the only things that change, but the signature is only used
// in the second pass and the rawdata is already encoded, regardless of
// request type.
/* Build key-value pairs needed for OAuth request token, without signature */
buildOAuthTokenKeyValuePairs( includeOAuthVerifierPin, rawData, std::string( "" ), rawKeyValuePairs, true, true );
/* Get url encoded base64 signature using request type, url and parameters */
getSignature( eType, pureUrl, rawKeyValuePairs, oauthSignature );
/* Now, again build key-value pairs with signature this time */
buildOAuthTokenKeyValuePairs( includeOAuthVerifierPin, std::string( "" ), oauthSignature, rawKeyValuePairs, do_urlencode, false );
/* Get OAuth header in string format. If we're getting the Authorization
* header, we need to filter out other parameters.
*/
if (string_type == AuthorizationHeaderString) {
KeyValuePairs oauthKeyValuePairs;
std::vector<std::string> oauth_keys;
oauth_keys.push_back(Defaults::CONSUMERKEY_KEY);
oauth_keys.push_back(Defaults::NONCE_KEY);
oauth_keys.push_back(Defaults::SIGNATURE_KEY);
oauth_keys.push_back(Defaults::SIGNATUREMETHOD_KEY);
oauth_keys.push_back(Defaults::TIMESTAMP_KEY);
oauth_keys.push_back(Defaults::TOKEN_KEY);
oauth_keys.push_back(Defaults::VERIFIER_KEY);
oauth_keys.push_back(Defaults::VERSION_KEY);
for(size_t i = 0; i < oauth_keys.size(); i++) {
assert(rawKeyValuePairs.count(oauth_keys[i]) <= 1);
KeyValuePairs::iterator oauth_key_it = rawKeyValuePairs.find(oauth_keys[i]);
if (oauth_key_it != rawKeyValuePairs.end())
ReplaceOrInsertKeyValuePair(oauthKeyValuePairs, oauth_keys[i], oauth_key_it->second);
}
getStringFromOAuthKeyValuePairs( oauthKeyValuePairs, rawParams, separator );
}
else if (string_type == QueryStringString) {
getStringFromOAuthKeyValuePairs( rawKeyValuePairs, rawParams, separator );
}
/* Build authorization header */
return rawParams;
}
/*++
* @method: Client::getStringFromOAuthKeyValuePairs
*
* @description: this method builds a sorted string from key-value pairs
*
* @input: rawParamMap - key-value pairs map
* paramsSeperator - sepearator, either & or ,
*
* @output: rawParams - sorted string of OAuth parameters
*
* @remarks: internal method
*
*--*/
bool Client::getStringFromOAuthKeyValuePairs( const KeyValuePairs& rawParamMap,
std::string& rawParams,
const std::string& paramsSeperator )
{
rawParams.assign( "" );
if( rawParamMap.size() )
{
KeyValueList keyValueList;
std::string dummyStr;
/* Push key-value pairs to a list of strings */
keyValueList.clear();
KeyValuePairs::const_iterator itMap = rawParamMap.begin();
for( ; itMap != rawParamMap.end(); itMap++ )
{
dummyStr.assign( itMap->first );
dummyStr.append( "=" );
if( paramsSeperator == "," )
{
dummyStr.append( "\"" );
}
dummyStr.append( itMap->second );
if( paramsSeperator == "," )
{
dummyStr.append( "\"" );
}
keyValueList.push_back( dummyStr );
}
/* Sort key-value pairs based on key name */
keyValueList.sort();
/* Now, form a string */
dummyStr.assign( "" );
KeyValueList::iterator itKeyValue = keyValueList.begin();
for( ; itKeyValue != keyValueList.end(); itKeyValue++ )
{
if( dummyStr.length() )
{
dummyStr.append( paramsSeperator );
}
dummyStr.append( itKeyValue->c_str() );
}
rawParams.assign( dummyStr );
}
return ( rawParams.length() ) ? true : false;
}
} // namespace OAuth

View file

@ -0,0 +1,102 @@
#include "urlencode.h"
#include <cassert>
std::string char2hex( char dec )
{
char dig1 = (dec&0xF0)>>4;
char dig2 = (dec&0x0F);
if ( 0<= dig1 && dig1<= 9) dig1+=48; //0,48 in ascii
if (10<= dig1 && dig1<=15) dig1+=65-10; //A,65 in ascii
if ( 0<= dig2 && dig2<= 9) dig2+=48;
if (10<= dig2 && dig2<=15) dig2+=65-10;
std::string r;
r.append( &dig1, 1);
r.append( &dig2, 1);
return r;
}
std::string urlencode( const std::string &c, URLEncodeType enctype)
{
std::string escaped;
int max = c.length();
for(int i=0; i<max; i++)
{
// Unreserved chars
if ( (48 <= c[i] && c[i] <= 57) ||//0-9
(65 <= c[i] && c[i] <= 90) ||//ABC...XYZ
(97 <= c[i] && c[i] <= 122) || //abc...xyz
(c[i]=='~' || c[i]=='-' || c[i]=='_' || c[i]=='.')
)
{
escaped.append( &c[i], 1);
}
else if (c[i] != ':' && c[i] != '/' && c[i] != '?' && c[i] != '#' &&
c[i] != '[' && c[i] != ']' && c[i] != '@' && c[i] != '%' &&
c[i] != '!' && c[i] != '$' && c[i] != '&' && c[i] != '\'' &&
c[i] != '(' && c[i] != ')' && c[i] != '*' && c[i] != '+' &&
c[i] != ',' && c[i] != ';' && c[i] != '=')
{
// Characters not in unreserved (first if block) and not in
// the reserved set are always encoded.
escaped.append("%");
escaped.append( char2hex(c[i]) );//converts char 255 to string "FF"
}
else
{
// Finally, the reserved set. Encoding here depends on the
// context (where in the URI we are, what type of URI, and
// which character).
bool enc = false;
// Always encode reserved gen-delims + '%' (which always
// needs encoding
if (c[i] == ':' || c[i] == '/' || c[i] == '?' || c[i] == '#' ||
c[i] == '[' || c[i] == ']' || c[i] == '@' || c[i] == '%')
{
enc = true;
}
else {
switch (enctype) {
case URLEncode_Everything:
enc = true;
break;
case URLEncode_Path:
// Only reserved sub-delim that needs encoding is %,
// taken care of above. Otherwise, leave unencoded
enc = false;
break;
case URLEncode_QueryKey:
if (c[i] == '&' ||
c[i] == '+' ||
c[i] == '=')
enc = true;
else
enc = false;
break;
case URLEncode_QueryValue:
if (c[i] == '&' ||
c[i] == '+')
enc = true;
else
enc = false;
break;
default:
assert(false && "Unknown urlencode type");
break;
}
}
if (enc) {
escaped.append("%");
escaped.append( char2hex(c[i]) );//converts char 255 to string "FF"
} else {
escaped.append( &c[i], 1);
}
}
}
return escaped;
}

View file

@ -0,0 +1,16 @@
#ifndef __URLENCODE_H__
#define __URLENCODE_H__
#include <iostream>
#include <string>
std::string char2hex( char dec );
enum URLEncodeType {
URLEncode_Everything,
URLEncode_Path,
URLEncode_QueryKey,
URLEncode_QueryValue,
};
std::string urlencode( const std::string &c, URLEncodeType enctype );
#endif // __URLENCODE_H__

View file

@ -22,5 +22,3 @@ target_compile_definitions(${PROJECT_NAME}
)
target_compile_options(${PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang,GNU>:-Wno-unused-value>)
target_link_libraries(${PROJECT_NAME} PUBLIC ZLIB::ZLIB)

View file

@ -4,7 +4,6 @@
#include <algorithm>
#include <cmath>
#include <cstdint>
#include "codearea.h"

View file

@ -32,7 +32,6 @@
#include <iomanip>
#include <ios>
#include <ostream>
#include <sstream>
#include <tuple>
#include <type_traits>
#include <vector>
@ -97,24 +96,26 @@ class StreamFlagsKeeper
std::ios_base::fmtflags m_flags;
};
template <typename TNumber>
constexpr bool IsChar(TNumber) noexcept
{
return std::is_same<signed char, TNumber>::value ||
std::is_same<unsigned char, TNumber>::value ||
std::is_same<char, TNumber>::value;
};
template <typename TNumber, typename std::enable_if<!IsChar(TNumber{}), void*>::type = nullptr>
void PrintPaddedNumber(std::ostream & ost, TNumber const number, uint32_t const padding = 1)
{
static constexpr bool isChar = std::is_same_v<signed char, TNumber> ||
std::is_same_v<unsigned char, TNumber> ||
std::is_same_v<char, TNumber>;
static_assert(std::is_integral<TNumber>::value, "number should be of integral type.");
StreamFlagsKeeper keeper(ost);
ost << std::setw(padding) << std::setfill('0') << number;
}
if constexpr (isChar)
{
PrintPaddedNumber(ost, static_cast<int32_t>(number), padding);
}
else
{
static_assert(std::is_integral<TNumber>::value, "number should be of integral type.");
StreamFlagsKeeper keeper(ost);
ost << std::setw(padding) << std::setfill('0') << number;
}
template <typename TNumber, typename std::enable_if<IsChar(TNumber{}), void*>::type = nullptr>
void PrintPaddedNumber(std::ostream & ost, TNumber const number, uint32_t const padding = 1)
{
PrintPaddedNumber(ost, static_cast<int32_t>(number), padding);
}
void PrintHoursMinutes(std::ostream & ost,

View file

@ -6,7 +6,13 @@ omim_add_test(${PROJECT_NAME} ${SRC} BOOST_TEST)
target_link_libraries(${PROJECT_NAME} opening_hours)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(COPY_CMD cp -u)
else()
set(COPY_CMD rsync -a)
endif()
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/opening-count.lst" "${CMAKE_BINARY_DIR}/"
COMMAND ${COPY_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/opening-count.lst" "${CMAKE_BINARY_DIR}/"
COMMENT "Copying opening-count.lst file for testing"
)

@ -1 +1 @@
Subproject commit 30cc354fe37114ec7a0a4ed2192951690357c2ed
Subproject commit a0e064336317c9347a91224112af9933598714e9

View file

@ -0,0 +1,12 @@
project(sdf_image)
set(SRC
sdf_image.cpp
sdf_image.h
)
add_library(${PROJECT_NAME} ${SRC})
target_compile_options(${PROJECT_NAME}
PRIVATE $<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-shorten-64-to-32>
)

View file

@ -0,0 +1,510 @@
/*
Copyright (C) 2009 by Stefan Gustavson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "3party/sdf_image/sdf_image.h"
#include "base/math.hpp"
#include "base/scope_guard.hpp"
#include <algorithm>
#include <limits>
using namespace std::placeholders;
namespace sdf_image
{
namespace
{
float const SQRT2 = 1.4142136f;
float ComputeXGradient(float ul, float /*u*/, float ur, float l, float r, float dl, float /*d*/, float dr)
{
return (ur + SQRT2 * r + dr) - (ul + SQRT2 * l + dl);
}
float ComputeYGradient(float ul, float u, float ur, float /*l*/, float /*r*/, float dl, float d, float dr)
{
return (ur + SQRT2 * d + dr) - (ul + SQRT2 * u + dl);
}
}
#define BIND_GRADIENT(f) std::bind(&f, _1, _2, _3, _4, _5, _6, _7, _8)
#define TRANSFORM(offset, dx, dy) \
if (Transform(i, offset, dx, dy, xDist, yDist, oldDist)) \
{ \
dist.m_data[i] = oldDist; \
changed = true; \
}
SdfImage::SdfImage(uint32_t h, uint32_t w)
: m_height(h)
, m_width(w)
{
m_data.resize(m_width * m_height, 0);
}
SdfImage::SdfImage(uint32_t h, uint32_t w, uint8_t * imageData, uint8_t border)
{
int8_t doubleBorder = 2 * border;
m_width = w + doubleBorder;
m_height = h + doubleBorder;
uint32_t floatCount = m_width * m_height;
m_data.resize(floatCount, 0.0f);
for (size_t row = border; row < h + border; ++row)
{
size_t dstBaseIndex = row * m_width;
size_t srcBaseIndex = (row - border) * w;
for (size_t column = border; column < w + border; ++column)
m_data[dstBaseIndex + column] = (float)imageData[srcBaseIndex + column - border] / 255.0f;
}
}
SdfImage::SdfImage(SdfImage const & copy)
{
m_height = copy.m_height;
m_width = copy.m_width;
m_data = copy.m_data;
}
uint32_t SdfImage::GetWidth() const
{
return m_width;
}
uint32_t SdfImage::GetHeight() const
{
return m_height;
}
void SdfImage::GetData(std::vector<uint8_t> & dst)
{
ASSERT(m_data.size() <= dst.size(), ());
std::transform(m_data.begin(), m_data.end(), dst.begin(), [](float const & node)
{
return static_cast<uint8_t>(node * 255.0f);
});
}
void SdfImage::Scale()
{
float maxi = std::numeric_limits<float>::min();
float mini = std::numeric_limits<float>::max();
std::for_each(m_data.begin(), m_data.end(), [&maxi, &mini](float const & node)
{
maxi = std::max(maxi, node);
mini = std::min(mini, node);
});
maxi -= mini;
std::for_each(m_data.begin(), m_data.end(), [&maxi, &mini](float & node)
{
node = (node - mini) / maxi;
});
}
void SdfImage::Invert()
{
std::for_each(m_data.begin(), m_data.end(), [](float & node)
{
node = 1.0f - node;
});
}
void SdfImage::Minus(SdfImage & im)
{
ASSERT(m_data.size() == im.m_data.size(), ());
std::transform(m_data.begin(), m_data.end(), im.m_data.begin(), m_data.begin(), [](float const & n1, float const & n2)
{
return n1 - n2;
});
}
void SdfImage::Distquant()
{
std::for_each(m_data.begin(), m_data.end(), [](float & node)
{
node = base::Clamp(0.5f + node * 0.0325f, 0.0f, 1.0f);
});
}
void SdfImage::GenerateSDF(float sc)
{
Scale();
SdfImage outside(m_height, m_width);
SdfImage inside(m_height, m_width);
size_t shortCount = m_width * m_height;
std::vector<short> xDist;
std::vector<short> yDist;
xDist.resize(shortCount, 0);
yDist.resize(shortCount, 0);
MexFunction(*this, xDist, yDist, outside);
fill(xDist.begin(), xDist.end(), 0);
fill(yDist.begin(), yDist.end(), 0);
Invert();
MexFunction(*this, xDist, yDist, inside);
outside.Minus(inside);
outside.Distquant();
outside.Invert();
*this = outside.Bilinear(sc);
}
SdfImage SdfImage::Bilinear(float scale)
{
uint32_t srcWidth = GetWidth();
uint32_t srcHeight = GetHeight();
uint32_t dstWidth = std::round(srcWidth * scale);
uint32_t dstHeight = std::round(srcHeight * scale);
SdfImage result(dstHeight, dstWidth);
float xRatio = static_cast<float>(srcWidth) / dstWidth;
float yRatio = static_cast<float>(srcHeight) / dstHeight;
for (uint32_t i = 0; i < dstHeight; i++)
{
uint32_t baseIndex = i * dstWidth;
for (uint32_t j = 0; j < dstWidth; j++)
{
float fx = xRatio * j;
float fy = yRatio * i;
uint32_t x = static_cast<uint32_t>(fx);
uint32_t y = static_cast<uint32_t>(fy);
uint32_t index = y * srcWidth + x;
ASSERT_LESS(index, m_data.size(), ());
// range is 0 to 255 thus bitwise AND with 0xff
float A = m_data[index];
float B = m_data[index + 1];
float C = m_data[index + srcWidth];
float D = m_data[index + srcWidth + 1];
float xDiff = fx - x;
float yDiff = fy - y;
float xInvertDiff = 1.0f - xDiff;
float yInvertDiff = 1.0f - yDiff;
float gray = A * xInvertDiff * yInvertDiff + B * xDiff * yInvertDiff +
C * xInvertDiff * yDiff + D * xDiff * yDiff;
result.m_data[baseIndex + j] = gray;
}
}
return result;
}
float SdfImage::ComputeGradient(uint32_t x, uint32_t y, SdfImage::TComputeFn const & fn) const
{
if (x < 1 || x > m_width - 1 ||
y < 1 || y > m_height - 1)
{
return 0.0;
}
size_t k = y * m_width + x;
uint32_t l = k - 1;
uint32_t r = k + 1;
uint32_t u = k - m_width;
uint32_t d = k + m_width;
uint32_t ul = u - 1;
uint32_t dl = d -1;
uint32_t ur = u + 1;
uint32_t dr = d + 1;
if (m_data[k] > 0.0 && m_data[k] < 1.0)
{
return fn(m_data[ul], m_data[u], m_data[ur],
m_data[l], m_data[r],
m_data[dl], m_data[d], m_data[dr]);
}
else
return 0.0;
}
void SdfImage::MexFunction(SdfImage const & img, std::vector<short> & xDist, std::vector<short> & yDist, SdfImage & out)
{
ASSERT_EQUAL(img.GetWidth(), out.GetWidth(), ());
ASSERT_EQUAL(img.GetHeight(), out.GetHeight(), ());
img.EdtaA3(xDist, yDist, out);
// Pixels with grayscale>0.5 will have a negative distance.
// This is correct, but we don't want values <0 returned here.
std::for_each(out.m_data.begin(), out.m_data.end(), [](float & n)
{
n = std::max(0.0f, n);
});
}
float SdfImage::DistaA3(int c, int xc, int yc, int xi, int yi) const
{
int closest = c - xc - yc * m_width; // Index to the edge pixel pointed to from c
//if (closest < 0 || closest > m_data.size())
// return 1000000.0;
ASSERT_GREATER_OR_EQUAL(closest, 0, ());
ASSERT_LESS(closest, m_data.size(), ());
float a = base::Clamp(m_data[closest], 0.0f, 1.0f); // Grayscale value at the edge pixel
if(a == 0.0)
return 1000000.0; // Not an object pixel, return "very far" ("don't know yet")
double dx = static_cast<double>(xi);
double dy = static_cast<double>(yi);
double di = sqrt(dx * dx + dy * dy); // Length of integer vector, like a traditional EDT
double df = 0.0;
if(di == 0.0)
{
int y = closest / m_width;
int x = closest % m_width;
// Use local gradient only at edges
// Estimate based on local gradient only
df = EdgeDf(ComputeGradient(x, y, BIND_GRADIENT(ComputeXGradient)),
ComputeGradient(x, y, BIND_GRADIENT(ComputeYGradient)), a);
}
else
{
// Estimate gradient based on direction to edge (accurate for large di)
df = EdgeDf(dx, dy, a);
}
return static_cast<float>(di + df); // Same metric as edtaa2, except at edges (where di=0)
}
double SdfImage::EdgeDf(double gx, double gy, double a) const
{
double df = 0.0;
if ((gx == 0) || (gy == 0))
{
// Either A) gu or gv are zero
// B) both
df = 0.5 - a; // Linear approximation is A) correct or B) a fair guess
}
else
{
double glength = sqrt(gx * gx + gy * gy);
if(glength > 0)
{
gx = gx / glength;
gy = gy / glength;
}
// Everything is symmetric wrt sign and transposition,
// so move to first octant (gx>=0, gy>=0, gx>=gy) to
// avoid handling all possible edge directions.
gx = fabs(gx);
gy = fabs(gy);
if (gx < gy)
std::swap(gx, gy);
double a1 = 0.5 * gy / gx;
if (a < a1)
df = 0.5 * (gx + gy) - sqrt(2.0 * gx * gy * a);
else if (a < (1.0 - a1))
df = (0.5 - a) * gx;
else
df = -0.5 * (gx + gy) + sqrt(2.0 * gx * gy * (1.0 - a));
}
return df;
}
void SdfImage::EdtaA3(std::vector<short> & xDist, std::vector<short> & yDist, SdfImage & dist) const
{
ASSERT_EQUAL(dist.GetHeight(), GetHeight(), ());
ASSERT_EQUAL(dist.GetWidth(), GetWidth(), ());
ASSERT_EQUAL(dist.m_data.size(), m_data.size(), ());
int w = GetWidth();
int h = GetHeight();
/* Initialize the distance SdfImages */
for (size_t y = 0; y < h; ++y)
{
size_t baseIndex = y * w;
for (size_t x = 0; x < w; ++x)
{
size_t index = baseIndex + x;
if (m_data[index] <= 0.0)
dist.m_data[index]= 1000000.0; // Big value, means "not set yet"
else if (m_data[index] < 1.0)
{
dist.m_data[index] = EdgeDf(ComputeGradient(x, y, BIND_GRADIENT(ComputeXGradient)),
ComputeGradient(x, y, BIND_GRADIENT(ComputeYGradient)),
m_data[index]);
}
}
}
/* Initialize index offsets for the current SdfImage width */
int offsetU = -w;
int offsetD = w;
int offsetR = 1;
int offsetL = -1;
int offsetRu = -w + 1;
int offsetRd = w + 1;
int offsetLd = w - 1;
int offsetLu = -w - 1;
/* Perform the transformation */
bool changed;
do
{
changed = false;
for(int y = 1; y < h; ++y)
{
int i = y * w;
/* scan right, propagate distances from above & left */
/* Leftmost pixel is special, has no left neighbors */
float oldDist = dist.m_data[i];
if(oldDist > 0) // If non-zero distance or not set yet
{
TRANSFORM(offsetU, 0, 1);
TRANSFORM(offsetRu, -1, 1);
}
++i;
/* Middle pixels have all neighbors */
for(int x = 1; x < w - 1; ++x, ++i)
{
oldDist = dist.m_data[i];
if(oldDist > 0.0)
{
TRANSFORM(offsetL, 1, 0);
TRANSFORM(offsetLu, 1, 1);
TRANSFORM(offsetU, 0, 1);
TRANSFORM(offsetRu, -1, 1);
}
}
/* Rightmost pixel of row is special, has no right neighbors */
oldDist = dist.m_data[i];
if(oldDist > 0)
{
TRANSFORM(offsetL, 1, 0);
TRANSFORM(offsetLu, 1, 1);
TRANSFORM(offsetU, 0, 1);
}
/* Move index to second rightmost pixel of current row. */
/* Rightmost pixel is skipped, it has no right neighbor. */
i = y * w + w - 2;
/* scan left, propagate distance from right */
for(int x = w - 2; x >= 0; --x, --i)
{
oldDist = dist.m_data[i];
if(oldDist > 0.0)
TRANSFORM(offsetR, -1, 0);
}
}
/* Scan rows in reverse order, except last row */
for(int y = h - 2; y >= 0; --y)
{
/* move index to rightmost pixel of current row */
int i = y * w + w - 1;
/* Scan left, propagate distances from below & right */
/* Rightmost pixel is special, has no right neighbors */
float oldDist = dist.m_data[i];
if(oldDist > 0) // If not already zero distance
{
TRANSFORM(offsetD, 0, -1);
TRANSFORM(offsetLd, 1, -1);
}
--i;
/* Middle pixels have all neighbors */
for(int x = w - 2; x > 0; --x, --i)
{
oldDist = dist.m_data[i];
if(oldDist > 0.0)
{
TRANSFORM(offsetR, -1, 0);
TRANSFORM(offsetRd, -1, -1);
TRANSFORM(offsetD, 0, -1);
TRANSFORM(offsetLd, 1, -1);
}
}
/* Leftmost pixel is special, has no left neighbors */
oldDist = dist.m_data[i];
if(oldDist > 0)
{
TRANSFORM(offsetR, -1, 0);
TRANSFORM(offsetRd, -1, -1);
TRANSFORM(offsetD, 0, -1);
}
/* Move index to second leftmost pixel of current row. */
/* Leftmost pixel is skipped, it has no left neighbor. */
i = y * w + 1;
for(int x = 1; x < w; ++x, ++i)
{
/* scan right, propagate distance from left */
oldDist = dist.m_data[i];
if(oldDist > 0.0)
TRANSFORM(offsetL, 1, 0);
}
}
}
while(changed);
}
bool SdfImage::Transform(int baseIndex, int offset, int dx, int dy, std::vector<short> & xDist, std::vector<short> & yDist, float & oldDist) const
{
double const epsilon = 1e-3;
ASSERT_EQUAL(xDist.size(), yDist.size(), ());
ASSERT_GREATER_OR_EQUAL(baseIndex, 0, ());
ASSERT_LESS(baseIndex, xDist.size(), ());
int candidate = baseIndex + offset;
ASSERT_GREATER_OR_EQUAL(candidate, 0, ());
ASSERT_LESS(candidate, xDist.size(), ());
int cDistX = xDist[candidate];
int cDistY = yDist[candidate];
int newDistX = cDistX + dx;
int newDistY = cDistY + dy;
float newDist = DistaA3(candidate, cDistX, cDistY, newDistX, newDistY);
if(newDist < oldDist - epsilon)
{
xDist[baseIndex] = newDistX;
yDist[baseIndex] = newDistY;
oldDist = newDist;
return true;
}
return false;
}
} // namespace sdf_image

View file

@ -0,0 +1,81 @@
#pragma once
// +----------------------------------------+
// | |
// | http://contourtextures.wikidot.com |
// | |
// +----------------------------------------+
/*
Copyright (C) 2009 by Stefan Gustavson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "base/buffer_vector.hpp"
#include <cstdint>
#include <functional>
#include <vector>
namespace sdf_image
{
class SdfImage
{
public:
SdfImage() = default;
SdfImage(uint32_t h, uint32_t w);
SdfImage(uint32_t h, uint32_t w, uint8_t * imageData, uint8_t border);
SdfImage(SdfImage const & copy);
uint32_t GetWidth() const;
uint32_t GetHeight() const;
void GetData(std::vector<uint8_t> & dst);
void GenerateSDF(float sc);
private:
void Scale();
void Invert();
void Minus(SdfImage &im);
void Distquant();
SdfImage Bilinear(float Scale);
private:
/// ul = up left
/// u = up
/// ...
/// d = down
/// dr = down right
/// ul u ur l r dl d dr
using TComputeFn = std::function<float (float, float, float, float, float, float, float, float)>;
float ComputeGradient(uint32_t x, uint32_t y, TComputeFn const & fn) const;
void MexFunction(SdfImage const & img, std::vector<short> & xDist, std::vector<short> & yDist,
SdfImage & out);
float DistaA3(int c, int xc, int yc, int xi, int yi) const;
double EdgeDf(double gx, double gy, double a) const;
void EdtaA3(std::vector<short> & xDist, std::vector<short> & yDist, SdfImage & dist) const;
bool Transform(int baseIndex, int offset, int dx, int dy, std::vector<short> & xDist,
std::vector<short> & yDist, float & oldDist) const;
private:
uint32_t m_height = 0;
uint32_t m_width = 0;
buffer_vector<float, 512> m_data;
};
} // namespace sdf_image

View file

@ -511,7 +511,7 @@ static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, c
STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_bmp_core(&s, x, y, comp, data);
}
@ -519,7 +519,7 @@ STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x,
#ifndef STBI_WRITE_NO_STDIO
STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_bmp_core(&s, x, y, comp, data);
stbi__end_write_file(&s);
@ -610,7 +610,7 @@ static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, v
STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_tga_core(&s, x, y, comp, (void *) data);
}
@ -618,7 +618,7 @@ STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x,
#ifndef STBI_WRITE_NO_STDIO
STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_tga_core(&s, x, y, comp, (void *) data);
stbi__end_write_file(&s);
@ -786,14 +786,14 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_hdr_core(&s, x, y, comp, (float *) data);
}
STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data);
stbi__end_write_file(&s);
@ -1606,7 +1606,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_jpg_core(&s, x, y, comp, (void *) data, quality);
}
@ -1615,7 +1615,7 @@ STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x,
#ifndef STBI_WRITE_NO_STDIO
STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality)
{
stbi__write_context s = {};
stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_jpg_core(&s, x, y, comp, data, quality);
stbi__end_write_file(&s);

View file

@ -38,14 +38,14 @@ namespace succinct {
typedef std::vector<uint64_t> bits_type;
bit_vector_builder(uint64_t size = 0, bool initBit = false)
bit_vector_builder(uint64_t size = 0, bool init = 0)
: m_size(size)
{
m_bits.resize(detail::words_for(size), initBit ? uint64_t(-1) : 0);
m_bits.resize(detail::words_for(size), uint64_t(-init));
if (size) {
m_cur_word = &m_bits.back();
// clear padding bits
if (initBit && size % 64) {
if (init && size % 64) {
*m_cur_word >>= 64 - (size % 64);
}
}

View file

@ -0,0 +1 @@
../../utfcpp/source

@ -1 +1 @@
Subproject commit 6be08bbea14ffa0a5c594257fb6285a054395cd7
Subproject commit 6f0e7c7865208f2a6b882a7e138584beb1b6b2fd

View file

@ -7,19 +7,7 @@ set(SRC
add_library(${PROJECT_NAME} ${SRC})
if (WITH_SYSTEM_PROVIDED_3PARTY)
find_package(VulkanHeaders REQUIRED)
target_link_libraries(${PROJECT_NAME} Vulkan::Headers)
else()
set(VulkanHeaders_INCLUDE_DIR ../Vulkan-Headers/include)
target_include_directories(${PROJECT_NAME} PUBLIC ../Vulkan-Headers/include)
endif()
target_include_directories(${PROJECT_NAME} PUBLIC .)
if (PLATFORM_LINUX)
target_compile_definitions(${PROJECT_NAME} PRIVATE VK_USE_PLATFORM_XLIB_KHR)
endif()
target_include_directories(${PROJECT_NAME} PUBLIC . ../Vulkan-Headers/include)
# dlopen
target_link_libraries(${PROJECT_NAME} $<$<BOOL:CMAKE_DL_LIBS>:${CMAKE_DL_LIBS}>)

View file

@ -22,20 +22,7 @@ extern "C" {
#include <dlfcn.h>
int InitVulkan(void) {
#if defined(__APPLE__)
void* libvulkan = dlopen("libvulkan.dylib", RTLD_NOW | RTLD_LOCAL);
if (!libvulkan) {
libvulkan = dlopen("libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL);
}
if (!libvulkan) {
libvulkan = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL);
}
#else
void* libvulkan = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
if (!libvulkan) {
libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
}
#endif
void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
if (!libvulkan) return 0;
// Vulkan supported, set function addresses
@ -558,10 +545,6 @@ int InitVulkan(void) {
vkDestroyDebugReportCallbackEXT = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(dlsym(libvulkan, "vkDestroyDebugReportCallbackEXT"));
vkDebugReportMessageEXT = reinterpret_cast<PFN_vkDebugReportMessageEXT>(dlsym(libvulkan, "vkDebugReportMessageEXT"));
#if defined(__APPLE__)
vkCreateMacOSSurfaceMVK = reinterpret_cast<PFN_vkCreateMacOSSurfaceMVK>(dlsym(libvulkan, "vkCreateMacOSSurfaceMVK"));
#endif
return 1;
}
@ -978,10 +961,8 @@ PFN_vkDestroyPrivateDataSlotEXT vkDestroyPrivateDataSlotEXT;
PFN_vkSetPrivateDataEXT vkSetPrivateDataEXT;
PFN_vkGetPrivateDataEXT vkGetPrivateDataEXT;
PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV;
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkAcquireWinrtDisplayNV vkAcquireWinrtDisplayNV;
PFN_vkGetWinrtDisplayNV vkGetWinrtDisplayNV;
#endif
PFN_vkAcquireWinrtDisplayNV vkAcquireWinrtDisplayNV;
PFN_vkGetWinrtDisplayNV vkGetWinrtDisplayNV;
PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT;
PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI;
PFN_vkCmdSubpassShadingHUAWEI vkCmdSubpassShadingHUAWEI;
@ -1154,10 +1135,6 @@ PFN_vkCmdDecodeVideoKHR vkCmdDecodeVideoKHR;
PFN_vkCmdEncodeVideoKHR vkCmdEncodeVideoKHR;
#endif
#if defined(__APPLE__)
PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK;
#endif
#ifdef __cplusplus
}
#endif

View file

@ -25,10 +25,6 @@ extern "C" {
#define VK_USE_PLATFORM_ANDROID_KHR 1
#include <vulkan/vulkan.h>
#if defined(__APPLE__)
#include <vulkan/vulkan_macos.h>
#endif
/* Initialize the Vulkan function pointer variables declared in this header.
* Returns 0 if vulkan is not available, non-zero if it is available.
*/
@ -504,10 +500,6 @@ extern PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
extern PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT;
extern PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT;
#if defined(__APPLE__)
extern PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK;
#endif
#ifdef __cplusplus
}
#endif

View file

@ -1,21 +1,12 @@
cmake_minimum_required(VERSION 3.22.1)
cmake_minimum_required(VERSION 3.18)
project(omim C CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)
# Our code does not rely on gnu extensions.
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# Fixes warning ld: warning: ignoring duplicate libraries on Mac and Windows.
if (POLICY CMP0156)
cmake_policy(SET CMP0156 NEW)
endif()
if (APPLE AND NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android))
# OBJC/OBJCXX are needed to skip m/mm files in Unity builds.
# https://gitlab.kitware.com/cmake/cmake/-/issues/21963
@ -23,12 +14,10 @@ if (APPLE AND NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android))
set(CMAKE_OBJC_EXTENSIONS OFF)
set(CMAKE_OBJC_STANDARD 11)
set(CMAKE_OBJC_FLAGS -fobjc-arc)
set(CMAKE_OBJC_VISIBILITY_PRESET hidden)
enable_language(OBJCXX)
set(CMAKE_OBJCXX_EXTENSIONS OFF)
set(CMAKE_OBJCXX_STANDARD 20)
set(CMAKE_OBJCXX_STANDARD 17)
set(CMAKE_OBJCXX_FLAGS -fobjc-arc)
set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden)
endif()
message(STATUS "Using compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
@ -73,36 +62,32 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OMIM_ROOT}/cmake")
include(OmimHelpers)
include(OmimTesting)
set(PLATFORM_DESKTOP TRUE)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(PLATFORM_LINUX TRUE)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(PLATFORM_MAC TRUE)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(PLATFORM_WIN TRUE)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
set(PLATFORM_ANDROID TRUE)
set(PLATFORM_DESKTOP FALSE)
elseif (CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(PLATFORM_IPHONE TRUE)
set(PLATFORM_DESKTOP FALSE)
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(LINUX_DETECTED TRUE)
endif()
if(${PLATFORM_MAC})
set(XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
# Metal language support
list(APPEND CMAKE_MODULE_PATH ${OMIM_ROOT}/3party/CMake-MetalShaderSupport/cmake)
include(CheckLanguage)
include(MetalShaderSupport)
check_language(Metal)
if(CMAKE_Metal_COMPILER)
enable_language(Metal)
if (CMAKE_SYSTEM_NAME MATCHES "Android")
set(ANDROID_DETECTED TRUE)
if ((${OS} MATCHES "mac"))
set(DARWIN TRUE)
endif()
endif()
omim_set_platform_var(PLATFORM_IPHONE "iphone-.*")
omim_set_platform_var(PLATFORM_ANDROID "android-.*" ${ANDROID_DETECTED})
omim_set_platform_var(PLATFORM_MAC "macx-.*" ${APPLE})
omim_set_platform_var(PLATFORM_WIN "win32-.*" ${WIN32})
omim_set_platform_var(PLATFORM_LINUX "linux-.*" ${LINUX_DETECTED})
if (PLATFORM_LINUX OR PLATFORM_MAC OR PLATFORM_WIN)
set(PLATFORM_DESKTOP TRUE)
else()
set(PLATFORM_DESKTOP FALSE)
endif()
# End of setting the target platform
# Sanitizer
if (PLATFORM_DESKTOP)
# https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
@ -121,31 +106,14 @@ if (NOT CMAKE_BUILD_TYPE)
endif()
# Global compile options for all configurations.
if (MSVC)
add_compile_options(/utf-8)
add_link_options(/INCREMENTAL:NO)
else()
add_compile_options(-ffast-math)
endif()
if (PLATFORM_WIN)
add_definitions(
-DWIN32_LEAN_AND_MEAN
-DNOMINMAX
)
endif()
add_compile_options(-ffast-math)
# Built-in CMake configurations: Debug, Release, RelWithDebInfo, MinSizeRel
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_definitions(-DDEBUG)
if (NOT MSVC)
add_compile_options(-fno-omit-frame-pointer)
endif()
add_definitions(-DDEBUG -fno-omit-frame-pointer)
elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel")
add_definitions(-DRELEASE)
if (NOT MSVC)
add_compile_options(-Ofast) # Also enables -ffast-math
endif()
add_compile_options(-Ofast)
else()
message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
endif()
@ -162,21 +130,15 @@ if (BUILD_DESIGNER)
add_definitions(-DBUILD_DESIGNER)
endif()
option(BUILD_STANDALONE "Build standalone application" OFF)
if (BUILD_STANDALONE)
message(STATUS "Standalone building is enabled")
add_definitions(-DBUILD_STANDALONE)
endif()
option(USE_ASAN "Enable Address Sanitizer" OFF)
option(USE_TSAN "Enable Thread Sanitizer" OFF)
option(USE_LIBFUZZER "Enable LibFuzzer" OFF)
option(PYBINDINGS "Create makefiles for building python bindings" OFF)
option(SKIP_QT_GUI "Skip building of Qt GUI" OFF)
# TODO: Fix mapshot, it doesn't work without our old FreeType hack.
option(BUILD_MAPSHOT "Build mapshot tool" OFF)
option(USE_PCH "Use precompiled headers" OFF)
option(NJOBS "Number of parallel processes" OFF)
option(ENABLE_VULKAN_DIAGNOSTICS "Enable Vulkan diagnostics" OFF)
option(ENABLE_TRACE "Enable Tracing" OFF)
if (NJOBS)
message(STATUS "Number of parallel processes: ${NJOBS}")
@ -186,9 +148,9 @@ if (NJOBS)
set(CMAKE_JOB_POOL_PRECOMPILE_HEADER custom)
endif()
# GCC 10.0 is required to support <charconv> header inclusion in base/string_utils.hpp
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
message(FATAL_ERROR "Minimum supported g++ version is 10.0, yours is ${CMAKE_CXX_COMPILER_VERSION}")
# GCC 8.1 is required to support <charconv> header inclusion in base/string_utils.hpp, otherwise 7.0 is sufficient
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.1)
message(FATAL_ERROR "Minimum supported g++ version is 8.1 yours is ${CMAKE_CXX_COMPILER_VERSION}")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@ -228,16 +190,6 @@ if (USE_HEAPPROF)
message(STATUS "Heap Profiler is enabled")
endif()
if (ENABLE_VULKAN_DIAGNOSTICS)
message(WARNING "Vulkan diagnostics are enabled. Be aware of performance impact!")
add_definitions(-DENABLE_VULKAN_DIAGNOSTICS)
endif()
if (ENABLE_TRACE)
message(STATUS "Tracing is enabled")
add_definitions(-DENABLE_TRACE)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Set environment variables
@ -278,6 +230,16 @@ find_package(Threads REQUIRED)
# Scripts
if (NOT CMAKE_HOST_WIN32)
execute_process(
COMMAND "${OMIM_ROOT}/tools/unix/check_cert.sh"
RESULT_VARIABLE CheckCertResult
)
if (CheckCertResult)
message(FATAL_ERROR "Certificate check failed")
endif()
endif()
if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
list(APPEND qt_components Core Network)
if (NOT SKIP_QT_GUI OR NOT SKIP_TESTS OR PYBINDINGS)
@ -288,13 +250,11 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
endif()
# PATHS are hard-coded hints where to look for qt6 in addition to other places.
find_package(Qt6 COMPONENTS REQUIRED ${qt_components} PATHS $ENV{QT_PATH} /opt/homebrew/opt/qt@6 /usr/local/opt/qt@6 /usr/lib/x86_64-linux-gnu/qt6)
endif()
set(MINIMUM_REQUIRED_QT_VERSION 6.4.0)
if (Qt6Widgets_VERSION VERSION_LESS ${MINIMUM_REQUIRED_QT_VERSION})
message(FATAL_ERROR "Unsupported Qt version: ${Qt6Widgets_VERSION}, the minimum required is ${MINIMUM_REQUIRED_QT_VERSION}")
else()
message(STATUS "Found Qt version: ${Qt6Widgets_VERSION}")
endif()
find_library(LIBZ NAMES z)
if (LIBZ STREQUAL "LIBZ-NOTFOUND")
message(FATAL_ERROR "Failed to find libz library.")
endif()
# To allow #include "base/file_name.hpp" in all sources.
@ -332,35 +292,27 @@ if (USE_PCH)
endif()
# Should be on the root level, not in 3party, so tests can get these dependencies.
if (PLATFORM_LINUX OR PLATFORM_WIN)
# Should go before 3party as harfbuzz is using them.
if (LINUX_DETECTED)
find_package(ICU COMPONENTS uc i18n data REQUIRED)
find_package(Freetype REQUIRED)
find_package(harfbuzz REQUIRED)
endif()
if (WITH_SYSTEM_PROVIDED_3PARTY)
set(GFLAGS_USE_TARGET_NAMESPACE ON)
find_package(gflags REQUIRED)
find_package(expat CONFIG REQUIRED)
find_package(jansson CONFIG REQUIRED)
find_package(pugixml REQUIRED)
find_package(utf8cpp REQUIRED)
endif()
find_package(ZLIB REQUIRED)
# Include 3party dependencies.
add_subdirectory(3party)
# Not needed for the usual build process, but it fixes QtCreator editor,
# that doesn't see gflags/gflags.h in binary dir (gflags has tricky cmake configuration).
if (PLATFORM_DESKTOP AND NOT WITH_SYSTEM_PROVIDED_3PARTY)
if (PLATFORM_DESKTOP)
include_directories("${PROJECT_BINARY_DIR}/3party/gflags/include")
endif()
# Used in qt/ and shaders/
find_package(Python3 REQUIRED COMPONENTS Interpreter)
find_package(Python3 COMPONENTS Interpreter)
if (Python3_Interpreter_FOUND)
message(STATUS "Found python to use in qt/, shaders/ and 3party/: ${Python3_EXECUTABLE}")
else()
message(FATAL_ERROR "Could not find python3 to use in qt/, shaders/ and 3party/.")
endif()
add_subdirectory(base)
add_subdirectory(coding)
@ -386,6 +338,10 @@ add_subdirectory(traffic)
add_subdirectory(transit)
if (PLATFORM_DESKTOP)
if (BUILD_MAPSHOT)
add_subdirectory(mapshot)
add_subdirectory(software_renderer)
endif()
omim_add_tool_subdirectory(feature_list)
add_subdirectory(generator)
add_subdirectory(openlr)
@ -397,7 +353,6 @@ if (PLATFORM_DESKTOP)
add_subdirectory(qt)
omim_add_tool_subdirectory(skin_generator)
endif()
add_subdirectory(dev_sandbox)
endif()
omim_add_test_subdirectory(qt_tstfrm)

View file

@ -1,72 +1,11 @@
This file contains a list of people who have contributed to this project.
Its not neccesarily comprehensive.
Feel free to add yourself here along with your first contribution!
This file contains a list of people who have contributed to the
public version of MAPS.ME and Organic Maps.
--------------------------------------------------------------------------------
Organic Maps (formerly OMaps) contributors:
(in alphabetic order)
--------------------------------------------------------------------------------
Alexander Borsuk <me@alex.bio>
Alexey Krasilnikov
Andrew Shkrob
Anton Makouski
Arnaud Vergnet
Arthur-GYT
Atemu
Caspar Nuël <casparnuel@yandex.com>
cyber-toad
David Martinez
dbf
Dzmitry Strekha
Dzmitry Yarmolenka
Fabian Wüthrich
Ferenc Géczi
Filip Czaplicki
FinixFighter
fparri
Francesco Gazzetta
gallegonovato
Gonzalo Pesquero
Harry Bond <me@hbond.xyz>
Jaime Marquinez Ferrandiz
Jean-Baptiste Charron
Jenny Em
Joan Montané
Karina Kordon
Kavi Khalique
Kiryl Kaveryn
Kiryl Razhdzestvenski
Konstantin Pastbin
Loïc Hernaut
Lukas Hamm
Lukas Kronberger
Luna Rose
map-per
Markku Huotari
Mateusz Konieczny
Matheus Gomes
MbTy1
Meenbeese
Metehan Özyürek
Michał Brzozowski
Nishant Bhandari <nishantbhandari0019@gmail.com>
Ognjen Blagojevic
Osyotr
renderexpert
Roman Kuznetsov
Roman Tsisyk <roman@tsisyk.com>
Rudo Kemper
Sebastiao Sousa <sebastiao.sousa@tecnico.ulisboa.pt>
Sergiy Kozyr
Tobias G. <tobi.goergens@gmail.com>
Veniamin Gvozdikov <g.veniamin@googlemail.com>
Viktor Govako <viktor.govako@gmail.com>
Will Bradley
--------------------------------------------------------------------------------
MAPS.ME at Mail.Ru Group (prior to the Organic Maps (OMaps) fork in 2020/2021):
--------------------------------------------------------------------------------
Original MAPS.ME (MapsWithMe) design and implementation:
Yury Melnichek <yury@melnichek.com>
Alexander Borsuk <me@alex.bio>
Viktor Govako <viktor.govako@gmail.com>
Siarhei Rachytski <siarhei.rachytski@gmail.com>
Code contributions:
Dmitry Yunitski
@ -96,6 +35,10 @@ Code contributions:
Alex Gontmakher <gsasha@gmail.com>
Dima Korolev <dmitry.korolev@gmail.com>
Max Grigorev <forwidur@gmail.com>
Roman Tsisyk <roman@tsisyk.com>
Caspar Nuël <casparnuel@yandex.com>
Konstantin Pastbin
Nishant Bhandari <nishantbhandari0019@gmail.com>
Porting to Tizen platform:
Sergey Pisarchik
@ -119,6 +62,11 @@ Strings and translations:
Vasily Korotkevich
Mark N. Kuramochi
Lidia Vasiljeva
Karina Kordon
Konstantin Pastbin
Metehan Özyürek
Joan Montané
Luna Rose
Project management:
Alexander Matveenko
@ -138,13 +86,3 @@ Special thanks to:
Yuri Gurski
Dmitry Matveev
Anna Yakovleva
--------------------------------------------------------------------------------
MAPS.ME (originally MapsWithMe) design and implementation at MapsWithMe GmbH
(from 2010 till the acquisition by Mail.ru Group in 2014):
--------------------------------------------------------------------------------
Yury Melnichek <yury@melnichek.com>
Alexander Borsuk <me@alex.bio>
Viktor Govako <viktor.govako@gmail.com>
Siarhei Rachytski <siarhei.rachytski@gmail.com>

9
LEGAL
View file

@ -1,9 +0,0 @@
Certain project resources, including but not limited to domain names, trademarks, hosting accounts, payment accounts, and others, are overseen and managed by Organic Maps OÜ. The governance of these digital assets is subject to policies established by Organic Maps OÜ, in compliance with applicable statutory laws.
Organic Maps OÜ is a legal entity established on 2021-05-01 under the laws of the Republic of Estonia and the European Union, with registration number 16225385. The primary purpose of the entity is to shield the project's members from personal liability and to ensure the legal protection of the project's assets. Official up-to-date information about the entity can be found in the Estonian Business Register:
https://ariregister.rik.ee/eng/company/16225385/Organic-Maps-O%C3%9C
Organic Maps OÜ does not require contributors to transfer copyright ownership and does not retain any copyright over the code contributed to the repository. See the NOTICE file and docs/DCO.md for additional information.
For any legal inquiries, feel free to contact legal@organicmaps.app.

2
NOTICE
View file

@ -1,5 +1,5 @@
Copyright 2020 My.com B.V. (Mail.Ru Group)
Copyright 2024 Organic Maps Contributors
Copyright 2021 Organic Maps Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View file

@ -1,17 +1,31 @@
<div align="center">
<img src="qt/res/logo.png" height="100"/>
</div>
<h1 align="center"">Organic Maps</h1>
# Organic Maps
<a name="install"/>
[Organic Maps](https://organicmaps.app) is a free Android & iOS offline maps app for travellers, tourists, drivers, hikers, and cyclists.
It uses crowd-sourced [OpenStreetMap](https://www.openstreetmap.org) data and is developed with love by the creators of **MapsWithMe** (later renamed to **Maps.Me**) and by our community.
No ads, no tracking, no data collection, no crapware. Your [donations](https://organicmaps.app/donate/) and positive reviews motivate and inspire us, thanks ❤️!
[<img src="docs/badges/apple-appstore.png" alt="App Store" width="160">](https://apps.apple.com/app/organic-maps/id1567437057)
[<img src="docs/badges/google-play.png" alt="Google Play" width="160">](https://play.google.com/store/apps/details?id=app.organicmaps)
[<img src="docs/badges/huawei-appgallery.png" alt="AppGallery" width="160">](https://appgallery.huawei.com/#/app/C104325611)
[<img src="docs/badges/obtainium.png" alt="Obtainium" width="160">](https://github.com/organicmaps/organicmaps/wiki/Installing-Organic-Maps-from-GitHub-using-Obtainium)
[<img src="docs/badges/fdroid.png" alt="F-Droid" width="160">](https://f-droid.org/en/packages/app.organicmaps/)
<p float="left">
<a href="https://apps.apple.com/app/organic-maps/id1567437057">
<img alt="Download on the App Store" src="docs/badges/apple-appstore.png" width="180">
</a>
<a href="https://play.google.com/store/apps/details?id=app.organicmaps">
<img alt="Get it on Google Play" src="docs/badges/google-play.png" width="180">
</a>
<a href="https://appgallery.huawei.com/#/app/C104325611">
<img alt="Explore it on AppGallery" src="docs/badges/huawei-appgallery.png" width="180">
</a>
<a href="https://f-droid.org/en/packages/app.organicmaps/">
<img alt="Get it on F-Droid" src="docs/badges/fdroid.png" width="180">
</a>
<a href='https://flathub.org/apps/details/app.organicmaps.desktop'>
<img alt="Download on Flathub" src="docs/badges/flathub.png" width="180"/>
</a>
<a href="https://repology.org/project/organicmaps/versions">
<img src="https://repology.org/badge/vertical-allrepos/organicmaps.svg" width="180" alt="Packaging status">
</a>
</p>
<p float="left">
<img src="android/app/src/fdroid/play/listings/en-US/graphics/phone-screenshots/1.jpg" width="400" />
@ -88,54 +102,11 @@ Reject surveillance - embrace your freedom.
The app is free for everyone, so we rely on donations. Please donate at [organicmaps.app/donate](https://organicmaps.app/donate) to support us!
Beloved institutional sponsors below have provided targeted grants to cover some infrastructure costs and fund development of new selected features:
### Our sponsors
<table>
<tr>
<td>
<a href="https://nlnet.nl/"><img src="docs/sponsors/nlnet.svg" alt="The NLnet Foundation" width="200px"></a>
</td>
<td>
<a href="https://github.com/organicmaps/organicmaps/milestone/7">The Search & Fonts improvement project</a> has been <a href="https://nlnet.nl/project/OrganicMaps/">funded</a> through NGI0 Entrust Fund. <a href="https://nlnet.nl/entrust/">NGI0 Entrust Fund</a> is established by the <a href="https://nlnet.nl/">NLnet Foundation</a> with financial support from the European Commission's <a href="https://www.ngi.eu/">Next Generation Internet programme</a>, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594.
</td>
</tr>
<tr>
<td>
<a href="https://summerofcode.withgoogle.com/"><img src="docs/sponsors/gsoc.svg" alt="Google Summer of Code" width="200px"></a>
</td>
<td>
<a href="https://summerofcode.withgoogle.com/">Google</a> backed 5 student's projects in the Google Summer of Code program during <a href="https://summerofcode.withgoogle.com/programs/2022/organizations/organic-maps">2022</a> and <a href="https://summerofcode.withgoogle.com/programs/2023/organizations/organic-maps">2023</a> programs. Noteworthy projects included Android Auto and Wikipedia Dump Extractor.
</td>
</tr>
<tr>
<td>
<a href="https://www.mythic-beasts.com/"><img src="docs/sponsors/mythic-beasts.png" alt="Mythic Beasts" width="200px"></a>
</td>
<td>
<a href="https://www.mythic-beasts.com/">Mythic Beasts</a> ISP <a href="https://www.mythic-beasts.com/blog/2021/10/06/improving-the-world-bit-by-expensive-bit/">provides us</a> two virtual servers with 400 TB/month of free bandwidth to host and serve maps downloads and updates.
</td>
</tr>
<tr>
<td>
<a href="https://44plus.vn"><img src="docs/sponsors/44plus.svg" alt="44+ Technologies" width="200px"></a>
</td>
<td>
<a href="https://44plus.vn">44+ Technologies</a> is <a href="https://44plus.vn/organicmaps">providing us </a>with a free dedicated server worth around $12,000/year to serve maps across Vietnam & Southeast Asia.
</td>
</tr>
<tr>
<td>
<a href="https://futo.org"><img src="docs/sponsors/futo.svg" alt="FUTO" width="200px"></a>
</td>
<td>
<a href="https://futo.org">FUTO</a> has <a href="https://www.youtube.com/watch?v=fJJclgBHrEw">awarded $1000 micro-grant</a> to Organic Maps in February 2023.
</td>
</tr>
</table>
The majority of all expenses have been funded by founders of the project since its inception. The project is far from achieving any sort of financial sustainability. The current level of voluntary donations falls significantly short of covering efforts needed to sustain the app. Any new developments of features are beyond the scope of possibility due to the absence of the necessary financial resources.
Please consider [donating](https://organicmaps.app/donate) if you want to see this open-source project thriving, not dying. There are [other ways how to support the project](#contributing). No coding skills required.
[Mythic Beasts](https://www.mythic-beasts.com/) ISP [provides us](https://www.mythic-beasts.com/blog/2021/10/06/improving-the-world-bit-by-expensive-bit/)
two virtual servers with 400 TB/month of free bandwidth to host and serve
maps downloads and updates.
## Copyrights
@ -147,9 +118,7 @@ for more information.
## Governance
See [docs/GOVERNANCE.md](docs/GOVERNANCE.md).
<a name="contributing">
See [docs/GOVERNANCE.md)](docs/GOVERNANCE.md).
## Contributing
@ -167,18 +136,18 @@ Please join our beta program, suggest your features, and report bugs:
- **Rate us on the [App Store](https://apps.apple.com/app/organic-maps/id1567437057)
and [Google Play](https://play.google.com/store/apps/details?id=app.organicmaps)**.
- **Star us on Forgejo**.
- Report bugs or issues to [the issue tracker](https://git.omaps.dev/organicmaps/organicmaps/issues).
- **Star us on GitHub**.
- Report bugs or issues to [the issue tracker](https://github.com/organicmaps/organicmaps/issues).
- [Discuss](https://github.com/organicmaps/organicmaps/discussions/categories/ideas) ideas or propose feature requests.
- Subscribe to our [Telegram Channel](https://t.me/OrganicMapsApp) or to the [[matrix] space](https://matrix.to/#/#organicmaps:matrix.org) for updates.
- Join our [Telegram Group](https://t.me/OrganicMaps) to discuss with other users.
- Присоединяйтесь к нашей [русскоязычной группе в Telegram](https://t.me/OrganicMapsRu) для обратной связи и помощи.
- Diğer kullanıcılarla tartışmak için [Telegram Grubumuza](https://t.me/OrganicMapsTR) katılın.
- Rejoignez notre groupe [Telegram](https://t.me/OrganicMapsFR) pour obtenir de l'aide.
- Contact us by [email](mailto:hello@organicmaps.app).
- Follow our updates in
[Mastodon](https://fosstodon.org/@organicmaps),
[Facebook](https://facebook.com/OrganicMaps),
[X (Twitter)](https://x.com/OrganicMapsApp),
[Twitter](https://twitter.com/OrganicMapsApp),
[Instagram](https://instagram.com/organicmaps.app/).
- Güncellemelerimizi [Instagram](https://instagram.com/organicmapstr/) üzerinden takip edin.

3
android/.gitignore vendored
View file

@ -21,6 +21,3 @@ local.properties
.project
lint.xml
.gradletasknamecache
# Generated by Eclipse and JDTLS
.settings/

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
<g inkscape:groupmode="layer" inkscape:label="Layer 1">
<rect fill="#006c35" fill-opacity="1.0" x="0" y="0" width="1024" height="1024"/>
<path fill="#ffffff" d="m861.3562052 256.9139426c18.220574 48.4374573-79.2585233 166.2022835-172.1806378 196.4226995-168.0803471-58.2153969-173.5457836 39.5504743-311.1096159 132.4296677 162.6149552 112.4329497 332.9737882 24.8856325 329.7844002-85.7673036-127.9956457 73.3254376-208.1650824 81.3238121-254.1719349 79.1032962 154.8710218-30.6636026 322.0404219-125.7633124 357.0667834-165.7616685 0.032202 1.7749817 0.049863 3.5523114 0.049863 5.33456 0 191.0905993-295.1650572 474.6148576-295.1650572 474.6148576s-154.5086464-147.95159-239.9499331-302.4701423c-11.943516-0.1614425-83.8230022 25.9633002-110.3310391-9.051445-29.6082623-39.1049397 80.1693081-170.2028122 175.3699196-209.3102117 170.3563508 77.3261904 263.7351577-123.0971499 317.0292402-134.2068293-158.9688193-94.2135154-316.1183714-55.5493358-333.8847017 84.4353407 88.3675802-50.2172465 196.7775505-78.65765 246.8822227-76.4346744-140.7606999 28.7623957-301.9981102 132.8752019-350.2809443 172.4255642 0-159.041983 132.1505407-287.9677052 295.1650569-287.9677052 96.4018995 0 182.0095151 45.0859887 235.8744518 114.8252613 0.00335 0 96.1884344-31.2834041 109.851981 11.3787329zm-33.7059144 14.218972c-12.6607646-17.2289278-56.7341326 2.8936807-56.7341326 2.8936807 6.1678152 10.3446685 11.7002555 21.0960758 16.5352245 32.2084942 4.8995467 11.2622344 9.0867303 22.8954305 12.5044868 34.8382086 0 0 45.0041042-46.3863227 27.6944213-69.9403835zm-629.5734431 294.3797539c13.6858848 18.6189721 61.3258973-3.1309266 61.3258973-3.1309266-6.6716772-11.1802827-12.6484216-22.8033047-17.8755617-34.8139472-5.2966478-12.1727565-9.8213865-24.7454316-13.5171072-37.6545218 0 0-48.6427553 50.1397674-29.9332284 75.5993956z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2 KiB

View file

@ -12,7 +12,6 @@
/firebase-app-distribution.json
/firebase-test-lab.json
/huawei-appgallery.json
/agconnect-services.json
/src/main/res/xml/network_security_config.xml
# ignore flags symlinks

View file

@ -4,14 +4,26 @@ buildscript {
mavenCentral()
}
//
// The magic below is needed to disable Google Firebase Services during the build time.
// Unfortunately, the only way to disable Gradle plugins is to add these hardcore switches to buildscript().
// The magic below is needed to disable Google Mobile Services (a.k.a GMS) and
// Google Firebase Services during the build time. Unfortunately, the only way
// to disable Gradle plugins is to add these hardcore switches to buildscript().
//
// Detect flavors from the task name.
def taskName = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
def isFdroid = taskName.contains('fdroid')
def isBeta = taskName.contains('beta')
def isDebug = taskName.contains('debug')
def isSyncWithFiles = taskName.contains('rundefaulttasksexecutionrequest') // used by Android Studio
//
// Please add symlinks to google/java/app/organicmaps/location for each new gms-enabled flavor below:
// ```
// mkdir -p src/$flavor/java/app/organicmaps/
// ln -sf ../../../../google/java/app/organicmaps/location src/$flavor/java/app/organicmaps/
// ls -la src/$flavor/java/app/organicmaps/location/GoogleFusedLocationProvider.java
// ```
ext.googleMobileServicesEnabled = taskName.contains('google') || taskName.contains('huawei') || taskName.contains('web')
// Firebase Crashlytics compile-time feature flag: -Pfirebase=true|false
def googleFirebaseServicesFlag = findProperty('firebase')
@ -21,20 +33,32 @@ buildscript {
googleFirebaseServicesFlag == '' || googleFirebaseServicesFlag.toBoolean() :
googleFirebaseServicesDefault
// Android Auto compile-time feature flag: -Pandroidauto=true|false
def androidAutoFlag = findProperty('androidauto')
// Enable Android Auto by default for all debug and beta flavors except fdroid.
def androidAutoDefault = isSyncWithFiles || ((isDebug || isBeta) && !isFdroid)
ext.androidAutoEnabled = androidAutoFlag != null ? androidAutoFlag.toBoolean() : androidAutoDefault
dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
classpath 'com.android.tools.build:gradle:8.1.4'
if (googleMobileServicesEnabled) {
println('Building with Google Mobile Services')
classpath 'com.google.gms:google-services:4.4.0'
} else {
println('Building without Google Services')
}
if (googleFirebaseServicesEnabled) {
println('Building with Google Firebase Services')
classpath 'com.google.gms:google-services:4.4.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
classpath 'com.google.firebase:firebase-appdistribution-gradle:5.0.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.1'
} else {
println('Building without Google Firebase Services')
}
classpath('com.github.triplet.gradle:play-publisher:3.10.1')
classpath('ru.cian:huawei-publish-gradle-plugin:1.4.2')
classpath('com.github.triplet.gradle:play-publisher:3.8.6')
classpath('ru.cian:huawei-publish-gradle-plugin:1.4.0')
}
}
@ -45,14 +69,67 @@ repositories {
}
apply plugin: 'com.android.application'
if (googleFirebaseServicesEnabled) {
apply from: 'secure.properties'
if (googleMobileServicesEnabled) {
apply plugin: 'com.google.gms.google-services'
}
if (googleFirebaseServicesEnabled) {
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.appdistribution'
}
apply plugin: 'com.github.triplet.play'
apply plugin: 'ru.cian.huawei-publish-gradle-plugin'
dependencies {
// Google Mobile Services
if (googleMobileServicesEnabled) {
implementation 'com.google.android.gms:play-services-location:21.0.1'
}
// Google Firebase Services
if (googleFirebaseServicesEnabled) {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:32.6.0')
// Add the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-crashlytics-ndk'
}
if (androidAutoEnabled) {
println('Building with Android Auto')
implementation 'androidx.car.app:app:1.4.0-rc01'
// Fix for app/organicmaps/util/FileUploadWorker.java:14: error: cannot access ListenableFuture
// https://github.com/organicmaps/organicmaps/issues/6106
implementation 'com.google.guava:guava:32.1.3-android'
} else {
println('Building without Android Auto')
}
// This line is added as a workaround for duplicate classes error caused by some outdated dependency:
// > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
// We don't use Kotlin, but some dependencies are actively using it.
// See https://stackoverflow.com/a/75719642
implementation 'androidx.core:core:1.12.0'
implementation(platform('org.jetbrains.kotlin:kotlin-bom:1.9.21'))
implementation 'androidx.annotation:annotation:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.fragment:fragment:1.6.2'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.work:work-runtime:2.8.1'
implementation 'androidx.lifecycle:lifecycle-process:2.6.2'
implementation 'com.google.android.material:material:1.10.0'
implementation 'com.github.devnullorthrow:MPAndroidChart:3.2.0-alpha'
implementation 'net.jcip:jcip-annotations:1.0'
// Test Dependencies
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.7.0'
testImplementation 'org.mockito:mockito-inline:5.2.0'
}
def run(cmd) {
def stdout = new ByteArrayOutputStream()
exec {
@ -83,24 +160,22 @@ def osName = System.properties['os.name'].toLowerCase()
project.ext.appId = 'app.organicmaps'
project.ext.appName = 'Organic Maps'
// I have Java 21 installed, but this doesn't work on MacOS.
//java {
// toolchain {
// languageVersion.set(JavaLanguageVersion.of(17))
// }
//}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
android {
namespace 'app.organicmaps'
buildFeatures {
dataBinding = true
buildConfig = true
}
// All properties are read from gradle.properties file
compileSdk propCompileSdkVersion.toInteger()
ndkVersion '27.2.12479018'
ndkVersion '26.1.10909125'
defaultConfig {
// Default package name is taken from the manifest and should be app.organicmaps
@ -124,16 +199,6 @@ android {
def njobs = ''
if (project.hasProperty('njobs')) njobs = project.getProperty('njobs')
def enableVulkanDiagnostics = 'OFF'
if (project.hasProperty('enableVulkanDiagnostics')) {
enableVulkanDiagnostics = project.getProperty('enableVulkanDiagnostics')
}
def enableTrace = 'OFF'
if (project.hasProperty('enableTrace')) {
enableTrace = project.getProperty('enableTrace')
}
cmake {
cppFlags '-fexceptions', '-frtti'
// There is no sense to enable sections without gcc's --gc-sections flag.
@ -141,8 +206,7 @@ android {
'-Wno-extern-c-compat'
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static',
"-DOS=$osName", '-DSKIP_TESTS=ON', '-DSKIP_TOOLS=ON', "-DUSE_PCH=$pchFlag",
"-DNJOBS=$njobs", "-DENABLE_VULKAN_DIAGNOSTICS=$enableVulkanDiagnostics",
"-DENABLE_TRACE=$enableTrace"
"-DNJOBS=$njobs"
targets 'organicmaps'
}
}
@ -168,10 +232,14 @@ android {
// For the emulator, chromebooks and some Intel Atom devices.
abiFilters.add('x86_64')
}
println('Building for ' + abiFilters + ' archs.')
println("Building for " + abiFilters + " archs.")
}
setProperty('archivesBaseName', appName.replaceAll('\\s','') + '-' + defaultConfig.versionCode)
setProperty("archivesBaseName", appName.replaceAll("\\s","") + "-" + defaultConfig.versionCode)
if (!androidAutoEnabled) {
sourceSets.main.java.excludes += '**/organicmaps/car'
}
}
flavorDimensions += 'default'
@ -181,27 +249,26 @@ android {
final int HUAWEI_VERSION_CODE_BASE = 01_00_00_00_00
google {
dimension 'default'
dimension "default"
versionName = android.defaultConfig.versionName + '-Google'
buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@organicmaps.app"'
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=app.organicmaps"'
}
web {
dimension 'default'
applicationIdSuffix '.web'
dimension "default"
versionName = android.defaultConfig.versionName + '-Web'
buildConfigField 'String', 'SUPPORT_MAIL', '"apk@organicmaps.app"'
}
fdroid {
dimension 'default'
dimension "default"
versionName = android.defaultConfig.versionName + '-FDroid'
buildConfigField 'String', 'SUPPORT_MAIL', '"fdroid@organicmaps.app"'
}
huawei {
dimension 'default'
dimension "default"
versionName = android.defaultConfig.versionName + '-Huawei'
versionCode = HUAWEI_VERSION_CODE_BASE + android.defaultConfig.versionCode
buildConfigField 'String', 'SUPPORT_MAIL', '"huawei@organicmaps.app"'
@ -217,7 +284,7 @@ android {
splits.abi {
boolean enabled = project.hasProperty('splitApk')
println ('Create separate apks: ' + enabled)
println ("Create separate apks: " + enabled)
enable enabled
reset()
include 'x86', 'armeabi-v7a', 'arm64-v8a', 'x86_64'
@ -234,6 +301,8 @@ android {
disable 'CustomSplashScreen'
// https://github.com/organicmaps/organicmaps/issues/3610
disable 'InsecureBaseConfiguration'
// https://github.com/organicmaps/organicmaps/issues/3608
disable 'UnusedResources'
abortOnError true
}
@ -246,11 +315,6 @@ android {
}
}
def securityPropertiesFileExists = file('secure.properties').exists()
if (securityPropertiesFileExists) {
apply from: 'secure.properties'
}
signingConfigs {
debug {
storeFile file('debug.keystore')
@ -260,15 +324,10 @@ android {
}
release {
if (securityPropertiesFileExists) {
println('The release signing keys are available')
storeFile file(spropStoreFile)
storePassword spropStorePassword
keyAlias spropKeyAlias
keyPassword spropKeyPassword
} else {
println('The release signing keys are unavailable')
}
storeFile file(spropStoreFile)
storePassword spropStorePassword
keyAlias spropKeyAlias
keyPassword spropKeyPassword
}
}
@ -279,7 +338,8 @@ android {
jniDebuggable true // Enable jni debug build
zipAlignEnabled true
signingConfig signingConfigs.debug
resValue 'string', 'app_name', 'Debug Organic Maps'
resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix
resValue 'string', 'app_name', project.ext.appName + ' ' + '(Debug)'
// Do not generate separate debug symbols for debug apps, because we don't distribute them.
ndk.debugSymbolLevel = 'none'
@ -299,6 +359,7 @@ android {
// Includes the default ProGuard rules files that are packaged with the Android Gradle plugin.
// To learn more, go to the documentation section about R8 configuration files.
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
resValue 'string', 'app_id', android.defaultConfig.applicationId
resValue 'string', 'app_name', project.ext.appName
// Full size symbols are too big for Google, 217mb aab vs 95mb.
ndk.debugSymbolLevel = 'symbol_table'
@ -320,7 +381,8 @@ android {
// To learn more, go to the documentation section about R8 configuration files.
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
matchingFallbacks = ['debug', 'release']
resValue 'string', 'app_name', 'Beta Organic Maps'
resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix
resValue 'string', 'app_name', project.ext.appName + ' ' + '(Beta)'
// Full size symbols are too big for Google, 217mb aab vs 95mb.
ndk.debugSymbolLevel = 'symbol_table'
@ -332,7 +394,7 @@ android {
// A new beta release is created for each commit.
// Use the last commit message for the release notes.
releaseNotes = getCommitMessage()
groups = 'qa' // Notify only selected people.
groups = "qa" // Notify only selected people.
serviceCredentialsFile = "$projectDir/firebase-app-distribution.json"
}
}
@ -341,9 +403,9 @@ android {
externalNativeBuild {
cmake {
version '3.22.1+'
buildStagingDirectory './nativeOutputs'
path '../../CMakeLists.txt'
version "3.22.1+"
buildStagingDirectory "./nativeOutputs"
path "../../CMakeLists.txt"
}
}
@ -355,83 +417,34 @@ android {
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
// Google Play Location Services
//
// Please add symlinks to google/java/app/organicmaps/location for each new gms-enabled flavor below:
// ```
// mkdir -p src/$flavor/java/app/organicmaps/
// ln -sf ../../../../google/java/app/organicmaps/location src/$flavor/java/app/organicmaps/
// ls -la src/$flavor/java/app/organicmaps/location/GoogleFusedLocationProvider.java
// ```
//
webImplementation 'com.google.android.gms:play-services-location:21.3.0'
googleImplementation 'com.google.android.gms:play-services-location:21.3.0'
huaweiImplementation 'com.google.android.gms:play-services-location:21.3.0'
// This is the microG project's re-implementation which is permissible on
// F-droid because it's Apache-2.0.
fdroidImplementation 'org.microg.gms:play-services-location:0.3.6.244735'
// Google Firebase Services
if (googleFirebaseServicesEnabled) {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:33.5.1')
// Add the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-crashlytics-ndk'
packagingOptions.jniLibs {
excludes += [
'lib/**/libVkLayer_khronos_validation.so',
'lib/**/libVkLayer_core_validation.so',
'lib/**/libVkLayer_threading.so',
'lib/**/libVkLayer_image.so',
'lib/**/libVkLayer_parameter_validation.so',
'lib/**/libVkLayer_object_tracker.so',
'lib/**/libVkLayer_swapchain.so',
'lib/**/libVkLayer_unique_objects.so',
]
}
// This line is added as a workaround for duplicate classes error caused by some outdated dependency:
// > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
// We don't use Kotlin, but some dependencies are actively using it.
// See https://stackoverflow.com/a/75719642
implementation 'androidx.core:core:1.15.0'
implementation(platform('org.jetbrains.kotlin:kotlin-bom:2.1.10'))
implementation 'androidx.annotation:annotation:1.9.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.car.app:app:1.7.0-rc01'
implementation 'androidx.car.app:app-projected:1.7.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.fragment:fragment:1.8.5'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.work:work-runtime:2.10.0'
implementation 'androidx.lifecycle:lifecycle-process:2.8.7'
implementation 'com.google.android.material:material:1.12.0'
// Fix for app/organicmaps/util/FileUploadWorker.java:14: error: cannot access ListenableFuture
// https://github.com/organicmaps/organicmaps/issues/6106
implementation 'com.google.guava:guava:33.3.0-android'
implementation 'com.github.devnullorthrow:MPAndroidChart:3.2.0-alpha'
implementation 'net.jcip:jcip-annotations:1.0'
// Test Dependencies
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.15.2'
testImplementation 'org.mockito:mockito-inline:5.2.0'
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}
android.applicationVariants.all { variant ->
def authorityValue = variant.applicationId + ".provider"
android.buildTypes.all { buildType ->
def suffix = applicationIdSuffix != null ? applicationIdSuffix : ""
def authorityValue = android.defaultConfig.applicationId + suffix + ".provider"
def authority = "\"" + authorityValue + "\""
variant.buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', authority
def flavor = variant.getMergedFlavor()
flavor.manifestPlaceholders += [FILE_PROVIDER_PLACEHOLDER : authorityValue]
variant.resValue 'string', 'app_id', variant.applicationId
buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', authority
manifestPlaceholders += [FILE_PROVIDER_PLACEHOLDER : authorityValue]
manifestPlaceholders += [ANDROID_AUTO_ENABLED : androidAutoEnabled]
}
task prepareGoogleReleaseListing {
@ -442,7 +455,7 @@ task prepareGoogleReleaseListing {
final sourceDir = new File("${projectDir}/src/$sourceFlavor/play/listings")
final targetDir = new File("${projectDir}/src/$targetFlavor/play/listings")
final sourceFiles = fileTree(dir: sourceDir,
include: '**/*.txt', exclude: "**/*-${targetFlavor}.txt")
include: "**/*.txt", exclude: "**/*-${targetFlavor}.txt")
sourceFiles.each { File sourceFile ->
final locale = sourceFile.parentFile.getName()
final targetLocaleDir = new File(targetDir, locale)
@ -450,7 +463,7 @@ task prepareGoogleReleaseListing {
targetLocaleDir.mkdirs()
final targetFile = new File(targetLocaleDir, sourceFile.getName())
// Override Google-specific values by using ${name}-google.txt files.
final overrideFile = new File(sourceFile.getPath().replace('.txt', "-${targetFlavor}.txt"))
final overrideFile = new File(sourceFile.getPath().replace(".txt", "-${targetFlavor}.txt"))
targetFile.text = overrideFile.exists() ? overrideFile.text : sourceFile.text
}
copy {
@ -462,10 +475,11 @@ task prepareGoogleReleaseListing {
play {
enabled.set(false)
track.set('production')
track.set("production")
userFraction.set(Double.valueOf(0.10)) // 10%
defaultToAppBundles.set(true)
releaseStatus.set(ReleaseStatus.IN_PROGRESS)
serviceAccountCredentials.set(file('google-play.json'))
serviceAccountCredentials.set(file("google-play.json"))
}
huaweiPublish {
@ -474,7 +488,7 @@ huaweiPublish {
credentialsPath = "$projectDir/huawei-appgallery.json"
buildFormat = 'aab'
deployType = 'draft' // confirm manually
def releaseDescriptions = []
releaseNotes = []
def localeOverride = [
'am' : 'am-ET',
'gu': 'gu_IN',
@ -492,9 +506,8 @@ huaweiPublish {
def path = file.getPath()
def locale = file.parentFile.getName()
locale = localeOverride.get(locale, locale)
releaseDescriptions.add(new ru.cian.huawei.publish.ReleaseNote(locale, path))
releaseNotes.add(new ru.cian.huawei.publish.ReleaseNote(locale, path))
}
releaseNotes = new ru.cian.huawei.publish.ReleaseNotesExtension(releaseDescriptions, true)
}
}
}

View file

@ -0,0 +1,28 @@
package app.organicmaps;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest
{
@Test
public void useAppContext()
{
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("app.organicmaps", appContext.getPackageName());
}
}

View file

@ -1 +0,0 @@
../../../../google/java/app/organicmaps/location

View file

@ -0,0 +1,18 @@
package app.organicmaps.location;
import android.content.Context;
import androidx.annotation.NonNull;
public class LocationProviderFactory
{
public static boolean isGoogleLocationAvailable(@NonNull @SuppressWarnings("unused") Context context)
{
return false;
}
public static BaseLocationProvider getProvider(@NonNull Context context, @NonNull BaseLocationProvider.Listener listener)
{
return new AndroidNativeProvider(context, listener);
}
}

View file

@ -16,7 +16,7 @@
• العلامات المرجعية وتتبع التصدير والاستيراد بأشكال KML و KMZ و GPX
• الوضع المظلم لحماية عينيك
لا يوجد نظام وسائل النقل العام وخرائط الأقمار الصناعية وغيرها من الميزات الرائعة <i>حتى الآن</i> في الخرائط العضوية. ولكن مع <i>مساعدتك ودعمك</i>، يمكننا أن نجعل هذا العالم أفضل خطوة بخطوة.
لا يوجد نظام Android Auto ووسائل النقل العام وخرائط الأقمار الصناعية وغيرها من الميزات الرائعة <i>حتى الآن</i> في الخرائط العضوية. ولكن مع <i>مساعدتك ودعمك</i>، يمكننا أن نجعل هذا العالم أفضل خطوة بخطوة.
الخرائط العضوية هي <b>نقية وعضوية، مصنوعة من الحب</b>:

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• New OpenStreetMap data as of November 13
• The maximum zoom level is twice as deep as it was before
• Fixed import of bookmarks in KMB format
• Disabled the screen wake lock by default to improve power-saving
• Corrected the location search indication when the map is moved or zoomed
• Outdoors map style preview - read on how to activate it and about many other improvements on omaps.org/news

View file

@ -1,7 +1,7 @@
‣ Our free app does not track you, does not have ads, and it needs your support.
‣ It is constantly being improved by contributors and our small team, in our free time.
‣ If something is wrong or missing on the map, please fix it in <b>OpenStreetMap</b> and see your changes in the future maps update.
‣ If navigation or search doesn't work, please check it on osm.org first, and then email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
‣ If navigation or search doesn't work, please email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
<b>Your feedback and 5-star reviews are the best motivators for us!</b>
@ -11,12 +11,12 @@ Key features:
• Detailed offline maps with places that don't exist on Google maps, thanks to the <b>OpenStreetMap</b> community
• Cycling routes, hiking trails, and walking paths
• Contour lines, elevation profiles, peaks, and slopes
• Turn-by-turn walking, cycling, and car navigation with voice guidance and Android Auto
• Turn-by-turn walking, cycling, and EXPERIMENTAL car navigation with voice guidance
• Fast offline search
• Bookmarks and tracks export and import in KML, KMZ, GPX formats
• Dark mode to protect your eyes
There is no public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make better maps step by step.
There is no Android Auto, public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make this world better step by step.
Organic Maps is <b>pure and organic, made with love</b>:

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• New OpenStreetMap data as of November 13
• The maximum zoom level is twice as deep as it was before
• Fixed import of bookmarks in KMB format
• Disabled the screen wake lock by default to improve power-saving
• Corrected the location search indication when the map is moved or zoomed
• Outdoors map style preview - read on how to activate it and about many other improvements on omaps.org/news

View file

@ -1,7 +1,7 @@
‣ Our free app does not track you, does not have ads, and it needs your support.
‣ It is constantly being improved by contributors and our small team, in our free time.
‣ If something is wrong or missing on the map, please fix it in <b>OpenStreetMap</b> and see your changes in the future maps update.
‣ If navigation or search doesn't work, please check it on osm.org first, and then email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
‣ If navigation or search doesn't work, please email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
<b>Your feedback and 5-star reviews are the best motivators for us!</b>
@ -11,12 +11,12 @@ Key features:
• Detailed offline maps with places that don't exist on Google maps, thanks to the <b>OpenStreetMap</b> community
• Cycling routes, hiking trails, and walking paths
• Contour lines, elevation profiles, peaks, and slopes
• Turn-by-turn walking, cycling, and car navigation with voice guidance and Android Auto
• Turn-by-turn walking, cycling, and EXPERIMENTAL car navigation with voice guidance
• Fast offline search
• Bookmarks and tracks export and import in KML, KMZ, GPX formats
• Dark mode to protect your eyes
There is no public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make better maps step by step.
There is no Android Auto, public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make this world better step by step.
Organic Maps is <b>pure and organic, made with love</b>:

View file

@ -1,8 +1,5 @@
• Новыя дадзеныя OpenStreetMap ад 27 лютага
• Магчымасць уручную расстаўляць прамежкавыя кропкі маршруту
• Экспарт аднаго абранага трэка са спісу
• Палепшаная маршрутызацыя для веласіпедыстаў
• Дададзена сістэмнае апавяшчэнне пры загрузцы карт, фонавыя загрузкі больш не перарываюцца
• Дададзены мігатлівы віджэт запісу трэка
…і шматлікае іншае на omaps.org/news
• Новыя дадзеныя OpenStreetMap па стане на 13 лістапада.
• Цяпер зуміцца/набліжаць карту можна яшчэ мацней!
• Выпраўлены імпарт метак у фармаце KMB.
• Выпраўлена індыкацыя пошуку месцазнаходжання пры перамяшчэнні або маштабаванні карты.
• Пра тое, як актываваць эксперыментальны стыль для пешых паходаў, а таксама пра многія іншыя паляпшэнні, чытайце на сайце omaps.org/news

View file

@ -1,7 +1,7 @@
‣ Our free app does not track you, does not have ads, and it needs your support.
‣ It is constantly being improved by contributors and our small team, in our free time.
‣ If something is wrong or missing on the map, please fix it in <b>OpenStreetMap</b> and see your changes in the future maps update.
‣ If navigation or search doesn't work, please check it on osm.org first, and then email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
‣ If navigation or search doesn't work, please email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
<b>Your feedback and 5-star reviews are the best motivators for us!</b>
@ -11,12 +11,12 @@ Key features:
• Detailed offline maps with places that don't exist on Google maps, thanks to the <b>OpenStreetMap</b> community
• Cycling routes, hiking trails, and walking paths
• Contour lines, elevation profiles, peaks, and slopes
• Turn-by-turn walking, cycling, and car navigation with voice guidance and Android Auto
• Turn-by-turn walking, cycling, and EXPERIMENTAL car navigation with voice guidance
• Fast offline search
• Bookmarks and tracks export and import in KML, KMZ, GPX formats
• Dark mode to protect your eyes
There is no public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make better maps step by step.
There is no Android Auto, public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make this world better step by step.
Organic Maps is <b>pure and organic, made with love</b>:

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• New OpenStreetMap data as of November 13
• The maximum zoom level is twice as deep as it was before
• Fixed import of bookmarks in KMB format
• Disabled the screen wake lock by default to improve power-saving
• Corrected the location search indication when the map is moved or zoomed
• Outdoors map style preview - read on how to activate it and about many other improvements on omaps.org/news

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• New OpenStreetMap data as of November 13
• The maximum zoom level is twice as deep as it was before
• Fixed import of bookmarks in KMB format
• Disabled the screen wake lock by default to improve power-saving
• Corrected the location search indication when the map is moved or zoomed
• Outdoors map style preview - read on how to activate it and about many other improvements on omaps.org/news

View file

@ -10,12 +10,12 @@ Característiques clau:
• Mapes detallats fora de línia amb llocs que no existeixen a Google Maps, gràcies a la comunitat de l'<b>OpenStreetMap</b>
• Rutes amb bicicleta, rutes d'excursionisme i senderisme
• Corbes de nivell, perfils d'elevació, cims i pendents
• Passeig, bicicleta i navegació en cotxe amb guia de veu, Android Auto
• Passeig, bicicleta i navegació EXPERIMENTAL en cotxe amb guia de veu
• Cerca ràpida fora de línia
• Exportació i importació d'adreces d'interès en formats KML, KMZ i GPX
• Mode fosc per a protegir els ulls
No hi ha <i>de moment</i> transport públic, mapes per satèl·lit i altres funcions interessants a l'Organic Maps. Però amb <i>la vostra ajuda i suport</i>, podem millorar aquest món pas a pas.
No hi ha <i>de moment</i> Android Auto, transport públic, mapes per satèl·lit i altres funcions interessants a l'Organic Maps. Però amb <i>la vostra ajuda i suport</i>, podem millorar aquest món pas a pas.
L'Organic Maps és <b>pur i orgànic, fet amb amor</b>:

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• New OpenStreetMap data as of November 13
• The maximum zoom level is twice as deep as it was before
• Fixed import of bookmarks in KMB format
• Disabled the screen wake lock by default to improve power-saving
• Corrected the location search indication when the map is moved or zoomed
• Outdoors map style preview - read on how to activate it and about many other improvements on omaps.org/news

View file

@ -1,53 +1,10 @@
‣ Naše bezplatná aplikace vás nesleduje, neobsahuje reklamy a potřebuje vaši podporu.
‣ Je neustále vylepšována přispěvateli a naším malým týmem v našem volném čase.
‣ Pokud je na mapě něco špatně nebo na ní něco chybí, opravte to prosím na <b>OpenStreetMap</b>. Své změny uvidíte v pozdějších aktualizacích map.
‣ Pokud nefunguje navigace nebo vyhledávání, zkontrolujte to prosím nejprve na osm.org a až poté nám napište e-mail. Odpovídáme na <i>KAŽDÝ</i> e-mail a problémy opravujeme jak nejdříve můžeme.
Organic Maps je navigační aplikace s ochranou soukromí pro řidiče, turisty a cyklisty. Aplikace má navigaci s ochranou soukromí - žádné sledování polohy, neshromažďuje data a nemá reklamy. Vyhledávání, směrování a navigace fungují bez mobilního signálu, což je ideální pro cestování na vzdálených turistických trasách nebo místech se špatným připojením. Aplikace Organic Maps využívá data OpenStreetMap, na jejichž tvorbě se podílejí davy přispěvatelů z celého světa. Projekt je řízen komunitou, kód je open-source a upřednostňuje komunitní rozvoj a spolupráci.
<b>Vaše zpětná vazba a 5-hvězdičková hodnocení jsou pro nás nejlepší motivací!</b>
Klíčové funkce:
• Bezplatné, open-source, bez reklam, bez sledování
• Podrobné offline mapy s místy, které neexistují v Mapách Google, díky komunitě <b>OpenStreetMap</b>
• Cyklotrasy, turistické trasy a pěší stezky
• Vrstevnice, výškové profily, vrcholy a svahy
• Pěší, cyklistická a automobilová navigace krok po kroku s hlasovými pokyny a Android Auto
• Rychlý offline vyhledávač
• Export a import záložek a tras ve formátech KML, KMZ a GPX
• Tmavý režim pro ochranu vašich očí
Organic Maps <i>zatím</i> neobsahují cool vychytávky jako veřejnou dopravu nebo satelitní mapy, <i>s vaší pomocí a podporou</i> ale můžeme postupně mapy vylepšovat.
Aplikace Organic Maps je <b>čistá a organická, vytvořená s láskou</b>:
• Neskutečně rychlý offline zážitek
• Respektuje vaše soukromí
• Šetří vaší baterii
• Žádné neočekávané poplatky za mobilní data
• Je jednoduchá na používání, obsahuje pouze nejdůležitější funkce
Neobsahuje sledovací prvky a další špatnosti:
• Není nutný mobilní signál - vyhledávání a trasování bez signálu
• Efektivní využití baterie - menší vybíjení baterie
• Rychlé vyhledávání - rychlé vyhledávání míst
V Organic Maps si ceníme soukromí:
• Žádné sledování polohy
• Žádné shromažďování dat
• Žádné reklamy
• Žádné sledování
• Žádné sbírání dat
• Žádné volání domů
• Žádná otravná registrace
• Žádné povinné tutoriály
• Žádný e-mailový spam
• Žádná vyskakovací oznámení
• Žádný crapware
• Ž̶á̶d̶n̶é̶ ̶p̶e̶s̶t̶i̶c̶i̶d̶y̶ Plně organické
V Organic Maps věříme, že <b>soukromí je základní lidské právo</b>:
• Organic Maps jsou nezávislý komunitní open-source projekt
• Chráníme vaše soukromí před zvědavýma očima Big Tech firem
• Nezávisle na vašem umístění jste v bezpečí
Podle hlášení Exodus Privacy neobsahuje aplikace žádné sledovací prvky a vyžaduje pouze minimální množství oprávnění.
Pro další podrobnosti a často kladené dotazy prosím navštivte webové stránky <b><i>organicmaps.app</i></b>. Kontaktovat nás můžete přes @OrganicMapsApp na Telegramu.
Odmítněte sledování - přijměte svou svobodu.
<b>Vyzkoušejte Organic Maps!</b>

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• Nová data z OpenStreetMap z 13. listopadu
• Maximální úroveň přiblížení je nyní dvakrát hloubější, než dříve
• Opraveno importování záložek ve formátu KMB
• Ve výchozím nastavení vypnuta možnost Zobrazit na uzamčené obrazovce
• Opravena indikace vyhledávání umístění při přiblížení nebo pohnutí s mapou
• Náhled stylu venkovních map - jak jej aktivovat a spoustu dalších vylepšení najdete na omaps.org/news

View file

@ -1,7 +1,7 @@
‣ Our free app does not track you, does not have ads, and it needs your support.
‣ It is constantly being improved by contributors and our small team, in our free time.
‣ If something is wrong or missing on the map, please fix it in <b>OpenStreetMap</b> and see your changes in the future maps update.
‣ If navigation or search doesn't work, please check it on osm.org first, and then email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
‣ If navigation or search doesn't work, please email us. We reply to <i>EVERY</i> email, and we'll fix it ASAP!
<b>Your feedback and 5-star reviews are the best motivators for us!</b>
@ -11,12 +11,12 @@ Key features:
• Detailed offline maps with places that don't exist on Google maps, thanks to the <b>OpenStreetMap</b> community
• Cycling routes, hiking trails, and walking paths
• Contour lines, elevation profiles, peaks, and slopes
• Turn-by-turn walking, cycling, and car navigation with voice guidance and Android Auto
• Turn-by-turn walking, cycling, and EXPERIMENTAL car navigation with voice guidance
• Fast offline search
• Bookmarks and tracks export and import in KML, KMZ, GPX formats
• Dark mode to protect your eyes
There is no public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make better maps step by step.
There is no Android Auto, public transport, satellite maps, and other cool features <i>yet</i> in Organic Maps. But with <i>your help and support</i>, we can make this world better step by step.
Organic Maps is <b>pure and organic, made with love</b>:

View file

@ -1,8 +1,6 @@
• New OpenStreetMap data as of February 27
• Ability to manually arrange intermediate route points
• Share a single selected track from the list
• Improved routing for bicycles
• Display a system notification when downloading maps and don't interrupt background downloads
• Added a flashing Track Recording widget
…more details at omaps.org/news
• New OpenStreetMap data as of November 13
• The maximum zoom level is twice as deep as it was before
• Fixed import of bookmarks in KMB format
• Disabled the screen wake lock by default to improve power-saving
• Corrected the location search indication when the map is moved or zoomed
• Outdoors map style preview - read on how to activate it and about many other improvements on omaps.org/news

View file

@ -1,53 +1,10 @@
‣ Unsere kostenlose App trackt niemanden, enthält keine Werbung und braucht deine Unterstützung.
‣ Sie wird ständig von Mitwirkenden und unserem kleinen Team verbessert, in unserer Freizeit.
‣ Wenn etwas auf der Karte falsch ist oder fehlt, dann korrigiere es bitte in <b>OpenStreetMap</b> und sieh deine Änderungen in der zukünftigen Kartenaktualisierung.
‣ Sollte die Navigation oder die Suche nicht funktionieren, sende uns bitte eine E-Mail. Wir antworten auf <i>JEDE</i> E-Mail und werden das Problem so schnell wie möglich beheben!
Organic Maps ist eine GPS-Navigations-App mit Fokus auf Datenschutz für Autofahrer, Wanderer und Radfahrer. Die App bietet Navigation mit Datenschutz - keine Standortverfolgung, keine Datenerfassung und keine Werbung. Die Suche, Routenplanung und Navigation funktionieren ohne Mobilfunksignal und sind ideal für Reisen auf entlegenen Wanderwegen oder in Regionen mit schlechter Verbindung. Organic Maps verwendet die von der OpenStreetMap-Community bereitgestellten Daten mit Beitragenden aus der ganzen Welt. Das Projekt ist community-getrieben, der Code ist Open Source und legt Wert auf die Entwicklung und Zusammenarbeit in der Gemeinschaft.
<b>Dein Feedback und deine 5-Sterne-Bewertungen sind die beste Motivation für uns!</b>
• Kein Mobilfunksignal erforderlich - Suche und Routenplanung ohne Signal
• Effiziente Akkunutzung - Reduzierter Akkuverbrauch
• Schnelle Suche - Finde Standorte schnell
Wichtigste Funktionen:
• Kostenlos, Open-Source, keine Werbung, kein Tracking
• Detaillierte Offline-Karten mit Orten, die es auf anderen Karten nicht gibt, dank an die <b>OpenStreetMap</b> Community
• Rad-, Wander- und Spazierwege
• Höhenlinien, Höhenprofile, Bergspitzen und Steigungen
• Schritt-für-Schritt-Navigation für Fußgänger, Radfahrer und Autos mit Sprachführung
• Schnelle Offlinesuche
• Export und Import von Lesezeichen im KML, KMZ, GPX-Format
• Dunkler Modus zum Schutz deiner Augen
Öffentlichen Verkehrsmittel, Satellitenbildkarten und viele weitere wichtige Merkmale werden <i>noch</i> nicht unterstützt. Aber mit <i>deiner Hilfe und Unterstützung</i> können wir diese Welt und unsere Karten Schritt für Schritt besser machen.
Organic Maps ist <b>rein, organisch und mit Liebe gemacht</b>:
• Rasend schnelle Offline-Erfahrung
• Respektiert deine Privatsphäre
• Schont deinen Akku
• Keine unerwarteten Gebühren für mobile Daten
• Einfach zu bedienen, nur die wichtigsten Funktionen integriert
Frei von Trackern und schlechten Dingen:
• Keine Werbung
• Kein Tracking
Bei Organic Maps wird Datenschutz großgeschrieben:
• Keine Standortverfolgung
• Keine Datenerfassung
• Kein Telefonieren nach Hause
• Keine lästige Registrierung
• Keine obligatorischen Tutorials
• Kein lästiger E-Mail-Spam
• Keine Push-Benachrichtigungen
• Keine Crapware
• -K̶e̶i̶n̶e̶ ̶P̶e̶s̶t̶i̶z̶i̶d̶e̶ Rein organisch
Wir bei Organic Maps glauben, dass <b>Privatsphäre ein grundlegendes Menschenrecht</b> ist:
• Organic Maps ist ein von einer unabhängigen Gemeinschaft betriebenes Open-Source-Projekt
• Wir schützen deine Privatsphäre vor den neugierigen Augen der großen Technologiekonzerne
• Bleib sicher, egal wo du bist
Keine Tracker und nur minimal erforderliche Berechtigungen sind laut dem Exodus-Datenschutzbericht vorhanden.
Bitte besuche <b><i>organicmaps.app</i></b> Webseite für weitere Details und ein FAQ. Oder kontaktiere uns direkt unter @OrganicMapsApp in Telegram.
Lehne Überwachung ab - lebe deine Freiheit.
<b>Teste Organic Maps!</b>
• Keine Werbung

View file

@ -1,8 +1,6 @@
• Neue OpenStreetMap-Daten vom 27. Februar
• Möglichkeit, Zwischenroutenpunkte manuell zu arrangieren
• Einen einzelnen ausgewählten Track aus der Liste teilen
• Verbesserte Routenführung für Fahrräder
• Beim Herunterladen von Karten eine Systembenachrichtigung anzeigen und Hintergrunddownloads nicht unterbrechen
• Ein blinkendes Trackaufzeichnungs-Widget hinzugefügt
…weitere Details unter omaps.org/news
• Neue OpenStreetMap-Daten vom 13. November
• Die maximale Zoomstufe ist jetzt doppelt so tief wie zuvor
• Behebung des Imports von Lesezeichen im KMB-Format
• Standardmäßige Deaktivierung des Bildschirm-Wake-Locks zur Verbesserung der Akkulaufzeit
• Korrekte Anzeige der Ortssuche, wenn die Karte verschoben oder gezoomt wird
• Vorschau des Outdoors-Kartenstils - Weitere Informationen zur Aktivierung und zu vielen anderen Verbesserungen finden Sie auf omaps.org/news.

Some files were not shown because too many files have changed in this diff Show more