[Request] startXServer.sh - Atrix 4G Q&A, Help & Troubleshooting

Would it be possible for someone who is rooted on 2.3.4 to copy the startXServer.sh file in /etc/init.d and post it?
I used the HDMI Mirror hack over in http://forum.xda-developers.com/showthread.php?t=1169457 and for some reason the original one that was backed up in startXServer.bak was overwritten. I think it is the reason I cannot get my media center to work again.
Thanks.

I am on K. Penn's 4.5.91 beta 3, and this file does not exist for me in that location.

CaelanT said:
I am on K. Penn's 4.5.91 beta 3, and this file does not exist for me in that location.
Click to expand...
Click to collapse
Same here....don't have it. Sorry man!

J-man67 said:
Same here....don't have it. Sorry man!
Click to expand...
Click to collapse
Thanks for the look. I appreciate it. I'm on the OTA from the update.zip
it was under the /ect/init.d folder, there is another ect folder in system but that one is different( /system/ect)

#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi
Sent from my MB860 using XDA App

Robert Havens said:
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi
Sent from my MB860 using XDA App
Click to expand...
Click to collapse
Thank you very much for this. Worked like a charm. I basically used it to rewrite the .sh file. You're a life saver. MODS please close if needed, unless someone else runs into the same issue.

Related

Two versions of the same app

