Skip to content

Commit

Permalink
Merge branch 'improvements'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Feb 10, 2025
2 parents 5b7bfaa + dc146b6 commit 74deeb2
Show file tree
Hide file tree
Showing 37 changed files with 421 additions and 323 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ Sometimes you need to fake the location of your device (for privacy or to test a

## How does it work?

Long press in the map where you want to be located or type the latitude and longitude, and tap the Apply button. Tapping the "..." button you will be shown two settings to mock the location over a period of time.
Long press in the map where you want to be located or type the latitude and longitude, and tap the Apply button. Tapping the gear (⚙) button (formerly the "..." button) will show two settings to mock the location over a period of time.

<div style="display:flex;">
<img alt="App image" src="screenshots/Screenshot_Fake_Traveler_20180722-192131.png" width="30%">
<img alt="App image" src="screenshots/Screenshot_Fake_Traveler_20180722-192305.png" width="30%">
</div>

### Notes

If your reported location appears to bounce from one location to another or is otherwise unstable, you
may want to go to system **Settings**, and in **Location services**, disable **Wi-Fi scanning** and
**Bluetooth scanning** as these alternate location providers may compete with the GPS location data
you are mocking.

## Requirements?

Expand Down
15 changes: 8 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ android {
}
defaultConfig {
applicationId "cl.coders.faketraveler"
minSdkVersion 16
compileSdk 33
targetSdk 33
versionCode 10
versionName "1.9.2"
minSdkVersion 21
compileSdk 35
targetSdk 35
versionCode 200
versionName "2.0.0-beta"
}
buildTypes {
release {
Expand All @@ -23,8 +23,9 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.13.0-alpha10'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
Expand Down
21 changes: 11 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"
<uses-permission
android:name="android.permission.ACCESS_MOCK_LOCATION"
tools:ignore="MockLocation,ProtectedPermissions" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -15,23 +16,23 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="AllowBackup">
<activity android:name="cl.coders.faketraveler.MainActivity"
android:exported="true"
>
<activity
android:name="cl.coders.faketraveler.MainActivity"
android:exported="true">

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="cl.coders.faketraveler.MoreActivity"
android:parentActivityName="cl.coders.faketraveler.MainActivity"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="cl.coders.faketraveler.MoreActivity"
android:parentActivityName="cl.coders.faketraveler.MainActivity" />

<receiver
android:name=".ApplyMockBroadcastReceiver"
Expand Down
104 changes: 62 additions & 42 deletions app/src/main/assets/leaflet.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,26 @@
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-overlay-pane svg {
max-width: none !important;
max-height: none !important;
}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
width: auto;
padding: 0;
}

.leaflet-container img.leaflet-tile {
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
Expand Down Expand Up @@ -166,9 +176,6 @@

/* zoom and fade animations */

.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
Expand All @@ -183,9 +190,10 @@
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
svg.leaflet-zoom-animated {
will-change: transform;
}
}

.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
Expand Down Expand Up @@ -251,14 +259,11 @@ svg.leaflet-image-layer.leaflet-interactive path {

.leaflet-container {
background: #ddd;
outline: 0;
outline-offset: 1px;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
Expand All @@ -267,7 +272,10 @@ svg.leaflet-image-layer.leaflet-interactive path {

/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
font-size: 0.75rem;
line-height: 1.5;
}


Expand All @@ -277,8 +285,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
.leaflet-bar a {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
Expand All @@ -295,7 +302,8 @@ svg.leaflet-image-layer.leaflet-interactive path {
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
.leaflet-bar a:hover,
.leaflet-bar a:focus {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
Expand Down Expand Up @@ -385,6 +393,8 @@ svg.leaflet-image-layer.leaflet-interactive path {
}
.leaflet-control-layers label {
display: block;
font-size: 13px;
font-size: 1.08333em;
}
.leaflet-control-layers-separator {
height: 0;
Expand All @@ -393,7 +403,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
}

/* Default icon URLs */
.leaflet-default-icon-path {
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png);
}

Expand All @@ -402,23 +412,27 @@ svg.leaflet-image-layer.leaflet-interactive path {

.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
background: rgba(255, 255, 255, 0.8);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
line-height: 1.4;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
.leaflet-attribution-flag {
display: inline !important;
vertical-align: baseline !important;
width: 1em;
height: 0.6669em;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
Expand All @@ -431,14 +445,11 @@ svg.leaflet-image-layer.leaflet-interactive path {
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;

background: #fff;
background: rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.8);
text-shadow: 1px 1px #fff;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
Expand Down Expand Up @@ -474,17 +485,22 @@ svg.leaflet-image-layer.leaflet-interactive path {
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
margin: 13px 24px 13px 20px;
line-height: 1.3;
font-size: 13px;
font-size: 1.08333em;
min-height: 1px;
}
.leaflet-popup-content p {
margin: 18px 0;
margin: 17px 0;
margin: 1.3em 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-top: -1px;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
Expand All @@ -495,6 +511,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
padding: 1px;

margin: -10px auto 0;
pointer-events: auto;

-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
Expand All @@ -511,24 +528,21 @@ svg.leaflet-image-layer.leaflet-interactive path {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
width: 24px;
height: 24px;
font: 16px/24px Tahoma, Verdana, sans-serif;
color: #757575;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
color: #585858;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}

.leaflet-oldie .leaflet-popup-content-wrapper {
Expand All @@ -541,9 +555,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
Expand Down Expand Up @@ -578,7 +589,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
.leaflet-tooltip.leaflet-interactive {
cursor: pointer;
pointer-events: auto;
}
Expand Down Expand Up @@ -639,3 +650,12 @@ svg.leaflet-image-layer.leaflet-interactive path {
border-right-color: #fff;
}

/* Printing */

@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
8 changes: 4 additions & 4 deletions app/src/main/assets/leaflet.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions app/src/main/assets/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
flex-grow: 1;
width: 100%;
}
:root {
--dark-mode-filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}
@media (prefers-color-scheme: dark) {
.map-tiles,
.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
filter:var(--dark-mode-filter, none);
}
#search,
.leaflet-container {
background: #000
}
}
</style>
</head>
<body>
Expand Down Expand Up @@ -66,6 +81,7 @@

L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
className: 'map-tiles',
minZoom: 1,
maxZoom: 19,
}).addTo(map);
Expand Down
Loading

0 comments on commit 74deeb2

Please sign in to comment.