当我将Facebook集成到我的Android应用程序中时,我没有在Logcat中获得KeyHash,而是获得了一些其他键
public class HomeActivity extends AppCompatActivity {
private EditText editText_Email,editText_Password;
private Button button_login,button_fbinteglogin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
// editText_Email = findViewById(R.id.editText_email);
// editText_Password = findViewById(R.id.editText_password);
try {
PackageInfo info = getPackageManager().getPackageInfo("com.example.alimuhammad.fbintegapp", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
}
搜索KeyHash时Logcat的结果,什么都没有显示,但是当我编写一个键时,发现下面的结果。现在该怎么办?
08-09 12:11:40.887 2103-2103/? W/PowerMonitor.PeriodCheckItem: powergenie_mode, put to hashmap: key = 1533798700886, value = 2, length = 1
08-09 12:11:40.889 2103-2103/? W/PowerMonitor.PeriodCheckItem: backlight, put to hashmap: key = 1533798700886, value = 59, length = 2
08-09 12:11:40.891 2103-2103/? W/PowerMonitor.PeriodCheckItem: discharging, put to hashmap: key = 1533798700886, value = 236, length = 3
08-09 12:13:40.899 2103-2103/? W/PowerMonitor.PeriodCheckItem: powergenie_mode, put to hashmap: key = 1533798820893, value = 2, length = 1
08-09 12:13:40.901 2103-2103/? W/PowerMonitor.PeriodCheckItem: backlight, put to hashmap: key = 1533798820893, value = 5, length = 1
08-09 12:13:40.902 2103-2103/? W/PowerMonitor.PeriodCheckItem: discharging, put to hashmap: key = 1533798820893, value = 311, length = 3
08-09 12:14:09.327 2630-2630/? I/HwLauncher: MutilSelectedIcons onPreHandleUpdatedTask : mIsInMutilSelectMode = false task = 2 packages = [com.example.alimuhammad.fbintegapp] hasHandleInvisiblePanel = false
08-09 12:15:40.912 2103-2103/? W/PowerMonitor.PeriodCheckItem: powergenie_mode, put to hashmap: key = 1533798940911, value = 2, length = 1
08-09 12:15:40.915 2103-2103/? W/PowerMonitor.PeriodCheckItem: backlight, put to hashmap: key = 1533798940911, value = 83, length = 2
08-09 12:15:40.916 2103-2103/? W/PowerMonitor.PeriodCheckItem: discharging, put to hashmap: key = 1533798940911, value = 222, length = 3
08-09 12:17:40.920 2103-2103/? W/PowerMonitor.PeriodCheckItem: powergenie_mode, put to hashmap: key = 1533799060918, value = 2, length = 1
08-09 12:17:40.922 2103-2103/? W/PowerMonitor.PeriodCheckItem: backlight, put to hashmap: key = 1533799060918, value = 5, length = 1
08-09 12:17:40.924 2103-2103/? W/PowerMonitor.PeriodCheckItem: discharging, put to hashmap: key = 1533799060918, value = 293, length = 3
08-09 12:19:40.927 2103-2103/? W/PowerMonitor.PeriodCheckItem: powergenie_mode, put to hashmap: key = 1533799180926, value = 2, length = 1
08-09 12:19:40.929 2103-2103/? W/PowerMonitor.PeriodCheckItem: backlight, put to hashmap: key = 1533799180926, value = 5, length = 1
08-09 12:19:40.931 2103-2103/? W/PowerMonitor.PeriodCheckItem: discharging, put to hashmap: key = 1533799180926, value = 301, length = 3
08-09 12:21:40.934 2103-2103/? W/PowerMonitor.PeriodCheckItem: powergenie_mode, put to hashmap: key = 1533799300933, value = 2, length = 1
08-09 12:21:40.937 2103-2103/? W/PowerMonitor.PeriodCheckItem: backlight, put to hashmap: key = 1533799300933, value = 5, length = 1
08-09 12:21:40.939 2103-2103/? W/PowerMonitor.PeriodCheckItem: discharging, put to hashmap: key = 1533799300933, value = 324, length = 3