How to write scripts for a file editing task - General Questions and Answers

Hello everyone.
I own an LG G4.
I want to know how to write a script from scratch and where to place it so it edits the following file and makes the changes given below into the file.
Location of file to edit: /data/data/com.lge.launcher2/shared_prefs/numofmenu.xml
Contents of the file that is to be edited:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="app_xnumofmenu" value="4" />
<int name="app_ynumofmenu" value="5" />
</map>
What i want the script to edit?
I simply want the script to edit the value of xnumofmenu to 3 and the value of ynumofmenu to 4 on every startup.
This is how i want the file to become after editing:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="app_xnumofmenu" value="3" />
<int name="app_ynumofmenu" value="4" />
</map>
What this file is?
I wanted to edit the grid of drawer on my lg g4 but i cant buy the unlocker for g4tweaksbox so i found this way to edit it. But the file goes back to default on every startup of phone.
Can someone please explain me how to write the script and how to save it. Basically guide me from scratch. Or can someone please write the script for me? Thanks alot.

Related

[TUT] Add rotation on your own to Netflix apps (and other apps)

This is just a simple tutorial about enabling screen rotation to apps that do not rotate automatically when you turn your device. It is really a TUT on how to open an apk and edit the androidmanifest.xml file. Pretty simple.
Easy:​
1. Decompile the Application.apk with apktool
2. Edit the androidmanifest with Notepad++
3. Build the Application.apk with apktool
4. Sign the apk with autosign.
Click to expand...
Click to collapse
Detailed:​
You will need some tools:
************************************************************
Android SDK: http://developer.android.com/sdk/index.html
APK Tool: http://code.google.com/p/android-apktool/
Notepad++: http://notepad-plus-plus.org/
A signing tool: Google "auto-sign apk"
An archiving tool: Plenty of them out there cable of .zip files
After you get this figured out, move on to step 1.
************************************************************
I do this from my desktop, so this is written as such.
Step 1. Decompile the Application.apk with apktool
___________________________________________________________
A. Open cmd.exe
B. Type apktool d C:/users/desktop/Netflix1.4.apk
(this refers to your desktop, so type the correct address for YOURS. However, I do not type, I drag and drop the Netflix.apk from my destop onto the cmd window)
C. Add a space then add destination directory "C:/users/destop/Netflixmod"
Again, your address of wherever you are working, and whetever you want to call the destination folder. For this I also drag and drop the same file, and just remove the .apk text.
D. Hit enter
Code:
apktool d C:\users\desktop\Netflix1.4.apk "C:\users\desktop\Netflixmod"
Your desktop address will be different than what I have typed, your Netflix app or whatever app you are decompiling will be different and your destination address and directory name will be different. DO NOT COPY PASTE THIS CODE INTO YOUR CMD LINE.
Click to expand...
Click to collapse
Step 2. Edit the androidmanifest with Notepad++
___________________________________________________________
This is for Netflix 1.4
In the folder that you just created on your desktop (or wherever you are working) There is a file called androidmanifest.xml
Open this file with Notepad++ and edit the following lines:
Change line 5: android:screenOrientation="portrait" to android:screenOrientation="sensor"
Change line 29: android:screenOrientation="landscape" to android:screenOrientation="sensor"
Save the file.
Click to expand...
Click to collapse
Step 3. Build the Application.apk with apktool
___________________________________________________________
Similar to decompiling:
A.
Code:
apktool b C:\users\desktop\Netflixmod
This will build the application in the same folder that you are working in (i.e. "Netflixmod" folder) You can specify a new directory if you want, but I do not.
There will now be a folder named "Build" within the "Netflixmod" folder.
B. Copy the "Assets" folder into the "build" folder. (apktool leaves this out, but it is important).
C. Zip the contents of the build folder into a .zip file called apk.zip. (do not zip the Build folder, just everything inside of it INCLUDING THE ASSETS FOLDER!)
D. Rename the apk.zip file to apk.apk file.
Click to expand...
Click to collapse
Step 4. Sign the apk with autosign.
___________________________________________________________
Well, sign the app with some signing tool that you are comfortable with.
Just google auto-sign apk, there are plenty of options. Cant find the link towhat I use. Please feel free to post an easy signing tool here if you want it added.
Click to expand...
Click to collapse
**************************************************
Here is all of the code that I changed in the Netflix1.4 app to enable rotation and fix graphic bugs.
You can copy paste this into a text editor like Notepad++ and save as /.xml files. Then replace the files in your decompiled app with these. Or you can download the text file attached and create separate files out of each section of code.
New Netflix 1.4 Updated 9/09/2011
BELOW ARE THE FILES THAT NEED TO BE EDITED TO ENABLE ROTATION AND AVOID GRAPHICS BUGS.
TO CHANGE COLOR, EDIT THE "#ffb9090b" TO ANOTHER HEX COLOR. IN ALL FILES EXCEPT FOR THE ANDROID MANIFEST.
───────────────────────────────────
Android Manifest.xml:
───────────────────────────────────
Change line 5: android:screenOrientation="portrait" to android:screenOrientation="sensor"
Change line 29: android:screenOrientation="landscape" to android:screenOrientation="sensor"
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="259" android:versionName="1.4.0 build 259" android:installLocation="auto" package="com.netflix.mediaclient"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:theme="@android:style/Theme.NoTitleBar" android:label="@string/app_name" android:icon="@drawable/icon" android:name=".NetflixApplication" android:debuggable="false">
<activity android:label="@string/app_name" android:name=".UIWebViewActivity" android:enabled="@bool/phone" android:finishOnTaskLaunch="false" android:clearTaskOnLaunch="true" android:launchMode="singleTop" android:screenOrientation="sensor" android:configChanges="keyboardHidden|orientation" android:alwaysRetainTaskState="true" android:allowTaskReparenting="true" android:windowSoftInputMode="stateVisible|adjustResize" android:noHistory="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="nflx" android:host="www.netflix.com" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name=".UIWebViewTabletActivity" android:enabled="@bool/tablet" android:finishOnTaskLaunch="false" android:clearTaskOnLaunch="true" android:launchMode="singleTop" android:configChanges="keyboardHidden|orientation" android:alwaysRetainTaskState="true" android:allowTaskReparenting="true" android:windowSoftInputMode="stateVisible|adjustResize" android:noHistory="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="nflx" android:host="www.netflix.com" />
</intent-filter>
</activity>
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="@string/app_name" android:name=".PlayerActivity" android:screenOrientation="sensor" android:configChanges="orientation" android:noHistory="false" />
</application>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11" />
</manifest
\res\layout folder
playout_splash.xml
───────────────────────────────────
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_marginBottom="100.0dip" to android:layout_marginBottom="90.0dip"
Dblfstr
-->
Code:
<?xml version="1.0" encoding="UTF-8"?>
<FrameLayout android:orientation="vertical" android:id="@id/top_panel" android:background="#ffb9090b" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_gravity="center" android:id="@id/logo" android:visibility="visible" android:layout_width="202.0dip" android:layout_height="62.0dip" android:src="@drawable/logo_splash" />
<ProgressBar android:layout_gravity="bottom|center" android:id="@id/pb_loading" android:visibility="visible" android:layout_width="30.0dip" android:layout_height="30.0dip" android:layout_marginBottom="90.0dip" android:indeterminate="true" android:indeterminateOnly="true" android:soundEffectsEnabled="false" style="?android:progressBarStyleSmallInverse" />
<TextView android:textSize="14.0dip" android:textColor="#ffffffff" android:layout_gravity="bottom|center" android:id="@id/label_loading" android:visibility="visible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="50.0dip" android:text="@string/label_ps_loading" />
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_marginBottom="100.0dip" to android:layout_marginBottom="90.0dip"
Dblfstr
-->
</FrameLayout>
\res\layout folder
ui_splash.xml
───────────────────────────────────
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_width="wrap_content" android:layout_height="wrap_content" to android:layout_width="30.0dip" android:layout_height="30.0dip" and "android:layout_marginTop="80.0dip"
Dblfstr
-->
Code:
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout android:id="@id/FrameLayout" android:background="#ffb9090b" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_gravity="center" android:id="@id/logo" android:visibility="visible" android:layout_width="202.0dip" android:layout_height="62.0dip" android:src="@drawable/logo_splash" android:layout_centerInParent="true" />
<ProgressBar android:id="@id/ui_load" android:visibility="visible" android:layout_width="30.0dip" android:layout_height="30.0dip" android:layout_marginTop="80.0dip" android:indeterminate="true" android:indeterminateOnly="true" android:layout_below="@id/logo" android:layout_centerInParent="true" android:soundEffectsEnabled="false" />
<!--
Edited Line 4: android:layout_gravity="bottom|center" to android:layout_gravity="center"
removed android:layout_marginBottom="150.0dip"
Edited Line 5: android:layout_width="wrap_content" android:layout_height="wrap_content" to android:layout_width="30.0dip" android:layout_height="30.0dip" and "android:layout_marginTop="80.0dip"
Dblfstr
-->
</RelativeLayout>
\res\layout folder
webview.xml
───────────────────────────────────
<!--
Edited line 2; android:background hex values
-->
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/address" android:background="#ffb9090b" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:id="@id/go_button" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<WebView android:id="@id/ui" android:background="@drawable/splash" android:visibility="visible" android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</LinearLayout>
<!--
Edited line 2; android:background hex values
-->
</LinearLayout>
all of this code is found in the attached .txt file. Remember to save each bit of code as a separate file and replace in your Netflix.apk.
and i need this
should take this
for us NON programmers, anyway you (or someone else) can actually post a modified apk?
OK, so I tried to modify these .xml files... so far, I haven't been able to open them up successfully. So my noob-ish question is, "what editor do I use to open these up?" Standard XML editors found in Windows/Office doesn't show them right.
Or can I just replace the files altogether by copying and pasting the stuff in the post? ... I will try that first, I guess...
Update1:
So I extracted the files for editing, and then replaced all the lines in those files (which by the way, opened up to show some weird encoding) using Notepad++ ... I was able to replace all the stuff anyways, and I saved it. Re-packed the apk... Nothing changed. What am I missing??
Update 2:
I think my problem now is finding out how I can recompile the file and be able to either keep the signature or make a valid signature. I say this because now all I get when I try to install the modifed apk it says "error parsing file" or "... not signed correctly"
I give up! I tried and took a few shots at it, but I guess I am missing something. Oh well...
http://forum.xda-developers.com/showthread.php?p=17446113#post17446113
All Credit goes to Dblfstr!
Sent from A Van Down By The River!
Worked like a charm dblfstr. Thanks.
Whew, exactly what I needed. Thanks again. I guess I'LLC leave all the Modding stuff to the seasoned folks.
Simple tutorial added.
Suggestions welcome
Thanks
bklizard said:
OK, so I tried to modify these .xml files... so far, I haven't been able to open them up successfully. So my noob-ish question is, "what editor do I use to open these up?" Standard XML editors found in Windows/Office doesn't show them right.
Or can I just replace the files altogether by copying and pasting the stuff in the post? ... I will try that first, I guess...
Update1:
So I extracted the files for editing, and then replaced all the lines in those files (which by the way, opened up to show some weird encoding) using Notepad++ ... I was able to replace all the stuff anyways, and I saved it. Re-packed the apk... Nothing changed. What am I missing??
Update 2:
I think my problem now is finding out how I can recompile the file and be able to either keep the signature or make a valid signature. I say this because now all I get when I try to install the modifed apk it says "error parsing file" or "... not signed correctly"
I give up! I tried and took a few shots at it, but I guess I am missing something. Oh well...
Click to expand...
Click to collapse
Simple tutorial added that may assist you.
Yes, the app has to be decompiled before you can edit the .xml files.
You will need to build the app after you made your changes.
Then zip the app
then sign the app.
[APP][UPDATE][Netflix V1.4] Netflix Rotation Enabled Apps w/ Colored Loading Screens updated to Netflix 1.4 for those who do not want to attempt to add the rotation on your own.
Thanks
I saw this on the front page Congrats! I'm wondering if this was disable because there are several instances of tabbed views leaking activities when the orientation is changed. A good test would be to link up ddms to the app and repeatedly change the orientation and see if the memory gets eattin up.
Am I SOL if the screenOrientation="1" is in all the lines?
is it possible to to this with the touchwiz30 .apk?
WOW, made it to the portal. That is awesome. Hopefully someone can benefit from this thread.
Pacifik said:
Am I SOL if the screenOrientation="1" is in all the lines?
Click to expand...
Click to collapse
Not necessarily. To what app are you referring?
ChadBFlores said:
is it possible to to this with the touchwiz30 .apk?
Click to expand...
Click to collapse
Probably a little more difficult. Nothing is impossible, however.
Screen Orientation + High Resolution Support
Is it possible to do any of those steps directly on the device itself ? For those who don't have access to computers on a regular basis...
Also, would you know which property(ies) I would have to change to get an app to fill the whole screen instead of a small part surrounded by black bars ?
I'm referring to the Canadian Sirius Radio app... It used to render correctly on my Droid1/Milestone, but now with my Droid3/XT860, the screen resolution as changed and it doesn't seem to be "programmed" to support larger screen resolution (qHD).
If I can implement both fixes, yours and mine, I'll be a happy man !
Looks ok, but as a developer I can tell you that most apps will break because of faulty design. Setting stick orientation is a workaround for their lesser API knowledge used by many beginning developers. I did it myself, stopped doing that when I learned more. Most of hacked apps will experience memory leaks, some of them FCs.
Anyway idea is great

