openstf / STFService.apk

Monitor and perform various actions on your Android device. Not meant for actual user devices.
Other
242 stars 207 forks source link

Report for Android P hidden list #25

Closed thinkhy closed 6 years ago

thinkhy commented 6 years ago

Scanned STFService.apk with veridex tool provided by Google, the report shows 27 hidden APIs used and 1 in blacklist:

#2: Linking blacklist Landroid/view/IRotationWatcher$Stub;-><init>()V use(s):
         Ljp/co/cyberagent/stf/compat/WindowManagerWrapper$1;-><init>(Ljp/co/cyberagent/stf/compat/WindowManagerWrapper;Ljp/co/cyberagent/stf/compat/WindowManagerWrapper$RotationWatcher;)V

PS: the full report


art/tools/veridex/appcompat.sh  --dex-file=STFService.apk

NOTE: appcompat.sh is still under development. It can report
API uses that do not execute at runtime, and reflection uses
that do not exist. It can also miss on reflection uses.
#1: Linking light greylist Landroid/graphics/Canvas;->save(I)I use(s):
       Landroid/support/v4/widget/SlidingPaneLayout;->drawChild(Landroid/graphics/Canvas;Landroid/view/View;J)Z

#2: Linking blacklist Landroid/view/IRotationWatcher$Stub;-><init>()V use(s):
       Ljp/co/cyberagent/stf/compat/WindowManagerWrapper$1;-><init>(Ljp/co/cyberagent/stf/compat/WindowManagerWrapper;Ljp/co/cyberagent/stf/compat/WindowManagerWrapper$RotationWatcher;)V

#3: Reflection light greylist Landroid/view/animation/Animation;->mListener use:
       Landroid/support/v4/app/FragmentManagerImpl;->setHWLayerAnimListenerIfAlpha(Landroid/view/View;Landroid/view/animation/Animation;)V

#4: Reflection light greylist Landroid/service/media/MediaBrowserService$Result;->mFlags use:
       Landroid/support/v4/media/MediaBrowserServiceCompatApi24;-><clinit>()V

#5: Reflection light greylist Landroid/view/LayoutInflater;->mFactory2 use:
       Landroid/support/v4/view/LayoutInflaterCompatHC;->forceSetFactory2(Landroid/view/LayoutInflater;Landroid/view/LayoutInflater$Factory2;)V

#6: Reflection light greylist Landroid/view/View;->mAccessibilityDelegate use:
       Landroid/support/v4/view/ViewCompat$ICSViewCompatImpl;->hasAccessibilityDelegate(Landroid/view/View;)Z

#7: Reflection light greylist Landroid/view/View;->mMinHeight use:
       Landroid/support/v4/view/ViewCompatBase;->getMinimumHeight(Landroid/view/View;)I

#8: Reflection light greylist Landroid/view/View;->mMinWidth use:
       Landroid/support/v4/view/ViewCompatBase;->getMinimumWidth(Landroid/view/View;)I

#9: Reflection light greylist Landroid/widget/CompoundButton;->mButtonDrawable use:
       Landroid/support/v4/widget/CompoundButtonCompatGingerbread;->getButtonDrawable(Landroid/widget/CompoundButton;)Landroid/graphics/drawable/Drawable;

#10: Reflection light greylist Landroid/widget/PopupWindow;->mOverlapAnchor use:
       Landroid/support/v4/widget/PopupWindowCompatApi21;-><clinit>()V

#11: Reflection light greylist Landroid/view/View;->mRecreateDisplayList use:
       Landroid/support/v4/widget/SlidingPaneLayout$SlidingPanelLayoutImplJB;-><init>()V

#12: Reflection light greylist Landroid/content/res/Resources;->mResourcesImpl use:
       Landroid/support/v7/app/ResourcesFlusher;->flushNougats(Landroid/content/res/Resources;)Z

#13: Reflection light greylist Landroid/widget/PopupWindow;->mAnchor use:
       Landroid/support/v7/widget/AppCompatPopupWindow;->wrapOnScrollChangedListener(Landroid/widget/PopupWindow;)V

#14: Reflection light greylist Landroid/widget/PopupWindow;->mOnScrollChangedListener use:
       Landroid/support/v7/widget/AppCompatPopupWindow;->wrapOnScrollChangedListener(Landroid/widget/PopupWindow;)V

#15: Reflection light greylist Landroid/widget/AbsListView;->mIsChildViewEnabled use:
       Landroid/support/v7/widget/ListViewCompat;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

#16: Reflection light greylist Landroid/os/Bundle;->getIBinder use:
       Landroid/support/v4/app/BundleCompatGingerbread;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;

#17: Reflection light greylist Landroid/os/Bundle;->putIBinder use:
       Landroid/support/v4/app/BundleCompatGingerbread;->putBinder(Landroid/os/Bundle;Ljava/lang/String;Landroid/os/IBinder;)V

#18: Reflection light greylist Landroid/app/Notification;->setLatestEventInfo use:
       Landroid/support/v4/app/NotificationCompatBase;->add(Landroid/app/Notification;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)Landroid/app/Notification;

