clean up tab intendation (#3707)

This commit is contained in:
Igor Eisberg 2024-10-03 20:58:44 +03:00 committed by GitHub
parent 111a95f369
commit 03a7c67082
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 895 additions and 895 deletions

View File

@ -119,7 +119,7 @@ public class TypedValue {
/** Identifies the end of plain integer values. */ /** Identifies the end of plain integer values. */
public static final int TYPE_LAST_INT = 0x1f; public static final int TYPE_LAST_INT = 0x1f;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** Complex data: bit location of unit information. */ /** Complex data: bit location of unit information. */
public static final int COMPLEX_UNIT_SHIFT = 0; public static final int COMPLEX_UNIT_SHIFT = 0;
@ -182,7 +182,7 @@ public class TypedValue {
*/ */
public static final int COMPLEX_MANTISSA_MASK = 0xffffff; public static final int COMPLEX_MANTISSA_MASK = 0xffffff;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* {@link #TYPE_NULL} data indicating the value was not specified. * {@link #TYPE_NULL} data indicating the value was not specified.
@ -207,7 +207,7 @@ public class TypedValue {
*/ */
public static final int DENSITY_NONE = 0xffff; public static final int DENSITY_NONE = 0xffff;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* The type held by this value, as defined by the constants here. This tells * The type held by this value, as defined by the constants here. This tells

View File

@ -17,7 +17,7 @@
package brut.androlib.exceptions; package brut.androlib.exceptions;
public class CantFind9PatchChunkException extends AndrolibException { public class CantFind9PatchChunkException extends AndrolibException {
public CantFind9PatchChunkException(String message, Throwable cause) { public CantFind9PatchChunkException(String message, Throwable cause) {
super(message, cause); super(message, cause);
} }
} }

View File

@ -17,18 +17,18 @@
package brut.androlib.exceptions; package brut.androlib.exceptions;
public class CantFindFrameworkResException extends AndrolibException { public class CantFindFrameworkResException extends AndrolibException {
public CantFindFrameworkResException(int id) { public CantFindFrameworkResException(int id) {
mPkgId = id; mPkgId = id;
} }
public int getPkgId() { public int getPkgId() {
return mPkgId; return mPkgId;
} }
@Override @Override
public String getMessage() { public String getMessage() {
return String.format("Can't find framework resources for package of id: %d", this.getPkgId()); return String.format("Can't find framework resources for package of id: %d", this.getPkgId());
} }
private final int mPkgId; private final int mPkgId;
} }

View File

@ -17,6 +17,6 @@
package brut.androlib.exceptions; package brut.androlib.exceptions;
public class InFileNotFoundException extends AndrolibException { public class InFileNotFoundException extends AndrolibException {
public InFileNotFoundException() { public InFileNotFoundException() {
} }
} }

View File

@ -17,6 +17,6 @@
package brut.androlib.exceptions; package brut.androlib.exceptions;
public class OutDirExistsException extends AndrolibException { public class OutDirExistsException extends AndrolibException {
public OutDirExistsException() { public OutDirExistsException() {
} }
} }

View File

@ -17,7 +17,7 @@
package brut.androlib.exceptions; package brut.androlib.exceptions;
public class UndefinedResObjectException extends AndrolibException { public class UndefinedResObjectException extends AndrolibException {
public UndefinedResObjectException(String message) { public UndefinedResObjectException(String message) {
super(message); super(message);
} }
} }

View File

@ -469,12 +469,12 @@ public class ARSCDecoder {
} }
private ResIntBasedValue readValue() throws IOException, AndrolibException { private ResIntBasedValue readValue() throws IOException, AndrolibException {
short size = mIn.readShort(); short size = mIn.readShort();
if (size < 8) { if (size < 8) {
return null; return null;
} }
mIn.skipCheckByte((byte) 0); // zero mIn.skipCheckByte((byte) 0); // zero
byte type = mIn.readByte(); byte type = mIn.readByte();
int data = mIn.readInt(); int data = mIn.readInt();

View File

@ -262,8 +262,8 @@ public class StringBlock {
val = array[offset]; val = array[offset];
offset += 1; offset += 1;
if ((val & 0x80) != 0) { if ((val & 0x80) != 0) {
int low = (array[offset] & 0xFF); int low = (array[offset] & 0xFF);
length = ((val & 0x7F) << 8) + low; length = ((val & 0x7F) << 8) + low;
offset += 1; offset += 1;
} else { } else {
length = val; length = val;

View File

@ -31,26 +31,26 @@ public class StringBlockWithSurrogatePairInUtf8Test {
@Test @Test
public void decodeTwoOctets() { public void decodeTwoOctets() {
final String actual0 = new StringBlock(new byte[] { (byte) 0xC2, (byte) 0x80}, true).decodeString(0, 2); final String actual0 = new StringBlock(new byte[] {(byte) 0xC2, (byte) 0x80}, true).decodeString(0, 2);
assertEquals("Incorrect decoding", "\u0080", actual0); assertEquals("Incorrect decoding", "\u0080", actual0);
final String actual1 = new StringBlock(new byte[] { (byte) 0xDF, (byte) 0xBF}, true).decodeString(0, 2); final String actual1 = new StringBlock(new byte[] {(byte) 0xDF, (byte) 0xBF}, true).decodeString(0, 2);
assertEquals("Incorrect decoding", "\u07FF", actual1); assertEquals("Incorrect decoding", "\u07FF", actual1);
} }
@Test @Test
public void decodeThreeOctets() { public void decodeThreeOctets() {
final String actual0 = new StringBlock(new byte[] { (byte) 0xE0, (byte) 0xA0, (byte) 0x80}, true).decodeString(0, 3); final String actual0 = new StringBlock(new byte[] {(byte) 0xE0, (byte) 0xA0, (byte) 0x80}, true).decodeString(0, 3);
assertEquals("Incorrect decoding", "\u0800", actual0); assertEquals("Incorrect decoding", "\u0800", actual0);
final String actual1 = new StringBlock(new byte[] { (byte) 0xEF, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 3); final String actual1 = new StringBlock(new byte[] {(byte) 0xEF, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 3);
assertEquals("Incorrect decoding", "\uFFFF", actual1); assertEquals("Incorrect decoding", "\uFFFF", actual1);
} }
@Test @Test
public void decodeSurrogatePair_when_givesAsThreeOctetsFromInvalidRangeOfUtf8() { public void decodeSurrogatePair_when_givesAsThreeOctetsFromInvalidRangeOfUtf8() {
// See: https://github.com/iBotPeaches/Apktool/issues/2299 // See: https://github.com/iBotPeaches/Apktool/issues/2299
final String actual = new StringBlock(new byte[] { (byte) 0xED, (byte) 0xA0, (byte) 0xBD, (byte) 0xED, (byte) 0xB4, (byte) 0x86}, true).decodeString(0, 6); final String actual = new StringBlock(new byte[] {(byte) 0xED, (byte) 0xA0, (byte) 0xBD, (byte) 0xED, (byte) 0xB4, (byte) 0x86}, true).decodeString(0, 6);
assertEquals("Incorrect decoding", "\uD83D\uDD06", actual); assertEquals("Incorrect decoding", "\uD83D\uDD06", actual);
// See: https://github.com/iBotPeaches/Apktool/issues/2546 // See: https://github.com/iBotPeaches/Apktool/issues/2546
@ -74,7 +74,7 @@ public class StringBlockWithSurrogatePairInUtf8Test {
// \u10FFFF is encoded in UTF-8 as "0xDBFF 0xDFFF" (4-byte encoding), // \u10FFFF is encoded in UTF-8 as "0xDBFF 0xDFFF" (4-byte encoding),
// but when used in Android resources which are encoded in UTF-8, 3-byte encoding is used, // but when used in Android resources which are encoded in UTF-8, 3-byte encoding is used,
// so each of these is encoded as 3-bytes // so each of these is encoded as 3-bytes
final String actual = new StringBlock(new byte[] { (byte) 0xED, (byte) 0xAF, (byte) 0xBF, (byte) 0xED, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 6); final String actual = new StringBlock(new byte[] {(byte) 0xED, (byte) 0xAF, (byte) 0xBF, (byte) 0xED, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 6);
assertEquals("Incorrect decoding", "\uDBFF\uDFFF", actual); assertEquals("Incorrect decoding", "\uDBFF\uDFFF", actual);
} }
} }

View File

@ -53,7 +53,7 @@ public class OS {
} }
public static void rmfile(String file) { public static void rmfile(String file) {
File del = new File(file); File del = new File(file);
//noinspection ResultOfMethodCallIgnored //noinspection ResultOfMethodCallIgnored
del.delete(); del.delete();
} }