[Q] Edit AndroidManifest.xml to Remove Ads

Hi, if I remove this lines (RED) from AndroidManifest.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1" android:versionName="1.0" package="com.strek.whistle.dog"
xmlns:android="xttp://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="3" />
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:theme="@android:style/Theme.Light.NoTitleBar" android:label="@string/app_name" android:name=".DogWhistleActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
[COLOR="red"] <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />[/COLOR]
</application>
[COLOR="Red"] <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />[/COLOR]
</manifest>
would that be enough to get rid of ads?
Cheers!!!
Are my question stupid?
Anyone!
You can patch host file in /system/etc/hosts
dhruv.always said:
You can patch host file in /system/etc/hosts
Click to expand...
Click to collapse
thanksssssss
dhruv.always said:
You can patch host file in /system/etc/hosts
Click to expand...
Click to collapse
Thank you for this but you gave me the fish and I want to learn fishing!
Look like I am going to delete those 3 lines, compile and see will app crush...
Cheers!!!
Ads added to an app by the developer are there so the app can be free and the developer doesn't have to make paid only apps to support the time needed to make the apps. If you don't want the ads then use a modded host file.
XDA is a site focused on developers so we will not help you remove the things they need to keep developing.
Thread closed

[Q] /system/media/audio/ui/ control file

