Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8174029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:20:48+00:00 2026-06-06T22:20:48+00:00

So I have a file in res/values/ on my desktop, in it is strings.xml,

  • 0

So I have a file in res/values/ on my desktop, in it is strings.xml, this strings.xml contains the following:

<?xml version="1.0" encoding="utf-8"?>
<resources>

  <string name="hello">Hello World, SHAHashActivity!</string>
  <string name="app_name">SHA-Hash</string>
  <string name="sha">12345</string>
  <string name="app_path">67890</string>

</resources>

I have a script that contains that then takes some user input in regards to the name of the apk im trying to modify, then it unzips the apk, hashes classes.dex and attempts to insert the hash value to replace 12345 in strings.xml. In all, once modified, it attempts to use aapt to update the strings.xml file in the apk, but to no avail. Here is a part of the script.

export hash=`/usr/bin/openssl sha1 apk/classes.dex | sed "s|SHA1(apk/classes.dex)= ||g"`
sed -i '' -e"s/12345/$hash/g" res/values/strings.xml
./aapt a -v SHA-Hash.apk res/values/strings.xml

Using sed to locally update the strings file works, it modifies it, but using aapt to update it in the apk does not work.

Any ideas on which command to use aapt properly to replace the existing /res/values/strings.xml with the one on my computer? I can’t find much documentation on aapt so any help would be appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:20:50+00:00Added an answer on June 6, 2026 at 10:20 pm

    What about overwriting res/values/strings.xml using plain old jar:

    jar vuf SHA-Hash.apk res/values/strings.xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, I have an xml file in res/xml <?xml version=1.0 encoding=utf-8?> <rootelement1> <subelement> Hello
I have created an xml file like this: <?xml version=1.0 encoding=utf-8?> <ListView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent
I have an options_menu.xml file like this: <?xml version=1.0 encoding=utf-8?> <menu xmlns:android=http://schemas.android.com/apk/res/android> <item android:id=@+id/search
I have the following XML layout file, HELPME.XML <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have two resources file in res/values directory: string.xml and names.xml how can I
In my foo_layout.xml file I have a subclassed RelativeLayout: <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android
I have a current Android app that uses i18n via resources. res/values-es/strings.xml and so
Consider this preferences.xml file: <?xml version=1.0 encoding=utf-8?> <PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/android android:title=@string/preference_main> <PreferenceScreen android:title=@string/preference_sight android:key=category_sight> <ListPreference
I have a file /res/values/maps_api_key.xml where I defined my Google Maps API key: <resources>
I have a custom style file( style.xml ) in res/values that looks like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.