Skip to content

Commit

Permalink
Merge pull request #9 from wardellbagby/develop
Browse files Browse the repository at this point in the history
The Lollipop Fix V2: Electric Boogaloo.
  • Loading branch information
wardellbagby committed Dec 23, 2017
2 parents 822f942 + 7076d05 commit d258ebf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mrchandler.disableprox"
android:versionCode="10"
android:versionName="2.1.1">
android:versionCode="11"
android:versionName="2.1.2">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mrchandler.disableprox.xposed.sensormodifications.mock;

import android.app.AndroidAppHelper;
import android.content.Context;
import android.hardware.Sensor;

Expand Down Expand Up @@ -28,7 +29,7 @@ float[].class, long[].class, int.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) {
Sensor sensor = (Sensor) param.args[0];
Context context = (Context) XposedHelpers.getObjectField(XposedHelpers.getSurroundingThis(param.thisObject), "mContext");
Context context = AndroidAppHelper.currentApplication();
//Use processName here always. Not packageName.
if (!isPackageAllowedToSeeTrueSensor(lpparam.processName, sensor, context) && getSensorStatus(sensor, context) == Constants.SENSOR_STATUS_MOCK_VALUES) {
// Get the mock values from the settings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mrchandler.disableprox.xposed.sensormodifications.remove;

import android.app.AndroidAppHelper;
import android.content.Context;
import android.hardware.Sensor;

Expand Down Expand Up @@ -34,7 +35,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//Create a new list so we don't modify the original list.
@SuppressWarnings("unchecked") List<Sensor> fullSensorList = new ArrayList<>((Collection<? extends Sensor>) param.getResult());
Iterator<Sensor> iterator = fullSensorList.iterator();
Context context = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext");
Context context = AndroidAppHelper.currentApplication();
while (iterator.hasNext()) {
Sensor sensor = iterator.next();
if (!isPackageAllowedToSeeTrueSensor(lpparam.processName, sensor, context) && getSensorStatus(sensor, context) == Constants.SENSOR_STATUS_REMOVE_SENSOR) {
Expand Down

0 comments on commit d258ebf

Please sign in to comment.