Browse Source

Updated Andr0id pr0ject files to work w/ Studio v4.0, simplified .gitignores (one inside Android st00dio dir for all that shit and one in the git root for errythang else), VERSION_CODE property file is now created if it doesn't exist, explicitly disable minify for debug builds, fixed/suppressed a bunch of code inspection warnings/errors, standardised version numbering (x.y.z), some security fixes (e.g no longer export services lmoa), build number on settings screen now includes build type (debug/release/etc), use commit() instead of apply() for prefs (the former makes it apply immediately, fuck that delayed bullshit), updated Gradle dependencies to the latest version where possibru, added custom project search sc0pe, reimported certain image assets cuz shit was bitching about improper DPI and pr0lly some other misc fixes xdxd

Wazakindjes 1 year ago
parent
commit
da08f6f924
36 changed files with 378 additions and 182 deletions
  1. 0 33
      .gitignore
  2. BIN
      app/Meqqy.apk
  3. 90 9
      app/src/.gitignore
  4. 109 25
      app/src/.idea/codeStyles/Project.xml
  5. 11 0
      app/src/.idea/inspectionProfiles/Project_Default.xml
  6. 40 0
      app/src/.idea/jarRepositories.xml
  7. 12 2
      app/src/.idea/misc.xml
  8. 3 0
      app/src/.idea/scopes/Project_sauce.xml
  9. 0 1
      app/src/app_Meqqy/.gitignore
  10. 12 0
      app/src/app_Meqqy/build.gradle
  11. 1 0
      app/src/app_Meqqy/src/androidTest/java/com/jemoeder/lief/meqqy/ExampleInstrumentedTest.java
  12. 10 9
      app/src/app_Meqqy/src/main/AndroidManifest.xml
  13. 51 42
      app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MainActivity.java
  14. 3 3
      app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MuhNumberPicker.java
  15. 9 5
      app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/SettingsActivity.java
  16. BIN
      app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_reconnect.png
  17. BIN
      app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_settings.png
  18. BIN
      app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_reconnect.png
  19. BIN
      app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_settings.png
  20. BIN
      app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_reconnect.png
  21. BIN
      app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_settings.png
  22. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_reconnect.png
  23. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_settings.png
  24. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_reconnect.png
  25. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_settings.png
  26. 0 9
      app/src/app_Meqqy/src/main/res/drawable/ic_info_black_24dp.xml
  27. 0 9
      app/src/app_Meqqy/src/main/res/drawable/ic_notifications_black_24dp.xml
  28. 0 9
      app/src/app_Meqqy/src/main/res/drawable/ic_sync_black_24dp.xml
  29. 11 11
      app/src/app_Meqqy/src/main/res/layout/activity_main.xml
  30. 5 3
      app/src/app_Meqqy/src/main/res/menu/main.xml
  31. 3 2
      app/src/app_Meqqy/src/main/res/values/strings.xml
  32. 0 6
      app/src/app_Meqqy/src/main/res/values/styles.xml
  33. 3 2
      app/src/app_Meqqy/src/main/res/xml/network_security_config.xml
  34. 2 0
      app/src/app_Meqqy/version.properties
  35. 1 1
      app/src/build.gradle
  36. 2 1
      app/src/gradle/wrapper/gradle-wrapper.properties

+ 0 - 33
.gitignore

@@ -4,37 +4,4 @@ $RECYCLE.BIN
 .*.swp
 *-bak*
 *.ini
-*.conf
 /ssl
-
-/app/release
-/app/src/.idea/assetWizardSettings.xml
-/app/src/.idea/caches
-/app/src/.idea/gradle.xml
-/app/src/.idea/libraries
-/app/src/.idea/modules.xml
-/app/src/.idea/workspace.xml
-
-.gradle/
-build/
-*.class
-*.dex
-local.properties
-proguard/
-*.log
-.navigation/
-captures/
-*.iml
-/app/src/.idea/tasks.xml
-/app/src/.idea/dictionaries
-.externalNativeBuild
-google-services.json
-freeline.py
-freeline/
-freeline_project_description.json
-fastlane/report.xml
-fastlane/Preview.html
-fastlane/screenshots
-fastlane/test_output
-fastlane/readme.md
-

BIN
app/Meqqy.apk


+ 90 - 9
app/src/.gitignore

