Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 96076cc

Browse files
committed
API and cosmetic fixes
1 parent d878721 commit 96076cc

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

ClassySharkWS/src/com/google/classyshark/silverghost/translator/apk/ApkTranslator.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void apply() {
5757

5858
for (int i = 0; i < numDexes; i++) {
5959

60-
ELEMENT element = new ELEMENT("\nclasses" + ((i==0)? "" : i + "") + ".dex", TAG.MODIFIER);
60+
ELEMENT element = new ELEMENT("\nclasses" + ((i == 0) ? "" : i + "") + ".dex", TAG.MODIFIER);
6161
elements.add(element);
6262

6363
element = new ELEMENT(
@@ -96,7 +96,7 @@ public void apply() {
9696

9797
for (int i = 0; i < numDexes; i++) {
9898

99-
element = new ELEMENT("\nclasses" + ((i==0)? "" : i + "") + ".dex", TAG.MODIFIER);
99+
element = new ELEMENT("\nclasses" + ((i == 0) ? "" : i + "") + ".dex", TAG.MODIFIER);
100100
elements.add(element);
101101

102102
element = new ELEMENT(
@@ -123,8 +123,12 @@ public List<String> getDependencies() {
123123
}
124124

125125
public String toString() {
126-
// TODO some sort of convertion for the command line
126+
StringBuilder sb = new StringBuilder();
127127

128-
return elements.toString();
128+
for (ELEMENT element : elements) {
129+
sb.append(element.text);
130+
}
131+
132+
return sb.toString();
129133
}
130134
}

ClassySharkWS/src/com/google/classyshark/silverghost/translator/apk/apkinspectionsbag/ApkInspectionsBag.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ public List<String> getNativeLibNamesSorted() {
9595
}
9696

9797
public String getPrivateLibErrorTag(String nativeLib) {
98-
return PrivateNativeLibsInspector.isPrivate(nativeLib, getNativeLibNamesSorted());
98+
boolean isPrivate = PrivateNativeLibsInspector.isPrivate(nativeLib, getNativeLibNamesSorted());
99+
100+
if(isPrivate) {
101+
return " -- private api!";
102+
} else {
103+
return "";
104+
}
105+
99106
}
100107

101108
public static Set<String> getClassesWithNativeMethodsPerDexIndex(int dexIndex, File classesDex) {

ClassySharkWS/src/com/google/classyshark/silverghost/translator/apk/apkinspectionsbag/PrivateNativeLibsInspector.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ public class PrivateNativeLibsInspector {
5353

5454
private static List<String> APIS_LIB_LIST = new LinkedList<>(Arrays.asList(apiLibs));
5555

56-
// TODO make it boolean
57-
public static String isPrivate(String nativeLib, List<String> nativeLibNames) {
56+
public static boolean isPrivate(String nativeLib, List<String> nativeLibNames) {
5857

5958
if (!APIS_LIB_LIST.contains(nativeLib) && !nativeLibNames.contains(nativeLib)) {
60-
return " -- private api!";
59+
return true;
6160
}
6261

63-
return "";
62+
return false;
6463
}
6564
}

0 commit comments

Comments
 (0)