问题背景:
产线用到的CIT、PCBA、RUNIN等标志位,工模apk做完测试之后调用so动态库文件写入二进制文件。Write方法失败。
问题分析:
之前的项目标志位是存在productinfo/producinfo.bin二进制文件中,可以直接写成功,SC8830 android2.3平台是存在/dev/ubi0_miscdata 裸分区中,使用ubi方案,该裸分区必须root权限才可以去写,但是我们工程模式apk具有system权限,通过jni调用底层so动态库文件去写,该so库文件也是system权限,导致写操作失败。返回-1.
问题解决:
1. 在产线down完版本PC端发AT指令去写sn号时,将/dev/ubi0_miscdata同步到productinfo/producinfo.bin文件(这两个二进制文件的结构相同),结构定义如下所示:
typedef struct _tagSP09_PHASE_CHECK
{
unsigned long Magic; // "SP09" (ÀÏ\u0153Ó¿ÚΪSP05)
char SN1[SP09_MAX_SN_LEN]; // SN , SN_LEN=24
char SN2[SP09_MAX_SN_LEN]; // add for Mobile
int StationNum; // the test station number of the testing
char StationName[SP09_MAX_STATION_NUM][SP09_MAX_STATION_NAME_LEN];
产线用到的CIT、PCBA、RUNIN等标志位,工模apk做完测试之后调用so动态库文件写入二进制文件。Write方法失败。
问题分析:
之前的项目标志位是存在productinfo/producinfo.bin二进制文件中,可以直接写成功,SC8830 android2.3平台是存在/dev/ubi0_miscdata 裸分区中,使用ubi方案,该裸分区必须root权限才可以去写,但是我们工程模式apk具有system权限,通过jni调用底层so动态库文件去写,该so库文件也是system权限,导致写操作失败。返回-1.
问题解决:
1. 在产线down完版本PC端发AT指令去写sn号时,将/dev/ubi0_miscdata同步到productinfo/producinfo.bin文件(这两个二进制文件的结构相同),结构定义如下所示:
typedef struct _tagSP09_PHASE_CHECK
{
unsigned long Magic; // "SP09" (ÀÏ\u0153Ó¿ÚΪSP05)
char SN1[SP09_MAX_SN_LEN]; // SN , SN_LEN=24
char SN2[SP09_MAX_SN_LEN]; // add for Mobile
int StationNum; // the test station number of the testing
char StationName[SP09_MAX_STATION_NUM][SP09_MAX_STATION_NAME_LEN];