软件更新协议

来源:互联网 发布:php 在线客服 免费 编辑:程序博客网 时间:2024/04/27 19:21

各位亲 有时间可以去看看我的  “金骏家居淘宝店” http://jinjun1688.taobao.com/shop/view_shop.htm?tracelog=twddp 买时说明在我的博客看到有优惠哦 还有意外礼品赠送  真正的程序员淘宝店

option optimize_for=LITE_RUNTIME;



enum PlatformType 

{

    PT_None = 0;

    PT_iOS = 101;

    PT_Android = 102;

}


enum SubPlatform 

{

    SPT_None = 0;

    SPT_iPhone = 1001;

    SPT_iPad = 1002;

    SPT_iPod = 1003;

    SPT_Android_General = 1004;

    SPT_Android_Pad = 1005;

    SPT_Android_HD = 1006;

}


enum ProductID 

{

    PI_None = 0;

    PI_MT = 101;    //MT

    PI_LDT = 102;   //乱斗堂

}


message UserInfo 

{

    required string uuid = 1;

    required ProductID product = 2 [ default = PI_None ];  //产品编号

    required string version = 3 [ default = "0.0" ];

    optional string buildno = 4 [ default = "0" ];

    optional int32 channelID = 5;   //渠道

    

    optional PlatformType platformtype = 6 [ default = PT_None ];   //平台类型

    optional SubPlatform subplatform = 7 [ default = SPT_None ];    //子平台  

    optional string sys_version = 8;    //系统版本号

    optional string imei = 9;

    optional string mac_address = 10;  //mac地址    

    optional string imsi = 11;

    optional bool isroot = 12;    //是否

}


message RequestBase

{

   required int32 request_id = 1;

   required int32 server_id = 2;

   required string request_function = 3;

}



enum RequestType

{

    RT_None = 0;

    RT_User = 1;    //用户请求更新

    RT_Auto = 2;    //自动请求更新

    RT_Tips = 3;

}


message RequestUpdate

{

    required RequestBase requestbase = 1;

    required UserInfo userinfo = 2;

    required RequestType request_type = 3;

    optional string reserve = 4;

}





enum UpdateControl

{

    UPCTL_None = 0;

    UPCTL_SlientUpdate = 101;   //静默更新

    UPCTL_UserOpt = 102;    //用户选择更新

    UPCTL_UserForce = 103;  //用户强制更新

}


enum FileType

{

    FT_None = 0;

    FT_IPA = 101;

    FT_DEB = 102;

    FT_APK = 103;

    FT_ZIP = 104;

    FT_PNG = 105;

    FT_JPG = 106;

}


message UpdateInfo

{

    required UpdateControl update_control = 1 [ default = UPCTL_None ];

    optional string package_address = 2;

    optional string package_md5 = 3;

    optional FileType package_type = 4;

}


enum TipsControl

{

    TIPSCTRL_None = 0;

    TIPSCTRL_Text = 1;

    TIPSCTRL_Image = 2;

}


message TipsInfo

{

    required TipsControl tips_control = 1 [ default = TIPSCTRL_None];

    optional string title = 2;

    optional string detail = 3;

    optional string image_addr = 4;

    optional string image_md5 = 5;

    optional FileType image_type = 6;

}



enum ResponseResultType

{

    RRT_None = 0;

    RRT_Update = 101;

    RRT_Tips = 102;

    BRT_UpdateTips = 103;   //更新并且提示tips,如果是静默更新,则更新后弹tips,如果是用户更新则更新前弹tips

}


message TimeControl

{

    required string start_time = 1; //"0"表示永久有效,"1"表示即时开始有效,其他表示有效的起始时间(unix s)

    optional string end_time = 2;   // (unix s)

    optional string last_time = 3;  //持续时间(s)

}


message ResponseUpdate 

{

    required ResponseResultType check_result = 1; 

    repeated UpdateInfo updateinfo = 2;

    repeated TipsInfo tipsinfo = 3;

    optional TimeControl time_control = 4;

}