Skip to content

Commit

Permalink
#11 DEX format - rename items
Browse files Browse the repository at this point in the history
  • Loading branch information
amosshi committed Aug 17, 2021
1 parent 196aa88 commit 3d4c8b7
Show file tree
Hide file tree
Showing 23 changed files with 256 additions and 186 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions FormatDEX/src/main/java/org/freeinternals/format/dex/CodeItem.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import java.util.SortedMap;
import java.util.TreeMap;
import javax.swing.tree.DefaultMutableTreeNode;
import org.freeinternals.commonlib.core.BytesTool;
import org.freeinternals.commonlib.core.FileComponent;
import org.freeinternals.commonlib.core.FileFormat;
import org.freeinternals.commonlib.core.FileFormatException;
import org.freeinternals.commonlib.core.PosByteArrayInputStream;
import org.freeinternals.commonlib.core.PosDataInputStream;
import org.freeinternals.commonlib.core.BytesTool;
import org.freeinternals.commonlib.core.FileFormatException;
import org.freeinternals.format.dex.header_item.Endian;

/**
Expand Down Expand Up @@ -114,8 +114,8 @@ public String getString(int index) {
}

FileComponent fc = this.data.get(this.string_ids[index].string_data_off.value);
if (fc instanceof StringDataItem) {
return ((StringDataItem) fc).getString();
if (fc instanceof string_data_item) {
return ((string_data_item) fc).getString();
} else {
return null;
}
Expand Down Expand Up @@ -180,7 +180,7 @@ private void parse() throws IOException, FileFormatException {
this.string_ids = new string_id_item[this.header.string_ids_size.intValue()];
for (int i = 0; i < this.string_ids.length; i++) {
this.string_ids[i] = new string_id_item(stream);
todoData.put(this.string_ids[i].string_data_off.value, StringDataItem.class);
todoData.put(this.string_ids[i].string_data_off.value, string_data_item.class);
}
}

Expand Down Expand Up @@ -241,9 +241,9 @@ private void parse() throws IOException, FileFormatException {

// data
for (Map.Entry<Long, Class<?>> todoItem : todoData.entrySet()) {
if (todoItem.getValue() == StringDataItem.class) {
if (todoItem.getValue() == string_data_item.class) {
stream.flyTo(todoItem.getKey().intValue());
this.data.put(todoItem.getKey(), new StringDataItem(stream));
this.data.put(todoItem.getKey(), new string_data_item(stream));
}

}
Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions FormatDEX/src/main/java/org/freeinternals/format/dex/MapList.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ private void generateStringIds() {
node.add(itemNode);

FileComponent fc = this.dexFile.data.get(item.string_data_off.value);
if (fc instanceof StringDataItem) {
((StringDataItem) fc).generateTreeNode(itemNode);
if (fc instanceof string_data_item) {
((string_data_item) fc).generateTreeNode(itemNode);
} else {
itemNode.add(new DefaultMutableTreeNode(new JTreeNodeFileComponent(
0,
Expand Down Expand Up @@ -325,8 +325,8 @@ private void generateData() {
Type_uint.toString(startPos) + " - " + fc.getClass().getSimpleName()));
node.add(itemNode);

if (fc instanceof StringDataItem) {
((StringDataItem) fc).generateTreeNode(itemNode);
if (fc instanceof string_data_item) {
((string_data_item) fc).generateTreeNode(itemNode);
}
}
}
Expand Down
17 changes: 0 additions & 17 deletions FormatDEX/src/main/java/org/freeinternals/format/dex/TypeList.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* AnnotationItem.java June 23, 2015, 06:20
*
* Copyright 2015, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.dex;

import org.freeinternals.commonlib.core.FileComponent;

/**
*
* @author Amos Shi
*
* <pre>
* java:S101 - Class names should comply with a naming convention --- We respect the name from DEX Spec instead
* java:S116 - Field names should comply with a naming convention --- We respect the DEX spec name instead
* java:S1104 - Class variable fields should not have public accessibility --- No, we like the simplified final value manner
* </pre>
*/
@SuppressWarnings({"java:S101", "java:S116", "java:S1104"})
public class annotation_item extends FileComponent{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* AnnotationSetList.java June 23, 2015, 06:20
*
* Copyright 2015, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.dex;

import org.freeinternals.commonlib.core.FileComponent;

/**
*
* @author Amos Shi
*
* <pre>
* java:S101 - Class names should comply with a naming convention --- We respect the name from DEX Spec instead
* java:S116 - Field names should comply with a naming convention --- We respect the DEX spec name instead
* java:S1104 - Class variable fields should not have public accessibility --- No, we like the simplified final value manner
* </pre>
*/
@SuppressWarnings({"java:S101", "java:S116", "java:S1104"})
public class annotation_set_item extends FileComponent{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* AnnotationSetRefList.java June 23, 2015, 06:20
*
* Copyright 2015, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.dex;

import org.freeinternals.commonlib.core.FileComponent;

/**
*
* @author Amos Shi
*
* <pre>
* java:S101 - Class names should comply with a naming convention --- We respect the name from DEX Spec instead
* java:S116 - Field names should comply with a naming convention --- We respect the DEX spec name instead
* java:S1104 - Class variable fields should not have public accessibility --- No, we like the simplified final value manner
* </pre>
*/
@SuppressWarnings({"java:S101", "java:S116", "java:S1104"})
public class annotation_set_ref_list extends FileComponent{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* AnnotationsDirectoryItem.java June 23, 2015, 06:20
*
* Copyright 2015, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.dex;

import org.freeinternals.commonlib.core.FileComponent;

/**
*
* @author Amos Shi
*
* <pre>
* java:S101 - Class names should comply with a naming convention --- We respect the name from DEX Spec instead
* java:S116 - Field names should comply with a naming convention --- We respect the DEX spec name instead
* java:S1104 - Class variable fields should not have public accessibility --- No, we like the simplified final value manner
* </pre>
*/
@SuppressWarnings({"java:S101", "java:S116", "java:S1104"})
public class annotations_directory_item extends FileComponent{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* ClassDataItem.java June 23, 2015, 06:20
*
* Copyright 2015, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.dex;

import org.freeinternals.commonlib.core.FileComponent;

/**
*
* @author Amos Shi
*
* <pre>
* java:S101 - Class names should comply with a naming convention --- We respect the name from DEX Spec instead
* java:S116 - Field names should comply with a naming convention --- We respect the DEX spec name instead
* java:S1104 - Class variable fields should not have public accessibility --- No, we like the simplified final value manner
* </pre>
*/
@SuppressWarnings({"java:S101", "java:S116", "java:S1104"})
public class class_data_item extends FileComponent{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* CodeItem.java June 23, 2015, 06:20
*
* Copyright 2015, FreeInternals.org. All rights reserved.
* Use is subject to license terms.
*/
package org.freeinternals.format.dex;

import org.freeinternals.commonlib.core.FileComponent;

/**
*
* @author Amos Shi
*
* <pre>
* java:S101 - Class names should comply with a naming convention --- We respect the name from DEX Spec instead
* java:S116 - Field names should comply with a naming convention --- We respect the DEX spec name instead
* java:S1104 - Class variable fields should not have public accessibility --- No, we like the simplified final value manner
* </pre>
*/
@SuppressWarnings({"java:S101", "java:S116", "java:S1104"})
public class code_item extends FileComponent{

}
Loading

0 comments on commit 3d4c8b7

Please sign in to comment.