Browse Source

Merge with default

JNI-88
Hussein Kasem 6 years ago
parent
commit
9d8bdbbd79
  1. 2
      android/src/org/pEp/jniadapter/AndroidHelper.java
  2. 17
      src/basic_api.cc
  3. 10
      src/pEp.yml2
  4. 47
      utils/extract_pEp_status_codes_from_engine.sh

2
android/src/org/pEp/jniadapter/AndroidHelper.java

@ -29,7 +29,7 @@ public class AndroidHelper {
private static File tmpDir;
// TODO : Increment when needed.
public static int ENGINE_VERSION_CODE = 3104;
public static int ENGINE_VERSION_CODE = 3293;
private static File shareDir;

17
src/basic_api.cc

@ -172,6 +172,23 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustPersonalKey(
::trust_personal_key(session(), _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustOwnKey(
JNIEnv *env,
jobject obj,
jobject ident
)
{
PEP_SESSION session = (PEP_SESSION) callLongMethod(env, obj, "getHandle");
pEp_identity *_ident = to_identity(env, ident);
if (_ident->fpr == NULL || _ident->fpr[0] == 0) {
throw_pEp_Exception(env, PEP_CANNOT_FIND_IDENTITY);
return;
}
::trust_own_key(session, _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_importKey(
JNIEnv *env,
jobject obj,

10
src/pEp.yml2

@ -29,8 +29,10 @@ namespace pEp {
pEp_cannot_export_key > 0x0204
pEp_cannot_edit_key > 0x0205
pEp_key_unsuitable > 0x0206
pEp_malformed_key_reset_msg > 0x0210
pEp_key_not_reset > 0x0211
pEp_key_imported > 0x0220
pEp_no_key_imported > 0x0221
pEp_key_import_status_unknown > 0x0222
pEp_cannot_find_identity > 0x0301
pEp_cannot_set_person > 0x0381
@ -42,7 +44,7 @@ namespace pEp {
pEp_cannot_find_alias > 0x0391
pEp_cannot_set_alias > 0x0392
pEp_unencrypted > 0x0400
pEp_verified > 0x0401
pEp_decrypted > 0x0402
@ -75,6 +77,7 @@ namespace pEp {
pEp_sync_cannot_encrypt > 0x0905
pEp_sync_no_message_send_callback > 0x0906
pEp_sequence_violated > 0x0970
pEp_cannot_increase_sequence > 0x0971
pEp_statemachine_error > 0x0980
@ -284,6 +287,7 @@ namespace pEp {
basic void keyMistrusted(identity ident);
basic void keyResetTrust(identity ident);
basic void trustPersonalKey(identity ident);
basic void trustOwnKey(identity ident);
basic void importKey(string key);
basic void blacklist_add(string fpr);
basic void blacklist_delete(string fpr);

47
utils/extract_pEp_status_codes_from_engine.sh

@ -0,0 +1,47 @@
################################################################################
# Argument cheking #
################################################################################
if [ ! -f $1 ]; then
echo -e "\e[1m\e[31mInput file not found!\e[0m"
fi
if [ -z "$2" ]; then
echo -e "\e[1m\e[31mNo output file supplied\e[0m"
fi
if [ "$#" -ne 2 ]; then
echo "Expected use is: $0 input_file output_file"
exit 1
fi
################################################################################
# Select GNU SED #
################################################################################
OS="$(uname -s)"
case "${OS}" in
Linux*) SED=sed;;
Darwin*) SED=gsed;;
CYGWIN*) echo "UNSUPORTED YET" && exit;;
MINGW*) echo "UNSUPORTED YET" && exit;;
*) echo "UNKNOWN:${OS}" && exit;;
esac
################################################################################
# Transform input file PEP_STATUS to yml2 status #
################################################################################
$SED -n '/} PEP_STATUS/q;p' $1 > $2
$SED -i -n '/STATUS_OK/,$p' $2
$SED -i -e 's/\(.*\)/\L\1/' $2
$SED -i "-e s/ pep/ pEp/g" $2
$SED -i s/=/\>/g $2
$SED -i s/,//g $2
################################################################################
# Show results #
################################################################################
cat $2
Loading…
Cancel
Save