Is it possible to install two versions of the same app without overwriting the previous one??
i have tried to decompile the app and change the app name in package field of manif
est.xml, i was successful in installing the apps but the one with unedited manifest.xml works whereas the other force closes
This is possible, but you will need to adjust the folders containing the smali files (after using apktool), as well as (not sure about this bit) changing the class declaration names in each smali file.
It's complex, but it is possible to do and you're on the right tracks with the package name
is there any automated tool to do all that?
keyboardcowboy said:
is there any automated tool to do all that?
Click to expand...
Click to collapse
Unlikely
10 char
I have seen Brut's modified Google maps, it can be installed beside original app...How did he do it?
keyboardcowboy said:
is there any automated tool to do all that?
Click to expand...
Click to collapse
Someone could make a script. I'll post my solution to give that person a head start.
Code:
apktool d -f base_MYAPP.apk base_MYAPP
mv base_MYAPP/smali/com/MYCOMPANY/MYAPP base_MYAPP/smali/com/MYCOMPANY/NEW_MYAPP
find base_MYAPP/smali/com/MYCOMPANY/NEW_MYAPP -name "*.smali" -print | xargs sed -i -e 's/MYAPP/NEW_MYAPP/g'
sed -i -e 's/MYAPP/NEW_MYAPP/g' base_MYAPP/AndroidManifest.xml
sed -i -e 's/APP NAME/APP NAME NEW/g' base_MYAPP/res/values/strings.xml
rm -f base_MYAPP/res/values/strings.xml-e base_MYAPP/AndroidManifest.xml-e
find base_MYAPP/smali/com/MYCOMPANY/NEW_MYAPP -name "*.smali-e" -print | xargs rm -f
apktool b base_MYAPP NEW_MYAPP-unaligned.apk
jarsigner -keystore my.keystore -storepass pass1 -keypass pass2 NEW_MYAPP-unaligned.apk alias
zipalign -f -v 4 NEW_MYAPP-unaligned.apk NEW_MYAPP.apk
Something like that. I need to go home. =)
awesome
Try something like this:
Code:
#!/bin/bash
##### Constants
APK_NAME="My App"
PACKAGE="My_App"
PACKAGE_PATH=com/my_company/
KEYSTORE="my.keystore"
KEYSTORE_PASS="keystore_pass"
ALIAS="alias_name"
ALIAS_PASS="alias_pass"
##### Functions
function copy_apk
{
# Parameters
base_file=$1
new_package=$2
new_apk_name=$3
input_dir=base/
file_modification_date=$(stat -f "%Sm" -t "%Y%m%d" $input_dir/$base_file)
file_modification_time=$(stat -f "%Sm" -t "%H%M%S" $input_dir/$base_file)
output_dir=$file_modification_date/
# Variables
file_name=$(echo "$base_file" | cut -d'.' -f1)
file_extension=$(echo "$base_file" | cut -d'.' -f2)
new_file_name_unaligned="${file_name}-unaligned.${file_extension}"
new_file_name_aligned="${file_name}_${file_modification_date}_${file_modification_time}.${file_extension}"
work_directory=$input_dir$file_name/
smali_directory=$work_directory/smali/$PACKAGE_PATH/
# Function Body
mkdir -p $input_dir
mkdir -p $output_dir
apktool d -f $input_dir$base_file $work_directory
mv $smali_directory/$PACKAGE $smali_directory/$new_package
find $smali_directory/ -name "*.smali" -print | xargs sed -i -e "s/$PACKAGE/$new_package/g"
find $smali_directory/ -name "*.smali-e" -print | xargs rm -f
find $work_directory/ -name "*.xml" -print | xargs sed -i -e "s/$PACKAGE/$new_package/g"
sed -i -e "s/$APK_NAME/$new_apk_name/g" $work_directory/res/values/strings.xml
find $work_directory/ -name "*.xml-e" -print | xargs rm -f
apktool b $work_directory $input_dir/$new_file_name_unaligned
jarsigner -keystore $KEYSTORE -storepass $KEYSTORE_PASS -keypass $ALIAS_PASS $input_dir/$new_file_name_unaligned $ALIAS
zipalign -f 4 "$input_dir/$new_file_name_unaligned" "$output_dir/$new_file_name_aligned"
}
function apk_version
{
# Parameters
base_file=$1
package_extension=$2
# Variables
new_package="${PACKAGE}_${package_extension}"
new_apk_name="${APK_NAME} $package_extension"
# Function Body
$(copy_apk "$base_file" "$new_package" "$new_apk_name")
}
##### Main
$(apk_version my_app_sandbox.apk Sandbox)
$(apk_version my_app_release.apk Release)
sgeos said:
Try something like this:
Code:
#!/bin/bash
##### Constants
APK_NAME="My App"
PACKAGE="My_App"
PACKAGE_PATH=com/my_company/
KEYSTORE="my.keystore"
KEYSTORE_PASS="keystore_pass"
ALIAS="alias_name"
ALIAS_PASS="alias_pass"
##### Functions
function copy_apk
{
# Parameters
base_file=$1
new_package=$2
new_apk_name=$3
input_dir=base/
file_modification_date=$(stat -f "%Sm" -t "%Y%m%d" $input_dir/$base_file)
file_modification_time=$(stat -f "%Sm" -t "%H%M%S" $input_dir/$base_file)
output_dir=$file_modification_date/
# Variables
file_name=$(echo "$base_file" | cut -d'.' -f1)
file_extension=$(echo "$base_file" | cut -d'.' -f2)
new_file_name_unaligned="${file_name}-unaligned.${file_extension}"
new_file_name_aligned="${file_name}_${file_modification_date}_${file_modification_time}.${file_extension}"
work_directory=$input_dir$file_name/
smali_directory=$work_directory/smali/$PACKAGE_PATH/
# Function Body
mkdir -p $input_dir
mkdir -p $output_dir
apktool d -f $input_dir$base_file $work_directory
mv $smali_directory/$PACKAGE $smali_directory/$new_package
find $smali_directory/ -name "*.smali" -print | xargs sed -i -e "s/$PACKAGE/$new_package/g"
find $smali_directory/ -name "*.smali-e" -print | xargs rm -f
find $work_directory/ -name "*.xml" -print | xargs sed -i -e "s/$PACKAGE/$new_package/g"
sed -i -e "s/$APK_NAME/$new_apk_name/g" $work_directory/res/values/strings.xml
find $work_directory/ -name "*.xml-e" -print | xargs rm -f
apktool b $work_directory $input_dir/$new_file_name_unaligned
jarsigner -keystore $KEYSTORE -storepass $KEYSTORE_PASS -keypass $ALIAS_PASS $input_dir/$new_file_name_unaligned $ALIAS
zipalign -f 4 "$input_dir/$new_file_name_unaligned" "$output_dir/$new_file_name_aligned"
}
function apk_version
{
# Parameters
base_file=$1
package_extension=$2
# Variables
new_package="${PACKAGE}_${package_extension}"
new_apk_name="${APK_NAME} $package_extension"
# Function Body
$(copy_apk "$base_file" "$new_package" "$new_apk_name")
}
##### Main
$(apk_version my_app_sandbox.apk Sandbox)
$(apk_version my_app_release.apk Release)
Click to expand...
Click to collapse
this is fun, but I am not sure how to runt he script on my phone.

