linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] ZRTP don't working


From: Mohamad Mansouri
Subject: [Linphone-developers] ZRTP don't working
Date: Thu, 28 Feb 2013 12:02:40 -0800 (PST)

hello fellas
i want use ZRTP for media encryption in linphone for android
but i can verify SAS or authentication string which showed when clicking on encryption status in status bar.
ok
when clicking on encryption status a toast appear on screen for authenticating called. i found in source code that click on security OK image if user authenticated.i trying do that but don.t working. 
i need you're help. thank u
statusfragment:

private void showZRTPDialog(final LinphoneCall call) {
        boolean authVerified = call.isAuthenticationTokenVerified();
        String format = getString(authVerified ? R.string.reset_sas_fmt : R.string.verify_sas_fmt);
        
LayoutInflater inflater = LayoutInflater.from(getActivity());
View layout = inflater.inflate(R.layout.zrtp_dialog, (ViewGroup) getActivity().findViewById(R.id.toastRoot));
TextView toastText = (TextView) layout.findViewById(R.id.toastMessage);
toastText.setText(String.format(format, call.getAuthenticationToken()));
zrtpToast = new Toast(getActivity());
zrtpToast.setGravity(Gravity.TOP | Gravity.RIGHT, 0, LinphoneUtils.pixelsToDpi(getResources(), 100));
zrtpToast.setDuration(Toast.LENGTH_LONG);
ImageView ok = (ImageView) layout.findViewById(R.id.toastOK);
ok.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (call != null) {
call.setAuthenticationTokenVerified(true);
}
if (encryption != null) {
encryption.setImageResource(R.drawable.security_ok);
}
hideZRTPDialog();
}
});
ImageView notOk = (ImageView) layout.findViewById(R.id.toastNotOK);
notOk.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (call != null) {
call.setAuthenticationTokenVerified(false);
}
if (encryption != null) {
encryption.setImageResource(R.drawable.security_pending);
}
hideZRTPDialog();
}
});
zrtpHack = new CountDownTimer(3000, 1000)
{
   public void onTick(long millisUntilFinished) 
   { 
    if (!hideZrtpToast) {
    zrtpToast.show(); 
    }
   }
   public void onFinish() { 
    if (!hideZrtpToast) { 
    zrtpToast.show();
    zrtpHack.start();
    }
   }

};

zrtpToast.setView(layout);
hideZrtpToast = false;
zrtpToast.show();
zrtpHack.start();
}  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]