i would like to ask whether anyone can help me with this or at least tell me whether it is possible to edit or not.
Volume Step sound in Sense 4.0 is "do re mi fa so la ti", total/max 'steps' count is 7. Original files name in '/system/media/audio/ui' are 'Volume-1.aac' to 'Volume-7.aac'
But after changing Volume Step in Tweak to "Finest", the max count became 15. Then the Volume Step sound became "do re mi fa so la [(ti) x 9]"
I wish to customize/add Volume Step sound of 8th step and above, so i played around with those "Volume-*.aac" in '/system/media/audio/ui/'. I tried duplicating those files and rename up to "Volume-15.aac" and restarted device, but there is no effects.
Which file (for example build.prop) in '/system/' should i edit, in order to make 'Volume-8.aac' to 'Volumn-15.aac' work?
Thanks in advance.
In order to add that resource I'm guessing you'll need to edit Settings.apk>res/xml/soundsettings.xml
The device will not play a resource that doesn't exist in the base.
Thanks for your quick response. =)
I google-ed around and installed apktool.
Below are the codes from the xml files, but i don't know which to edit. Any help here?
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.htc.preference.HtcPreferenceScreen android:title="@string/sound_settings" android:key="sound_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.htc.preference.HtcPreferenceCategory android:title="@string/sound_category_sound_title" android:key="sound_group" />
<com.htc.preference.HtcListPreference android:persistent="false" android:entries="@array/profile_item_list" android:title="@string/silent_list_title" android:key="silentlist" android:summary="@string/silent_mode_summary" android:dialogTitle="@string/profiles_dialog_title" android:entryValues="@array/animations_values" />
<com.htc.preference.HtcPreference android:persistent="false" android:entries="@array/profile_item_list" android:title="@string/silent_list_title" android:key="customize_silentlist" android:summary="@string/silent_mode_summary" android:dialogTitle="@string/profiles_dialog_title" android:entryValues="@array/animations_values" />
<com.htc.preference.HtcListPreference android:title="@string/musicfx_title" android:key="musicfx">
<intent android:targetPackage="com.android.musicfx" android:targetClass="com.android.musicfx.ControlPanelPicker" />
</com.htc.preference.HtcListPreference>
<com.android.settings.RingerVolumePreference android:persistent="false" android:title="@string/all_volume_title" android:key="ring_volume" android:summary="@string/volume_setting_summary" android:dialogTitle="@string/all_volume_title" android:streamType="ring" />
<com.htc.preference.HtcPreference android:persistent="true" android:title="@string/htc_beats_audio_settings_title" android:key="htc_sound_enhancer" />
<com.htc.preference.HtcCheckBoxPreference android:persistent="true" android:title="@string/vibrate_title" android:key="vibrate" android:summary="@string/vibrate_summary" android:dependency="silentlist" android:defaultValue="true" />
<com.htc.preference.HtcPreferenceCategory android:title="@string/sound_category_calls_title" android:key="sound_category_calls">
<com.htc.preference.HtcPreference android:persistent="true" android:title="@string/ringtone_title" android:key="ringtone" android:summary="@string/ringtone_summary" android:dependency="silentlist" android:dialogTitle="@string/ringtone_title" />
<com.htc.preference.HtcPreference android:persistent="true" android:title="@string/ringtone_title" android:key="ringtone_slot2" android:summary="@string/ringtone_summary" android:dependency="silentlist" android:dialogTitle="@string/ringtone_title" />
<com.htc.preference.HtcPreference android:persistent="true" android:title="@string/htc_ringtone_virbrate_title" android:key="ringtone_vibrate" android:summary="@string/htc_ringtone_virbrate_summary" android:dialogTitle="@string/htc_ringtone_virbrate_title" />
<com.android.settings.framework.preference.sound.HtcBePolitePreference android:dependency="silentlist" />
<com.android.settings.framework.preference.sound.HtcPocketModePreference android:dependency="silentlist" />
<com.android.settings.framework.preference.sound.HtcFlipToSpeakerPreference android:dependency="silentlist" />
</com.htc.preference.HtcPreferenceCategory>
<com.htc.preference.HtcPreferenceCategory android:title="@string/sound_category_notification_title" android:key="category_notification" />
<com.htc.preference.HtcPreference android:persistent="true" android:title="@string/htc_notification_sound_title" android:key="notification_sound" android:summary="@string/htc_notification_sound_summary" android:dependency="silentlist" android:dialogTitle="@string/htc_notification_sound_dialog_title" />
<com.htc.preference.HtcPreference android:persistent="true" android:title="@string/htc_notification_sound_vibrate_title" android:key="notification_sound_vibrate" android:summary="@string/htc_notification_sound_vibrate_summary" android:dialogTitle="@string/htc_notification_sound_vibrate_title" />
<com.htc.preference.HtcCheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" android:summary="@string/notification_pulse_summary" />
<com.htc.preference.HtcPreferenceCategory android:title="@string/sound_category_feedback_title" />
<com.htc.preference.HtcCheckBoxPreference android:title="@string/dtmf_tone_enable_title" android:key="dtmf_tone" android:defaultValue="true" android:summaryOn="@string/dtmf_tone_enable_summary_on" android:summaryOff="@string/dtmf_tone_enable_summary_off" />
<com.htc.preference.HtcListPreference android:persistent="true" android:entries="@array/htc_cdma_dtmf_tone_entries" android:title="@string/dtmf_tone_enable_title" android:key="htc_cdma_dtmf_tone" android:dependency="silentlist" android:defaultValue="0" android:entryValues="@array/htc_cdma_dtmf_tone_values" />
<com.htc.preference.HtcCheckBoxPreference android:title="@string/sound_effects_enable_title" android:key="sound_effects" android:defaultValue="true" android:summaryOn="@string/sound_effects_enable_summary_on" android:summaryOff="@string/sound_effects_enable_summary_off" />
<com.htc.preference.HtcCheckBoxPreference android:title="@string/lock_sounds_enable_title" android:key="lock_sounds" android:defaultValue="true" android:summaryOn="@string/lock_sounds_enable_summary_on" android:summaryOff="@string/lock_sounds_enable_summary_off" />
<com.htc.preference.HtcListPreference android:persistent="false" android:title="@string/powersaver_haptic_feedback" android:key="haptic_feedback_list" android:summary="@string/haptic_feedback_enable_summary_on" android:dialogTitle="@string/profiles_dialog_title" />
<com.htc.preference.HtcCheckBoxPreference android:title="@string/powersaver_haptic_feedback" android:key="haptic_feedback" android:defaultValue="true" android:summaryOn="@string/haptic_feedback_enable_summary_on" android:summaryOff="@string/haptic_feedback_enable_summary_off" />
<com.htc.preference.HtcCheckBoxPreference android:persistent="false" android:title="@string/roaming_ringtone_title" android:key="button_roaming_ringtone" android:summary="@string/roaming_ringtone_summary" android:dependency="silentlist" android:defaultValue="false" />
<com.htc.preference.HtcListPreference android:entries="@array/emergency_tone_entries" android:title="@string/emergency_tone_title" android:key="emergency_tone" android:summary="@string/emergency_tone_summary" android:entryValues="@array/emergency_tone_values" />
</com.htc.preference.HtcPreferenceScreen>
I'd need to search around for it. Keep looking for now, I won't have time until the weekend.
Sent from my HTC Sensation 4G using Tapatalk 2
GROGG88,
after cross-checking titles in '\res\xml\sound_settings.xml' with '\res\values\strings.xml', I found out that editing sound_settings.xml doesn't help.
Can you please check it out?
Thank you very much =)
I'll put it on my list of things to do. I'm out of town right now...