[Request] Dev Help Pretty Please!

Ok I'm on the OTA 2.3.4 from a fresh unlocked 4.1.83 no problems what soever and I'm looking to make a few mods when I saw the link posted for the 2.3.4 HDMI Mirror over at
http://forum.xda-developers.com/showthread.php?t=1169457
I went ahead and ran
adb shell
su
mount -o remount,rw /dev/block/mmcblk0p12 /system
sed -ie s/ro.hdmi.mirror.enable=false/ro.hdmi.mirror.enable=true/g /system/build.prop
mount -o remount,ro /dev/block/mmcblk0p12 /system
cd /etc/init.d
cp startXServer.sh startXServer.bak
(head -n 40 startXServer.bak; echo "if [ ! -e /var/run/noWebtop ]; then"; tail -n 12 startXServer.bak; echo "fi") > startXServer.sh
restart your phone
I read through the command and seemed pretty safe and was excited because the post listed the HDMI Mirror as being in "landscape" mode. Hell yeah right! Well it wasn't, it was the same portrait so I was looking to revert back. Go change the build.prop back for the ro.hdmi.mirror to equal false. No big deal that's easy enough with root explorer. Read through the commands and saw that the startXServer.sh was cp to startXServer.bak. Easy enough just delete the startXServer.sh and rename startXServer.bak to .sh.
Well there is the problem. When i ran the commands the first time didn't work so i went into the build.prop and did a manual change. Then re-ran the bottom half. It seems doing that I over wrote the .bak agan and now both files are exactly the same and have no way of reverting. I have the system, boot, and webtop backed up with an .img but that didn't fix my entertainment center when I plug in an HDMI to the TV. The original commands did a back-up so I didn't double back-up the file.lol
I was wondering if a dev that has a little more command line knowledge, maybe the orginal contents of startXServer.sh, or the actual file could help me out with the revert back and a working entertainment center. The current contents are
if [ ! -e /var/run/noWebtop ]
fi
I'm pretty sure that's the problem, unless someone else sees something I'm missing.
**Edit**
This was solved under the Q&A Section from a earlier post yesterday afternoon. Mods please close if necessary. In case any one needs it see below. I just rewrote the startXServer.sh to contain the following.
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi

need help to translate MIUI V4 (ICS)

