diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index d4b1009..a820e2b 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -264,4 +264,4 @@ jobs: steps: - name: PR Closed Without Merge run: | - echo "PR #${{ github.event.number }} has been closed without being merged" + echo "PR #${{ github.event.number }} has been edited or closed without being merged" diff --git a/README.md b/README.md index 0dbc469..2509097 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Hide Mock Location is an Xposed Module (now LSPosed on Android 11), which hides ## Usage * Install [module](https://github.com/Xposed-Modules-Repo/com.github.thepiemonster.hidemocklocation) from [LSPosed module store](https://github.com/LSPosed/LSPosed). * Enable module in LSPosed (select System Framework) and reboot device. +* Start a mock location provider application such as [Fake GPS Location](https://play.google.com/store/apps/details?id=com.lexa.fakegps&hl=en_US&gl=US). * That's it! You can open Hide Mock Location and view the "Test Location Data" page to view the status of the mock location setting. ## Tips diff --git a/app/build.gradle b/app/build.gradle index 18c0262..e4ac37e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "com.github.thepiemonster.hidemocklocation" minSdk 30 targetSdk 30 - versionCode 209 - versionName "2.0.9" + versionCode 210 + versionName "2.0.10" } signingConfigs { @@ -53,16 +53,12 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') //testImplementation 'junit:junit:4.12' - compileOnly 'de.robv.android.xposed:api:82' compileOnly 'de.robv.android.xposed:api:82:sources' - - implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' - implementation 'com.google.gms:google-services:4.3.10' - implementation 'com.google.android.material:material:1.5.0-alpha02' - + implementation 'com.google.gms:google-services:4.3.10' implementation 'com.drakeet.about:about:2.5.0' implementation 'com.drakeet.multitype:multitype:4.3.0' //implementation 'com.takisoft.fix:preference-v7:24.1.1.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9d72e86..35314dd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,7 +26,7 @@ + android:theme="@style/AppTheme"> diff --git a/app/src/main/java/com/github/thepiemonster/hidemocklocation/MainActivity.java b/app/src/main/java/com/github/thepiemonster/hidemocklocation/MainActivity.java index 9bf16a7..c6c86b6 100644 --- a/app/src/main/java/com/github/thepiemonster/hidemocklocation/MainActivity.java +++ b/app/src/main/java/com/github/thepiemonster/hidemocklocation/MainActivity.java @@ -28,7 +28,11 @@ import android.text.style.ForegroundColorSpan; import android.util.Log; import android.view.View; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.widget.Toast; +import android.widget.Toolbar; public class MainActivity extends AppCompatActivity { @@ -78,6 +82,29 @@ protected void onCreate(Bundle savedInstanceState) { // Go to activity_main layout setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); + /* + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + // Display application icon in the toolbar + getSupportActionBar().setDisplayShowHomeEnabled(true); + getSupportActionBar().setLogo(R.drawable.app_icon); + getSupportActionBar().setDisplayUseLogoEnabled(true); + + // assigning ID of textView2 to a variable + textView = (TextView) findViewById(R.id.textView2); + + + // "on click" operations to be performed + textView.setOnClickListener(new View.OnClickListener() { + @Override + + // incrementing the value of textView + public void onClick( View view ) { + count++; + textView.setText("" + count); + } + });*/ + binding = ActivityMainBinding.inflate(getLayoutInflater()); // inflating our xml layout in our activity main binding setModuleState(binding); binding.menuDetectionTest.setOnClickListener(new View.OnClickListener() { @@ -198,7 +225,7 @@ public void getMockLocationSetting() { string.setSpan(new ForegroundColorSpan(isMockSettingsNewerThanAndroid6Color), infoTextCount + isMockSettingsOlderThanAndroid6TextCountTotal + isMockSettingsNewerThanAndroid6TextCount, infoTextCount + isMockSettingsOlderThanAndroid6TextCountTotal + isMockSettingsNewerThanAndroid6TextCount + isMockSettingsNewerThanAndroid6BoolCount, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); dialogBuilder.setMessage(string); - dialogBuilder.setNegativeButton(getString(R.string.alert_dialog_close), new DialogInterface.OnClickListener() { + dialogBuilder.setPositiveButton(getString(R.string.alert_dialog_close), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } @@ -255,9 +282,6 @@ public void onProviderDisabled(String provider) { } }; - - - /* @OnCheckedChanged(R.id.list_type) public void changeListType(boolean isChecked) { @@ -295,30 +319,12 @@ public void changeListType(boolean isChecked) { } } + @Override public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.action_menu, menu); - - final MenuItem searchItem = menu.findItem(R.id.action_search); - final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); - // Resize searchView - searchView.setMaxWidth(Integer.MAX_VALUE); - - searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { - @Override - public boolean onQueryTextSubmit(String query) { - adapter.filter(query); - searchView.clearFocus(); - return true; - } - - @Override - public boolean onQueryTextChange(String newText) { - adapter.filter(newText); - return true; - } - }); return true; } @@ -337,11 +343,7 @@ public boolean onOptionsItemSelected(MenuItem item) { default: return super.onOptionsItemSelected(item); } - return true; - } -*/ - - + }*/ /** * Creates an alert dialog window with the supplied exception message @@ -398,19 +400,21 @@ public void onClick(DialogInterface dialogInterface, int i) { private void setModuleState(ActivityMainBinding binding) { if (isModuleEnabled()) { binding.moduleStatusCard.setCardBackgroundColor(getColor(R.color.purple_500)); - binding.moduleStatusIcon.setImageDrawable(AppCompatResources.getDrawable(this, - R.drawable.baseline_check_circle_24)); + //binding.moduleStatusCard.setBackgroundTintList(this.getColorStateList(R.color.purple_500)); + binding.moduleStatusIcon.setImageDrawable(AppCompatResources.getDrawable(this, R.drawable.baseline_check_circle_24)); binding.moduleStatusText.setText(getString(R.string.card_title_activated)); binding.serviceStatusText.setText(getString(R.string.card_detail_activated)); binding.serveTimes.setText(getString(R.string.card_serve_time)); } else { binding.moduleStatusCard.setCardBackgroundColor(getColor(R.color.red_500)); - binding.moduleStatusIcon.setImageDrawable(AppCompatResources.getDrawable(this, - R.drawable.baseline_error_24)); + //binding.moduleStatusCard.setBackgroundTintList(this.getColorStateList(R.color.red_500)); + binding.moduleStatusIcon.setImageDrawable(AppCompatResources.getDrawable(this, R.drawable.baseline_error_24)); binding.moduleStatusText.setText(getText(R.string.card_title_not_activated)); binding.serviceStatusText.setText(getText(R.string.card_detail_not_activated)); binding.serveTimes.setVisibility(View.GONE); } + binding.menuDetectionTest.setCardBackgroundColor(getColor(R.color.softGray)); + binding.menuAbout.setCardBackgroundColor(getColor(R.color.softGray)); } /** diff --git a/app/src/main/res/drawable-hdpi/ic_action_search.png b/app/src/main/res/drawable-hdpi/ic_action_search.png deleted file mode 100644 index 45c099a..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_action_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_settings.png b/app/src/main/res/drawable-hdpi/ic_settings.png deleted file mode 100644 index e613122..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_settings.png and /dev/null differ diff --git a/app/src/main/res/drawable-ldpi/ic_action_search.png b/app/src/main/res/drawable-ldpi/ic_action_search.png deleted file mode 100644 index 7ca935a..0000000 Binary files a/app/src/main/res/drawable-ldpi/ic_action_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-ldpi/ic_settings.png b/app/src/main/res/drawable-ldpi/ic_settings.png deleted file mode 100644 index 83895c8..0000000 Binary files a/app/src/main/res/drawable-ldpi/ic_settings.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_search.png b/app/src/main/res/drawable-mdpi/ic_action_search.png deleted file mode 100644 index 174ccaa..0000000 Binary files a/app/src/main/res/drawable-mdpi/ic_action_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_settings.png b/app/src/main/res/drawable-mdpi/ic_settings.png deleted file mode 100644 index 2c57cbb..0000000 Binary files a/app/src/main/res/drawable-mdpi/ic_settings.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_search.png b/app/src/main/res/drawable-xhdpi/ic_action_search.png deleted file mode 100644 index 079c9a3..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_action_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_settings.png b/app/src/main/res/drawable-xhdpi/ic_settings.png deleted file mode 100644 index 83f7f11..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_settings.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_search.png b/app/src/main/res/drawable-xxhdpi/ic_action_search.png deleted file mode 100644 index 7d8c57b..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_settings.png b/app/src/main/res/drawable-xxhdpi/ic_settings.png deleted file mode 100644 index 97a855d..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_settings.png and /dev/null differ diff --git a/app/src/main/res/drawable/baseline_my_location_24.xml b/app/src/main/res/drawable/baseline_my_location_24.xml index b050330..5b16d5f 100644 --- a/app/src/main/res/drawable/baseline_my_location_24.xml +++ b/app/src/main/res/drawable/baseline_my_location_24.xml @@ -4,7 +4,7 @@ android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> - diff --git a/app/src/main/res/drawable/baseline_settings_24.xml b/app/src/main/res/drawable/baseline_settings_24.xml new file mode 100644 index 0000000..ff809b4 --- /dev/null +++ b/app/src/main/res/drawable/baseline_settings_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3400cb2..076eadc 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -2,14 +2,53 @@ + android:orientation="vertical" > + + + + + + + + + + + + + + style="@style/DefaultCard" + android:layout_below="@+id/appBarLayout"> - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ec691f6..3a2f96a 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,7 +3,6 @@ #3F51B5 #303F9F #ff80ab - #757575 @color/colorAccent #FFBB86FC #FF6200EE @@ -14,4 +13,9 @@ #FF000000 #FFFFFFFF #EEEEEE + #121212 + #212121 + #1D1D1D + #424242 + #B1B1B1 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1f2b810..dab2ac2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,7 +34,7 @@ This module is designed to hide the use of the Android Mock Locations feature from system and application usage. When this module is enabled, the mock locations feature will show as disabled to all applications. \n\nhttps://github.com/ThePieMonster/HideMockLocation Legal - You agree to use this module (i.e. Hide Mock Locations) only for legally compliant purposes. You agree that the author will not be held liable for any consequences resulting from a violation of this statement. \n\nBy continuing to use this module, you agree to the above terms. + You agree to use this module (i.e. Hide Mock Location) only for legally compliant purposes. You agree that the author will not be held liable for any consequences resulting from a violation of this statement. \n\nBy continuing to use this module, you agree to the above terms. Recommendations diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1773f42..ddec622 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,22 +1,20 @@ - - +