@@ -1,11 +1,92 @@
+# .gitignore to put in the rewt of an Android Studio pr0ject dir ;]
+# Got this shit from: https://github.com/github/gitignore/blob/master/Android.gitignore
+
+# Built application files
+*.apk
+*.aar
+*.ap_
+*.aab
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Any release files should be generated and stored outside the project dir, e.g. in the *git tree* rewtt dir
+release/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# IntelliJ
 *.iml
-.gradle
-/local.properties
-/.idea/caches/build_file_checksums.ser
-/.idea/libraries
-/.idea/modules.xml
-/.idea/workspace.xml
-.DS_Store
-/build
-/captures
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/assetWizardSettings.xml
+.idea/dictionaries
+.idea/libraries
+# Android Studio 3 in .gitignore file.
+.idea/caches
+.idea/modules.xml
+# Comment next line if keeping position of elements in Navigation Editor is relevant for you
+.idea/navEditor.xml
+
+# Keystore files
+# The project is set up to read the necessary information from Keychain shit instead =]
+*.jks
+*.keystore
+
+# External native build folder generated in Android Studio 2.2 and later
 .externalNativeBuild
+.cxx/
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json
+
+# fastlane
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots
+fastlane/test_output
+fastlane/readme.md
+
+# Version control
+vcs.xml
+
+# lint
+lint/intermediates/
+lint/generated/
+lint/outputs/
+lint/tmp/
+lint/reports/
+
+# Android Profiling
+*.hprof

+ 109 - 25
app/src/.idea/codeStyles/Project.xml

@@ -1,29 +1,113 @@
 <component name="ProjectCodeStyleConfiguration">
   <code_scheme name="Project" version="173">
-    <Objective-C-extensions>
-      <file>
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
-      </file>
-      <class>
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
-      </class>
-      <extensions>
-        <pair source="cpp" header="h" fileNamingConvention="NONE" />
-        <pair source="c" header="h" fileNamingConvention="NONE" />
-      </extensions>
-    </Objective-C-extensions>
+    <codeStyleSettings language="XML">
+      <arrangement>
+        <rules>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:android</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:id</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>style</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+        </rules>
+      </arrangement>
+    </codeStyleSettings>
   </code_scheme>
 </component>

+ 11 - 0
app/src/.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,11 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="AndroidLintTypos" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
+      <option name="processCode" value="true" />
+      <option name="processLiterals" value="true" />
+      <option name="processComments" value="true" />
+    </inspection_tool>
+  </profile>
+</component>

+ 40 - 0
app/src/.idea/jarRepositories.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
+      <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
+      <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/google/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" />
+      <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" />
+      <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
+      <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
+      <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/android/m2repository/" />
+    </remote-repository>
+  </component>
+</project>

+ 12 - 2
app/src/.idea/misc.xml

@@ -5,7 +5,7 @@
     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
     <option name="myNullables">
       <value>
-        <list size="7">
+        <list size="12">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
           <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
@@ -13,18 +13,28 @@
           <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
           <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
           <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
+          <item index="7" class="java.lang.String" itemvalue="android.annotation.Nullable" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
+          <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
+          <item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
+          <item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
         </list>
       </value>
     </option>
     <option name="myNotNulls">
       <value>
-        <list size="6">
+        <list size="11">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
           <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
           <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
+          <item index="6" class="java.lang.String" itemvalue="android.annotation.NonNull" />
+          <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
+          <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
+          <item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
         </list>
       </value>
     </option>

+ 3 - 0
app/src/.idea/scopes/Project_sauce.xml

@@ -0,0 +1,3 @@
+<component name="DependencyValidationManager">
+  <scope name="Project sauce" pattern="file:src/main/java//*||file:src/main/res//*||file:*.gradle||file:AndroidManifest.xml" />
+</component>

+ 0 - 1
app/src/app_Meqqy/.gitignore

@@ -1 +0,0 @@
-/build

+ 12 - 0
app/src/app_Meqqy/build.gradle

@@ -31,6 +31,16 @@ android {
 		}
 	}
 
