├── app ├── .gitignore ├── src │ └── main │ │ ├── assets │ │ └── xposed_init │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-hdpi │ │ │ ├── ic_info_black_24dp.png │ │ │ ├── ic_sync_black_24dp.png │ │ │ └── ic_notifications_black_24dp.png │ │ ├── drawable-mdpi │ │ │ ├── ic_info_black_24dp.png │ │ │ ├── ic_sync_black_24dp.png │ │ │ └── ic_notifications_black_24dp.png │ │ ├── drawable-xhdpi │ │ │ ├── ic_info_black_24dp.png │ │ │ ├── ic_sync_black_24dp.png │ │ │ └── ic_notifications_black_24dp.png │ │ ├── drawable-xxhdpi │ │ │ ├── ic_info_black_24dp.png │ │ │ ├── ic_sync_black_24dp.png │ │ │ └── ic_notifications_black_24dp.png │ │ ├── drawable-xxxhdpi │ │ │ ├── ic_info_black_24dp.png │ │ │ ├── ic_sync_black_24dp.png │ │ │ └── ic_notifications_black_24dp.png │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── drawable-v21 │ │ │ ├── ic_info_black_24dp.xml │ │ │ ├── ic_notifications_black_24dp.xml │ │ │ └── ic_sync_black_24dp.xml │ │ ├── layout │ │ │ └── activity_main.xml │ │ └── xml │ │ │ └── preference.xml │ │ ├── java │ │ └── name │ │ │ └── caiyao │ │ │ └── tencentsport │ │ │ ├── SettingsActivity.java │ │ │ ├── SettingFragment.java │ │ │ └── MainHook.java │ │ └── AndroidManifest.xml ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── README.md ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | name.caiyao.tencentsport.MainHook -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SportEditor 运动修改器 2 | 一个通过修改传感器数据进行运动数据修改的Xposed的模块。 3 | ##声明 4 | 本程序仅供测试,所有责任由使用者本人承担。 5 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 运动修改器 3 | 修改手机运动步数 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monkey-wenjun/SportEditor/master/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 29 03:13:51 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_info_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_sync_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/name/caiyao/tencentsport/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package name.caiyao.tencentsport; 2 | 3 | 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | import com.umeng.analytics.MobclickAgent; 8 | 9 | 10 | public class SettingsActivity extends AppCompatActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_main); 16 | getFragmentManager().beginTransaction().replace(R.id.container, new SettingFragment()).commit(); 17 | } 18 | 19 | @Override 20 | protected void onResume() { 21 | super.onResume(); 22 | MobclickAgent.onResume(this); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion '24.0.3' 6 | 7 | defaultConfig { 8 | applicationId "name.caiyao.sporteditor" 9 | minSdkVersion 16 10 | targetSdkVersion 24 11 | versionCode 127 12 | versionName "1.2.7 测试版" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled true 17 | shrinkResources true 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile fileTree(include: ['*.jar'], dir: 'libs') 25 | provided 'de.robv.android.xposed:api:81' 26 | compile 'com.umeng.analytics:analytics:latest.integration' 27 | compile 'com.android.support:appcompat-v7:24.2.1' 28 | } 29 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Sat Oct 08 15:27:40 CST 2016 16 | systemProp.http.proxyHost=127.0.0.1 17 | systemProp.http.proxyPort=1081 18 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -keep public class name.caiyao.tencentsport.MainHook 19 | -keep public class name.caiyao.tencentsport.SettingFragment{*;} 20 | -keep public class name.caiyao.sporteditor.R$*{ 21 | public static final int *; 22 | } 23 | -keepclassmembers class * { 24 | public (org.json.JSONObject); 25 | } 26 | -keepclassmembers enum * { 27 | public static **[] values(); 28 | public static ** valueOf(java.lang.String); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 17 | 20 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/java/name/caiyao/tencentsport/SettingFragment.java: -------------------------------------------------------------------------------- 1 | package name.caiyao.tencentsport; 2 | 3 | 4 | import android.content.ComponentName; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.content.pm.PackageManager; 8 | import android.os.Bundle; 9 | import android.preference.EditTextPreference; 10 | import android.preference.Preference; 11 | import android.preference.PreferenceFragment; 12 | 13 | public class SettingFragment extends PreferenceFragment implements Preference.OnPreferenceChangeListener, SharedPreferences.OnSharedPreferenceChangeListener { 14 | 15 | private EditTextPreference mEditTextPreference; 16 | 17 | public SettingFragment() { 18 | } 19 | 20 | @Override 21 | public void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | getPreferenceManager().setSharedPreferencesMode(1); 24 | getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); 25 | addPreferencesFromResource(R.xml.preference); 26 | } 27 | 28 | @Override 29 | public void onActivityCreated(Bundle savedInstanceState) { 30 | super.onActivityCreated(savedInstanceState); 31 | mEditTextPreference = (EditTextPreference) findPreference("magnification"); 32 | findPreference("version").setSummary(BuildConfig.VERSION_NAME); 33 | changeSummary(); 34 | } 35 | 36 | @Override 37 | public boolean onPreferenceChange(Preference preference, Object newValue) { 38 | changeSummary(); 39 | getKey(); 40 | return true; 41 | } 42 | 43 | private void getKey() { 44 | String SETTING_CHANGED = "name.caiyao.tencentsport.SETTING_CHANGED"; 45 | Intent intent = new Intent(SETTING_CHANGED); 46 | intent.putExtra("weixin", getPreferenceManager().getSharedPreferences().getBoolean("weiixn", true)); 47 | intent.putExtra("qq", getPreferenceManager().getSharedPreferences().getBoolean("qq", true)); 48 | intent.putExtra("magnification", getPreferenceManager().getSharedPreferences().getString("magnification", "100")); 49 | intent.putExtra("autoincrement", getPreferenceManager().getSharedPreferences().getBoolean("autoincrement", false)); 50 | intent.putExtra("ledong", getPreferenceManager().getSharedPreferences().getBoolean("ledong", true)); 51 | intent.putExtra("yuedong", getPreferenceManager().getSharedPreferences().getBoolean("yuedong", true)); 52 | intent.putExtra("pingan", getPreferenceManager().getSharedPreferences().getBoolean("pingan", true)); 53 | intent.putExtra("codoon", getPreferenceManager().getSharedPreferences().getBoolean("codoon", true)); 54 | intent.putExtra("weibo", getPreferenceManager().getSharedPreferences().getBoolean("weibo", true)); 55 | intent.putExtra("alipay", getPreferenceManager().getSharedPreferences().getBoolean("alipay", true)); 56 | if (getActivity() != null) { 57 | getActivity().sendBroadcast(intent); 58 | } 59 | boolean enabled = getPreferenceManager().getSharedPreferences().getBoolean("icon", true); 60 | int state; 61 | if (enabled) { 62 | state = PackageManager.COMPONENT_ENABLED_STATE_ENABLED; 63 | } else { 64 | state = PackageManager.COMPONENT_ENABLED_STATE_DISABLED; 65 | } 66 | getActivity().getPackageManager().setComponentEnabledSetting(new ComponentName(getActivity(), "name.caiyao.sporteditor.SettingsActivity-Alias"), state, 1); 67 | } 68 | 69 | private void changeSummary() { 70 | if (mEditTextPreference != null) 71 | mEditTextPreference.setSummary(getPreferenceManager().getSharedPreferences().getString("magnification", "1000")); 72 | } 73 | 74 | @Override 75 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { 76 | changeSummary(); 77 | getKey(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 15 | 21 | 24 | 25 | 26 | 32 | 38 | 44 | 50 | 56 | 62 | 65 | 66 | 67 | 68 | 74 | 80 | 83 | 86 | 89 | 90 | 94 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /app/src/main/java/name/caiyao/tencentsport/MainHook.java: -------------------------------------------------------------------------------- 1 | package name.caiyao.tencentsport; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.hardware.Sensor; 8 | import android.hardware.SensorEvent; 9 | import android.util.SparseArray; 10 | 11 | import java.lang.reflect.Field; 12 | 13 | import de.robv.android.xposed.IXposedHookLoadPackage; 14 | import de.robv.android.xposed.IXposedHookZygoteInit; 15 | import de.robv.android.xposed.XC_MethodHook; 16 | import de.robv.android.xposed.XSharedPreferences; 17 | import de.robv.android.xposed.XposedBridge; 18 | import de.robv.android.xposed.XposedHelpers; 19 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 20 | 21 | /** 22 | * Created by 蔡小木 on 2016/2/16 0016. 23 | */ 24 | public class MainHook implements IXposedHookLoadPackage, IXposedHookZygoteInit { 25 | private static final String WEXIN = "com.tencent.mm"; 26 | private static final String QQ = "com.tencent.mobileqq"; 27 | private static final String YUEDONG = "com.yuedong.sport"; 28 | private static final String LEDONG = "cn.ledongli.ldl"; 29 | private static final String PINGAN = "com.pingan.papd"; 30 | private static final String CODOON = "com.codoon.gps"; 31 | private static final String WEIBO = "com.sina.weibo"; 32 | private static final String ZHIFUBAO = "com.eg.android.AlipayGphone"; 33 | private static int weixinCount = 0, qqCount = 0, ledongCount = 0, yuedongCount = 0, pinganCount = 0, codoonCount = 0; 34 | private static float count = 0; 35 | private static boolean isWeixin, isQQ, isAuto, isLedong, isYuedong, isPingan, isCodoon, isWeibo, isAlipay; 36 | private XSharedPreferences sharedPreferences; 37 | private static int m, max = Integer.MAX_VALUE; 38 | 39 | private static Object sObject; 40 | 41 | @Override 42 | public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable { 43 | final Object activityThread = XposedHelpers.callStaticMethod(XposedHelpers.findClass("android.app.ActivityThread", null), "currentActivityThread"); 44 | final Context systemContext = (Context) XposedHelpers.callMethod(activityThread, "getSystemContext"); 45 | IntentFilter intentFilter = new IntentFilter(); 46 | String SETTING_CHANGED = "name.caiyao.tencentsport.SETTING_CHANGED"; 47 | intentFilter.addAction(SETTING_CHANGED); 48 | systemContext.registerReceiver(new BroadcastReceiver() { 49 | @Override 50 | public void onReceive(Context context, Intent intent) { 51 | isWeixin = intent.getExtras().getBoolean("weixin", true); 52 | isQQ = intent.getExtras().getBoolean("qq", true); 53 | m = Integer.valueOf(intent.getExtras().getString("magnification", "100")); 54 | isAuto = intent.getExtras().getBoolean("autoincrement", false); 55 | isLedong = intent.getExtras().getBoolean("ledong", true); 56 | isYuedong = intent.getExtras().getBoolean("yuedong", true); 57 | isPingan = intent.getExtras().getBoolean("pingan", true); 58 | isCodoon = intent.getExtras().getBoolean("codoon", true); 59 | isWeibo = intent.getExtras().getBoolean("weibo", true); 60 | isAlipay = intent.getExtras().getBoolean("alipay", true); 61 | } 62 | }, intentFilter); 63 | 64 | if (loadPackageParam.packageName.equals(YUEDONG) || loadPackageParam.packageName.equals(CODOON)) { 65 | Thread autoThread = new Thread() { 66 | @Override 67 | public void run() { 68 | while (!isInterrupted()) { 69 | if (isYuedong) { 70 | try { 71 | Thread.sleep(100); 72 | if (sObject != null) { 73 | count++; 74 | XposedHelpers.callMethod(sObject, "dispatchSensorEvent", 5, new float[]{count, 0, 0}, 3, System.currentTimeMillis()); 75 | } 76 | if (count == Integer.MAX_VALUE) { 77 | count = 0; 78 | } 79 | } catch (InterruptedException e) { 80 | e.printStackTrace(); 81 | } 82 | } 83 | if (isCodoon) { 84 | try { 85 | Thread.sleep(100); 86 | if (sObject != null) { 87 | count++; 88 | XposedHelpers.callMethod(sObject, "dispatchSensorEvent", 5, new float[]{count, 0, 0}, 3, System.currentTimeMillis()); 89 | } 90 | if (count == Integer.MAX_VALUE) { 91 | count = 0; 92 | } 93 | } catch (InterruptedException e) { 94 | e.printStackTrace(); 95 | } 96 | } 97 | } 98 | } 99 | }; 100 | autoThread.start(); 101 | } 102 | 103 | if (loadPackageParam.packageName.equals(ZHIFUBAO) || loadPackageParam.packageName.equals(WEIBO) || loadPackageParam.packageName.equals(PINGAN) || loadPackageParam.packageName.equals(WEXIN) || loadPackageParam.packageName.equals(QQ) || loadPackageParam.packageName.equals(LEDONG) || loadPackageParam.packageName.equals(YUEDONG) || loadPackageParam.packageName.equals(CODOON)) { 104 | getKey(); 105 | final Class sensorEL = XposedHelpers.findClass("android.hardware.SystemSensorManager$SensorEventQueue", loadPackageParam.classLoader); 106 | XposedBridge.hookAllMethods(sensorEL, "dispatchSensorEvent", new XC_MethodHook() { 107 | @Override 108 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 109 | int handle = (Integer) param.args[0]; 110 | sObject = param.thisObject; 111 | Field field = param.thisObject.getClass().getDeclaredField("mSensorsEvents"); 112 | field.setAccessible(true); 113 | Sensor ss = ((SparseArray) field.get(param.thisObject)).get(handle).sensor; 114 | if (ss == null) { 115 | XposedBridge.log("传感器为NULL"); 116 | return; 117 | } 118 | if (ss.getType() == Sensor.TYPE_ACCELEROMETER) { 119 | if (isLedong && loadPackageParam.packageName.equals(LEDONG)) { 120 | ledongCount += 1; 121 | //完美 122 | if (ledongCount % 3 == 0) { 123 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * 100; 124 | ((float[]) param.args[1])[1] += (float) -10; 125 | } else if (ledongCount % 2 == 0) { 126 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * 1000; 127 | ((float[]) param.args[1])[2] += (float) -20; 128 | ((float[]) param.args[1])[1] += (float) -5; 129 | } else { 130 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * 10; 131 | ((float[]) param.args[1])[2] += (float) 20; 132 | ((float[]) param.args[1])[1] += (float) -15; 133 | } 134 | } 135 | if (isYuedong && loadPackageParam.packageName.equals(YUEDONG)) { 136 | yuedongCount += 1; 137 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * 1000; 138 | if (yuedongCount % 2 == 0) { 139 | ((float[]) param.args[1])[2] += (float) -20; 140 | ((float[]) param.args[1])[1] += (float) -5; 141 | } else { 142 | ((float[]) param.args[1])[2] += (float) 20; 143 | ((float[]) param.args[1])[1] += (float) -15; 144 | } 145 | } 146 | if (isPingan && loadPackageParam.packageName.equals(PINGAN)) { 147 | pinganCount += 1; 148 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * 1000; 149 | if (pinganCount % 2 == 0) { 150 | ((float[]) param.args[1])[2] += (float) -20; 151 | ((float[]) param.args[1])[1] += (float) -5; 152 | } else { 153 | ((float[]) param.args[1])[2] += (float) 20; 154 | ((float[]) param.args[1])[1] += (float) -15; 155 | } 156 | } 157 | if (isCodoon && loadPackageParam.packageName.equals(CODOON)) { 158 | codoonCount += 1; 159 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * 1000; 160 | if (codoonCount % 2 == 0) { 161 | ((float[]) param.args[1])[2] += (float) -20; 162 | ((float[]) param.args[1])[1] += (float) -5; 163 | } else { 164 | ((float[]) param.args[1])[2] += (float) 20; 165 | ((float[]) param.args[1])[1] += (float) -15; 166 | } 167 | } 168 | } 169 | if (ss.getType() == Sensor.TYPE_STEP_COUNTER || ss.getType() == Sensor.TYPE_STEP_DETECTOR) { 170 | if ((isWeixin && loadPackageParam.packageName.equals(WEXIN))) { 171 | if (isAuto) { 172 | if (m * weixinCount < max) { 173 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] + m * weixinCount; 174 | weixinCount += 1; 175 | } else { 176 | weixinCount = 0; 177 | } 178 | } else { 179 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * m; 180 | } 181 | } 182 | if ((isQQ && loadPackageParam.packageName.equals(QQ))) { 183 | if (isAuto) { 184 | if (m * qqCount < max) { 185 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] + m * qqCount; 186 | qqCount += 1; 187 | } else { 188 | qqCount = 0; 189 | } 190 | } else { 191 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * m; 192 | } 193 | } 194 | if (isAlipay && loadPackageParam.packageName.equals(ZHIFUBAO)) { 195 | if (isAuto) { 196 | if (m * qqCount < max) { 197 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] + m * qqCount; 198 | qqCount += 1; 199 | } else { 200 | qqCount = 0; 201 | } 202 | } else { 203 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * m; 204 | } 205 | } 206 | if ((isWeibo && loadPackageParam.packageName.equals(WEIBO))) { 207 | ((float[]) param.args[1])[0] = ((float[]) param.args[1])[0] * m; 208 | } 209 | XposedBridge.log(loadPackageParam.packageName + "传感器类型:" + ss.getType() + ",修改后:" + ((float[]) param.args[1])[0]); 210 | } 211 | } 212 | }); 213 | } 214 | } 215 | 216 | private void getKey() { 217 | sharedPreferences.reload(); 218 | isWeixin = sharedPreferences.getBoolean("weixin", true); 219 | isQQ = sharedPreferences.getBoolean("qq", true); 220 | m = Integer.valueOf(sharedPreferences.getString("magnification", "100")); 221 | isAuto = sharedPreferences.getBoolean("autoincrement", false); 222 | isLedong = sharedPreferences.getBoolean("ledong", true); 223 | isYuedong = sharedPreferences.getBoolean("yuedong", true); 224 | isPingan = sharedPreferences.getBoolean("pingan", true); 225 | isCodoon = sharedPreferences.getBoolean("codoon", true); 226 | isWeibo = sharedPreferences.getBoolean("weibo", true); 227 | isAlipay = sharedPreferences.getBoolean("alipay", true); 228 | } 229 | 230 | @Override 231 | public void initZygote(StartupParam startupParam) throws Throwable { 232 | sharedPreferences = new XSharedPreferences(BuildConfig.APPLICATION_ID); 233 | } 234 | } 235 | --------------------------------------------------------------------------------