About this guide
File permissions are usually used in alphabetical format in rom/kernel thread but when you want to use "chmod" command in terminal emulator or in Recovery mode or adb you have to use Decimal format . I wana help you to convert a alphabetical permission to a decimal one .
Convert an alphabetical permission to a decimal permission
Let's start with a simple permissions . I choose "rwxr-xr-x" as an example . This permission is just like this table :
Code:
* * *
* - *
* - *
now start from left to right in first row :
If there was "read" permission put a "4" , if there was "write" permission add put a "2" if there was "execute" put a "1" . as an example in first row of out table we have " r w x" so you have to put "4+2+1"="7" in your mind . then go to next line and calculate it , in our example we have "r - x" in our second line so you have to put "4+0+1"=5 and do this for third row too . now you have three numbers "7"&"5"&"5" now you have to make a number with those . like this : "7"-"5"-"5" => 755 !!
I do two more examples :
rw-r--r-- => "rw-" & "r--" & "r--" => "4+2+0" + "4+0+0" + "4+0+0" => "6" & "4" & "4" => 644
rwxrwxrwx => "rwx" & "rwx" & "rwx" => "4+2+1" & "4+2+1" & "4+2+1" => "7" & "7" & "7" => 777
How to convert Decimal permissions to Alphabetical permissions
First of all Cut the Decimal permission into three number, for example : 777 -> 7 & 7 & 7 or 644 -> 6 & 4 & 4 or 755 -> 7 & 5 & 5 .
Then start from first number and do this for each number then put each number result in a row :
Code:
7 => 4+2+1 => r+w+x => rwx
6 => 4+2+0 => r+w => rw-
5 => 4+0+1 => r+x => r-x
4 => 4+0+0 => r => r--
3 => 0+2+1 => w+x => -wx
2 => 0+2+0 => w => -w-
1 => 0+0+1 => x => --x
then you will have the alphabetic permission ! take a look at these examples :
777 -> "4+2+1" & "4+2+1" & "4+2+1" => "rwx" & "rwx" & "rwx" => rwxrwxrwx
755 -> "4+2+1" & "4+0+1" & "4+0+1" => "rwx" & "r-x" & "r-x" => "rwxr-xr-x"
Now enjoy and convert your permissions
Good Job
Related
I have found a little bug in the WiFi settings of MIUI HD2 GINGER v9.2 where the Phase 2 authentication drop down menu does not accept its setting. In my case I am trying to set it to MSCHAPV2 and after selecting Save it does not take the setting and reverts to None.
How can I fix that bug
Didn't try yet ...but try this:
I'm not using eduRoam but our wifi is TTLS with Phase 2 PAP. Here's what worked for me
Step One
using adb shell:
# cd /data/misc/wifi
# cp wpa_supplicant.conf /sdcard
# exit
Step 2:
mount the sdcard on pc/ usb and edit the file
Here's what I added to my wpa_suppliant.conf file has (replace the *** with the correct information)
network={
ssid="***"
proto=WPA
key_mgmt=WPA-EAP IEEE8021X
group=CCMP TKIP
eap=TTLS
identity="***"
anonymous_identity="anonymous"
password="***"
ca_cert="/sdcard/***.cer"
phase2="auth=PAP"
priority=3
}
If you have a certificate ( ***.CER) you will need to have it on your sdcard - not inside a folder.
Step 3:
adb shell
# cd sdcard
# cp wpa_supplicant.conf /data/misc/wifi
# cd /data/misc/wifi
# su
# ls –l
(check other file(s) owners in my case it was – wifi.wifi but on previous ROMs it was root.root or System.wifi)
chown wifi.wifi wpa_supplicant.conf
# chmod 777 wpa_supplicant.conf (read, write execute for all) – start with 777 and relax it (I was lazy and left it there)
# reboot
An simply how to enable ad-hoc net via adb in a rotted devices.
1 - Download modified "wpa_supplicant" (at the end of post)
2 - Close Wi-Fi card.
3 - Open terminal (windows or linux) and :
3.O (enable R/W mode)
Code:
adb remount
3.I (create backup) =>
Code:
adb shell mv /system/bin/wpa_supplicant /system/bin/wpa_supplicant.bak
3.II (copy new wpa_supplicant) =>
Code:
adb push <path new wpa file in your pc> /system/bin/wpa_supplicant
3.III (change permission of new file) =>
Code:
adb shell chmod 776 /system/bin/wpa_supplicant
4 - Open Wi-Fi card.
5 - Enjoy
To restore original file open a terminal and =>
Code:
adb shell mv /system/bin/wpa_supplicant.bak /system/bin/wpa_supplicant
wpa_supplicant file aren't my
sorry for my bad english but it isn't my native language =)
Thanks, will try this when I get me TF tomorrow
Thanks !
The same, automatized with a little batch : View attachment 677233
- decompress
- 2xclic on wpa_supplicant.bat
Methods that worked for me.
Method 1.
Blow Air it will solve your prob hopefully.
Method 2.
go to samsung code *#0*#. then SENSORS and Read your Proximity sensor values.
<<< DECISION >>>>>
####Calibration isnot needed if ####
.
your phone doesnt vibrate in normal but does so when u physically put your finger on the Sensor.
#### Calibration needed if ####
.
your phone is vibrating in this menu no matter what, you put your finger on the sensor or not
Follow these steps
1. download Android Terminal from store
2. type these commands to calibrate automatically
$ su
# echo 0 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
# echo 1 > /sys/devices/virtual/sensors/proximity_sensor/prox_cal
Reboot and see if it works.go to *#0*# and check if it continuously vibrating or only does so when you put your finger on the SENSOR.
<<<< IF Continuously Vibrating Follow these steps>>>>
you need to manually put values in ur /efs/prox_cal.it Reads Hexadecimal value. so you have to convert your decimal values into HEX.
##### FIND YOUR Decimal Values and pushing them into /efs/prox_cal ######
Method : finding two values for calibration . offset + normal value.
##.. FINDING OFFSET ######
cat /sys/devices/virtual/sensors/proximity_sensor/prox_cal
note down the values it returns.. mine is 5,64,100.. you only need the 1st value which is 5.
### FINDING NORMAL STATE ######
cat /sys/devices/virtual/sensors/proximity_sensor/state
note down the value if returns. mine is 64
now ADD OFFSET value + Normal Value
5 + 64 = 69
Convert in Hexadecimal which is 45.
<<<<<<<<<<< Pushing the value in /efs/prox_cal >>>>>>>>>>>>>>
# echo -en $ '\x45' > /efs/prox_cal
then
# chown system:system /efs/prox_cal
# chmod 644 /efs/prox_cal
# sync
# Reboot
All done. after that go to *#0*# then SENSORS and move your finger on the sensor, yout phone will Vibrate only when you put your finger on the sensors.
Manual method worked for me.
ENJOY.
NOTE: I am not a developer. i was just stuck with this problem for so long so now i found it from "mcelicalderon". who posted this method some where.
Thank you ! That worked for me too
Pleasure is all mine
Sent from my GT-I9505 using xda app-developers app
thanks
i've had this problem a long time now. it worked fine with stock rom but as soon as i changed it, it went wrong. unrooted it and back to stock and it worked again. Been looking all over for a solution. tried air blowing and other non working solutions. the *#0*# did not run on my phone either. but after follwing this guide it got fixed. but insted of typing the long cat command in terminal i used ES file explorer and navigated to the right files and opened them.
so thank you for this guide to fix this irretating problem
I'm planning to develop an android application that can make use of the dynamic data that is fetched from my web server. I'm really eager to start this project but I have no idea where to start and how to design the app, not basic stuff like how to create a linear, relative layout, how to make button etc. but what kind of approach I must use. Here is the sample of the data that I will be fetching from the web server:
Code:
Array
(
[identification] => Array
(
[0] => Array
(
[question] =>
Who is the Philippine National Hero?
[answers] => Array
(
[0] =>
Jose Rizal
[1] => Rizal
)
[subject] => 16
[points] => 1
)
[1] => Array
(
[question] =>
Who is the first Philippine president?
[answers] => Array
(
[0] =>
Emilio Aguinaldo
[1] => Aguinaldo
)
[subject] => 16
[points] => 1
)
[2] => Array
(
[question] =>
What is the national bird of the Philippines?
[answers] => Array
(
[0] =>
Maya
)
[subject] => 16
[points] => 1
)
)
[multiplechoice] => Array
(
[0] => Array
(
[question] =>
What is the national animal of the Phillipines?
[answers] =>
Kalabaw
[choices] => Array
(
[0] =>
Baka
[1] =>
Baboy
[2] =>
Aso
)
[subject] => 16
[points] => 1
)
[1] => Array
(
[question] =>
What is the national flower of the Philippines?
[answers] =>
Sampaguita
[choices] => Array
(
[0] =>
Santan
[1] =>
Rosas
[2] =>
Calachuchi
[3] =>
Sunflower
)
[subject] => 16
[points] => 1
)
)
)
As you can see the code is in associative array(PHP) I'm planning on transforming that array into json so that my app can turn that data into an examination questions. Hope someone can help me with this because I don't have much time left to do that app, that's why I've posted the question here so that I can start on that project if I will be given a slight instructions on where to start.
Hello.
Presrequites:
Root permissions
USB cable for debugging
ADB (Android Debug-Bridge)
Preface - My overly dramatic story (feel free to skip; Unless you'd like a quick chuckle)
I couldn't help but notice that there are no tutorials explaining how to add audio to the bootanimation and shutdownanimation for the LG K7 (of any model)! I scoured the internet in search for it for myself. I had come back empty handed... Luckily though! Through perseverance and sweat and lots of coffee... I dug through the firmware ROM file and found a few gold nuggets.
During my journey, I stumbled upon a file (boot_resource.sh) located at: system/vendor/bin; This had me puzzled initially. It has multiple references (four, to be exact) to the same four attributes regarding the boot animation (and audio)! It clearly shows some directories that do not exist (on my rooted device at that)!!! I was intrigued. I was shocked. Could it be... This easy?! Jackpot! I found the gold pot at the end of the rainbow...!
I shuffled up to the... Latrine... In a sluggish manner: I asked my girlfriend to get me another cup of black liquid fuel (COFFEE)! I squinted and squirmed in excitement! I have finally located the holy grail of the sound.
Code:
USER_BOOTANIMATION_SOUND_FILE=/data/local/PowerOn.ogg
There was nothing there, except: /data/local/tmp! Nothing more than a plain, void directory with another empty folder (tmp). I hastily copied over the nearest locally stored *.ogg audio file I could find and pasted the default animation files into their and rebooted faster than one could run to the store for more milk!
Voila! I had done it...! I had my bootanimation with audio. A'lass...! Victory was mine!
The end.
To add a custom power-on animation and power-off animation (with sound):
Compile a *.zip file (compression: storage) with:
A text-file named "desc.txt" (EOF symbol at the end (preferably UNIX); Just press enter at the end)
A folder containing *.jpg or *.png images (my LG K7 does not load anything larger than 250KB); Sequentially numbered (000.png, 001.png, etc)
Name the *.zip file: "bootanimation.zip" for power-up animation ("shutdownanimation.zip" for power-down)
Name the power-on audio file "PowerOn.ogg"; It will only play once (the larger the file: The longer the load time)
Name the power-off audio file "PowerOff.ogg"; It also will only play once (synchronizing the image/sound is tough)
Copy the respective files to: /data/local/
Reboot your phone and laugh hysterically in amusement! :good:
Example of desc.txt:
Code:
480 854 30
p 0 0 SailorMoon
To further explain what these values are and why they are both necessary and important to understand:
Code:
480 = X resolution (width of the image)
854 = Y resolution (height of the image); 854 is the maximum I can load on my LG K7
30 = FPS (frames per second) that the images load at
p = A symbolic marker for Android to read; It signifies that this is the folder to load
0 = The quantity of loops of this particular folder of images (0 represents "infinitely")
0 = The delay of time before loading another folder of images
If you wished: You could download (or create your own!) five animations and load five folders and play them at 75FPS (5 folders of images * 30 frames (images) / 75FPS = '2 frames per second' (400ms an image)); It would flash by very fast, but it would also be a great way to sample large amounts of multiple boot animation sequences (with/without audio), without having to reboot and reload more animations a b'jillion times!
To elaborate on the suggestion above: We would create one desc.txt file for our 'bootanimation.zip' file.
Code:
480 854 75
p 1 0 SailorMoon
p 1 0 SailorMercury
p 1 0 SailorMars
p 1 0 SailorJupiter
p 1 0 SailorVenus
p 1 0 SailorNeptune
These examples are using 15-frame image sets (15 images per folder). Now all we have to do is place this desc.txt file and the respective folders/images into a (compression level: storage) *.zip file named: bootanimation.zip. Then we load it onto the phone and move it over to: /data/local/bootanimation.zip.
The alternative option is to over-write the carrier shipped bootanimation *.zip file located at: /system/media/bootanimation.zip; In the event of a 'factory reset': The default bootanimation should return. The gains in storage space are nominal by overwriting the prepackaged and shipped one (~2MB).
If you are running a Windows platform: Here are some easy and efficient batch file scripts to help speed everything up!
Insert your USB (ignore if you use an ADB root Wifi app on your phone)
Run the "newBootSequence.bat" file (copies files; Signs on ADB with su; Kills the server and reboots the phone after you exit the shell)
- newBootSequence.bat (lives at: C:\Android\)
Code:
adb devices
adb push C:\Android\bootanimation.zip /sdcard/
adb push C:\Android\shutdownanimation.zip /sdcard/
adb push C:\Android\PowerOn.ogg /sdcard/
adb push C:\Android\PowerOff.ogg /sdcard/
adb shell su
adb reboot
adb kill-server
adb wait-for-device
If you're like me and you despise repetitive tasks: I have yet another script file to ease development of testing out new animation sequences and audio files! This, however, is a bash script for your Android device.
- customBoot.sh (lives at: /sdcard/)
Code:
#!/sdcard/customBoot.sh
#
# Used for localized custom boot animation sequence *WITH* audio!
# Written by: ObliviousEnigma -- 2017/12/24 00:43
#
###############################################################################################
############# A little bit of extra information regarding boot animations / audio #############
###############################################################################################
# The LG K7 supports audio upon boot up; There are a few options for 'enabling' it.
# If the directory /data/local/ is populated (and has valid entries): It takes
# precedence over the default /system/media location (for loading images).
#
# If both entries are invalid or contain invalid data: Android pulls a default
# animated "Android" animation from some unknown location (I did not investigate).
#
# The only audio file format I've tested was: *.ogg (using a file converter).
# The file formats I've tested were: *.png and *.jpg;
#
# The internal format/filename/path do not matter (so long as they agree with: desc.txt).
# EG: Typically listed "part01" folder can be "Frozen Android"; It loads it just fine.
# Image names I did not play with /too/ much; I use IrfanView and name them: 000-999.
# bootanimation/shutdownanimation must be named respectively (stored-format *.zip).
#
# Format of: desc.txt within bootanimation/shutdownanimation should be:
# [X resolution] [Y resolution] [FPS]
# [1st folder of frames] [loop animation quantity] [delay in-between looping the next folder]
# [2nd folder of frames] [loop animation quantity] [delay in-between looping the next folder]
# [etc ...]
#
# EXAMPLE desc.txt:
# 480 854 30
# p 0 0 SailorNeptune0
# [EOF]
#
# Make sure you set the EOL (end of line) conversion to UNIX (safest bet)! Notepad++
#
# 480 = X (width) resolution in pixels
# 854 = Y (height) resolution in pixels
# 30 = FPS (frames per second) that the animation will play at
# p = "part" (symbol marker for the Android OS to read)
# 0 = Loop animation quantity (0 represents "infinite"; Useful if you only have 1 folder)
# 0 = Delay in-between loading folders of images (EG: SailorNeptune0, SailorNeptune1, etc)
# SailorNeptune0 = the folder name to load the images (*.png or *.jpg format) out of
#
# You could use a very high FPS (75FPS) to test multiple boot animations (5x = "15 FPS" per)
# The audio file (PowerOn.ogg) only appears to be played once; I am sure there's a setting
# To loop it multiple times; I do not know what it is for right now. Play at your own risk!
###############################################################################################
echo "\t**********\t**********\t**********\t**********\t**********\t**********"
echo "\t\tBash script by: ObliviousEnigma (XDA Developers)"
echo "\t\tINTENT: Customized boot-up/shut-down animations and audio for the LG K7 phones"
echo "\t**********\t**********\t**********\t**********\t**********\t**********"
# Prematurely terminate the script if the user is not currently logged in as: ROOT (0)
if [ "$USER" != "root" ]; then
echo "\t\tYou require ROOT permissions to execute this script!"
echo "\t\tScript location: $filePath"
echo "\t\tPlease re-run after you're logged in as root"
echo "\t\t\t***** Currently logged in as: \"$USER\" *****"
echo "\t**************************************************************"
echo ""
exit
fi
echo ""
echo ""
# I am not used to using BASH scripts; This is the best I could come up with.
# This will copy the output from the terminal (full filename; Relying on the wild-card ("glob")).
sPowerOn=$(ls PowerOn.*)
sPowerOff=$(ls PowerOff.*)
# Forcibly overwrite both animation files (power on and power off)
if [ -a "$filePath"/bootanimation.zip ]; then
mv -f -v "$filePath"/bootanimation.zip /data/local/bootanimation.zip
chown root:root /data/local/bootanimation.zip
chmod 775 /data/local/bootanimation.zip
else
echo "$filePath/bootanimation.zip\" -- NOT FOUND";
fi
if [ -a "$filePath"/shutdownanimation.zip ]; then
mv -f -v "$filePath"/shutdownanimation.zip /data/local/shutdownanimation.zip
chown root:root /data/local/shutdownanimation.zip
chmod 775 /data/local/shutdownanimation.zip
else
echo "$filePath/shutdownanimation.zip\" -- NOT FOUND";
fi
# Forcibly overwrite both audio files (KNOWN SUPPORTED FORMATS: ogg, mp3)
if [ -f "$filePath"/"$sPowerOn" ]; then
mv -f -v "$filePath"/"$sPowerOn" /data/local/"$sPowerOn"
chown root:root /data/local/"$sPowerOn"
chmod 775 /data/local/"$sPowerOn"
else
echo "$filePath/$sPowerOn\" -- NOT FOUND";
fi
if [ -f "$filePath/$sPowerOff" ]; then
mv -f -v "$filePath"/"$sPowerOff" /data/local/"$sPowerOff"
chown root:root /data/local/"$sPowerOff"
chmod 775 /data/local/"$sPowerOff"
else
echo "$filePath/$sPowerOff\" -- NOT FOUND";
fi
Fortunately: That is the end of everything for today.
I hope this helps someone! I know it surely made my day to FINALLY have audio for my LG K7!