Skip to content

Commit

Permalink
Override device-specific location providers settings
Browse files Browse the repository at this point in the history
Some devices (currently addison, nx512j and oneplus3) set
config_enableNetworkLocationOverlay=false, binding permanently
com.qualcomm.location as location provider and forbidding us to use
com.google.gms as a location provider.
  • Loading branch information
corna committed Mar 16, 2018
1 parent 43e95e1 commit fb179ac
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ for branch in $BRANCH_NAME; do
if [ -d "$path" ]; then
cd "$path"
git reset -q --hard
git clean -q -fd
cd "$SRC_DIR/$branch_dir"
fi
done
Expand Down Expand Up @@ -178,6 +179,11 @@ for branch in $BRANCH_NAME; do
fi
git clean -q -f
cd ../..

# Override device-specific settings for the location providers
sed -i "1s;^;PRODUCT_PACKAGE_OVERLAYS := vendor/$vendor/overlay/microg\n;" "vendor/$vendor/config/common.mk"
mkdir -p "vendor/$vendor/overlay/microg/frameworks/base/core/res/res/values/"
cp /root/signature_spoofing_patches/frameworks_base_config.xml "vendor/$vendor/overlay/microg/frameworks/base/core/res/res/values/config.xml"
else
echo ">> [$(date)] ERROR: can't find a suitable signature spoofing patch for the current Android version ($android_version)"
exit 1
Expand Down
25 changes: 25 additions & 0 deletions src/signature_spoofing_patches/frameworks_base_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Copyright (c) 2012-2016, The Linux Foundation. All rights reserved
Not a Contribution.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
-->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<!-- Force-enable the location overlays -->
<bool name="config_enableNetworkLocationOverlay" translatable="false">true</bool>
<bool name="config_enableFusedLocationOverlay" translatable="false">true</bool>

</resources>

0 comments on commit fb179ac

Please sign in to comment.