#19: Reflection light greylist Landroid/widget/PopupWindow;->setClipToScreenEnabled use:
       Landroid/support/v7/widget/ListPopupWindow;-><clinit>()V

#20: Reflection light greylist Landroid/widget/PopupWindow;->setEpicenterBounds use:
       Landroid/support/v7/widget/ListPopupWindow;-><clinit>()V

#21: Reflection light greylist Landroid/widget/PopupWindow;->setTouchModal use:
       Landroid/support/v7/widget/MenuPopupWindow;-><clinit>()V

#22: Reflection light greylist Landroid/widget/AutoCompleteTextView;->doBeforeTextChanged use:
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#23: Reflection light greylist Landroid/widget/AutoCompleteTextView;->doAfterTextChanged use:
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#24: Reflection light greylist Landroid/widget/AutoCompleteTextView;->ensureImeVisible use:
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#25: Reflection light greylist Landroid/view/inputmethod/InputMethodManager;->showSoftInputUnchecked use:
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#26: Reflection light greylist Landroid/view/View;->computeFitSystemWindows use:
       Landroid/support/v7/widget/ViewUtils;-><clinit>()V

#27: Reflection light greylist Landroid/os/Process;->setArgV0 use:
       Ljp/co/cyberagent/stf/util/ProcUtil;->setArgV0(Ljava/lang/String;)V

27 hidden API(s) used: 2 linked against, 25 through reflection
       1 in blacklist
       0 in dark greylist
       26 in light greylist
thinkhy commented 6 years ago

Scan code with the latest version of "vericode":

#1: Linking light greylist Landroid/view/IRotationWatcher$Stub;-><init>()V use(s):
       Ljp/co/cyberagent/stf/compat/WindowManagerWrapper$1;-><init>(Ljp/co/cyberagent/stf/compat/WindowManagerWrapper;Ljp/co/cyberagent/stf/compat/WindowManagerWrapper$RotationWatcher;)V

#2: Reflection light greylist Landroid/app/Notification;->setLatestEventInfo use(s):
       Landroid/support/v4/app/NotificationCompatBase;->add(Landroid/app/Notification;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)Landroid/app/Notification;

#3: Reflection light greylist Landroid/content/res/Resources;->mResourcesImpl use(s):
       Landroid/support/v7/app/ResourcesFlusher;->flushNougats(Landroid/content/res/Resources;)Z

#4: Reflection dark greylist Landroid/graphics/drawable/Drawable;->getOpticalInsets use(s):
       Landroid/support/v7/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;

#5: Reflection light greylist Landroid/media/session/MediaSession;->getCallingPackage use(s):
       Landroid/support/v4/media/session/MediaSessionCompatApi24;->getCallingPackage(Ljava/lang/Object;)Ljava/lang/String;

#6: Reflection light greylist Landroid/os/Bundle;->getIBinder use(s):
       Landroid/support/v4/app/BundleCompatGingerbread;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;

#7: Reflection light greylist Landroid/os/Bundle;->putIBinder use(s):
       Landroid/support/v4/app/BundleCompatGingerbread;->putBinder(Landroid/os/Bundle;Ljava/lang/String;Landroid/os/IBinder;)V

#8: Reflection light greylist Landroid/os/Process;->setArgV0 use(s):
       Ljp/co/cyberagent/stf/util/ProcUtil;->setArgV0(Ljava/lang/String;)V

#9: Reflection light greylist Landroid/os/ServiceManager;->getService use(s):
       Ljp/co/cyberagent/stf/util/InternalApi;->getServiceBinder(Ljava/lang/String;)Ljava/lang/Object;
       Ljp/co/cyberagent/stf/util/InternalApi;->hasService(Ljava/lang/String;)Z

#10: Reflection dark greylist Landroid/os/SystemProperties;->get use(s):
       Ljp/co/cyberagent/stf/IdentityActivity;->getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

#11: Reflection light greylist Landroid/service/media/MediaBrowserService$Result;->mFlags use(s):
       Landroid/support/v4/media/MediaBrowserServiceCompatApi24;-><clinit>()V

#12: Reflection light greylist Landroid/view/LayoutInflater;->mFactory2 use(s):
       Landroid/support/v4/view/LayoutInflaterCompatHC;->forceSetFactory2(Landroid/view/LayoutInflater;Landroid/view/LayoutInflater$Factory2;)V

#13: Reflection light greylist Landroid/view/View;->computeFitSystemWindows use(s):
       Landroid/support/v7/widget/ViewUtils;-><clinit>()V

#14: Reflection light greylist Landroid/view/View;->mAccessibilityDelegate use(s):
       Landroid/support/v4/view/ViewCompat$ICSViewCompatImpl;->hasAccessibilityDelegate(Landroid/view/View;)Z

#15: Reflection light greylist Landroid/view/View;->mMinHeight use(s):
       Landroid/support/v4/view/ViewCompatBase;->getMinimumHeight(Landroid/view/View;)I

#16: Reflection light greylist Landroid/view/View;->mMinWidth use(s):
       Landroid/support/v4/view/ViewCompatBase;->getMinimumWidth(Landroid/view/View;)I