Any App development to read the Wifi Passwords in WifiConfigStore.xml for Oreo?

I don't know if no one picked up on this but I don't see any discussion about app development to read wifi passwords for the replacement to wpa_supplicant.conf, that being WifiConfigStore.xml. I have notified the developer of the app I use of the change but he has yet to release an update.
Essentially if you upgrade your phone to Android Oreo it will migrate the /data/misc/wifi/wpa_supplicant.conf to /data/misc/wifi/WifiConfigStore.xml.
That is the new file
Your Wifi Password app of choice will read the wpa_supplicant.conf which will still exist, however, any new connections made will be stored in the WifiConfigStore.xml file meaning that the Wifi Password apps won't "see" the new connections.
Worse yet, If you did a reset of your phone and you are starting from scratch you will only be able to get that information from the WifiConfigStore.xml file.
All is not lost, since you most likely have root for the Wifi Password app to get that data in the first place, albeit in a nice gui.
This means that you access that file directly, via a root explorer file manager, to see your connections and passwords.
So is there anyone considering doing an app for this? If so, the following may help.
This is only a small sample with 2 wifi connections. One with a preshared key and one without.
I hope this helps.
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<WifiConfigStoreData>
<int name="Version" value="1" />
<NetworkList>
<Network>
<WifiConfiguration>
<string name="ConfigKey">"LIME1002"WPA_PSK</string>
<string name="SSID">"LIME1002"</string>
<null name="BSSID" />
<string name="PreSharedKey">"guesswhatitis"</string>
<null name="WEPKeys" />
<int name="WEPTxKeyIndex" value="0" />
<boolean name="HiddenSSID" value="false" />
<boolean name="RequirePMF" value="false" />
<byte-array name="AllowedKeyMgmt" num="1">02</byte-array>
<byte-array name="AllowedProtocols" num="1">03</byte-array>
<byte-array name="AllowedAuthAlgos" num="0"></byte-array>
<byte-array name="AllowedGroupCiphers" num="1">0c</byte-array>
<byte-array name="AllowedPairwiseCiphers" num="1">06</byte-array>
<boolean name="Shared" value="true" />
<int name="Status" value="0" />
<null name="FQDN" />
<null name="ProviderFriendlyName" />
<null name="LinkedNetworksList" />
<null name="DefaultGwMacAddress" />
<boolean name="ValidatedInternetAccess" value="true" />
<boolean name="NoInternetAccessExpected" value="false" />
<int name="UserApproved" value="1" />
<boolean name="MeteredHint" value="false" />
<boolean name="UseExternalScores" value="false" />
<int name="NumAssociation" value="2" />
<int name="CreatorUid" value="-1" />
<string name="CreatorName">null</string>
<null name="CreationTime" />
<int name="LastUpdateUid" value="-1" />
<string name="LastUpdateName">null</string>
<int name="LastConnectUid" value="-1" />
<boolean name="IsLegacyPasspointConfig" value="false" />
<long-array name="RoamingConsortiumOIs" num="0" />
</WifiConfiguration>
<NetworkStatus>
<string name="SelectionStatus">NETWORK_SELECTION_ENABLED</string>
<string name="DisableReason">NETWORK_SELECTION_ENABLE</string>
<null name="ConnectChoice" />
<long name="ConnectChoiceTimeStamp" value="-1" />
<boolean name="HasEverConnected" value="true" />
</NetworkStatus>
<IpConfiguration>
<string name="IpAssignment">DHCP</string>
<string name="ProxySettings">NONE</string>
</IpConfiguration>
</Network>
<Network>
<WifiConfiguration>
<string name="ConfigKey">"Ashton_Med_Patients"NONE</string>
<string name="SSID">"Ashton_Med_Patients"</string>
<null name="BSSID" />
<null name="PreSharedKey" />
<null name="WEPKeys" />
<int name="WEPTxKeyIndex" value="0" />
<boolean name="HiddenSSID" value="false" />
<boolean name="RequirePMF" value="false" />
<byte-array name="AllowedKeyMgmt" num="1">01</byte-array>
<byte-array name="AllowedProtocols" num="1">03</byte-array>
<byte-array name="AllowedAuthAlgos" num="0"></byte-array>
<byte-array name="AllowedGroupCiphers" num="1">0c</byte-array>
<byte-array name="AllowedPairwiseCiphers" num="1">06</byte-array>
<boolean name="Shared" value="true" />
<int name="Status" value="0" />
<null name="FQDN" />
<null name="ProviderFriendlyName" />
<null name="LinkedNetworksList" />
<null name="DefaultGwMacAddress" />
<boolean name="ValidatedInternetAccess" value="true" />
<boolean name="NoInternetAccessExpected" value="false" />
<int name="UserApproved" value="1" />
<boolean name="MeteredHint" value="false" />
<boolean name="UseExternalScores" value="false" />
<int name="NumAssociation" value="1" />
<int name="CreatorUid" value="1000" />
<string name="CreatorName">android.uid.system:1000</string>
<string name="CreationTime">time=07-26 13:20:02.564</string>
<int name="LastUpdateUid" value="1000" />
<string name="LastUpdateName">android.uid.system:1000</string>
<int name="LastConnectUid" value="1000" />
<boolean name="IsLegacyPasspointConfig" value="false" />
<long-array name="RoamingConsortiumOIs" num="0" />
</WifiConfiguration>
<NetworkStatus>
<string name="SelectionStatus">NETWORK_SELECTION_ENABLED</string>
<string name="DisableReason">NETWORK_SELECTION_ENABLE</string>
<null name="ConnectChoice" />
<long name="ConnectChoiceTimeStamp" value="-1" />
<boolean name="HasEverConnected" value="true" />
</NetworkStatus>
<IpConfiguration>
<string name="IpAssignment">DHCP</string>
<string name="ProxySettings">NONE</string>
</IpConfiguration>
</Network>
</NetworkList>
<PasspointConfigData>
<long name="ProviderIndex" value="0" />
</PasspointConfigData>
</WifiConfigStoreData>
I'm looking for an app that lets you manage/see wifi passwords with the new method too.
So far, the only app who does something with it, is titanium backup. It only backups/restores the networks with passwords though.
Hope there will be more apps being updated to support this.
I've created an app that you can test.
thread: https://forum.xda-developers.com/android/apps-games/app-oreo-wifi-passwords-t3708043
Try WiFi Password Show app, it can help you read WiFi Password on Android Oreo 8.0 and up
play.google.com/store/apps/details?id=com.phuongpn.wifipasswordshow
She reads them to me and makes a copy https://play.google.com/store/apps/details?id=com.rusdelphi.wifipassword
joseac said:
She reads them to me and makes a copy https://play.google.com/store/apps/details?id=com.rusdelphi.wifipassword
Click to expand...
Click to collapse
on samsung ROM, seems to be, the PWD not stored anymore in PLAIN ....
they are now encrypted ...
any idea if that can be supported as well ?
camro said:
on samsung ROM, seems to be, the PWD not stored anymore in PLAIN ....
they are now encrypted ...
any idea if that can be supported as well ?
Click to expand...
Click to collapse
Some time ago, it was said that if you changed the line the build.prop: ro.securestorage.support = true
by: - ​​ro.securestorage.support = false, and then restarted, it no longer encrypted networks.