Hi,
i tried to translate a MIUI for Galaxy Nexus rom into french (can also be an other language)
i wrote an unix script to automate the process.
What i do is quite simple:
i get a specific MIUI V4 version for my device and the same translated version for the nexus S (because the nexus S has a french version)
i decompile each apk from the french rom, an put the french files into to decompile galaxy nexus directories
i recompile each apk
and i copy the compiled resources into the origin galaxy nexus apks
and i build the new ROM
but i get a bootloop any ideas ?
here is my script
if there are any part of this script that isn't clear, i could try to explain them.
of course this script could also be used on other device or other translation with some changes.
Thanks in advance .
Code:
#!/bin/bash
# MIUI-FRENCH TRANSLATE SCRIPT FOR GNEX V1.0 By Alain57
BASE_DIR=$PWD
FRENCH_DIR=$BASE_DIR/french_rom
ORIGINAL_DIR=$BASE_DIR/original_rom
OUTPUT_ROM_DIR=$BASE_DIR/output_rom
OUT_DIR=$BASE_DIR/out
WORK_DIR=$BASE_DIR/workdir
ORIGIN_APK_DIR=$WORK_DIR/origin
TRANSLATION_DIR=$WORK_DIR/translation
DECODED_APK_DIR=$WORK_DIR/decoded
LOG_FILE=$BASE_DIR/log.txt
TEMP_DIR=$BASE_DIR/temp
# clean the log file and create the missing directories if they don't exist (for exemple on first run)
function cleanLog(){
rm -fr $LOG_FILE
ARRAY_DIR=( $FRENCH_DIR $ORIGINAL_DIR $OUTPUT_ROM_DIR $OUT_DIR $WORK_DIR $ORIGIN_APK_DIR $TRANSLATION_DIR $DECODED_APK_DIR $TEMP_DIR )
echo "creating missing directoriesi if needed"
for DIR in ${ARRAY_DIR[@]}; do
if [ ! -d $DIR ]; then
mkdir $DIR
fi
done
}
# configure apktool to use framework-res and framework-miui-res
function setFramework(){
cd $FRENCH_DIR
echo "<- apktool if system/framework/framework-res.apk ->" >> $LOG_FILE
apktool if framework-res.apk >> $LOG_FILE 2>&1
echo "<- apktool if system/framework/framework-miui-res.apk ->" >> $LOG_FILE
apktool if framework-miui-res.apk >> $LOG_FILE 2>&1
}
#decompile all apk file from the english Gnex miui rom
function decompileOriginFiles(){
cd $ORIGINAL_DIR
COUNT_ORIGINAL_ZIP=`ls . | grep '.zip' | wc -l`
if [ "$COUNT_ORIGINAL_ZIP" -eq "1" ]; then
mv *.zip en.zip
echo "unzip the original rom"
unzip -q -o en.zip
echo "copy the apks to the origin dir"
cp -a system/framework/*.apk $ORIGIN_APK_DIR
cp -a system/app/*apk $ORIGIN_APK_DIR
cd $ORIGIN_APK_DIR
for F in *.apk; do
echo "decompiling origianl file $F ..." | tee -a $LOG_FILE
apktool d $F $DECODED_APK_DIR/${F%.apk} >> $LOG_FILE 2>&1
done
else
echo "there need to be ONE zip file in the original directory"
exit
fi
}
# decompile all apk files from the french Nexus S ROM
function decompileTranslatedFiles(){
cd $FRENCH_DIR
COUNT_FRENCH_ZIP=`ls . | grep '.zip' | wc -l`
if [ "$COUNT_FRENCH_ZIP" -eq "1" ]; then
mv *.zip fr.zip
echo "unzip the french rom"
unzip -q -o fr.zip
setFramework
echo "copy the apks to the working dir"
cp -a system/framework/*.apk $WORK_DIR
cp -a system/app/*.apk $WORK_DIR
cd $WORK_DIR
for F in *.apk; do
echo "decompiling french file $F ..." | tee -a $LOG_FILE
apktool d $F $TRANSLATION_DIR/${F%.apk} >> $LOG_FILE 2>&1
done
else
echo "there neeed to be ONE zip file in the french directory"
exit
fi
}
# Delete the given directory, because it is not needed
function deleteDirectoryWithoutTranslation(){
echo " ---> directory useless, removed"
cd $TRANSLATION_APK_DIR
rm -fr $1
}
# delete all useless data from the french apks
function cleanTranslatedFiles(){
cd $TRANSLATION_DIR
for d in *; do
echo "cleaning the directory $d"
cd $TRANSLATION_DIR/$d
if [ -d "res" ]; then
ls . | grep -v res | xargs -o rm -fr
cd "res"
CONTAINS_FRENCH_TRANSLATION=`ls .| grep '\-fr' | wc -l`
if [ "$CONTAINS_FRENCH_TRANSLATION" -eq "0" ]; then
deleteDirectoryWithoutTranslation $d
else
echo "---> transltation here, clean it"
ls . | grep -v '\-fr\|\./\|\.\./' | xargs -o rm -fr
fi
else
echo "no res directory"
deleteDirectoryWithoutTranslation $d
fi
if [ ! -f $ORIGIN_APK_DIR/$d.apk ];then
echo "directory not in original rom $d"
deleteDirectoryWithoutTranslation $d
fi
done
}
# merge the decoded translation in the decoded english files
function mergeTranslations(){
cd $DECODED_APK_DIR
mv $TRANSLATION_DIR/* .
cd $WORK_DIR
rm -f *.apk
}
# compile new apks including french files
function compileApk(){
cd $ORIGIN_APK_DIR
for f in *.apk; do
echo "compiling $f"
echo "apktool b $DECODED_APK_DIR/${f%.apk} $WORK_DIR/$f"
apktool b $DECODED_APK_DIR/${f%.apk} $WORK_DIR/$f >> $LOG_FILE 2>&1
done
}
# delete apk in work directory and put the original apks there
function deleteWorkFileAndCopyOriginalApk(){
cd $WORK_DIR
rm -f *.apk
cp -a $ORIGIN_APK_DIR/*.apk .
}
# put the compiled modified files in the original apk files
function finalMerge(){
cd $DECODED_APK_DIR
for F in *.apk; do
echo "doing final build $F"
cd $TEMP_DIR
rm -fr *
unzip -q $DECODED_DIR/$F
ls . | grep -v 'res\|classes.dex\|resources.arsc\|\./\|\.\./' | xargs -o rm -fr
if [ -d res ]; then
cd res
ls . | grep -v '\-fr\|\./\|\.\./' | xargs -o rm -fr
HAS_FR=`ls . | grep '\-fr' | wc -l`
if [ "$HAS_FR" -eq "0" ]; then
cd ..
rm -fr res
else
cd ..
fi
fi
zip -r $WORK_DIR/$F *
done
}
#replace the english apk files with the new french apk files, change the build.prop value and create an unsigned zip that can be flashed
function createRom(){
cd $OUTPUT_ROM_DIR
mv $ORIGINAL_DIR/system $ORIGINAL_DIR/boot.img $ORIGINAL_DIR/META-INF .
mv $WORK_DIR/*.apk system/app
mv system/app/framework*.apk system/framework
mv system/build.prop build.prop
sed 's/=en/=fr/g' build.prop > build1.prop
rm -f build.prop
sed 's/=US/=FR/g' build1.prop > system/build.prop
rm -f build1.prop
zip -r $BASE_DIR/new_rom.zip *
}
cleanLog
decompileTranslatedFiles
decompileOriginFiles
cleanTranslatedFiles
mergeTranslations
compileApk
deleteWorkFileAndCopyOriginalApk
finalMerge
createRom
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A

[Q] How to use string array in init.d script?

I want to make app symlinks to sd-ext on booting.
I made a short init.d script, And It correctly worked on JB based rom.
But after I downgraded to GB, It doesn't work anymore.
I founded that pure bone shell doesn't support arrays.
The script uses string array to declare apk list I want to symlink.
So is there a way to use string array or make similar effect?
Here is my script.
Code:
#!/system/bin/sh
if [ -z "$SD_EXT_DIRECTORY" ]; then SD_EXT_DIRECTORY=/sd-ext; fi
SYSBLOCK=`mount | grep system | cut -f 1 -d ' '`
sysapp2sd=("BackupRestoreConfirmation.apk" "BasicDreams.apk" "Bluetooth.apk" "CertInstaller.apk" "Calculator.apk" "CMFileManager.apk" "CMScreenshot.apk" "DSPManager.apk" "DrmProvider.apk" "Email.apk" "Email2.apk" "Exchange.apk" "Exchange2.apk" "Gmail.apk" "GoogleBackupTransport.apk" "InputDevices.apk" "Music.apk" "OneTimeInitializer.apk" "PhotoTable.apk" "PicoTts.apk" "SamsungTTS.apk" "SharedStorageBackup.apk" "SoundRecorder.apk" "Talk.apk" "ThemeChooser.apk" "ThemeManager.apk" "Torch.apk" "VpnDialogs.apk" "WAPPushManager.apk")
app2sd_exception=("com.UCMobile" "com.adobe.flashplayer" "com.android.lmt" "com.fiberthemax.OpQ2keyboard" "com.fiberthemax.OpQ2keyboard.dict.ko" "com.google.android.gms" "com.google.android.googlequicksearchbox" "com.jungsup.thecall" "com.mobint.hololauncher" "com.mobint.hololauncherplus" "com.mobitobi.android.gentlealarm" "com.myhome.mytheme" "com.rs.autorun" "com.teslacoilsw.launcher" "com.vladlee.callconfirm.free" "eu.chainfire.supersu" "kz.mek.DialerOne" "me.dennis.weather.naver" "net.dinglisch.android.taskerm" "net.everythingandroid.smspopup" )
# make sure $SD_EXT_DIRECTORY is actually mounted
if ! awk -vDIR="$SD_EXT_DIRECTORY" '$2 == DIR { exit 1; }' /proc/mounts ; then
mount -rw -o remount SYSBLOCK /system
mkdir -p /sd-ext/symlink/system/app
# /system/app/ -> /sd-ext/symlink/system/app/
FILES=`find /system/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
for pattern in ${sysapp2sd[@]}; do
if [[ $filename == $pattern ]]; then
cp /system/app/$filename /sd-ext/symlink/system/app/
rm -f /system/app/$filename
ln -s /sd-ext/symlink/system/app/$filename /system/app/$filename
fi
done
done
# /data/app/ -> /sd-ext/symlink/data/app/
FILES=`find /data/app -maxdepth 1 -type f`
for file in $FILES; do
filename=`basename $file`
match=false
for pattern in ${app2sd_exception[@]}; do
if [[ $filename == $pattern* ]]; then
match=true
fi
done
if ! $match; then
cp /data/app/$filename /sd-ext/symlink/data/app/
rm -f /data/app/$filename
ln -s /sd-ext/symlink/data/app/$filename /data/app/$filename
fi
done
mount -r -o remount SYSBLOCK /system
fi
You can use echo or cat command to wrap list and grab it with awk.
and add another for loop over for loop for getting the counted numbers to be used on awk...

PAC Building Error.

Hello All,
I'm builiding PAC for an officially supported device the Motorola Edison.
And i've been experiencing a stand still in the build process :crying:
Code:
[email protected]:/home/android/PAC# make bacon -j4
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
CM_VERSION=
TARGET_PRODUCT=pac_edison
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-15-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KVT49L
OUT_DIR=/home/android/PAC/out
============================================
build/core/java.mk:23: *** cts/apps/CtsVerifier: Invalid LOCAL_SDK_VERSION 'current' Choices are: . Stop.
[email protected]:/home/android/PAC#
java.mk:23 is the error i get. and it seems to be related the cts/apps/CtsVerifier.
i tried manually inputting the LOCAL_SDK_VERSION to to my version number. but still i experience the same error.
i have also tried using Oracle JDK 6. And Open JDK 6 & 7. but still i experience the same result.
If there's anyone who can help me with this error i would gladly appreciate it :crying:
Regards,
Uzayr
Uzayr said:
Hello All,
I'm builiding PAC for an officially supported device the Motorola Edison.
And i've been experiencing a stand still in the build process :crying:
Code:
[email protected]:/home/android/PAC# make bacon -j4
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
CM_VERSION=
TARGET_PRODUCT=pac_edison
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-15-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KVT49L
OUT_DIR=/home/android/PAC/out
============================================
build/core/java.mk:23: *** cts/apps/CtsVerifier: Invalid LOCAL_SDK_VERSION 'current' Choices are: . Stop.
[email protected]:/home/android/PAC#
java.mk:23 is the error i get. and it seems to be related the cts/apps/CtsVerifier.
i tried manually inputting the LOCAL_SDK_VERSION to to my version number. but still i experience the same error.
i have also tried using Oracle JDK 6. And Open JDK 6 & 7. but still i experience the same result.
If there's anyone who can help me with this error i would gladly appreciate it :crying:
Regards,
Uzayr
Click to expand...
Click to collapse
You have to set android latest SDK to your linux path
Regards
MasterAwesome
MasterAwesome said:
You have to set android latest SDK to your linux path
Regards
MasterAwesome
Click to expand...
Click to collapse
Thank you MasterAwesome for repsonding.
And, if you don't mind. Any idea how i can set the linux path to the latest SDK?
Uzayr said:
Thank you MasterAwesome for repsonding.
And, if you don't mind. Any idea how i can set the linux path to the latest SDK?
Click to expand...
Click to collapse
Open your ~/.bashrc and at the end add
Code:
export PATH=$PATH:~/SDK/platform-tools;
export PATH=$PATH:~/SDK/build-tools;
export PATH=$PATH:~/SDK/tools;
or to do it via terminal
Code:
echo 'export PATH=$PATH:~/SDK/platform-tools;' >> ~/.bashrc
echo 'export PATH=$PATH:~/SDK/build-tools;' >> ~/.bashrc
echo 'export PATH=$PATH:~/SDK/tools;' >> ~/.bashrc
MasterAwesome said:
Open your ~/.bashrc and at the end add
Code:
export PATH=$PATH:~/SDK/platform-tools;
export PATH=$PATH:~/SDK/build-tools;
export PATH=$PATH:~/SDK/tools;
or to do it via terminal
Code:
echo 'export PATH=$PATH:~/SDK/platform-tools;' >> ~/.bashrc
echo 'export PATH=$PATH:~/SDK/build-tools;' >> ~/.bashrc
echo 'export PATH=$PATH:~/SDK/tools;' >> ~/.bashrc
Click to expand...
Click to collapse
That's more than enough
thanks a lot. that should hopefully fix my issue.
i appreciate your help
you just saved hours of work.
Sent from my MB865 using Tapatalk
Don't mention it
I have a question, what does your signature mean?
Regards
MasterAwesome
MasterAwesome said:
Don't mention it
I have a question, what does your signature mean?
Regards
MasterAwesome
Click to expand...
Click to collapse
Lol
there you go :
http://it.toolbox.com/blogs/grandpuba/lesson-1-never-play-leapfrog-with-a-unicorn-18108
EDIT:
I get the same error even after installing the ADT Bundle,
This is what my .bashrc looks like.
Code:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\[email protected]\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to [email protected]:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\[email protected]\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export PATH=~/bin:$PATH
# Android tools
export PATH=$PATH:~/sdk/platform-tools;
export PATH=$PATH:~/sdk/build-tools;
export PATH=$PATH:~/sdk/tools;
export PATH=${PATH}:~/bin;
Uzayr said:
Lol
there you go :
http://it.toolbox.com/blogs/grandpuba/lesson-1-never-play-leapfrog-with-a-unicorn-18108
EDIT:
I get the same error even after installing the ADT Bundle,
This is what my .bashrc looks like.
Code:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\[email protected]\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to [email protected]:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\[email protected]\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export PATH=~/bin:$PATH
# Android tools
export PATH=$PATH:~/sdk/platform-tools;
export PATH=$PATH:~/sdk/build-tools;
export PATH=$PATH:~/sdk/tools;
export PATH=${PATH}:~/bin;
Click to expand...
Click to collapse
Well that was a fun article :/
Anyway type emulator in your terminal and see if you get any result.. If you don't you haven't set the path correctly.
Regards
MasterAwesome
---------- Post added at 07:49 PM ---------- Previous post was at 07:48 PM ----------
MasterAwesome said:
Well that was a fun article :/
Anyway type emulator in your terminal and see if you get any result.. If you don't you haven't set the path correctly.
Or set your path during setting the build environment by typing the export commands in your terminal without the semicolon at the end
Regards
MasterAwesome
Click to expand...
Click to collapse
Regards
MasterAwesome
MasterAwesome said:
Well that was a fun article :/
Anyway type emulator in your terminal and see if you get any result.. If you don't you haven't set the path correctly.
Regards
MasterAwesome
---------- Post added at 07:49 PM ---------- Previous post was at 07:48 PM ----------
Regards
MasterAwesome
Click to expand...
Click to collapse
this is what i get when i type emulator
Code:
[email protected]:~$ emulator
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android SDK user, please use '@<name>' or '-avd <name>'
to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator
[email protected]:~$
but my other builds have no problems. it's only PAC which is causing me problems.
Uzayr said:
this is what i get when i type emulator
Code:
[email protected]:~$ emulator
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android SDK user, please use '@<name>' or '-avd <name>'
to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator
[email protected]:~$
but my other builds have no problems. it's only PAC which is causing me problems.
Click to expand...
Click to collapse
Try syncing your repository..
And try
Sudo updates-alternatives --config java
And two me output
Regards
MasterAwesome
MasterAwesome said:
Try syncing your repository..
And try
Sudo updates-alternatives --config java
And two me output
Regards
MasterAwesome
Click to expand...
Click to collapse
i got OpenJDK 6 & 7 and i switch between them when i have to.
Code:
[email protected]:~$ sudo update-alternatives --config java
[sudo] password for android:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
Press enter to keep the current choice[*], or type selection number:
and syncing is fine..i just did a re-sync again.
Uzayr said:
i got OpenJDK 6 & 7 and i switch between them when i have to.
Code:
[email protected]:~$ sudo update-alternatives --config java
[sudo] password for android:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
Press enter to keep the current choice
[*], or type selection number:
and syncing is fine..i just did a re-sync again.
Click to expand...
Click to collapse
There's your error you need sun java.. Oracle JDK 1.6 others are not supported.
Regards
MasterAwesome
MasterAwesome said:
There's your error you need sun java.. Oracle JDK 1.6 others are not supported.
Regards
MasterAwesome
Click to expand...
Click to collapse
i had previously Oracle jdk 1.6 when i started this build. but after these errors i switched to open jdk.
oracle jdk 7 breaks my java installation.
Uzayr said:
i had previously Oracle jdk 1.6 when i started this build. but after these errors i switched to open jdk.
oracle jdk 7 breaks my java installation.
Click to expand...
Click to collapse
yeah you're not supposed to use jdk 7 for now android supports only jdk 1.6_45 :/
first, extract jdk 1.6.bin to your /usr/lib/jvm
and you're supposed to update-configurations for each java binary
rename the .txt attched to .sh and make it runnable by using chmod a+x filename and run it.. you'll get options choose sun java 1.6 and click update. this will make it work.
MasterAwesome said:
yeah you're not supposed to use jdk 7 for now android supports only jdk 1.6_45 :/
first, extract jdk 1.6.bin to your /usr/lib/jvm
and you're supposed to update-configurations for each java binary
rename the .txt attched to .sh and make it runnable by using chmod a+x filename and run it.. you'll get options choose sun java 1.6 and click update. this will make it work.
Click to expand...
Click to collapse
i'll try it out and let you know, ASAP
thank you
Uzayr said:
i'll try it out and let you know, ASAP
thank you
Click to expand...
Click to collapse
ASAP=as slow as possible?
Jk
Regards
MasterAwesome
MasterAwesome said:
ASAP=as slow as possible?
Jk
Regards
MasterAwesome
Click to expand...
Click to collapse
lol,
alright...i get the same error when using Oracle's Java 6
Code:
[email protected]:~$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
[email protected]:~$ javac -version
javac 1.6.0_45
[email protected]:~$
Uzayr said:
lol,
alright...i get the same error when using Oracle's Java 6
Code:
[email protected]:~$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
[email protected]:~$ javac -version
javac 1.6.0_45
[email protected]:~$
Click to expand...
Click to collapse
Okay send me the build/core/java.mk I'll check it
Regards
MasterAwesome
MasterAwesome said:
Okay send me the build/core/java.mk I'll check it
Regards
MasterAwesome
Click to expand...
Click to collapse
I have attaches
Uzayr said:
I have attaches
Click to expand...
Click to collapse
facing the same issue. is it solved ?

Categories

Resources