#17: Reflection light greylist Landroid/view/View;->mRecreateDisplayList use(s):
       Landroid/support/v4/widget/SlidingPaneLayout$SlidingPanelLayoutImplJB;-><init>()V

#18: Reflection light greylist Landroid/view/animation/Animation;->mListener use(s):
       Landroid/support/v4/app/FragmentManagerImpl;->setHWLayerAnimListenerIfAlpha(Landroid/view/View;Landroid/view/animation/Animation;)V

#19: Reflection light greylist Landroid/view/inputmethod/InputMethodManager;->showSoftInputUnchecked use(s):
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#20: Reflection light greylist Landroid/widget/AbsListView;->mIsChildViewEnabled use(s):
       Landroid/support/v7/widget/ListViewCompat;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

#21: Reflection light greylist Landroid/widget/AutoCompleteTextView;->doAfterTextChanged use(s):
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#22: Reflection light greylist Landroid/widget/AutoCompleteTextView;->doBeforeTextChanged use(s):
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#23: Reflection light greylist Landroid/widget/AutoCompleteTextView;->ensureImeVisible use(s):
       Landroid/support/v7/widget/SearchView$AutoCompleteTextViewReflector;-><init>()V

#24: Reflection light greylist Landroid/widget/CompoundButton;->mButtonDrawable use(s):
       Landroid/support/v4/widget/CompoundButtonCompatGingerbread;->getButtonDrawable(Landroid/widget/CompoundButton;)Landroid/graphics/drawable/Drawable;

#25: Reflection light greylist Landroid/widget/PopupWindow;->mAnchor use(s):
       Landroid/support/v7/widget/AppCompatPopupWindow;->wrapOnScrollChangedListener(Landroid/widget/PopupWindow;)V

#26: Reflection light greylist Landroid/widget/PopupWindow;->mOnScrollChangedListener use(s):
       Landroid/support/v7/widget/AppCompatPopupWindow;->wrapOnScrollChangedListener(Landroid/widget/PopupWindow;)V

#27: Reflection light greylist Landroid/widget/PopupWindow;->mOverlapAnchor use(s):
       Landroid/support/v4/widget/PopupWindowCompatApi21;-><clinit>()V

#28: Reflection light greylist Landroid/widget/PopupWindow;->setClipToScreenEnabled use(s):
       Landroid/support/v7/widget/ListPopupWindow;-><clinit>()V

#29: Reflection light greylist Landroid/widget/PopupWindow;->setEpicenterBounds use(s):
       Landroid/support/v7/widget/ListPopupWindow;-><clinit>()V

#30: Reflection light greylist Landroid/widget/PopupWindow;->setTouchModal use(s):
       Landroid/support/v7/widget/MenuPopupWindow;-><clinit>()V

#31: Reflection light greylist Landroid/widget/TextView;->mMaxMode use(s):
       Landroid/support/v4/widget/TextViewCompatGingerbread;->getMaxLines(Landroid/widget/TextView;)I

#32: Reflection light greylist Landroid/widget/TextView;->mMaximum use(s):
       Landroid/support/v4/widget/TextViewCompatGingerbread;->getMaxLines(Landroid/widget/TextView;)I
       Landroid/support/v4/widget/TextViewCompatGingerbread;->getMaxLines(Landroid/widget/TextView;)I

#33: Reflection dark greylist Landroid/widget/TextView;->mMinMode use(s):
       Landroid/support/v4/widget/TextViewCompatGingerbread;->getMinLines(Landroid/widget/TextView;)I

#34: Reflection light greylist Landroid/widget/TextView;->mMinimum use(s):
       Landroid/support/v4/widget/TextViewCompatGingerbread;->getMinLines(Landroid/widget/TextView;)I
       Landroid/support/v4/widget/TextViewCompatGingerbread;->getMinLines(Landroid/widget/TextView;)I

#35: Reflection light greylist Ljava/nio/Buffer;->address use(s):
       Lcom/google/protobuf/UnsafeUtil;-><clinit>()V

35 hidden API(s) used: 1 linked against, 34 through reflection
       0 in blacklist
       3 in dark greylist
       32 in light greylist
To run an analysis that can give more reflection accesses, 
but could include false positives, pass the --imprecise flag. 

Above result looks well, the API IRotationWatcher has been put into light grey list:-) Still left 3 in dark greylist which would be banned when the code is compiled with target SDK 28.

#4: Reflection dark greylist Landroid/graphics/drawable/Drawable;->getOpticalInsets use(s):
      Landroid/support/v7/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/          graphics/Rect;

#10: Reflection dark greylist Landroid/os/SystemProperties;->get use(s):
      Ljp/co/cyberagent/stf/IdentityActivity;->getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

#33: Reflection dark greylist Landroid/widget/TextView;->mMinMode use(s):
        Landroid/support/v4/widget/TextViewCompatGingerbread;->getMinLines(Landroid/widget/TextView;)I
sorccu commented 6 years ago

Yeah, it works fine on the final version.