The debug is wrong here, it should be old=%s,new=%d instead.
Also, there's a memory corruption when copying the aid_str string to sd, as you basically just assign the pointer (line 435), instead of copying the value (the corruption happens once ril_util_free_sim_apps is called). Same happens with app_str.
With such fix in place I'm able to lock/unlock my sim card.
750 + g_ril_append_ print_buf( sd->ril, "(puk=% s,pin=% s,aid=% s)",
751 + old, new,
752 + sd->aid_str);
The debug is wrong here, it should be old=%s,new=%d instead.
Also, there's a memory corruption when copying the aid_str string to sd, as you basically just assign the pointer (line 435), instead of copying the value (the corruption happens once ril_util_ free_sim_ apps is called). Same happens with app_str.
With such fix in place I'm able to lock/unlock my sim card.