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 and pr0lly some other misc fixes xdxd

Wazakindjes 1 year ago
parent
commit
0003ccfc19

+ 0 - 35
.gitignore

@@ -3,38 +3,3 @@
 $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/k0di.apk


+ 92 - 0
app/src/.gitignore

@@ -0,0 +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
+.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>

+ 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_k0di/.gitignore

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

+ 8 - 8
app/src/app_k0di/build.gradle

@@ -32,24 +32,20 @@ android {
 	}
 
 	def versionPropsFile = file('version.properties')
-	def vcode = 0
+	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)
-	}
-	else {
-		throw new GradleException("Could not read version.properties!")
 	}
+	versionProps['VERSION_CODE'] = vcode.toString()
+	versionProps.store(versionPropsFile.newWriter(), null)
 
 	compileSdkVersion 28
 	defaultConfig {
 		applicationId "com.jemoeder.lief.k0di"
 		minSdkVersion 27
-		//noinspection OldTargetApi,ExpiredTargetSdkVersion ZERO FUCKS GIVEN (ain't publishan on Jewgle gay st0re anyways so)
+		//noinspection OldTargetApi ZERO FUCKS GIVEN (ain't publishan on Jewgle gay st0re anyways so)
 		targetSdkVersion 27
 		testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 		signingConfig signingConfigs.muhconfig
@@ -63,6 +59,7 @@ android {
 			signingConfig signingConfigs.muhconfig
 		}
 		debug {
+			minifyEnabled false // Explicitly disable lmao
 			signingConfig signingConfigs.muhconfig
 		}
 
@@ -83,6 +80,9 @@ dependencies {
 	implementation 'com.android.support:support-v4:28.0.0'
 	implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 	implementation 'com.android.support:design:28.0.0'
+
+	// Apparently there's a problem between (I think) flexbox > 1.0 and Andr0id SDK 27, so let's use an older version L M A O
+	//noinspection GradleDependency
 	implementation 'com.google.android:flexbox:1.0.0'
 
 	testImplementation 'junit:junit:4.12'

+ 1 - 0
app/src/app_k0di/src/androidTest/java/com/jemoeder/lief/k0di/ExampleInstrumentedTest.java

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

+ 3 - 3
app/src/app_k0di/src/main/AndroidManifest.xml

@@ -2,7 +2,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	xmlns:tools="http://schemas.android.com/tools"
 	package="com.jemoeder.lief.k0di"
-	android:versionName="1.14">
+	android:versionName="1.1.0">
 
 	<!-- Need an internet connection to work 0bv lol -->
 	<uses-permission android:name="android.permission.INTERNET" />
@@ -18,7 +18,7 @@
 		android:icon="@mipmap/ic_launcher"
 		android:label="@string/app_name"
 		android:supportsRtl="true"
-		android:name=".k0diWrapper"
+		android:name="com.jemoeder.lief.k0di.k0diWrapper"
 		android:theme="@style/k0diTheme"
 		tools:ignore="AllowBackup">
 
@@ -48,7 +48,7 @@
 		</activity>
 
 		<service
-			android:name=".k0diService"
+			android:name="com.jemoeder.lief.k0di.k0diService"
 			android:enabled="true"
 			android:exported="true"
 			android:permission=""

+ 21 - 14
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/MainActivity.java

@@ -126,7 +126,7 @@ public class MainActivity extends AppCompatActivity {
 	final int reqcode_import = 0;
 	private final int permcode_storage = 2;
 
-	@SuppressLint({"CommitPrefEdits", "ApplySharedPref"})
+	@SuppressLint({"CommitPrefEdits", "ApplySharedPref", "DefaultLocale"})
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
@@ -192,15 +192,15 @@ public class MainActivity extends AppCompatActivity {
 			}
 		}
 
+		// 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;
-			wrapass.muhprefs_ed.putString("prefs_versionbuild", "v" + version + " build " + build).commit();
-		}
-		catch(Exception fuckoff) {
-			// No flying fucks given
-		}
+			String buildtype = BuildConfig.BUILD_TYPE;
+
+			wrapass.muhprefs_ed.putString("prefs_versionbuild", String.format("v%s build %d (%s)", version, build, buildtype)).commit();
+		} catch(Exception fuckoff) { /* No flying fucks given */ }
 
 		// Also enable em controls right away if the socket managed to connect already xd
 		if(muhsock != null) {
@@ -209,7 +209,6 @@ public class MainActivity extends AppCompatActivity {
 		}
 	}
 
