From 8b8912c3501d2741fcd694b403438cb90263afd6 Mon Sep 17 00:00:00 2001 From: Tim Strazzere Date: Fri, 3 Jan 2025 10:41:52 -0800 Subject: [PATCH] (chore) fix gradle, fix licenses, fix linting issues --- LICENSE | 2 +- build.gradle | 12 ++++++++---- src/main/java/android/content/res/AXMLResource.java | 2 +- .../android/content/res/chunk/AttributeType.java | 2 +- .../java/android/content/res/chunk/ChunkType.java | 2 +- .../java/android/content/res/chunk/ChunkUtil.java | 2 +- .../java/android/content/res/chunk/PoolItem.java | 2 +- .../content/res/chunk/sections/ChunkSection.java | 2 +- .../res/chunk/sections/GenericChunkSection.java | 5 ++--- .../content/res/chunk/sections/ResourceSection.java | 5 ++--- .../content/res/chunk/sections/StringSection.java | 5 ++--- .../android/content/res/chunk/types/AXMLHeader.java | 2 +- .../android/content/res/chunk/types/Attribute.java | 6 +----- .../java/android/content/res/chunk/types/Buffer.java | 2 +- .../java/android/content/res/chunk/types/Chunk.java | 2 +- .../java/android/content/res/chunk/types/EndTag.java | 4 ++-- .../content/res/chunk/types/GenericChunk.java | 2 +- .../android/content/res/chunk/types/NameSpace.java | 4 ++-- .../android/content/res/chunk/types/StartTag.java | 4 ++-- .../android/content/res/chunk/types/TextTag.java | 4 ++-- src/main/java/diff/rednaga/AXMLPrinter.java | 4 ++-- .../res/chunk/sections/ResourceSectionTest.java | 2 +- .../content/res/chunk/types/AttributeTest.java | 2 +- .../android/content/res/chunk/types/EndTagTest.java | 2 +- .../content/res/chunk/types/GenericChunkTest.java | 2 +- .../content/res/chunk/types/NameSpaceTest.java | 2 +- .../content/res/chunk/types/StartTagTest.java | 2 +- .../android/content/res/chunk/types/TextTagTest.java | 2 +- 28 files changed, 43 insertions(+), 46 deletions(-) diff --git a/LICENSE b/LICENSE index 4c874ef..be81de6 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2015 Red Naga - Tim 'diff' Strazzere + Copyright 2015-2025 Red Naga - Tim 'diff' Strazzere Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/build.gradle b/build.gradle index fd8ac8b..bacb3d8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ plugins { id 'java' id 'jacoco' - id 'com.github.kt3k.coveralls' version '2.8.4' } version = '1.0.0' @@ -12,9 +11,10 @@ repositories { } dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3' - testImplementation 'org.mockito:mockito-core:5.9.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testImplementation 'org.mockito:mockito-core:5.15.2' } allprojects { @@ -49,4 +49,8 @@ test { '--add-opens', 'java.base/java.io=ALL-UNNAMED', '--add-opens', 'java.base/java.util=ALL-UNNAMED' ) + + testLogging { + events "passed", "skipped", "failed" + } } diff --git a/src/main/java/android/content/res/AXMLResource.java b/src/main/java/android/content/res/AXMLResource.java index ef40560..418396b 100644 --- a/src/main/java/android/content/res/AXMLResource.java +++ b/src/main/java/android/content/res/AXMLResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/AttributeType.java b/src/main/java/android/content/res/chunk/AttributeType.java index 202ac02..665405d 100644 --- a/src/main/java/android/content/res/chunk/AttributeType.java +++ b/src/main/java/android/content/res/chunk/AttributeType.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/ChunkType.java b/src/main/java/android/content/res/chunk/ChunkType.java index b692b8c..cc2a81b 100644 --- a/src/main/java/android/content/res/chunk/ChunkType.java +++ b/src/main/java/android/content/res/chunk/ChunkType.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/ChunkUtil.java b/src/main/java/android/content/res/chunk/ChunkUtil.java index 7b43f00..bf7f3b4 100644 --- a/src/main/java/android/content/res/chunk/ChunkUtil.java +++ b/src/main/java/android/content/res/chunk/ChunkUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/PoolItem.java b/src/main/java/android/content/res/chunk/PoolItem.java index 3dc4be6..85e776b 100644 --- a/src/main/java/android/content/res/chunk/PoolItem.java +++ b/src/main/java/android/content/res/chunk/PoolItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/sections/ChunkSection.java b/src/main/java/android/content/res/chunk/sections/ChunkSection.java index 99b0096..928426c 100644 --- a/src/main/java/android/content/res/chunk/sections/ChunkSection.java +++ b/src/main/java/android/content/res/chunk/sections/ChunkSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensedimport java.io.IOException; diff --git a/src/main/java/android/content/res/chunk/sections/GenericChunkSection.java b/src/main/java/android/content/res/chunk/sections/GenericChunkSection.java index c8dfe34..17e8c70 100644 --- a/src/main/java/android/content/res/chunk/sections/GenericChunkSection.java +++ b/src/main/java/android/content/res/chunk/sections/GenericChunkSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import android.content.res.IntReader; import android.content.res.chunk.ChunkType; -import android.content.res.chunk.types.Chunk; import android.content.res.chunk.types.GenericChunk; import java.io.IOException; @@ -28,7 +27,7 @@ * * @author tstrazzere */ -public abstract class GenericChunkSection extends GenericChunk implements Chunk, ChunkSection { +public abstract class GenericChunkSection extends GenericChunk implements ChunkSection { public GenericChunkSection(ChunkType chunkType, IntReader reader) { super(chunkType, reader); diff --git a/src/main/java/android/content/res/chunk/sections/ResourceSection.java b/src/main/java/android/content/res/chunk/sections/ResourceSection.java index 39c86d1..0a4a6e0 100644 --- a/src/main/java/android/content/res/chunk/sections/ResourceSection.java +++ b/src/main/java/android/content/res/chunk/sections/ResourceSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import android.content.res.IntReader; import android.content.res.chunk.ChunkType; -import android.content.res.chunk.types.Chunk; import android.content.res.chunk.types.NameSpace; import java.io.IOException; @@ -31,7 +30,7 @@ * * @author tstrazzere */ -public class ResourceSection extends GenericChunkSection implements Chunk, ChunkSection { +public class ResourceSection extends GenericChunkSection { // TODO : Make this an ArrayList so it's easier to add/remove protected ArrayList resourceIDs; diff --git a/src/main/java/android/content/res/chunk/sections/StringSection.java b/src/main/java/android/content/res/chunk/sections/StringSection.java index 5b85d5c..a729680 100644 --- a/src/main/java/android/content/res/chunk/sections/StringSection.java +++ b/src/main/java/android/content/res/chunk/sections/StringSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ import android.content.res.IntReader; import android.content.res.chunk.ChunkType; import android.content.res.chunk.PoolItem; -import android.content.res.chunk.types.Chunk; import android.content.res.chunk.types.NameSpace; import java.io.IOException; @@ -28,7 +27,7 @@ import java.util.Arrays; import java.util.List; -public class StringSection extends GenericChunkSection implements Chunk, ChunkSection { +public class StringSection extends GenericChunkSection { // This specific tag appears unused but might need to be implemented? or used as an unknown? @SuppressWarnings("unused") diff --git a/src/main/java/android/content/res/chunk/types/AXMLHeader.java b/src/main/java/android/content/res/chunk/types/AXMLHeader.java index b98f8ef..2094b70 100644 --- a/src/main/java/android/content/res/chunk/types/AXMLHeader.java +++ b/src/main/java/android/content/res/chunk/types/AXMLHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/types/Attribute.java b/src/main/java/android/content/res/chunk/types/Attribute.java index 917611b..c539f4c 100644 --- a/src/main/java/android/content/res/chunk/types/Attribute.java +++ b/src/main/java/android/content/res/chunk/types/Attribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -143,10 +143,6 @@ public String toXML(StringSection stringSection, ResourceSection resourceSection } buffer.append(stringSection.getString(name)); - if (stringSection.getString(name).equals("protectionLevel")) { - boolean derp = true; - } - buffer.append("=\""); // TODO : This should be a switch... diff --git a/src/main/java/android/content/res/chunk/types/Buffer.java b/src/main/java/android/content/res/chunk/types/Buffer.java index 61c7a15..bc3fe1f 100644 --- a/src/main/java/android/content/res/chunk/types/Buffer.java +++ b/src/main/java/android/content/res/chunk/types/Buffer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/types/Chunk.java b/src/main/java/android/content/res/chunk/types/Chunk.java index 8c1177c..9e81bc4 100644 --- a/src/main/java/android/content/res/chunk/types/Chunk.java +++ b/src/main/java/android/content/res/chunk/types/Chunk.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/types/EndTag.java b/src/main/java/android/content/res/chunk/types/EndTag.java index 68ed5c0..0f6fc04 100644 --- a/src/main/java/android/content/res/chunk/types/EndTag.java +++ b/src/main/java/android/content/res/chunk/types/EndTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ * * @author tstrazzere */ -public class EndTag extends GenericChunk implements Chunk { +public class EndTag extends GenericChunk { private int lineNumber; private int commentIndex; diff --git a/src/main/java/android/content/res/chunk/types/GenericChunk.java b/src/main/java/android/content/res/chunk/types/GenericChunk.java index 9a6553e..88dd6be 100644 --- a/src/main/java/android/content/res/chunk/types/GenericChunk.java +++ b/src/main/java/android/content/res/chunk/types/GenericChunk.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/android/content/res/chunk/types/NameSpace.java b/src/main/java/android/content/res/chunk/types/NameSpace.java index 67770b4..5d5009a 100644 --- a/src/main/java/android/content/res/chunk/types/NameSpace.java +++ b/src/main/java/android/content/res/chunk/types/NameSpace.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ * * @author tstrazzere */ -public class NameSpace extends GenericChunk implements Chunk { +public class NameSpace extends GenericChunk { private int lineNumber; private int commentIndex; diff --git a/src/main/java/android/content/res/chunk/types/StartTag.java b/src/main/java/android/content/res/chunk/types/StartTag.java index d4d4130..1cd6feb 100644 --- a/src/main/java/android/content/res/chunk/types/StartTag.java +++ b/src/main/java/android/content/res/chunk/types/StartTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ * * @author tstrazzere */ -public class StartTag extends GenericChunk implements Chunk { +public class StartTag extends GenericChunk { private int lineNumber; private int commentIndex; diff --git a/src/main/java/android/content/res/chunk/types/TextTag.java b/src/main/java/android/content/res/chunk/types/TextTag.java index a4f98e6..4f2b62a 100644 --- a/src/main/java/android/content/res/chunk/types/TextTag.java +++ b/src/main/java/android/content/res/chunk/types/TextTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ * * @author tstrazzere */ -public class TextTag extends GenericChunk implements Chunk { +public class TextTag extends GenericChunk { private int lineNumber; private int commentIndex; diff --git a/src/main/java/diff/rednaga/AXMLPrinter.java b/src/main/java/diff/rednaga/AXMLPrinter.java index 1c5eb52..dea645f 100644 --- a/src/main/java/diff/rednaga/AXMLPrinter.java +++ b/src/main/java/diff/rednaga/AXMLPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ public static void main(String[] arguments) throws IOException { if (arguments[0].equalsIgnoreCase("-v") || arguments[0].equalsIgnoreCase("-version")) { System.out.printf("axmlprinter %s (http://github.com/rednaga/axmlprinter2)\n", VERSION); - System.out.printf("Copyright (C) 2015-2024 Red Naga - Tim 'diff' Strazzere (diff@protonmail.com)\n"); + System.out.printf("Copyright (C) 2015-2025 Red Naga - Tim 'diff' Strazzere (diff@protonmail.com)\n"); return; } diff --git a/src/test/java/android/content/res/chunk/sections/ResourceSectionTest.java b/src/test/java/android/content/res/chunk/sections/ResourceSectionTest.java index 86d67f3..fe5da37 100644 --- a/src/test/java/android/content/res/chunk/sections/ResourceSectionTest.java +++ b/src/test/java/android/content/res/chunk/sections/ResourceSectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/android/content/res/chunk/types/AttributeTest.java b/src/test/java/android/content/res/chunk/types/AttributeTest.java index d3caede..65996d4 100644 --- a/src/test/java/android/content/res/chunk/types/AttributeTest.java +++ b/src/test/java/android/content/res/chunk/types/AttributeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/android/content/res/chunk/types/EndTagTest.java b/src/test/java/android/content/res/chunk/types/EndTagTest.java index 772e0b8..309f9fb 100644 --- a/src/test/java/android/content/res/chunk/types/EndTagTest.java +++ b/src/test/java/android/content/res/chunk/types/EndTagTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/android/content/res/chunk/types/GenericChunkTest.java b/src/test/java/android/content/res/chunk/types/GenericChunkTest.java index 9686908..e51f3b9 100644 --- a/src/test/java/android/content/res/chunk/types/GenericChunkTest.java +++ b/src/test/java/android/content/res/chunk/types/GenericChunkTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/android/content/res/chunk/types/NameSpaceTest.java b/src/test/java/android/content/res/chunk/types/NameSpaceTest.java index bf020c5..a01c0cd 100644 --- a/src/test/java/android/content/res/chunk/types/NameSpaceTest.java +++ b/src/test/java/android/content/res/chunk/types/NameSpaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/android/content/res/chunk/types/StartTagTest.java b/src/test/java/android/content/res/chunk/types/StartTagTest.java index afc37d8..1537524 100644 --- a/src/test/java/android/content/res/chunk/types/StartTagTest.java +++ b/src/test/java/android/content/res/chunk/types/StartTagTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/android/content/res/chunk/types/TextTagTest.java b/src/test/java/android/content/res/chunk/types/TextTagTest.java index 5da59ab..f02a24a 100644 --- a/src/test/java/android/content/res/chunk/types/TextTagTest.java +++ b/src/test/java/android/content/res/chunk/types/TextTagTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Red Naga + * Copyright 2015-2025 Red Naga * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.