Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/src/main/res/commentOutResourceString.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Iterate over all directories starting 'values' and comment out the resource
# passed in as the argument in the strings.xml file.
for dir in ./values*; do (
cd "$dir" &&
if [ -f strings.xml ]; then
sed -i "s/[\t ]*<[\t ]*string[\t ]*name[\t ]*=[\t ]*\"$1\".*/<!-- & -->/" strings.xml
fi
); done
8 changes: 8 additions & 0 deletions app/src/main/res/uncommentOutResourceString.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Iterate over all directories starting 'values' and comment out the resource
# passed in as the argument in the strings.xml file.
for dir in ./values*; do (
cd "$dir" &&
if [ -f strings.xml ]; then
sed -ri "s/<!--[\t ]*(<[\t ]*string[\t ]*name[\t ]*=[\t ]*\"$1\".*)[\t ]-->/ \1/" strings.xml
fi
); done
50 changes: 50 additions & 0 deletions app/src/main/res/unusedResources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# --- Configuration ---
input_file="unused_resources.txt" # The file to read lines from
target_script="./commentOutResourceString.sh" # The script to call with each line

# --- Script Logic ---

# Check if the input file exists and is readable
if [ ! -f "$input_file" ]; then
echo "Error: Input file '$input_file' not found."
exit 1
fi

if [ ! -r "$input_file" ]; then
echo "Error: Input file '$input_file' is not readable."
exit 1
fi

# Check if the target script exists and is executable
if [ ! -f "$target_script" ]; then
echo "Error: Target script '$target_script' not found."
exit 1
fi

if [ ! -x "$target_script" ]; then
echo "Error: Target script '$target_script' is not executable. Please use 'chmod +x $target_script'."
exit 1
fi

echo "Reading lines from '$input_file' and passing them to '$target_script'..."

# Read the input file line by line
while IFS= read -r line; do
echo "Processing line: '$line'"
# Call the target script, passing the current line as an argument
# Use double quotes around "$line" to handle lines with spaces correctly
"$target_script" "$line"

# Optional: Add a small delay if needed
# sleep 1

# Optional: Check the exit status of the target script
# if [ $? -ne 0 ]; then
# echo "Warning: Target script exited with an error for line: '$line'"
# fi

done < "$input_file"

echo "Finished processing all lines from '$input_file'."
1,390 changes: 695 additions & 695 deletions app/src/main/res/values-da/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-de/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-el/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-en-rGB/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-es/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-fi/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-fr-rCA/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-fr/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-it/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-ja/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-nb/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-nl/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-pt-rBR/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-pt/strings.xml

Large diffs are not rendered by default.

1,390 changes: 695 additions & 695 deletions app/src/main/res/values-sv/strings.xml

Large diffs are not rendered by default.

1,412 changes: 706 additions & 706 deletions app/src/main/res/values/strings.xml

Large diffs are not rendered by default.

Loading