finish jni token-generate method