+	def versionPropsFile = file('version.properties')
+	def vcode = 0 // Apparently Gradle builds it twice the initial time, so by setting this to 0 it will become 1 when Gradle's done
+	Properties versionProps = new Properties()
+	if(versionPropsFile.canRead()) {
+		versionProps.load(new FileInputStream(versionPropsFile))
+		vcode = versionProps['VERSION_CODE'].toInteger() + 1
+	}
+	versionProps['VERSION_CODE'] = vcode.toString()
+	versionProps.store(versionPropsFile.newWriter(), null)
+
 	compileSdkVersion 28
 	defaultConfig {
 		applicationId "com.jemoeder.lief.meqqy"
@@ -39,6 +49,7 @@ android {
 		targetSdkVersion 25
 		testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 		signingConfig signingConfigs.muhconfig
+		versionCode vcode
 	}
 	buildTypes {
 		release {
@@ -48,6 +59,7 @@ android {
 			signingConfig signingConfigs.muhconfig
 		}
 		debug {
+			minifyEnabled false // Explicitly disable lmao
 			signingConfig signingConfigs.muhconfig
 		}
 

+ 1 - 0
app/src/app_Meqqy/src/androidTest/java/com/jemoeder/lief/meqqy/ExampleInstrumentedTest.java

@@ -16,6 +16,7 @@ import static org.junit.Assert.*;
  */
 @RunWith(AndroidJUnit4.class)
 public class ExampleInstrumentedTest {
+    @SuppressWarnings("unused")
     @Test
     public void useAppContext() {
         // Context of the app under test.

+ 10 - 9
app/src/app_Meqqy/src/main/AndroidManifest.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
+	xmlns:tools="http://schemas.android.com/tools"
 	package="com.jemoeder.lief.meqqy"
-	android:versionCode="263"
-	android:versionName="1.16">
+	android:versionName="1.1.0">
 
 	<!-- Need an internet connection to work 0bv lol -->
 	<uses-permission android:name="android.permission.INTERNET" />
@@ -14,12 +14,13 @@
 		android:allowBackup="true"
 		android:icon="@mipmap/ic_launcher"
 		android:label="@string/app_name"
-		android:name=".MeqqyWrapper"
+		android:name="com.jemoeder.lief.meqqy.MeqqyWrapper"
 		android:supportsRtl="true"
-		android:theme="@style/MeqqyTheme">
+		android:theme="@style/MeqqyTheme"
+		tools:ignore="AllowBackup">
 
 		<activity
-			android:name=".MainActivity"
+			android:name="com.jemoeder.lief.meqqy.MainActivity"
 			android:label="@string/app_name"
 			android:launchMode="singleTask"
 			android:configChanges="orientation|keyboardHidden"
@@ -34,9 +35,9 @@
 		</activity>
 
 		<activity
-			android:name=".SettingsActivity"
+			android:name="com.jemoeder.lief.meqqy.SettingsActivity"
 			android:label="@string/title_activity_settings"
-			android:parentActivityName=".MainActivity"
+			android:parentActivityName="com.jemoeder.lief.meqqy.MainActivity"
 			android:windowSoftInputMode="adjustPan">
 			<meta-data
 				android:name="android.support.PARENT_ACTIVITY"
@@ -44,9 +45,9 @@
 		</activity>
 
 		<service
-			android:name=".MeqqyService"
+			android:name="com.jemoeder.lief.meqqy.MeqqyService"
 			android:enabled="true"
-			android:exported="true" />
+			android:exported="false" />
 	</application>
 
 </manifest>

+ 51 - 42
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MainActivity.java

@@ -6,6 +6,7 @@
 package com.jemoeder.lief.meqqy;
 
 // A shitload of imports l m a o
+import android.annotation.SuppressLint;
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
@@ -80,7 +81,7 @@ public class MainActivity extends AppCompatActivity {
 	private boolean sentcmd;
 	private muhSender lolsender;
 	private muhReceiver lolreceiver;
-	private Vector<String> muhcmds = new Vector<>();
+	private final Vector<String> muhcmds = new Vector<>();
 
 	// Snackbar yo
 	private CoordinatorLayout muhparent;
@@ -90,7 +91,7 @@ public class MainActivity extends AppCompatActivity {
 
 	// Some important View stuff
 	private Button firstview;
-	private Vector<Object> muhviews = new Vector<>();
+	private final Vector<Object> muhviews = new Vector<>();
 	private TextView connstatus;
 	private TextView errortxt;
 
@@ -115,6 +116,7 @@ public class MainActivity extends AppCompatActivity {
 	private Context muhctx;
 	private Resources muhres;
 
+	@SuppressLint({"ClickableViewAccessibility", "DefaultLocale", "ApplySharedPref"})
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
@@ -152,7 +154,7 @@ public class MainActivity extends AppCompatActivity {
 		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
 			if(!muhprefs.getBoolean("deleted_notifchan_20191209", false)) {
 				wrapass.notifMan.deleteNotificationChannel(muhchanActive);
-				muhprefs_ed.putBoolean("deleted_notifchan_20191209", true).apply();
+				muhprefs_ed.putBoolean("deleted_notifchan_20191209", true).commit();
 			}
 
 			NotificationChannel notifChannel = new NotificationChannel(muhchanActive, muhchanActive, NotificationManager.IMPORTANCE_HIGH);
@@ -200,21 +202,22 @@ public class MainActivity extends AppCompatActivity {
 		connstatus = findViewById(R.id.mainact_connstatus);
 		errortxt = findViewById(R.id.mainact_connstatus_errortxt);
 
+		// This shit can't really fail, it's mostly to silence the warnings/possibly err0rs you'd otherwise get
 		try {
 			PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
 			String version = pInfo.versionName;
 			int build = pInfo.versionCode;
-			muhprefs_ed.putString("prefs_versionbuild", "v" + version + " build " + build).apply();
-		} catch(Exception fuckoff) {
-			// No flying fucks given
-		}
+			String buildtype = BuildConfig.BUILD_TYPE;
+
+			muhprefs_ed.putString("prefs_versionbuild", String.format("v%s build %d (%s)", version, build, buildtype)).commit();
+		} catch(Exception fuckoff) { /* No flying fucks given */ }
 
 		// When dragging seekbars, gotta update the value label on the right of it as well as send the !volume command on release
 		volbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
 			@Override
 			public void onStopTrackingTouch(SeekBar seekBar) {
 				if(!block_seekbars && vb_pos != vb_last) {
-					seekBar.setTag(muhres.getString(R.string.cmd_volume) + " " + String.valueOf(vb_pos));
+					seekBar.setTag(muhres.getString(R.string.cmd_volume) + " " + vb_pos);
 					mainact_docmd(seekBar);
 				}
 			}
@@ -230,12 +233,11 @@ public class MainActivity extends AppCompatActivity {
 				vb_pos = progress;
 				vb_label.setText(String.valueOf(progress));
 				muhprefs_ed.putInt("lastval_volumebar", progress);
-				muhprefs_ed.apply();
+				muhprefs_ed.commit();
 			}
 		});
 
 		// Also prevent draggin if we're not even connected lol
-		//noinspection AndroidLintClickableViewAccessibility ZERO FUCKS GIVEN
 		volbar.setOnTouchListener(new View.OnTouchListener() {
 			@Override
 			public boolean onTouch(View v, MotionEvent me) {
@@ -248,7 +250,7 @@ public class MainActivity extends AppCompatActivity {
 			@Override
 			public void onStopTrackingTouch(SeekBar seekBar) {
 				if(!block_seekbars && bb_pos != bb_last) {
-					seekBar.setTag(muhres.getString(R.string.cmd_brightness) + " " + String.valueOf(bb_pos));
+					seekBar.setTag(muhres.getString(R.string.cmd_brightness) + " " + bb_pos);
 					mainact_docmd(seekBar);
 				}
 			}
@@ -264,10 +266,9 @@ public class MainActivity extends AppCompatActivity {
 				bb_pos = progress;
 				bb_label.setText(String.valueOf(progress));
 				muhprefs_ed.putInt("lastval_brightnessbar", progress);
-				muhprefs_ed.apply();
+				muhprefs_ed.commit();
 			}
 		});
-		//noinspection AndroidLintClickableViewAccessibility ZERO FUCKS GIVEN
 		brightbar.setOnTouchListener(new View.OnTouchListener() {
 			@Override
 			public boolean onTouch(View v, MotionEvent me) {
@@ -302,13 +303,15 @@ public class MainActivity extends AppCompatActivity {
 
 		// Some integer values are stored as a string so try to convert that shit, also make sure the result isn't out of dem pre-set bounds
 		String ping_s = muhprefs.getString("prefs_ping", "30");
-		try { ping = Integer.parseInt(ping_s); } catch(Exception fuckoff) { /* No flying fucks given */ }
+		try { //noinspection ConstantConditions
+			ping = Integer.parseInt(ping_s); } catch(Exception fuckoff) { /* No flying fucks given */ }
 		if(ping_s == null || ping <= 0 || ping >= 100) {
 			ping = 30;
 		}
 
 		String volstep_s = muhprefs.getString("prefs_volstep", "1");
-		try { volstep = Integer.parseInt(volstep_s); } catch(Exception fuckoff) { /* No flying fucks given */ }
+		try { //noinspection ConstantConditions
+			volstep = Integer.parseInt(volstep_s); } catch(Exception fuckoff) { /* No flying fucks given */ }
 		if(volstep_s == null || volstep <= 0) {
 			volstep_s = "1";
 			volstep = 1;
@@ -475,7 +478,7 @@ public class MainActivity extends AppCompatActivity {
 			}
 
 			if(!volinit) {
-				cmd = muhres.getString(R.string.cmd_volume) + " " + String.valueOf(vol);
+				cmd = muhres.getString(R.string.cmd_volume) + " " + vol;
 				volinit = true;
 			}
 			volbar.setProgress(vol);
@@ -531,7 +534,7 @@ public class MainActivity extends AppCompatActivity {
 				if(h_i > 24) {
 					h_i = 24;
 				}
-				time += String.valueOf(h_i) + "h";
+				time += h_i + "h";
 			}
 
 			NumberPicker v_m = findViewById(R.id.mainact_nosleep_m);
@@ -540,7 +543,7 @@ public class MainActivity extends AppCompatActivity {
 				if(m_i >= 60) {
 					m_i = 59;
 				}
-				time += String.valueOf(m_i) + "m";
+				time += m_i + "m";
 			}
 
 			NumberPicker v_s = findViewById(R.id.mainact_nosleep_s);
@@ -549,7 +552,7 @@ public class MainActivity extends AppCompatActivity {
 				if(s_i >= 60) {
 					s_i = 59;
 				}
-				time += String.valueOf(s_i) + "s";
+				time += s_i + "s";
 			}
 
 			// Shit's empty if all pickers are set to 0 lol
@@ -613,13 +616,14 @@ public class MainActivity extends AppCompatActivity {
 	}
 
 	// Sender thread =]
+	@SuppressLint("StaticFieldLeak")
 	public static class muhSender extends AsyncTask<Void, Void, Void> {
 		// Some globals cuz we check some of these in onPostExecute as well
 		private int col;
 		private int status;
 		private int err;
-		private String errstr;
-		private MainActivity main;
+		private final String errstr;
+		private final MainActivity main;
 
 		muhSender(MainActivity a) {
 			col = R.color.colorAccent; // Just a default colour imo
@@ -668,12 +672,11 @@ public class MainActivity extends AppCompatActivity {
 						}
 
 						// If we quitting, make sure to remove _all_ currently buffered commands by getting the size again ;]
-						if(quit) {
+						if(quit)
 							cmdsize = main.muhcmds.size();
-						}
-						for(int i = 0; i < cmdsize; i++) {
+						//noinspection ListRemoveInLoop
+						for(int i = 0; i < cmdsize; i++)
 							main.muhcmds.remove(0);
-						}
 						if(quit) {
 							// Gonna attempt een clean shutdown imo
 							col = R.color.colorAccent;
@@ -749,6 +752,7 @@ public class MainActivity extends AppCompatActivity {
 
 		// Lil wrapper for setting the text messages in MainActivity (has to be done on the UI thread, thanks Google)
 		// This either A) displays a snackbar B) changes the status message C) both
+		@SuppressWarnings("SameParameterValue")
 		private void setMainStatus(final int c, final int s, final String e, final String pm, final int pl) {
 			main.runOnUiThread(new Runnable() {
 				@Override
@@ -768,12 +772,13 @@ public class MainActivity extends AppCompatActivity {
 	}
 
 	// Receiver thread lol, logic is mostly the same as for the sender ;];];]
+	@SuppressLint("StaticFieldLeak")
 	public static class muhReceiver extends AsyncTask<Void, Void, Void> {
 		private int col;
 		private int status;
 		private int err;
-		private String errstr;
-		private MainActivity main;
+		private final String errstr;
+		private final MainActivity main;
 
 		muhReceiver(MainActivity a) {
 			col = R.color.colorAccent;
@@ -789,6 +794,8 @@ public class MainActivity extends AppCompatActivity {
 		@Override
 		protected Void doInBackground(Void... arg0) {
 			// No need to compile this shit every goddamn time (used for getting current val00s)
+			// Have to use noinspection because apparently IntelliJ doesn't know what it wants (without escapes it errors and with throws a warning >_>)
+			//noinspection RegExpRedundantEscape
 			Pattern p_cur = Pattern.compile("^\\[([^\\]]+)\\] Current: (\\d+)$");
 
 			while(main.muhsock != null) {
@@ -916,7 +923,7 @@ public class MainActivity extends AppCompatActivity {
 			}
 
 			// Shud be gucci, let's snackbar that shit
-			setMainStatus(R.color.gucci, 0, "", setting_h + " Current: " + String.valueOf(cur), Snackbar.LENGTH_LONG);
+			setMainStatus(R.color.gucci, 0, "", setting_h + " Current: " + cur, Snackbar.LENGTH_LONG);
 
 			final int cur_f = cur;
 			main.runOnUiThread(new Runnable() {
@@ -930,21 +937,22 @@ public class MainActivity extends AppCompatActivity {
 		}
 	}
 
-	// Thread for setting up the connecting
+	// Thread for setting up the connection
+	@SuppressLint("StaticFieldLeak")
 	public static class connectAPI extends AsyncTask<Void, Void, Void> {
 		// Gotta pass along some preferences
-		private String authkey;
-		private String serbur;
-		private int pot;
+		private final String authkey;
+		private final String serbur;
+		private final int pot;
 
 		// Same globals as before lol
 		private int status;
 		private int err;
 		private String errstr;
-		private MainActivity main;
+		private final MainActivity main;
 
 		// Also some only relevant for this thread
-		private AnyTrust at;
+		private final AnyTrust at;
 		SSLSocket muhsock;
 		PrintWriter muhsock_out;
 		BufferedReader muhsock_in;
@@ -1075,15 +1083,16 @@ public class MainActivity extends AppCompatActivity {
 	}
 
 	// Custom AnyTrust class to just trust everything
-	public class AnyTrust extends X509ExtendedTrustManager {
+	@SuppressLint("TrustAllX509TrustManager")
+	public static class AnyTrust extends X509ExtendedTrustManager {
 		private final java.security.cert.X509Certificate[] ANY_CA = {};
 		@Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { return ANY_CA; }
-		@Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t)  {}
-		@Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t)  { }
-		@Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t, final SSLEngine e)  { }
-		@Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t, final Socket e)  { }
-		@Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t, final SSLEngine e)  { }
-		@Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t, final Socket    e)  { }
+		@Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t) { }
+		@Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t) { }
+		@Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t, final SSLEngine e) { }
+		@Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t, final Socket e) { }
+		@Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t, final SSLEngine e) { }
+		@Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t, final Socket e) { }
 	}
 
-}
+}

+ 3 - 3
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MuhNumberPicker.java

@@ -37,9 +37,9 @@ public class MuhNumberPicker extends NumberPicker {
 
 		// This is the only interesting part LMAO
 		try {
-			this.setMinValue(attrs.getAttributeIntValue(null, "minimum", 0));
-			this.setMaxValue(attrs.getAttributeIntValue(null, "maximum", 0));
-			this.setEnabled(attrs.getAttributeBooleanValue(null, "enabled", true));
+			this.setMinValue(attrs.getAttributeIntValue(null, "muh_minimum", 0));
+			this.setMaxValue(attrs.getAttributeIntValue(null, "muh_maximum", 0));
+			this.setEnabled(attrs.getAttributeBooleanValue(null, "muh_enabled", true));
 		} finally {
 			attributes.recycle();
 		}

+ 9 - 5
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/SettingsActivity.java

@@ -13,7 +13,7 @@ import android.support.v7.app.AppCompatActivity;
 
 // Ayyyy settings lol
 public class SettingsActivity extends AppCompatActivity {
-	private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
+	private static final Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
 		@Override
 		public boolean onPreferenceChange(Preference preference, Object value) {
 			// Just store as string so we don't have to do fucky checks and just cast to w/e we need later =]
@@ -25,10 +25,14 @@ public class SettingsActivity extends AppCompatActivity {
 
 	private static void bindPreferenceSummaryToValue(Preference preference) {
 		preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
-		sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
-				PreferenceManager
-						.getDefaultSharedPreferences(preference.getContext())
-						.getString(preference.getKey(), ""));
+		try {
+			//noinspection ConstantConditions
+			sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
+					PreferenceManager
+							.getDefaultSharedPreferences(preference.getContext())
+							.getString(preference.getKey(), ""));
+		}
+		catch(Exception fuckoff) { /* No flying fucks given */ }
 	}
 
 	@Override

BIN
app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_settings.png


+ 0 - 9
app/src/app_Meqqy/src/main/res/drawable/ic_info_black_24dp.xml

@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-	android:width="24dp"
-	android:height="24dp"
-	android:viewportWidth="24.0"
-	android:viewportHeight="24.0">
-	<path
-		android:fillColor="#FF000000"
-		android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z" />
-</vector>

+ 0 - 9
app/src/app_Meqqy/src/main/res/drawable/ic_notifications_black_24dp.xml

@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-	android:width="24dp"
-	android:height="24dp"
-	android:viewportWidth="24.0"
-	android:viewportHeight="24.0">
-	<path
-		android:fillColor="#FF000000"
-		android:pathData="M11.5,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zm6.5,-6v-5.5c0,-3.07 -2.13,-5.64 -5,-6.32V3.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,2.67 10,3.5v0.68c-2.87,0.68 -5,3.25 -5,6.32V16l-2,2v1h17v-1l-2,-2z" />
-</vector>

+ 0 - 9
app/src/app_Meqqy/src/main/res/drawable/ic_sync_black_24dp.xml

@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-	android:width="24dp"
-	android:height="24dp"
-	android:viewportWidth="24.0"
-	android:viewportHeight="24.0">
-	<path
-		android:fillColor="#FF000000"
-		android:pathData="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01,-.25 1.97,-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0,-4.42,-3.58,-8,-8,-8zm0 14c-3.31 0,-6,-2.69,-6,-6 0,-1.01.25,-1.97.7,-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4,-4,-4,-4v3z" />
-</vector>

+ 11 - 11
app/src/app_Meqqy/src/main/res/layout/activity_main.xml

@@ -12,8 +12,7 @@
 		android:layout_width="match_parent"
 		android:layout_height="match_parent">
 
-		<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-			xmlns:app="http://schemas.android.com/apk/res-auto"
+		<android.support.constraint.ConstraintLayout
 			android:layout_width="match_parent"
 			android:layout_height="wrap_content">
 
@@ -370,6 +369,7 @@
 				app:layout_constraintTop_toBottomOf="@id/mainact_button_curbright"
 				app:layout_constraintStart_toStartOf="@id/mainact_button_lockscreen" />
 
+			<!--suppress AndroidUnknownAttribute -->
 			<com.jemoeder.lief.meqqy.MuhNumberPicker
 				android:layout_width="35dp"
 				android:layout_height="60dp"
@@ -377,9 +377,9 @@
 				android:alpha="0.5"
 				android:textSize="@dimen/text_content"
 				android:descendantFocusability="blocksDescendants"
-				enabled="false"
-				minimum="0"
-				maximum="24"
+				muh_enabled="false"
+				muh_minimum="0"
+				muh_maximum="24"
 				app:layout_constraintTop_toBottomOf="@id/mainact_nosleeptxt"
 				app:layout_constraintStart_toStartOf="@id/mainact_nosleeptxt" />
 			<TextView
@@ -393,6 +393,7 @@
 				app:layout_constraintTop_toTopOf="@id/mainact_nosleep_h"
 				app:layout_constraintStart_toEndOf="@id/mainact_nosleep_h" />
 
+			<!--suppress AndroidUnknownAttribute -->
 			<com.jemoeder.lief.meqqy.MuhNumberPicker
 				android:layout_width="35dp"
 				android:layout_height="60dp"
@@ -401,9 +402,9 @@
 				android:layout_marginStart="16dp"
 				android:textSize="@dimen/text_content"
 				android:descendantFocusability="blocksDescendants"
-				enabled="false"
-				minimum="0"
-				maximum="59"
+				muh_enabled="false"
+				muh_minimum="0"
+				muh_maximum="59"
 				app:layout_constraintTop_toBottomOf="@id/mainact_nosleeptxt"
 				app:layout_constraintStart_toEndOf="@id/mainact_nosleeptxt_h" />
 			<TextView
@@ -417,6 +418,7 @@
 				app:layout_constraintTop_toTopOf="@id/mainact_nosleep_m"
 				app:layout_constraintStart_toEndOf="@id/mainact_nosleep_m" />
 
+			<!--suppress AndroidUnknownAttribute -->
 			<com.jemoeder.lief.meqqy.MuhNumberPicker
 				android:layout_width="35dp"
 				android:layout_height="60dp"
@@ -433,7 +435,6 @@
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
-				android:id="@+id/mainact_nosleeptxt_s"
 				android:layout_marginTop="@dimen/numberpicker_labelmargin"
 				android:textSize="@dimen/text_header2"
 				android:text="@string/mainact_nosleeptxt_s"
@@ -498,7 +499,6 @@
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
-				android:id="@+id/mainact_footer"
 				android:layout_marginTop="@dimen/main_divider_spacing"
 				android:textStyle="bold"
 				android:textSize="@dimen/text_header2"
@@ -508,4 +508,4 @@
 
 		</android.support.constraint.ConstraintLayout>
 	</ScrollView>
-</android.support.design.widget.CoordinatorLayout>
+</android.support.design.widget.CoordinatorLayout>

+ 5 - 3
app/src/app_Meqqy/src/main/res/menu/main.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
+<menu xmlns:tools="http://schemas.android.com/tools"
+	xmlns:android="http://schemas.android.com/apk/res/android"
 	xmlns:app="http://schemas.android.com/apk/res-auto">
 
 	<!-- Main menu yo, always show cuz there should be plenty of space and ifRoom sometimes get fucky -->
@@ -11,5 +12,6 @@
 	<item android:id="@+id/action_settings"
 		app:showAsAction="always"
 		android:title="@string/menuact_settings"
-		android:icon="@drawable/ic_action_settings" />
-</menu>
+		android:icon="@drawable/ic_action_settings"
+		tools:ignore="AlwaysShowAction" />
+</menu>

+ 3 - 2
app/src/app_Meqqy/src/main/res/values/strings.xml

@@ -1,3 +1,4 @@
+<!--suppress CheckTagEmptyBody -->
 <resources>
 	<!-- Lil hack so we can pass this an empty string as an int xd -->
 	<string name="NOSTRING"></string>
@@ -37,8 +38,8 @@
 	<string name="main_status_disconnected">disc0nnected</string>
 
 	<!-- Difference between working and connecting is that the former is for sending commands only ;] -->
-	<string name="main_status_working">Working...</string>
-	<string name="main_status_connecting">Connecting...</string>
+	<string name="main_status_working">Working</string>
+	<string name="main_status_connecting">Connecting</string>
 
 	<!-- Description texts (second line etc) -->
 	<string name="main_status_errtxt_key">Invalid key length</string>

+ 0 - 6
app/src/app_Meqqy/src/main/res/values/styles.xml

@@ -6,10 +6,4 @@
 		<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
 		<item name="colorAccent">@color/colorAccent</item>
 	</style>
-
-	<!-- Cuz the settings screen needs a few extra changes -->
-	<style name="MuhPrefs" parent="MeqqyTheme">
-		<item name="android:textSize">16sp</item>
-		<item name="android:textStyle">bold</item>
-	</style>
 </resources>

+ 3 - 2
app/src/app_Meqqy/src/main/res/xml/network_security_config.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<network-security-config>
+<network-security-config xmlns:tools="http://schemas.android.com/tools">
 	<base-config>
 		<trust-anchors>
 			<!-- Trust all user-installed certificate authorities found under system settings (Settings > Security > Credentials > Trusted CAs or smt similar) -->
-			<certificates src="user" />
+			<certificates src="user"
+				tools:ignore="AcceptsUserCertificates" />
 			<certificates src="system" />
 		</trust-anchors>
 	</base-config>

+ 2 - 0
app/src/app_Meqqy/version.properties

@@ -0,0 +1,2 @@
+#Thu Aug 13 19:43:53 CEST 2020
+VERSION_CODE=265

+ 1 - 1
app/src/build.gradle

@@ -6,7 +6,7 @@ buildscript {
 		jcenter()
 	}
 	dependencies {
-		classpath 'com.android.tools.build:gradle:3.2.0'
+		classpath 'com.android.tools.build:gradle:4.0.1'
 		// NOTE: Do not place your application dependencies here; they belong
 		// in the individual module build.gradle files
 	}

+ 2 - 1
app/src/gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +1,6 @@
+#Thu Aug 13 18:47:56 CEST 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip