We all know that Programmers sometimes spoof things, just like in android, programmers hide this item in setting:
We can find "about mobile phones" in which there is "android version,
When we click "android version", an image (spoof type
This is the 2.3 operating system, but an android logo image will pop up in the 4.0 system.
If you hold down the android logo and do not place it, there will be a lot of android logos in Mobile Animation:
).
Here we will talk about the 2.3 System:
First, find the source code of Settings. Under package/app/Settings/src/com/android/settings, find
The DeviceInfoSettings. java file is related to the code "about mobile phones". It references an xml file in its OnCreate method:
Copy codeThe Code is as follows: addPreferencesFromResource (R. xml. device_info_settings );
So we can find the device_info_settings.xml file:Copy codeThe Code is as follows: <! -- Device firmware version -->
<Preference android: key = "firmware_version"
Style = "? Android: preferenceInformationStyle"
Android: title = "@ string/firmware_version"
Android: summary = "@ string/device_info_default"/>
This is the code that represents the "android version". We can see that its Key isCopy codeThe Code is as follows: firmware_version
Therefore, we can find the referenced code in the java file. There is a public boolean onPreferenceTreeClick method in DeviceInfoSettings. java:Copy codeThe Code is as follows: @ Override
Public boolean onPreferenceTreeClick (PreferenceScreen preferenceScreen, Preference preference ){
If (preference. getKey (). equals ("firmware_version ")){
System. arraycopy (mHits, 1, mHits, 0, mHits. length-1 );
MHits [mHits. length-1] = SystemClock. uptimeMillis ();
If (mHits [0]> = (SystemClock. uptimeMillis ()-500 )){
Intent intent = new Intent (Intent. ACTION_MAIN );
Intent. setClassName ("android ",
Com. android. internal. app. PlatLogoActivity. class. getName ());
Try {
StartActivity (intent );
} Catch (Exception e ){
}
}
}
Return super. onPreferenceTreeClick (preferenceScreen, preference );
}
In this example, you can click "android version" to implement the function.