Skip to content

Commit

Permalink
Fix/replace_debuggable_false_with_true
Browse files Browse the repository at this point in the history
  • Loading branch information
tiandrew committed Mar 30, 2020
1 parent 99f4605 commit e54c812
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions debugapk
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ if ! grep "networkSecurityConfig" "$OUTPUT_DIRECTORY"/AndroidManifest.xml; then
fi

# Set debuggable in the Android Manifest
if ! grep "debuggable" "$OUTPUT_DIRECTORY"/AndroidManifest.xml; then
sed -E "s/(<application.*)(>)/\1 android\:debuggable=\"true\" \2 /" $OUTPUT_DIRECTORY/AndroidManifest.xml > $OUTPUT_DIRECTORY/AndroidManifest.xml.tmp
mv $OUTPUT_DIRECTORY/AndroidManifest.xml.tmp $OUTPUT_DIRECTORY/AndroidManifest.xml
if grep -i "debuggable=\"false\"" "$OUTPUT_DIRECTORY"/AndroidManifest.xml; then
sed -i "" "s|android:debuggable=\"false\"|android:debuggable=\"true\"|g" "$OUTPUT_DIRECTORY"/AndroidManifest.xml
elif ! grep -i "debuggable" "$OUTPUT_DIRECTORY"/AndroidManifest.xml; then
sed -i "" "s/(<application.*)(>)/\1 android\:debuggable=\"true\" \2 /" $OUTPUT_DIRECTORY/AndroidManifest.xml
fi

# Set verbose logging in the Android Manifest
Expand Down

0 comments on commit e54c812

Please sign in to comment.