|
[求助]模拟器用adb remount没有权限怎么办
是的啊,这是最无语的, 不知道为什么就我会这样。 |
|
[求助]模拟器用adb remount没有权限怎么办
[QUOTE=qqsunqiang;1459461]Microsoft Windows XP [版本 5.1.2600] (C) 版权所有 1985-2001 Microsoft Corp. C:\Documents and Settings\Administrator>adb shell root@android:/ # su su ...[/QUOTE] 我的是模拟器。4.4.2的还是arm架构的。我就是用mount 没有权限,头都要炸了。 |
|
[求助]模拟器用adb remount没有权限怎么办
push 没法用的, 因为/system 的属性是 ro有只读属性的, 我正是要remount将其改为 rw |
|
[求助]模拟器用adb remount没有权限怎么办
额, andriod的shell 毕竟和linux上的shell不一样,比如sudo这个命令他就没有。 |
|
[求助]模拟器用adb remount没有权限怎么办
我就是运行到 # mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system 这一步的时候, 实际看mount来说 我的应该是ext4 格式 /dev/block/vda, 所以就是这一步的时候, mount 显示mount: Permission denied 。 我苦恼的就是这一步。 |
|
[求助]模拟器用adb remount没有权限怎么办
啊?我就是想知道为什么我remount , 还有在shell 里面 mount 都没有权限啊 |
|
[求助]socket编程问题!谢谢
如果你的每个线程的传输数据都是繁忙的饱和的那到没有什么,看业务 |
|
[求助][求助]请大家指点下,这段c++代码优化的思路
#ifndef __BMLIB_STRUTILS_H__ #define __BMLIB_STRUTILS_H__ #include <algorithm> #include <string.h> #include <vector> #include <map> #include <stdarg.h> using namespace std; namespace BMLib { class BMStrUtils { public: /** * 格式化字符串\n * 根据参数pszFormat字符串来转换并格式化数据,然后将结果复制到参数str所指的字符串中,直到出现字符串结束'\0'为止 * @return 返回格式化后字符串的长度 */ static int Format(std::string& str, const char* pszFormat, ...) { va_list argList; va_start(argList, pszFormat); int iMaxLen = vsnprintf(NULL, 0, pszFormat, argList); va_end(argList); if (iMaxLen <= 0) { return iMaxLen; } iMaxLen++; char* pszBuf = (char *)malloc(iMaxLen+10); if (pszBuf != NULL) { memset(pszBuf,0,iMaxLen+10); va_list argListSave ; va_start(argListSave, pszFormat); iMaxLen = vsnprintf(pszBuf, iMaxLen, pszFormat, argListSave); va_end(argListSave); str = pszBuf; free(pszBuf); pszBuf = NULL; } /* 2012-7-18 ++iMaxLen; char* pszBuf = new char[iMaxLen]; if (!pszBuf) { return -1; } va_list argListSave ; va_start(argListSave, pszFormat); iMaxLen = vsnprintf(pszBuf, iMaxLen, pszFormat, argListSave); va_end(argListSave); str.assign(pszBuf, iMaxLen); delete[] pszBuf; */ return iMaxLen; } /** * 格式化字符串\n * 根据参数pszFormat字符串来转换并格式化数据,然后将结果复制到参数str所指的字符串中,直到出现字符串结束'\0'为止 * @return 返回格式化后字符串的长度 */ static std::string& MakeUpper(std::string& str) { transform(str.begin(), str.end(), str.begin(), static_cast<int(*)(int)> (toupper)); return str; } /** * 转为大写 */ static std::string& MakeLower(std::string& str) { transform(str.begin(), str.end(), str.begin(), static_cast<int(*)(int)> (tolower)); return str; } /** *转为小写 */ static int CompareNoCase(const std::string& str1, const std::string& str2) { return strcasecmp(str1.c_str(), str2.c_str()); } /** *字符串比较,不区分大小写 */ static int NCompareCase(const std::string& str1, const std::string& str2, unsigned int n) { return strncmp(str1.c_str(), str2.c_str(), n); } /** *比较前count个字符 */ static int NCompareNoCase(const std::string& str1, const std::string& str2, unsigned int n) { return strncasecmp(str1.c_str(), str2.c_str(), n); } /** * 字符替换 * @return 返回被替换的次数 */ static int Replace(std::string& str, char chOld, char chNew) { if (chOld == chNew) { return 0; } int iCount = 0; for (unsigned int i = 0; i < str.length(); ++i) { if (str[i] == chOld) { str[i] = chNew; ++iCount; } } return iCount; } /** * 字符串替换 * @return 返回被替换的次数 */ static int Replace(std::string& str, const char* pszOld, const char* pszNew) { if (pszOld == pszNew) { return 0; } const size_t iOldLen = strlen(pszOld); const size_t iNewLen = strlen(pszNew); int iCount = 0; size_t iIndex = str.find(pszOld, 0); while (iIndex != std::string::npos) { str.erase(iIndex, iOldLen); str.insert(iIndex, pszNew); iIndex = str.find(pszOld, iIndex + iNewLen); ++iCount; } return iCount; } /** * 删除字符串中的某字符 * @return 返回删除的次数 */ static int Remove(std::string& str, char ch) { int iCount = 0; size_t iIndex = str.find(ch); while (iIndex != std::string::npos) { str.erase(iIndex, 1); iIndex = str.find(ch); ++iCount; } return iCount; } /** * 删除字符串中的某些字符\n * 如果是想删除子串,用Replace * @return 返回删除的次数 */ static int Remove(std::string& str, const char* pszTrim) { int iCount = 0; size_t iIndex = str.find_first_of(pszTrim); while (iIndex != std::string::npos) { str.erase(iIndex, 1); iIndex = str.find_first_of(pszTrim); ++iCount; } return iCount; } /** * 删除字符串中某些字符外的字符 * @return 返回删除的次数 */ static int RemoveNot(std::string& str, const char* pszTrim) { int iCount = 0; size_t iIndex = str.find_first_not_of(pszTrim); while (iIndex != std::string::npos) { str.erase(iIndex, 1); iIndex = str.find_first_not_of(pszTrim); ++iCount; } return iCount; } /** * 删除字符串左边中的某些字符 */ static std::string& TrimLeft(std::string& str, const char* pszTrim) { size_t iIndex = str.find_first_not_of(pszTrim); if (iIndex != std::string::npos) { str.erase(0, iIndex); } return str; } /** * 删除字符串右边中的某些字符 */ static std::string& TrimRight(std::string& str, const char* pszTrim) { size_t iIndex = str.find_last_not_of(pszTrim); if ((++iIndex) != str.length()) { str.erase(iIndex, str.length() - iIndex); } return str; } static std::string& Trim(std::string& str, const char* pszTrim) { TrimLeft(str, pszTrim); TrimRight(str, pszTrim); return str; } /** * Url编码 */ static std::string& UrlEncode(const std::string& strSrc, std::string& strDst, bool bEncodeMutilBytes = false) { return UrlEncode(strSrc.c_str(), strDst, bEncodeMutilBytes); } static std::string& UrlEncode(const char* pszSrc, std::string& strDst, bool bEncodeMutilBytes = false) { const size_t iLen = strlen(pszSrc); strDst = ""; strDst.reserve(iLen * 3); unsigned char uch; char sz[8]; for (size_t i = 0; i < iLen; ++i) { uch = (unsigned char) pszSrc[i]; if (bEncodeMutilBytes && (uch > 0x7F)) { snprintf(sz, sizeof(sz), "%%%02X", uch); strDst += sz; } else { switch (uch) { case '&': strDst += "%26"; break; case '=': strDst += "%3D"; break; case '%': strDst += "%25"; break; case '+': strDst += "%2B"; break; case '?': strDst += "%3F"; break; case ' ': strDst += "+"; break; case '\n': strDst += "%0A"; break; case '\r': strDst += "%0D"; break; case '\t': strDst += "%09"; break; case ':': strDst += "%3A"; break; case '/': strDst += "%2F"; break; default: strDst += uch; break; } } } return strDst; } /** * 引号编码. * 如果一个字符串需要安全的放到引号中,用这种编码方式. * 实现方法就是按C++的字符串转义来处理 */ static std::string& QuotEncode(const std::string& strSrc, std::string& strDst) { return QuotEncode(strSrc.c_str(), strDst); } static std::string& QuotEncode(const char* pszSrc, std::string& strDst) { const size_t iLen = strlen(pszSrc); strDst = ""; strDst.reserve(iLen * 2); unsigned char uch; bool bMutilBytes = false; for (size_t i = 0; i < iLen; ++i) { uch = (unsigned char) pszSrc[i]; if (uch > 0x7F || bMutilBytes) { bMutilBytes = !bMutilBytes; strDst += uch; } else { switch (uch) { case '\n': strDst += "\\n"; break; case '\t': strDst += "\\t"; break; case '\v': strDst += "\\v"; break; case '\b': strDst += "\\b"; break; case '\r': strDst += "\\r"; break; case '\f': strDst += "\\f"; break; case '\a': strDst += "\\a"; break; case '\\': strDst += "\\\\"; break; case '\?': strDst += "\\\?"; break; case '\'': strDst += "\\\'"; break; case '\"': strDst += "\\\""; break; default: strDst += uch; break; } } } return strDst; } /** * 把0-9,A-F这样的十六进制字符转为相应的十进制 */ static int HexToInt(char ch) { if (ch >= '0' && ch <= '9') { return ch - '0'; } else if (ch >= 'a' && ch <= 'f') { return ch - 'a' + 10; } else if (ch >= 'A' && ch <= 'F') { return ch - 'A' + 10; } else { return 0; } } /** * Url解码 */ static bool UrlDecode(const std::string& strSrc, std::string& strDst) { return UrlDecode(strSrc.c_str(), strDst); } static bool UrlDecode(const char* pszSrc, std::string& strDst) { const size_t iLen = strlen(pszSrc); strDst = ""; strDst.reserve(iLen); char ch; for (size_t i = 0; i < iLen;) { switch (pszSrc[i]) { case '+': strDst += ' '; ++i; break; case '%': if ((i + 2) >= iLen) { return false; } ch = (HexToInt(pszSrc[i + 1]) << 4) + HexToInt( pszSrc[i + 2]); strDst += ch; i += 3; break; default: strDst += pszSrc[i]; ++i; break; } } return true; } /** * Url解码,不推荐使用 */ static bool UrlDecode(const char* pszSrc, char* pszDst) { std::string strDst; if (!UrlDecode(pszSrc, strDst)) { return false; } strcpy(pszDst, strDst.c_str()); return true; } /** * HTML编码 */ static std::string& HtmlEncode(const std::string& strSrc, std::string& strDst) { return HtmlEncode(strSrc.c_str(), strDst); } static std::string& HtmlEncode(const char* pszSrc, std::string& strDst) { const size_t iLen = strlen(pszSrc); strDst = ""; strDst.reserve(iLen * 3); unsigned char uch; bool bMutilBytes = false; for (size_t i = 0; i < iLen; ++i) { uch = (unsigned char) pszSrc[i]; if (uch > 0x7F || bMutilBytes) { bMutilBytes = !bMutilBytes; strDst += uch; } else { switch (uch) { case '<': strDst += "<"; break; case '>': strDst += ">"; break; case '&': strDst += "&"; break; case '"': strDst += """; break; case '$': strDst += "$"; break; case '%': strDst += "%"; break; default: strDst += uch; break; } } } return strDst; } /** * 分割字符串的相关操作 * 把字符串分割成多个字符串,可以有多个分割符 * 注意:这种方式会忽略重复的分割符 */ static void Split(const std::string& strBuf, const std::string& strDel, std::vector<std::string>& aryStringList) { size_t pos1 = 0, pos2 = 0; while (true) { pos1 = strBuf.find_first_not_of(strDel, pos2); if (pos1 == std::string::npos) { break; } pos2 = strBuf.find_first_of(strDel, pos1); if (pos2 == std::string::npos) { aryStringList.push_back(strBuf.substr(pos1)); break; } else { aryStringList.push_back( strBuf.substr(pos1, pos2 - pos1)); } } } static void Split(const std::string& strBuf, const std::string& strDel, int aryIntList[],int iarySize) { size_t pos1 = 0, pos2 = 0; int size=0; string strbuff; while (true) { pos1 = strBuf.find_first_not_of(strDel, pos2); if (pos1 == std::string::npos) { break; } pos2 = strBuf.find_first_of(strDel, pos1); if (pos2 == std::string::npos) { strbuff =strBuf.substr(pos1); if (size < iarySize) { aryIntList[size] =atoi(strbuff.c_str()); size ++; } break; } else { strbuff =strBuf.substr(pos1, pos2 - pos1); if (size < iarySize) { aryIntList[size] =atoi(strbuff.c_str()); size ++; } } } } /** * 分割字符串的相关操作 * 把字符串分割成多个字符串,分隔符唯一 * 注意:这种方式会#不#忽略重复的分割符 */ static void SplitNoSkip(const std::string& strBuf, const std::string& strDel, std::vector<std::string>& aryStringList) { size_t pos1 = 0, pos2 = 0; while (true) { pos2 = strBuf.find(strDel, pos1); if (pos2 == std::string::npos) { aryStringList.push_back(strBuf.substr(pos1)); break; } else { aryStringList.push_back( strBuf.substr(pos1, pos2 - pos1)); pos1 = pos2 + strDel.size(); } } } /** * 分割name=value串 */ static bool SplitIni(const std::string& strLine, std::string& strName, std::string& strValue) { if (strLine.size() == 0) { return false; } size_t iIndex = strLine.find('='); if (iIndex == std::string::npos) { return false; } strName = strLine.substr(0, iIndex); strValue = strLine.substr(iIndex + 1, strLine.size() - iIndex - 1); return true; } /** * 分割Url字符串 * Url串中的特殊字符需要在调用前过滤 */ static bool SplitUrl(const std::string& strLine, std::map< std::string, std::string>& mapNameValue, bool bEndecode = true, bool bNameCase = false) { std::vector<std::string> aryList; Split(strLine, "&", aryList); std::string strName, ssName; std::string strValue, ssValue; for (unsigned int i = 0; i < aryList.size(); ++i) { if (aryList[i].size() == 0) { continue; } if (!SplitIni(aryList[i], strName, strValue)) { return false; } if (bEndecode) { if (!UrlDecode(strName.c_str(), ssName) || !UrlDecode( strValue.c_str(), ssValue)) { return false; } } else { ssName = strName; ssValue = strValue; } if (!bNameCase) { MakeLower(ssName); } mapNameValue[ssName] = ssValue; } return true; } /** * 分割Cookie中的字符串 */ static bool SplitCookie(const std::string& strOriginLine, std::map< std::string, std::string>& mapNameValue, bool bEndecode = true, bool bNameCase = false) { std::string strLine = strOriginLine; strLine.erase(remove(strLine.begin(), strLine.end(), ' '), strLine.end()); std::vector<std::string> aryList; Split(strLine, ";", aryList); std::string strName, ssName; std::string strValue, ssValue; for (unsigned int i = 0; i < aryList.size(); ++i) { if (aryList[i].size() == 0) { continue; } if (!SplitIni(aryList[i], strName, strValue)) { //return false; // continue; } ssName = strName; ssValue = strValue; mapNameValue[ssName] = ssValue; } return true; } static void Byte2Hex(unsigned char* pszCharStr, string& strHex, int size) { strHex = ""; for (int i = 0; i < size; i++) { char buf[3]; memset(buf,0x00,3); snprintf(buf,3,"%X",pszCharStr[i]); string strValue = buf; if(strValue.length() == 1) { strHex += "0"; strHex += strValue; } else if(strValue.length() == 2) { strHex += strValue; } } } static void Char2HexStr(unsigned char* pszCharStr, string& strHex, int iSize) { char* pszHex = new char[iSize * 2 + 1]; if (pszHex) { Char2HexStr(pszCharStr, pszHex, iSize); pszHex[iSize * 2] = 0; strHex.assign(pszHex, iSize * 2); delete[] pszHex; pszHex = NULL; } } static void Char2Hex(unsigned char ch, char* szHex) { unsigned char sbyte[2]; sbyte[0] = ch / 16; sbyte[1] = ch % 16; for (int i = 0; i < 2; i++) { int nvale = sbyte[i]; if ((nvale >= 0) && (nvale <= 9)) { szHex[i] = '0' + sbyte[i]; } else { szHex[i] = 'A' + (sbyte[i] - 10); } } szHex[2] = 0; } static void Char2HexStr(unsigned char* pszCharStr, char* pszHexStr, int iSize) { char szHex[3]; pszHexStr[0] = 0; for (int i = 0; i < iSize; i++) { memset(szHex, 0x00, sizeof(szHex)); Char2Hex(pszCharStr[i], szHex); strcat(pszHexStr, szHex); } } }; } // namespace CHLib #endif // __CHLIB_STRUTILS_H__ |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值