Skip to content

Commit

Permalink
Add fix for app_get_wpa2_password
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Nov 1, 2024
1 parent c72af01 commit 6bdb3c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ndk/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ char *app_get_camera_ip(void) {

char *app_get_wpa2_password(void) {
JNIEnv *env = get_jni_env();
return jni_get_pref_str(env, "wpa_password", "");
char *s = jni_get_pref_str(env, "wpa_password", "");
size_t l = strlen(s);
if (l == 0 || l > 25) {
free(s);
return strdup("192.168.0.1");
}
}

SETTINGS_FUNC(jobject, getWPA2Password)(JNIEnv *env, jclass thiz, jobject ctx) {
Expand Down

0 comments on commit 6bdb3c0

Please sign in to comment.