-	@SuppressWarnings("EmptyMethod")
 	@Override
 	public void onConfigurationChanged(Configuration newConfig) {
 		// Just a qt lil hack so the layout texts don't get refreshed on orientation changes lol
@@ -254,7 +253,9 @@ public class MainActivity extends AppCompatActivity {
 			kservRemove();
 
 		Window window = getWindow();
-		@SuppressWarnings("deprecation") int flags = WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
+
+		@SuppressWarnings("deprecation")
+		int flags = WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
 				| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
 				| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
 				| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
@@ -412,6 +413,8 @@ public class MainActivity extends AppCompatActivity {
 		btn.setPadding(dimen_btn_padding_h, dimen_btn_padding_v, dimen_btn_padding_h, dimen_btn_padding_v);
 	}
 
+	// Because IntelliJ is too retarded to get that the XML layouts' onClick attributes require a View argument for this function
+	@SuppressWarnings("unused")
 	public void st0remd0it(View v) {
 		long unix = currentTimeMillis();
 		if(wrapass.lastcmd_time > 0 && (unix - wrapass.lastcmd_time) <= 1000)
@@ -420,6 +423,7 @@ public class MainActivity extends AppCompatActivity {
 		wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_STORE, null, null, null));
 	}
 
+	@SuppressWarnings("unused")
 	public void st0remRestore(View v) {
 		if(wrapass.st0rem_name == null) {
 			doSnackbar("Nothing was st0red imo tbh famalamalm", Snackbar.LENGTH_LONG, true);
@@ -436,6 +440,7 @@ public class MainActivity extends AppCompatActivity {
 		wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_RESTORE, wrapass.st0rem_name, wrapass.st0rem_pos, wrapass.st0rem_time));
 	}
 
+	@SuppressWarnings("unused")
 	public void st0remClear(View v) {
 		if(wrapass.st0rem_name == null)
 			return;
@@ -504,7 +509,7 @@ public class MainActivity extends AppCompatActivity {
 		try {
 			for(int order = 0; order < wrapass.sh0rtcuts.length(); order++) {
 				JSONObject jayson_sc = wrapass.sh0rtcuts.getJSONObject(order);
-				@SuppressWarnings("AccessStaticViaInstance") final String skippem = jayson_sc.getString(k0diWrapper.CMD_SKIP);
+				final String skippem = jayson_sc.getString(k0diWrapper.CMD_SKIP);
 
 				final Button sc_btn = new Button(new ContextThemeWrapper(muhctx, R.style.k0diTheme));
 				sc_btn.setText(jayson_sc.getString("name"));
@@ -553,8 +558,7 @@ public class MainActivity extends AppCompatActivity {
 					@Override
 					public boolean onDrag(View v_dragspot, DragEvent event) {
 						switch(event.getAction()) {
-							case DragEvent.ACTION_DRAG_STARTED:
-								break;
+							//case DragEvent.ACTION_DRAG_STARTED:
 							case DragEvent.ACTION_DRAG_ENTERED:
 								drw_btn.setColorFilter(btn_back_drag, PorterDuff.Mode.DARKEN);
 								break;
@@ -793,7 +797,7 @@ public class MainActivity extends AppCompatActivity {
 	String readKodi(InputStreamReader instream) throws Exception {
 		StringBuilder muhdata = new StringBuilder();
 		int arrsize = 1024;
-		char buffer[] = new char[arrsize];
+		char[] buffer = new char[arrsize];
 		int bread;
 		try {
 			while((bread = instream.read(buffer)) != -1) {
@@ -852,7 +856,8 @@ public class MainActivity extends AppCompatActivity {
 		return true;
 	}
 
-	public void onRequestPermissionsResult(int permcode, @NonNull String perms[], @NonNull int res[]) {
+	@SuppressWarnings("SwitchStatementWithTooFewBranches")
+	public void onRequestPermissionsResult(int permcode, @NonNull String[] perms, @NonNull int[] res) {
 		switch(permcode) {
 			case permcode_storage:
 				if(res.length > 0 && res[0] != PackageManager.PERMISSION_GRANTED)
@@ -863,6 +868,7 @@ public class MainActivity extends AppCompatActivity {
 		}
 	}
 
+	@SuppressWarnings("SwitchStatementWithTooFewBranches")
 	protected void onActivityResult(int reqcode, int rescode, Intent data) {
 		if(reqcode != reqcode_import || rescode != RESULT_OK || data == null)
 			return;
@@ -873,6 +879,7 @@ public class MainActivity extends AppCompatActivity {
 
 		try {
 			switch(reqcode) {
+				//noinspection ConstantConditions
 				case reqcode_import:
 					InputStream instream = getContentResolver().openInputStream(muhuri);
 					BufferedReader muhreader = new BufferedReader(new InputStreamReader(instream));
@@ -918,4 +925,4 @@ public class MainActivity extends AppCompatActivity {
 			doToast("Misc error: " + fuckoff2.getMessage(), Toast.LENGTH_LONG, true);
 		}
 	}
-}
+}

+ 3 - 1
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/ShortcutDialogClickListener.java

@@ -69,7 +69,7 @@ class ShortcutDialogClickListener implements View.OnClickListener {
 		if(sc_name.length() == 0) {
 			wegood = false;
 			sc_tv_name.setTextColor(main.col_rip);
-			muherr += ((!muherr.isEmpty() ? " -- " : "") + "Invalid name");
+			muherr = "Invalid name";
 		}
 		else {
 			boolean isdupe = false;
@@ -78,6 +78,8 @@ class ShortcutDialogClickListener implements View.OnClickListener {
 					if(order != i && main.wrapass.sh0rtcuts.getJSONObject(i).getString("name").toLowerCase().equals(sc_namelower)) {
 						isdupe = true;
 						wegood = false;
+						// Because IntelliJ is too retarded to get we're inside a loop
+						//noinspection ConstantConditions
 						muherr += ((!muherr.isEmpty() ? " -- " : "") + "Duplicate name");
 						break;
 					}

+ 2 - 1
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/connectAPI.java

@@ -12,6 +12,7 @@ import java.net.InetAddress;
 import java.net.Socket;
 import java.net.URL;
 import java.net.UnknownHostException;
+import java.nio.charset.StandardCharsets;
 import java.util.Locale;
 
 // Thread for setting up the connection
@@ -62,7 +63,7 @@ class connectAPI extends AsyncTask<Void, Void, Void> {
 		HttpURLConnection kodiHTTP = null;
 		try {
 			InetAddress serverAddr = InetAddress.getByName(serbur); // Cuz we prolly wanna support DNS too and not just IPs xd
-			byte bitch64[] = Base64.encode((user + ":" + pass).getBytes("UTF-8"), Base64.DEFAULT);
+			byte[] bitch64 = Base64.encode((user + ":" + pass).getBytes(StandardCharsets.UTF_8), Base64.DEFAULT);
 			kodiHTTP = (HttpURLConnection)(new URL(String.format(Locale.getDefault(), "http://%s:%d/", serbur, pot))).openConnection();
 			kodiHTTP.setRequestProperty("Authorization", "Basic " + new String(bitch64));
 			int ret = kodiHTTP.getResponseCode();

+ 1 - 1
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/k0diService.java

@@ -113,7 +113,7 @@ public class k0diService extends Service {
 
 		if(!wrapass.svcrunning || forcem) {
 			// Cuz apparently Android doesn't use different defaults if the channel was already created bef0
-			wrapass.muhprefs_ed.remove("deleted_notifchan_20190314").commit();
+			//wrapass.muhprefs_ed.remove("deleted_notifchan_20190314").commit();
 			//wrapass.muhprefs_ed.remove("deleted_notifchan_20190610").commit();
 			if(!wrapass.muhprefs.getBoolean("deleted_notifchan_20190610", false)) {
 				wrapass.notifMan.deleteNotificationChannel(wrapass.channelname);

+ 4 - 2
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/muhk0di.java

@@ -77,6 +77,7 @@ class muhk0di extends AsyncTask<Void, Void, Void> {
 					}
 
 					// Loop instead of .clear() to make sure we only remove what we processed ;]
+					//noinspection ListRemoveInLoop
 					for(int i = 0; i < cmdsize; i++)
 						main.wrapass.muhcmds.remove(0);
 				}
@@ -145,6 +146,7 @@ class muhk0di extends AsyncTask<Void, Void, Void> {
 		setMainStatus(R.color.colorAccent, R.string.main_status_working, str, snackstr, snacklength);
 	}
 
+	@SuppressWarnings("SameParameterValue")
 	private String k0di_writerecv(String cmd, int plsw8m8) throws Exception {
 		// Write that shit and listen for een resp0nse (after a lil delay 0bv)
 		String ret = null;
@@ -397,7 +399,7 @@ class muhk0di extends AsyncTask<Void, Void, Void> {
 			cursec = (jayson_time.getInt("hours") * 60 * 60) + (jayson_time.getInt("minutes") * 60) + jayson_time.getInt("seconds");
 		}
 
-		cursec += Integer.valueOf(sec);
+		cursec += Integer.parseInt(sec);
 		if(cursec < 0)
 			cursec = 0;
 
@@ -454,4 +456,4 @@ class muhk0di extends AsyncTask<Void, Void, Void> {
 			throw new Exception("reeeEeEEEeEEEE");
 		setMainStatus(R.color.gucci, R.string.main_status_gucci, "", "", 99);
 	}
-}
+}

+ 5 - 5
app/src/app_k0di/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"
 			android:layout_marginStart="@dimen/side_margins"
@@ -224,9 +223,10 @@
 				android:textStyle="bold"
 				android:textSize="@dimen/text_header2"
 				android:textColor="@color/text_header2"
-				app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text" />
-			<!--app:layout_constraintTop_toBottomOf="@id/mainact_divider_footer"-->
+				app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text"
+				app:layout_constraintTop_toBottomOf="@id/mainact_container_shortcuts" />
+
 
 		</android.support.constraint.ConstraintLayout>
 	</ScrollView>
-</android.support.design.widget.CoordinatorLayout>
+</android.support.design.widget.CoordinatorLayout>

+ 2 - 2
app/src/app_k0di/src/main/res/layout/dialog_impexp.xml

@@ -4,7 +4,7 @@
 	android:layout_width="match_parent"
 	android:layout_height="match_parent">
 
-	<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+	<TextView
 		android:layout_width="match_parent"
 		android:layout_height="wrap_content"
 		android:id="@+id/dial_impexp_title"
@@ -96,4 +96,4 @@
 		android:layout_height="8dp"
 		app:layout_constraintTop_toBottomOf="@id/dial_impexp_btn_cancel"
 		app:layout_constraintStart_toStartOf="@id/dial_impexp_btn_cancel" />
-</android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>

+ 2 - 2
app/src/app_k0di/src/main/res/layout/dialog_shortcut.xml

@@ -5,7 +5,7 @@
 	android:layout_width="match_parent"
 	android:layout_height="match_parent">
 
-	<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+	<TextView
 		android:layout_width="match_parent"
 		android:layout_height="wrap_content"
 		android:id="@+id/dial_addsc_title"
@@ -144,4 +144,4 @@
 		android:layout_height="8dp"
 		app:layout_constraintTop_toBottomOf="@id/dial_addsc_btn_cancel"
 		app:layout_constraintStart_toStartOf="@id/dial_addsc_btn_cancel" />
-</android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>

+ 10 - 2
app/src/app_k0di/src/main/res/layout/notif_k0di.xml

@@ -1,9 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
+
+<!--
+This shit is just an attempt at using a custom notification layout lel
+P sure it's pretty much functional but the built-in ones are much easier to
+work with (at least for now xd)
+-->
+
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 	xmlns:tools="http://schemas.android.com/tools"
 	android:layout_width="match_parent"
 	android:layout_height="wrap_content"
-	android:id="@+id/notif_parent">
+	android:id="@+id/notif_parent"
+	tools:keep="@layout/notif_k0di">
 
 	<ImageView
 		android:src="@mipmap/ic_launcher"
@@ -82,4 +90,4 @@
 			android:textAllCaps="false"
 			tools:ignore="HardcodedText" />
 	<!--</GridLayout>-->
-</RelativeLayout>
+</RelativeLayout>

+ 3 - 2
app/src/app_k0di/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 - 2
app/src/app_k0di/version.properties

@@ -1,2 +1,2 @@
-#Sun Oct 20 12:55:04 CEST 2019
-VERSION_CODE=1790
+#Thu Aug 13 19:59:10 CEST 2020
+VERSION_CODE=1800

+ 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 19:20:37 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