org.jf.dexlib2.analysis.reflection.util.ReflectionUtils Java Examples

The following examples show how to use org.jf.dexlib2.analysis.reflection.util.ReflectionUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReflectionClassDef.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example #2
Source File: ReflectionConstructor.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final Constructor method = this.constructor;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #3
Source File: ReflectionClassDef.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example #4
Source File: ReflectionMethod.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final java.lang.reflect.Method method = this.method;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #5
Source File: ReflectionMethod.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final java.lang.reflect.Method method = this.method;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #6
Source File: ReflectionConstructor.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final Constructor method = this.constructor;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #7
Source File: ReflectionClassDef.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example #8
Source File: ReflectionConstructor.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final Constructor method = this.constructor;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #9
Source File: ReflectionMethod.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final java.lang.reflect.Method method = this.method;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #10
Source File: ReflectionMethod.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final java.lang.reflect.Method method = this.method;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #11
Source File: ReflectionConstructor.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
    final Constructor method = this.constructor;
    return new AbstractList<MethodParameter>() {
        private final Class[] parameters = method.getParameterTypes();

        @Override public MethodParameter get(final int index) {
            return new BaseMethodParameter() {
                @Nonnull @Override public Set<? extends Annotation> getAnnotations() {
                    return ImmutableSet.of();
                }

                @Nullable @Override public String getName() {
                    return null;
                }

                @Nonnull @Override public String getType() {
                    return ReflectionUtils.javaToDexName(parameters[index].getName());
                }
            };
        }

        @Override public int size() {
            return parameters.length;
        }
    };
}
 
Example #12
Source File: ReflectionClassDef.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example #13
Source File: ReflectionClassDef.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example #14
Source File: ReflectionClassDef.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example #15
Source File: ReflectionClassDef.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example #16
Source File: ReflectionClassDef.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example #17
Source File: ReflectionMethod.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getReturnType() {
    return ReflectionUtils.javaToDexName(method.getReturnType().getName());
}
 
Example #18
Source File: ReflectionConstructor.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(constructor.getDeclaringClass().getName());
}
 
Example #19
Source File: ReflectionConstructor.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(constructor.getDeclaringClass().getName());
}
 
Example #20
Source File: ReflectionMethod.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(method.getDeclaringClass().getName());
}
 
Example #21
Source File: ReflectionMethod.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getReturnType() {
    return ReflectionUtils.javaToDexName(method.getReturnType().getName());
}
 
Example #22
Source File: ReflectionField.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(field.getDeclaringClass().getName());
}
 
Example #23
Source File: ReflectionMethod.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(method.getDeclaringClass().getName());
}
 
Example #24
Source File: ReflectionField.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(field.getType().getName());
}
 
Example #25
Source File: ReflectionField.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(field.getDeclaringClass().getName());
}
 
Example #26
Source File: ReflectionClassDef.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(cls.getName());
}
 
Example #27
Source File: ReflectionClassDef.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(cls.getName());
}
 
Example #28
Source File: ReflectionField.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(field.getType().getName());
}
 
Example #29
Source File: ReflectionField.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(field.getDeclaringClass().getName());
}
 
Example #30
Source File: ReflectionMethod.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getReturnType() {
    return ReflectionUtils.javaToDexName(method.getReturnType().getName());
}