[Guide] How to modify app preferences with adb (and set configuration for the Simple Calendar Widget)

HowTo change the Simple Calendar Widget configuration by modifying its internal files.​(also shows how to modify applications data files without root)​
Go to reply 1 to get the solution right away
Go to reply 2 to get my config file
Simple Calendar Widget is my favorite calendar widget. It has been with me since my first android phone. Unfortunately it hasn't been maintained for the last 10 years. The functionality is not lacking but an android change broke the widget. It still displays data properly but it's not possible to change the configuration (the app shuts down when you try to configure it).
Google store image on the left. My setup on the right.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Most of the users dropped the widget altogether and the store rating reflects it. It has nothing to do with how good the widget is - its perfect. Obviously most users are discouraged by the lack of configuration I am not though. Who needs a gui configuration as long as you can set the style you want. You only configure it once unless a migration between devices breaks your configuration or you remove and reinsert the widget.
I've decided to find out how the configuration is stored internally and make the changes I want by modifying files in apps data folder and that's what the guide is about.
Evaluating solutions
Picking best candidates
Finding out how to do stuff
Testing
Making the changes
Prospering
1. Evaluating solutions​
In general we can approach this in two ways. Either we fix the app by finding underlying issue and rebuilding the apk or find a way to modify the configuration without the GUI. Since rebuilding and posting a modified app without the authors consent is imo a bad form and doing all this work only for my benefit seemed not worth the time I went with the second option.
My main device is not rooted and cannot be rooted easily and with a rooted target device this whole task would not be worth a guide. Well at least not on xda.
With those decisions made the task is to find out how to setup the widget the way we want (a) and how to modify an app data on a non rooted device (b)
2. Picking best candidates​
Lets see what we can do about (b) first. Unless we succeed (a) is moot. With googles help I imagined those:
Modify the app manifest to make the app debuggable and execute commands from it's context
Accessing the data using root without permanently rooting the target device
Mounting the internal storage and reading/writing directly.
Triggering a load config from backup action without a gui (the widget has a config import/export capability - the gui to trigger it is broken though)
Backup-> modify -> restore app data
Looks like there are some potential options. 3. shouldn't even be here I don't even know how many protections there are for making it hard. 2. my device does not have an option to enable root on usb debugging. 4. I didn't feel like researching it so I picked 1. and 5.
Lets see about (a)
Look at the internal data and see if we can make any sense of it and be able to guess which parameter is stored where
Get an emulator with an old Android version (where the gui works) and see how gui config changes are reflected in the data files.
Both good enough but I didn't want to break stuff on my target device while playing with config so an emulator was needed. And since we use it we can get an old Android where the widget would work thus killing two birds (with one emulator) (read on for more excellent jokes like this)
3. Finding out how to do stuff​
Starting with (a) to mix things up I used the Apk Extractor from the store to export the app (com.anod.calendar) and installed it on the one emulator I had on hand - Bluestacks 5.4.100.1025 N32
This is the button to install an apk right there:
Also installed the Nova Launcher on the emulator from the store (the Bluestacks home screen is not a normal Android home screen and it's not possible to install widgets on it).
Amazingly I was was able to put the widget on the Nova Launcher home screen and it worked right of the bat.
The configuration is not exported with the apk - what I was hoping for - but still I hadn't expect it to work from first try.
For the next part we need to check how the changes in configuration are reflected in the data files. For this we need the adb: SDK Platform Tools includes adb and root on our Bluestacks instance.
To get root on Bluestacks go to %programdata%\BlueStacks_nxt folder and modify bluestacks.conf file (backup first). Change bst.feature.rooting="0" to "1" and bst.instance.Nougat32.enable_root_access="0" to "1". Note that if you have multiple Bluestacks instances the second line to modify might look like that: bst.instance.Nougat32_3.enable_root_access (4th instance)
Enable Android Debug Bridge in Settings->Advanced
Check if debug bridge works properly by listing available devices. Connect using the addressort listed on that page. In my instance its localhost on 5595 (127.0.0.1:5595). Then go to the app data folder and browse.
Code:
adb devices
adb connect localhost:5595
adb -e shell
su
cd /data/data/com.anod.calendar/
find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
No I did not write the last command myself
So this looks super uninteresting except from /shared_prefs/com.anod.calendar_preferences.xml and maybe app_webview/pref_store
tbc​
OK this got out of hand. It's already too long and I'm not even halfway there. Am I writing a book? Just wanted to copy couple of lines of code for reference...
Long story short:​Install the widget on an emulator where it runs properly
Make necessary config changes
Connect to both emulator (with connect) and target device (on usb) with adb
Code:
adb -e backup -apk com.anod.calendar
adb -d restore backup.ab
Reboot as many times as necessary on the emulator because sometimes config changes don't work without a reboot. Reboot the target device if needed.
Prosper
My config if anyone is interested. You need to change widget instance (here 4) to your instance id.
Code:
:%s,-4,-10,g ZZ
for instance if your instance id is 10
Then copy it to /data/data/com.anod.calendar/shared_prefs/com.anod.calendar_preferences.xml (with root)
or backup without apk -> use abe pack/unpack -> modify tar -> repack ->restore (without root)
abe: https://nelenkov.blogspot.com/2012/06/unpacking-android-backups.html
credit: Nikolay Elenkov
XML:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="line-color-4">#FF000000</string>
<string name="alt-layout-4">row_alt_2</string>
<string name="business-style-4">short_days</string>
<boolean name="highlight-today-text-4" value="true" />
<boolean name="show-date-4" value="false" />
<string name="text-color-eventdate-4">#FFFFFFFF</string>
<boolean name="calendar-4-1" value="true" />
<boolean name="tasks-due-allday-4" value="true" />
<string name="skin-4">simi_multiple</string>
<boolean name="today-text-cal-color-eventtext-4" value="true" />
<boolean name="provider-com.anod.calendar.sizes.CalWidgetProvider4x4" value="true" />
<int name="font-paint-weekday-4" value="0" />
<boolean name="hide-timezone-4" value="false" />
<int name="font-paint-eventdate-4" value="0" />
<boolean name="today-text-cal-color-eventtimes-4" value="false" />
<boolean name="time-prepend-zero-4" value="false" />
<string name="text-color-weekday-4">#FFFFFFFF</string>
<string name="lookup-millis-4">2592000000</string>
<string name="text-color-eventtext-4">#FFFFFFFF</string>
<boolean name="calendar-4-8" value="false" />
<boolean name="show-week-num-4" value="false" />
<string name="tasks-provider-4">none</string>
<boolean name="use-scrollable-4" value="false" />
<int name="max-number-of-event-4" value="50" />
<int name="today-font-size-eventtext-4" value="17" />
<boolean name="skin_changed_flag" value="false" />
<string name="calendar-application-4">default</string>
<boolean name="hide-duplicate-date-4" value="false" />
<boolean name="show-past-timed-events-4" value="true" />
<boolean name="calendar-4-7" value="false" />
<boolean name="today-text-cal-color-eventdate-4" value="false" />
<long name="drt_ts" value="0" />
<boolean name="hide-text-date-4" value="false" />
<boolean name="dismiss-on-end-4" value="false" />
<int name="font-size-eventtext-4" value="17" />
<boolean name="show-no-events-4" value="true" />
<string name="today-text-color-eventtext-4">#FFFFFFFF</string>
<boolean name="hide-text-weekday-4" value="false" />
<boolean name="one-day-only-4" value="false" />
<boolean name="config-button-4" value="true" />
<int name="today-font-paint-eventtext-4" value="32" />
<string name="bg-color-4">#20000000</string>
<string name="text-color-date-4">#FFFFFFFF</string>
<boolean name="show-timed-only-4" value="false" />
<boolean name="text-cal-color-eventtext-4" value="true" />
<int name="font-paint-eventtext-4" value="0" />
<boolean name="provider-com.anod.calendar.sizes.CalWidgetProvider4x3" value="true" />
<int name="today-font-paint-eventtimes-4" value="32" />
<boolean name="hide-end-time-4" value="true" />
<boolean name="provider-com.anod.calendar.sizes.CalWidgetProvider4x2" value="true" />
<string name="tasks-app-4">default</string>
<boolean name="hide-text-eventtext-4" value="false" />
<boolean name="text-cal-color-eventdate-4" value="false" />
<string name="drt"></string>
<boolean name="provider-com.anod.calendar.CalWidgetProvider" value="true" />
<int name="font-size-date-4" value="15" />
<boolean name="today-tomorrow-4" value="true" />
<int name="today-font-paint-eventdate-4" value="32" />
<boolean name="tasks-only-duedate-4" value="false" />
<int name="font-paint-date-4" value="0" />
<boolean name="provider-com.anod.calendar.sizes.CalWidgetProvider5x4" value="true" />
<int name="today-font-size-eventdate-4" value="16" />
<string name="month-name-4">none</string>
<boolean name="cal-color-bullet-4" value="false" />
<int name="font-size-weekday-4" value="16" />
<boolean name="click-anywhere-4" value="false" />
<boolean name="event-add-dow-4" value="false" />
<boolean name="hide-text-eventdate-4" value="false" />
<string name="today-text-color-eventdate-4">#FFFFFFFF</string>
<boolean name="hide-all-day-4" value="true" />
<boolean name="calendar-4-6" value="false" />
<boolean name="calendar-4-4" value="false" />
<string name="bg-opacity-4">32</string>
<string name="calendar-provider-4">google</string>
<int name="font-size-eventdate-4" value="16" />
<int name="date-side-width-4" value="1" />
<string name="today-text-color-eventtimes-4">#FFFFFFFF</string>
<int name="today-font-size-eventtimes-4" value="15" />
<boolean name="provider-com.anod.calendar.sizes.CalWidgetProvider5x1" value="true" />
<boolean name="day-prepend-zero-4" value="false" />
</map>

Categories

Resources