原文:A New Vulnerability in the Android Framework: Fragment Injection
出处:794K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4y4W2j5%4g2J5K9i4c8&6K9h3&6@1k6h3I4D9K9h3N6W2L8X3y4W2i4K6u0W2j5$3!0E0i4K6u0r3L8X3g2%4i4K6u0V1N6Y4g2D9L8X3g2J5j5h3u0A6L8r3W2@1P5g2)9J5k6r3q4F1k6s2u0G2K9h3c8Q4x3X3c8X3M7X3q4E0k6i4N6G2M7X3E0Q4x3X3c8X3M7X3q4Y4L8h3g2F1N6q4)9J5k6r3W2F1K9X3g2U0N6r3W2G2L8W2)9J5c8W2)9J5x3$3y4G2L8h3#2W2L8Y4c8K6
作者:Roee Hay,IBM Application Security Research Team
时间:2013.12.10
Java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String initialFragment = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
Bundle initialArguments = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS);
if (savedInstanceState != null) {
} else {
if (initialFragment != null && mSinglePane) {
// If we are just showing a fragment, we want to run in
// new fragment mode, but don't need to compute and show
// the headers.
switchToHeader(initialFragment, initialArguments);
} else {
if (mHeaders.size() > 0) {
if (!mSinglePane) {
if (initialFragment == null) {
} else {
switchToHeader(initialFragment, initialArguments);
}
}
}
}
}
}
public void switchToHeader(String fragmentName, Bundle args) {
setSelectedHeader(null);
switchToHeaderInner(fragmentName, args, 0);
}
private void switchToHeaderInner(String fragmentName, Bundle args, int direction) {
getFragmentManager().popBackStack(BACK_STACK_PREFS,
FragmentManager.POP_BACK_STACK_INCLUSIVE);
Fragment f = Fragment.instantiate(this, fragmentName, args);
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
transaction.replace(com.android.internal.R.id.prefs, f);
transaction.commitAllowingStateLoss();
}