porting with 1989flanker to CPP (Android JNI)