Skip to content

Commit

Permalink
Minor update for %debuggable%, fix #50
Browse files Browse the repository at this point in the history
  • Loading branch information
kkguo committed Apr 27, 2016
1 parent 1b6022c commit 5ddaf04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ApkShellext2/ApkContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ public static string ReplaceVariables(string ori, AppPackageReader reader) {
newStr = newStr.Replace(Resources.varLastModify,
File.GetLastWriteTime(reader.FileName).ToString("dd/MM/yy HH:mm:ss"));
if (newStr.Contains(Resources.varDebuggable))
if (reader.Type == AppPackageReader.AppType.AndroidApp)
newStr = newStr.Replace(Resources.varDebuggable,
((ApkReader)reader).Debuggable?"Debug":"Release");
(reader.Type == AppPackageReader.AppType.AndroidApp)?
(((ApkReader)reader).Debuggable?"Debug":"Release"):"");
return newStr;
}

Expand Down
3 changes: 3 additions & 0 deletions ApkShellext2/ApkQuickReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ public class ApkReader : AppPackageReader {
//private const string AttrName = @"name";
private const string AttrDebuggable = @"debuggable";
private const string ConstTrue = "true";
private const string ConstFalse = "false";

/// <summary>
/// extract the manifext
Expand Down Expand Up @@ -1229,6 +1230,8 @@ private ApkResource QuickSearchManifestXml(string tag, string attribute) {
return result;
} else if (dataType == (byte)DATA_TYPE.TYPE_REFERENCE) {
return QuickSearchResource((UInt32)data);
} else if (dataType == (byte)DATA_TYPE.TYPE_INT_BOOLEAN) {
result.defaultValue = (data == 0) ? ConstFalse : ConstTrue;
} else { // I would like to expect we only will recieve TYPE_STRING/TYPE_REFERENCE/any integer type, complex is not considering here,yet
result.defaultValue = data.ToString();
}
Expand Down

0 comments on commit 5ddaf04

Please sign in to comment.