Unlink Ringer and Notification Sound (4.2.2) - HTC One SV

For separated volume follow this steps
In file SettingsProvider.apk
SettingsProvider.apk/res/values/bools.xml
change
<bool name="def_notifications_use_ring_volume">true</bool>
to
<bool name="def_notifications_use_ring_volume">false</bool>
Rebuild SettingsProvider.apk
In file Settings.apk
Settings.apk/smali/com/android/settings//RingerVolume.smali
in method
.method protected onBindDialogView(Landroid/view/ViewV
delete all
Landroid/view/View;->setVisibility(I)V
Rebuild Settings.apk
In file framework.jar
framework.jar/smali/android/media/AudioService.smali
Change
.line 270
:array_a
.array-data 0x4
0x0t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x4t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x6t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
.end array-data
to
.line 270
:array_a
.array-data 0x4
0x0t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x4t 0x0t 0x0t 0x0t
0x5t 0x0t 0x0t 0x0t
0x6t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
.end array-data
Rebuild framework.jar
After all you have a working separate sound for ringer and notification. Its work with AudioManagerPro or the same programs only.
In Sense it doesnt work because all icons for that menu are located in framework-hts-res.apk but i cant rebuilt it.

rollon76 said:
For separated volume follow this steps
In file SettingsProvider.apk
SettingsProvider.apk/res/values/bools.xml
change
<bool name="def_notifications_use_ring_volume">true</bool>
to
<bool name="def_notifications_use_ring_volume">false</bool>
Rebuild SettingsProvider.apk
In file Settings.apk
Settings.apk/smali/com/android/settings//RingerVolume.smali
in method
.method protected onBindDialogView(Landroid/view/ViewV
delete all
Landroid/view/View;->setVisibility(I)V
Rebuild Settings.apk
In file framework.jar
framework.jar/smali/android/media/AudioService.smali
Change
.line 270
:array_a
.array-data 0x4
0x0t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x4t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x6t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
.end array-data
to
.line 270
:array_a
.array-data 0x4
0x0t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x4t 0x0t 0x0t 0x0t
0x5t 0x0t 0x0t 0x0t
0x6t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
.end array-data
Rebuild framework.jar
After all you have a working separate sound for ringer and notification. Its work with AudioManagerPro or the same programs only.
In Sense it doesnt work because all icons for that menu are located in framework-hts-res.apk but i cant rebuilt it.
Click to expand...
Click to collapse
Nice Tutorial, but if I try to decompile Settings.apk there's no smali-folder.
Can anybody upload the patched files?

Related

[Q] ROM Porting Help

Hello, i am in the process of porting a ROM, all seemed to be going fine until i flashed. I received an "Error 7" and it said it had trouble setting permissions, the following are the updater-script from both the port rom, and the base rom. I tried flashing from the internal and external SD card. Niether worked.
Base ROM:
Code:
show_progress(0.15, 5);
package_extract_file("updater.sh", "/tmp/updater.sh");
package_extract_file("make_ext4fs", "/tmp/make_ext4fs");
package_extract_file("busybox", "/tmp/busybox");
package_extract_file("flash_image", "/tmp/flash_image");
package_extract_file("erase_image", "/tmp/erase_image");
package_extract_file("bml_over_mtd", "/tmp/bml_over_mtd");
package_extract_file("bml_over_mtd.sh", "/tmp/bml_over_mtd.sh");
set_perm(0, 0, 0777, "/tmp/modem.bin");
set_perm(0, 0, 0777, "/tmp/updater.sh");
set_perm(0, 0, 0777, "/tmp/make_ext4fs");
set_perm(0, 0, 0777, "/tmp/busybox");
set_perm(0, 0, 0777, "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/erase_image");
set_perm(0, 0, 0777, "/tmp/bml_over_mtd");
set_perm(0, 0, 0777, "/tmp/bml_over_mtd.sh");
package_extract_file("boot.img", "/tmp/boot.img");
assert(run_program("/tmp/updater.sh" ) == 0);
delete("/tmp/boot.img");
mount("yaffs2", "MTD", "system", "/system");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");
unmount("/system");
show_progress(0.500000, 0);
ui_print("");
ui_print("");
ui_print("Slim Roms");
ui_print("");
ui_print(" www.slimroms.net ");
ui_print("");
ui_print("");
ui_print("Format and Mount System, Mount Data...");
format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/data");
show_progress(0.700000, 30);
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("Symlinks and permissions...");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
"/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
"/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
"/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
"/system/xbin/brctl", "/system/xbin/bunzip2", "/system/xbin/bzcat",
"/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat",
"/system/xbin/catv", "/system/xbin/chattr", "/system/xbin/chgrp",
"/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot",
"/system/xbin/clear", "/system/xbin/cmp", "/system/xbin/comm",
"/system/xbin/cp", "/system/xbin/cpio", "/system/xbin/crond",
"/system/xbin/crontab", "/system/xbin/cut", "/system/xbin/date",
"/system/xbin/dc", "/system/xbin/dd", "/system/xbin/depmod",
"/system/xbin/devmem", "/system/xbin/df", "/system/xbin/diff",
"/system/xbin/dirname", "/system/xbin/dmesg", "/system/xbin/dnsd",
"/system/xbin/dos2unix", "/system/xbin/du", "/system/xbin/echo",
"/system/xbin/ed", "/system/xbin/egrep", "/system/xbin/env",
"/system/xbin/expand", "/system/xbin/expr", "/system/xbin/false",
"/system/xbin/fdisk", "/system/xbin/fgrep", "/system/xbin/find",
"/system/xbin/flash_lock", "/system/xbin/flash_unlock",
"/system/xbin/flashcp", "/system/xbin/flock", "/system/xbin/fold",
"/system/xbin/free", "/system/xbin/freeramdisk", "/system/xbin/fsync",
"/system/xbin/ftpget", "/system/xbin/ftpput", "/system/xbin/fuser",
"/system/xbin/getopt", "/system/xbin/grep", "/system/xbin/groups",
"/system/xbin/gunzip", "/system/xbin/gzip", "/system/xbin/halt",
"/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/id",
"/system/xbin/ifconfig", "/system/xbin/inetd", "/system/xbin/insmod",
"/system/xbin/install", "/system/xbin/iostat", "/system/xbin/ip",
"/system/xbin/kill", "/system/xbin/killall", "/system/xbin/killall5",
"/system/xbin/length", "/system/xbin/less", "/system/xbin/ln",
"/system/xbin/losetup", "/system/xbin/ls", "/system/xbin/lsattr",
"/system/xbin/lsmod", "/system/xbin/lsusb", "/system/xbin/lzcat",
"/system/xbin/lzma", "/system/xbin/lzop", "/system/xbin/lzopcat",
"/system/xbin/man", "/system/xbin/md5sum", "/system/xbin/mesg",
"/system/xbin/mkdir", "/system/xbin/mke2fs", "/system/xbin/mkfifo",
"/system/xbin/mkfs.ext2", "/system/xbin/mkfs.vfat",
"/system/xbin/mknod", "/system/xbin/mkswap", "/system/xbin/mktemp",
"/system/xbin/modinfo", "/system/xbin/modprobe", "/system/xbin/more",
"/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mpstat",
"/system/xbin/mv", "/system/xbin/nanddump", "/system/xbin/nandwrite",
"/system/xbin/netstat", "/system/xbin/nice", "/system/xbin/nohup",
"/system/xbin/nslookup", "/system/xbin/ntpd", "/system/xbin/od",
"/system/xbin/patch", "/system/xbin/pgrep", "/system/xbin/pidof",
"/system/xbin/ping", "/system/xbin/pkill", "/system/xbin/pmap",
"/system/xbin/poweroff", "/system/xbin/printenv", "/system/xbin/printf",
"/system/xbin/ps", "/system/xbin/pstree", "/system/xbin/pwd",
"/system/xbin/pwdx", "/system/xbin/rdev", "/system/xbin/readlink",
"/system/xbin/realpath", "/system/xbin/renice", "/system/xbin/reset",
"/system/xbin/resize", "/system/xbin/rev", "/system/xbin/rm",
"/system/xbin/rmdir", "/system/xbin/rmmod", "/system/xbin/route",
"/system/xbin/run-parts", "/system/xbin/rx", "/system/xbin/sed",
"/system/xbin/seq", "/system/xbin/setconsole", "/system/xbin/setserial",
"/system/xbin/setsid", "/system/xbin/sh", "/system/xbin/sha1sum",
"/system/xbin/sha256sum", "/system/xbin/sha512sum",
"/system/xbin/sleep", "/system/xbin/sort", "/system/xbin/split",
"/system/xbin/stat", "/system/xbin/strings", "/system/xbin/stty",
"/system/xbin/sum", "/system/xbin/swapoff", "/system/xbin/swapon",
"/system/xbin/sync", "/system/xbin/sysctl", "/system/xbin/tac",
"/system/xbin/tail", "/system/xbin/tar", "/system/xbin/taskset",
"/system/xbin/tee", "/system/xbin/telnet", "/system/xbin/telnetd",
"/system/xbin/test", "/system/xbin/tftp", "/system/xbin/tftpd",
"/system/xbin/time", "/system/xbin/timeout", "/system/xbin/top",
"/system/xbin/touch", "/system/xbin/tr", "/system/xbin/traceroute",
"/system/xbin/true", "/system/xbin/ttysize", "/system/xbin/tune2fs",
"/system/xbin/umount", "/system/xbin/uname", "/system/xbin/uncompress",
"/system/xbin/unexpand", "/system/xbin/uniq", "/system/xbin/unix2dos",
"/system/xbin/unlzma", "/system/xbin/unlzop", "/system/xbin/unxz",
"/system/xbin/unzip", "/system/xbin/uptime", "/system/xbin/usleep",
"/system/xbin/uudecode", "/system/xbin/uuencode", "/system/xbin/vi",
"/system/xbin/watch", "/system/xbin/wc", "/system/xbin/wget",
"/system/xbin/which", "/system/xbin/whoami", "/system/xbin/xargs",
"/system/xbin/xz", "/system/xbin/xzcat", "/system/xbin/yes",
"/system/xbin/zcat");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chmod",
"/system/bin/chown", "/system/bin/cmp", "/system/bin/cp",
"/system/bin/date", "/system/bin/dd", "/system/bin/df",
"/system/bin/dmesg", "/system/bin/du", "/system/bin/getevent",
"/system/bin/getprop", "/system/bin/grep", "/system/bin/hd",
"/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
"/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
"/system/bin/kill", "/system/bin/ln", "/system/bin/log",
"/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof",
"/system/bin/md5", "/system/bin/mkdir", "/system/bin/mount",
"/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
"/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
"/system/bin/ps", "/system/bin/r", "/system/bin/reboot",
"/system/bin/renice", "/system/bin/restart", "/system/bin/rm",
"/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
"/system/bin/schedtop", "/system/bin/sendevent",
"/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",
"/system/bin/smd", "/system/bin/start", "/system/bin/stop",
"/system/bin/sync", "/system/bin/top", "/system/bin/touch",
"/system/bin/umount", "/system/bin/uptime", "/system/bin/vmstat",
"/system/bin/watchprops",
"/system/bin/wipe");
show_progress(0.150000, 5);
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0755, "/system/vendor/bin");
set_perm(0, 2000, 0755, "/system/vendor/etc");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm(0, 2000, 0755, "/system/vendor/lib/egl");
set_perm(0, 2000, 0755, "/system/vendor/lib/hw");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
show_progress(0.200000, 10);
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "restore");
delete("/system/bin/backuptool.sh");
delete("/system/bin/backuptool.functions");
unmount("/data");
unmount("/system");
Click to expand...
Click to collapse
Porting ROM:
Code:
assert(getprop("ro.product.device") == "galaxys" || getprop("ro.build.product") == "galaxys" ||
getprop("ro.product.device") == "galaxysmtd" || getprop("ro.build.product") == "galaxysmtd" ||
getprop("ro.product.device") == "GT-I9000" || getprop("ro.build.product") == "GT-I9000" ||
getprop("ro.product.device") == "GT-I9000M" || getprop("ro.build.product") == "GT-I9000M" ||
getprop("ro.product.device") == "GT-I9000T" || getprop("ro.build.product") == "GT-I9000T");
package_extract_file("modem.bin", "/tmp/modem.bin");
set_perm(0, 0, 0777, "/tmp/modem.bin");
package_extract_file("updater.sh", "/tmp/updater.sh");
set_perm(0, 0, 0777, "/tmp/updater.sh");
package_extract_file("make_ext4fs", "/tmp/make_ext4fs");
set_perm(0, 0, 0777, "/tmp/make_ext4fs");
package_extract_file("busybox", "/tmp/busybox");
set_perm(0, 0, 0777, "/tmp/busybox");
package_extract_file("flash_image", "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/flash_image");
package_extract_file("erase_image", "/tmp/erase_image");
set_perm(0, 0, 0777, "/tmp/erase_image");
package_extract_file("bml_over_mtd", "/tmp/bml_over_mtd");
set_perm(0, 0, 0777, "/tmp/bml_over_mtd");
package_extract_file("bml_over_mtd.sh", "/tmp/bml_over_mtd.sh");
set_perm(0, 0, 0777, "/tmp/bml_over_mtd.sh");
package_extract_file("boot.img", "/tmp/boot.img");
assert(run_program("/tmp/updater.sh") == 0);
mount("ext4", "EMMC", "/dev/lvpool/system", "/system");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");
unmount("/system");
show_progress(0.500000, 0);
ui_print("");
ui_print("");
ui_print("C-RoM Series");
ui_print("");
ui_print(" www.c-rom.biz ");
ui_print("");
ui_print("");
ui_print("Format and Mount System, Mount Data...");
format("ext4", "EMMC", "/dev/lvpool/system", "0", "/system");
mount("ext4", "EMMC", "/dev/lvpool/system", "/system");
mount("ext4", "EMMC", "/dev/lvpool/userdata", "/data");
show_progress(0.700000, 30);
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("Symlinks and permissions...");
package_extract_dir("system", "/system");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
"/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
"/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
"/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
"/system/xbin/brctl", "/system/xbin/bunzip2", "/system/xbin/bzcat",
"/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat",
"/system/xbin/catv", "/system/xbin/chattr", "/system/xbin/chgrp",
"/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot",
"/system/xbin/clear", "/system/xbin/cmp", "/system/xbin/comm",
"/system/xbin/cp", "/system/xbin/cpio", "/system/xbin/crond",
"/system/xbin/crontab", "/system/xbin/cut", "/system/xbin/date",
"/system/xbin/dc", "/system/xbin/dd", "/system/xbin/depmod",
"/system/xbin/devmem", "/system/xbin/df", "/system/xbin/diff",
"/system/xbin/dirname", "/system/xbin/dmesg", "/system/xbin/dnsd",
"/system/xbin/dos2unix", "/system/xbin/du", "/system/xbin/echo",
"/system/xbin/ed", "/system/xbin/egrep", "/system/xbin/env",
"/system/xbin/expand", "/system/xbin/expr", "/system/xbin/false",
"/system/xbin/fdisk", "/system/xbin/fgrep", "/system/xbin/find",
"/system/xbin/flash_lock", "/system/xbin/flash_unlock",
"/system/xbin/flashcp", "/system/xbin/flock", "/system/xbin/fold",
"/system/xbin/free", "/system/xbin/freeramdisk", "/system/xbin/fsync",
"/system/xbin/ftpget", "/system/xbin/ftpput", "/system/xbin/fuser",
"/system/xbin/getopt", "/system/xbin/grep", "/system/xbin/groups",
"/system/xbin/gunzip", "/system/xbin/gzip", "/system/xbin/halt",
"/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/id",
"/system/xbin/ifconfig", "/system/xbin/inetd", "/system/xbin/insmod",
"/system/xbin/install", "/system/xbin/iostat", "/system/xbin/ip",
"/system/xbin/kill", "/system/xbin/killall", "/system/xbin/killall5",
"/system/xbin/length", "/system/xbin/less", "/system/xbin/ln",
"/system/xbin/losetup", "/system/xbin/ls", "/system/xbin/lsattr",
"/system/xbin/lsmod", "/system/xbin/lsusb", "/system/xbin/lzcat",
"/system/xbin/lzma", "/system/xbin/lzop", "/system/xbin/lzopcat",
"/system/xbin/man", "/system/xbin/md5sum", "/system/xbin/mesg",
"/system/xbin/mkdir", "/system/xbin/mke2fs", "/system/xbin/mkfifo",
"/system/xbin/mkfs.ext2", "/system/xbin/mkfs.vfat",
"/system/xbin/mknod", "/system/xbin/mkswap", "/system/xbin/mktemp",
"/system/xbin/modinfo", "/system/xbin/modprobe", "/system/xbin/more",
"/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mpstat",
"/system/xbin/mv", "/system/xbin/nanddump", "/system/xbin/nandwrite",
"/system/xbin/netstat", "/system/xbin/nice", "/system/xbin/nohup",
"/system/xbin/nslookup", "/system/xbin/ntpd", "/system/xbin/od",
"/system/xbin/patch", "/system/xbin/pgrep", "/system/xbin/pidof",
"/system/xbin/ping", "/system/xbin/pkill", "/system/xbin/pmap",
"/system/xbin/poweroff", "/system/xbin/printenv", "/system/xbin/printf",
"/system/xbin/ps", "/system/xbin/pstree", "/system/xbin/pwd",
"/system/xbin/pwdx", "/system/xbin/rdev", "/system/xbin/readlink",
"/system/xbin/realpath", "/system/xbin/renice", "/system/xbin/reset",
"/system/xbin/resize", "/system/xbin/rev", "/system/xbin/rm",
"/system/xbin/rmdir", "/system/xbin/rmmod", "/system/xbin/route",
"/system/xbin/run-parts", "/system/xbin/rx", "/system/xbin/sed",
"/system/xbin/seq", "/system/xbin/setconsole", "/system/xbin/setserial",
"/system/xbin/setsid", "/system/xbin/sh", "/system/xbin/sha1sum",
"/system/xbin/sha256sum", "/system/xbin/sha512sum",
"/system/xbin/sleep", "/system/xbin/sort", "/system/xbin/split",
"/system/xbin/stat", "/system/xbin/strings", "/system/xbin/stty",
"/system/xbin/sum", "/system/xbin/swapoff", "/system/xbin/swapon",
"/system/xbin/sync", "/system/xbin/sysctl", "/system/xbin/tac",
"/system/xbin/tail", "/system/xbin/tar", "/system/xbin/taskset",
"/system/xbin/tee", "/system/xbin/telnet", "/system/xbin/telnetd",
"/system/xbin/test", "/system/xbin/tftp", "/system/xbin/tftpd",
"/system/xbin/time", "/system/xbin/timeout", "/system/xbin/top",
"/system/xbin/touch", "/system/xbin/tr", "/system/xbin/traceroute",
"/system/xbin/true", "/system/xbin/ttysize", "/system/xbin/tune2fs",
"/system/xbin/umount", "/system/xbin/uname", "/system/xbin/uncompress",
"/system/xbin/unexpand", "/system/xbin/uniq", "/system/xbin/unix2dos",
"/system/xbin/unlzma", "/system/xbin/unlzop", "/system/xbin/unxz",
"/system/xbin/unzip", "/system/xbin/uptime", "/system/xbin/usleep",
"/system/xbin/uudecode", "/system/xbin/uuencode", "/system/xbin/vi",
"/system/xbin/watch", "/system/xbin/wc", "/system/xbin/wget",
"/system/xbin/which", "/system/xbin/whoami", "/system/xbin/xargs",
"/system/xbin/xz", "/system/xbin/xzcat", "/system/xbin/yes",
"/system/xbin/zcat");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chmod",
"/system/bin/chown", "/system/bin/cmp", "/system/bin/cp",
"/system/bin/date", "/system/bin/dd", "/system/bin/df",
"/system/bin/dmesg", "/system/bin/du", "/system/bin/getevent",
"/system/bin/getprop", "/system/bin/grep", "/system/bin/hd",
"/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
"/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
"/system/bin/kill", "/system/bin/ln", "/system/bin/log",
"/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof",
"/system/bin/md5", "/system/bin/mkdir", "/system/bin/mount",
"/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
"/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
"/system/bin/ps", "/system/bin/r", "/system/bin/reboot",
"/system/bin/renice", "/system/bin/restart", "/system/bin/rm",
"/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
"/system/bin/schedtop", "/system/bin/sendevent",
"/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",
"/system/bin/smd", "/system/bin/start", "/system/bin/stop",
"/system/bin/sync", "/system/bin/top", "/system/bin/touch",
"/system/bin/umount", "/system/bin/uptime", "/system/bin/vmstat",
"/system/bin/watchprops",
"/system/bin/wipe");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0755, "/system/vendor/bin");
set_perm(0, 2000, 0755, "/system/vendor/etc");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm(0, 2000, 0755, "/system/vendor/lib/egl");
set_perm(0, 2000, 0755, "/system/vendor/lib/hw");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
show_progress(0.200000, 0);
show_progress(0.200000, 10);
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "restore");
delete("/system/bin/backuptool.sh");
delete("/system/bin/backuptool.functions");
show_progress(0.200000, 10);
show_progress(0.100000, 0);
unmount("/data");
unmount("/system");
Click to expand...
Click to collapse
Thank You In Advance :fingers-crossed:
To port my rom, I just used the bases's updater-script and everything worked fine. What rom are you trying to port?
Sent from my SAMSUNG-SGH-I997 using xda app-developers app
A Galaxy S i9000 ROM, i will try using the bases updater-script. Thanks
Not a problem, good luck
Sent from my SGH-I997 using xda app-developers app

[DISCONTINUED][GUIDE]Moving Clock to Centre of Statusbar[CM10/10.1]

Centering Clock on CM10.1 Statusbar​
Steps:
1.Decompile the SystemUI.apk
2.Go to res\layout\status_bar.xml
3.Now delete everything in there and copy this
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_large" android:scaleType="center" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_image_error" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
</LinearLayout>
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:paddingLeft="6.0dip" android:clickable="false" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<LinearLayout android:gravity="right" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<include android:id="@id/signal_cluster_text" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_text_view" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Battery" android:gravity="left|center" android:id="@id/dock_battery_text" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="-3.0dip" android:singleLine="true" />
<ImageView android:id="@id/dock_battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Battery" android:gravity="left|center" android:id="@id/battery_text" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="-3.0dip" android:singleLine="true" />
<ImageView android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<com.android.systemui.statusbar.policy.CircleBattery android:textAppearance="@style/TextAppearance.StatusBar.Battery" android:gravity="bottom" android:id="@id/circle_battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
4.Save and exit
5.Now go to res\layout\status_bar_expanded_header.xml
6.Replace the 2nd line with this
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/header" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" android:baselineAligned="false"
7.Recompile the apk
8.Push to system/app folder and reboot after giving necessary permissions!!
9.Done!!
Credits:
-Adi Aisiteru Reborn
-xda
-google
nice tutor..good job bro..

[Q] Data Signal In/Out won't show on CM11 GT-S7270

I want to show Signal In/Out, so I decide made some change in SystemUI.apk and here's msim_signal_cluster_view.xml content
Code:
[SIZE="3"][SIZE="2"]<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.MSimSignalClusterView android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout android:id="@id/wifi_combo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="-6.0dip">
<ImageView android:id="@id/wifi_signal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center" android:layout_centerVertical="true" android:layout_alignParentEnd="true" />
<ImageView android:layout_gravity="bottom|center" android:id="@id/wifi_inout" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<View android:id="@id/spacer" android:visibility="gone" android:layout_width="6.0dip" android:layout_height="6.0dip" />
<FrameLayout android:id="@id/mobile_combo" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">
<View android:visibility="invisible" android:layout_width="3.0dip" android:layout_height="6.0dip" />
<TextView android:layout_gravity="bottom|right|center" android:id="@id/mobile_slot_label" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/TextAppearance.StatusBar.SimSlotLabel" />
<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/mobile_signal" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/mobile_type" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="end|bottom|center" android:id="@id/mobile_inout" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<ImageView android:id="@id/mobile_roaming" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
<FrameLayout android:id="@id/mobile_combo_sub2" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">
<View android:visibility="invisible" android:layout_width="3.0dip" android:layout_height="6.0dip" />
<TextView android:layout_gravity="bottom|right|center" android:id="@id/mobile_slot_label_2" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/TextAppearance.StatusBar.SimSlotLabel" />
<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/mobile_signal_sub2" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/mobile_type_sub2" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="end|bottom|center" android:id="@id/mobile_inout_sub2" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<ImageView android:id="@id/mobile_roaming_sub2" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
<FrameLayout android:id="@id/mobile_combo_sub3" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">
<View android:visibility="invisible" android:layout_width="3.0dip" android:layout_height="6.0dip" />
<TextView android:layout_gravity="bottom|right|center" android:id="@id/mobile_slot_label_3" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/TextAppearance.StatusBar.SimSlotLabel" />
<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/mobile_signal_sub3" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/mobile_type_sub3" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="end|bottom|center" android:id="@id/mobile_inout_sub3" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<ImageView android:id="@id/mobile_roaming_sub3" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
<ImageView android:id="@id/airplane" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</com.android.systemui.statusbar.MSimSignalClusterView>[/SIZE][/SIZE]
So, I remove some line to make it simple, it's look like this
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.MSimSignalClusterView android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout android:id="@id/wifi_combo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="-6.0dip">
<ImageView android:id="@id/wifi_signal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center" android:layout_centerVertical="true" android:layout_alignParentEnd="true" />
<ImageView android:layout_gravity="bottom|center" android:id="@id/wifi_inout" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<View android:id="@id/spacer" android:visibility="gone" android:layout_width="6.0dip" android:layout_height="6.0dip" />
<FrameLayout android:id="@id/mobile_combo" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content">
<View android:visibility="invisible" android:layout_width="3.0dip" android:layout_height="6.0dip" />
<TextView android:layout_gravity="bottom|right|center" android:id="@id/mobile_slot_label" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/TextAppearance.StatusBar.SimSlotLabel" />
<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/mobile_signal" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/mobile_type" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="end|bottom|center" android:id="@id/mobile_inout" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<ImageView android:id="@id/mobile_roaming" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
<ImageView android:id="@id/airplane" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</com.android.systemui.statusbar.MSimSignalClusterView>
This some changes I've made
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.MSimSignalClusterView android:gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout android:id="@id/wifi_combo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="-6.0dip">
<ImageView android:id="@id/wifi_signal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center" android:layout_centerVertical="true" android:layout_alignParentEnd="true" />
<ImageView android:layout_gravity="bottom|center" android:id="@id/wifi_inout" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
<View android:id="@id/spacer" android:visibility="gone" android:layout_width="6.0dip" android:layout_height="6.0dip" />
<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<View android:visibility="invisible" android:layout_width="3.0dip" android:layout_height="6.0dip" />
<FrameLayout android:id="@id/mobile_combo" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/mobile_signal" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/mobile_type" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="end|bottom|center" android:id="@id/mobile_inout" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
</FrameLayout>
<ImageView android:id="@id/airplane" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</com.android.systemui.statusbar.MSimSignalClusterView>
Recompile...
Flash trough CWM...
And result is nothing changed...
Could someone here tell me, how to resolve this...

[CLOSED]Impossible d'afficher correctement un pdf créé via Google App Script sur Google Sheet

Bonjour à tous,
Je développe ma base de données sur Google Sheet, et j'aimerais pouvoir y générer des factures en pdf automatiquement, rapidement et gratuitement.
[Code à la fin]
La fonction script .gs aboutit bien, cependant le pdf généré ne peut pas être ouvert normalement après la génération, lorsque je clique sur le pdf j'obtiens ça :
lien de téléchargement du pdf généré : https://drive.google.com/file/d/1ahWPYlssZORkkE09wHIW8zoyp7uWlJiA/view?usp=sharing
Je suis obligé de me connecter sur mon compte Google VIA le document (jamais vu auparavant), pour pouvoir voir le contenu du pdf. Et j'ai l'impression que c'est uniquement après m'être connecté sur le compte avec lequel je l'ai créé, qu'il s'ouvre et se télécharge correctement (avec un autre compte, si je me connecte , j 'atterris sur le google sheet carrément, il ne me télécharge alors même plus le pdf, ni me le montre...)
Si vous avez des tuyaux pour contourner cette espèce de "mode privé", voire même une autre méthode, je suis preneur (même une simple suggestion). Merci pour le temps que vous voudrez bien m'accorder je reste disponible et réactif
Cela donne :
```
fonction onOpen() {
const ui = SpreadsheetApp.getUi();
ui.createMenu("GED").addItem("Enregistrer le PDF ↓ ","savePDF").addToUi();
}
fonction savePDF()
{
// SÉLECTIONNEUR LA FEUILLE A SAUVEGARDE
const ss = SpreadsheetApp.getActiveSpreadsheet();
feuille const = ss.getActiveSheet();
//URL de SS ?
const ssUrl = ss.getUrl();
const sheetId=sheet.getSheetId();
const url = ssUrl.replace(/\/edit.*$/,'')
+ '/export?exportformat=pdf&format=pdf'
+ '&taille=LETTRE'
+ '&portrait=vrai'
+ '&fitw=true'
+ '&top_margin=0.50'
+ '&bottom_margin=0.50'
+ '&marge_gauche=0.50'
+ '&marge_droite=0.50'
+ '&sheetnames=false'
+ '&printtitle=false'
+ '&pagenum=false'
+ '&gridlines=false'
+ '&fzr=FAUX'
+ '&gid='+sheetId;
// CREER LE PDF A PARTIR DE L'URL
// var jeton = ScriptApp.getOAuthToken();
const docurl = UrlFetchApp.fetch(url);
const pdf = docurl.getAs('application/pdf');
fichier const = DriveApp.createFile(pdf);
// RÉCOLTER LES INFORMATIONS DANS LA FEUILLE POUR COMPOSER LE NOM DU DOCUMENT
const docId = feuille.getRange('B2').getValue();
const clientName = sheet.getRange('C3').getValue();
const docDate = feuille.getRange('D2').getValue();
//mise en forme de la date : mois-annee
const docDateMMYY = docDate.getMonth()+"-"+docDate.getFullYear();
// Concaténons le tout
const docName = docId+"_DEVIS_10Zaine_"+clientName+"_"+docDateMMYY ;
// RENOMMER ET COPIER LE PDF DANS LE BON DOSSIER
/*
ATTENTION IL FAUT ADAPTATEUR LE CODE AVEC L'ID DU DOSSIER DE DESTINATION
https://drive.google.com/open?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/
dossier const = DriveApp.getFolderById("1OnsayBs90_G1NmBVbQALYNK_SmpWLWPF");
const finalFile = file.makeCopy(docName,folder);
//SUPPRIMER LE PDF ORIGINAL
file.setTrashed(true);
//RÉCUPÉRER LE LIEN
const docUrl = finalFile.getUrl();
//ajouter l'urL dans la GED.
const sheetGed = ss.getSheetByName('GED');
sheetGed.appendRow([new Date(),docId,docUrl,docName]);
// envoyer le document au client
const clientEmail = sheet.getRange('C7').getValue();
const message = "Bonjour"+"<p>Veuillez trouver ci-joint le devis "+docName+"</p>"+"<a href='"+docUrl+"'>Cliquez ici pour ouvrir le devis.</a >" ;
MailApp.sendEmail({to:clientEmail , subject: "Votre devis "+docName, htmlBody:message}) ;
// ANNONCER LA RÉUSSITE DE CRÉATION DU DOCUMENT
const ui = SpreadsheetApp.getUi();
ui.alert('Bien joué\n\nLe devis '+ docId +' a bien été créé\nIl porte le nom : '+docName+'\n\nLe lien a été ajouté dans la GED.');
openWindow(docUrl);
}
// Ouvrir le document dans une nouvelle fenêtre :
fonction openWindow(url)
{
let htmlContent = 'Le document a été créé. Cliquez ici pour l\'ouvrir'+
'<script>const thisWindowOpen = window.open("'+url+'" , "_blank", "resizable,scrollbars,status"); </script>';
const html = HtmlService.createHtmlOutput(htmlContent)
.setHauteur(100)
.setWidth(500);
const ui = SpreadsheetApp.getUi();
ui.showModalDialog(html, "Ouverture en cours.");
}```
Voici l'origine du code : https://thierryvanoffe.com/google-a...-lien-dun-pdf-depuis-une-feuille-de-calcul-en -un-clic/
@MaximusNimbusMeridius
Usually, I translate non-English posts as courtesy but your post is simply to long for me. With reference to rule no. 4 of the XDA Forum Rules, please post in English or add at least an English translation to your French posts. Thanks for your cooperation!
Spoiler: Rule No. 4
4. Use the English language.
We understand that with all the different nationalities, not everyone speaks English well, but please try. If you're really unable to post in English, use an online translator. You're free to include your original message in your own language, below the English translation. (This rule covers your posts, profile entries and signature). You could try :- https://translate.google.com/ or https://www.babelfish.com/ or use one of your choice.
Please change your post to an English one or add an English translation (including the thread title) within the next 3 days otherwise I'll have to close your thread.
Regards
Oswald Boelcke
Senior Moderator
@MaximusNimbusMeridius
Thread has been closed! Please advise the moderators team (best via the report function) when you're ready to change the opening post to English or to at least provide an English translation to your French post.
Regards
Oswald Boelcke
Senior Moderator

Unable to open a PDF created by Google App Script for Google Sheet

Hello,
I'm developping my own Data Base on google Sheet, and I would like to generate automatically PDF for my invoices, quickly and for free.
[Code at the end]
The .gs script function finish good, but the pdf generated can't be open normally after generation, when I click on the pdf to open, I obtain it :
Download link generated automatically : https:// drive.google.com/file/d/1ahWPYlssZORkkE09wHIW8zoyp7uWlJiA/view?usp=sharing
I'm forced to connect on my google account VIA the document ( never saw that before), in order to see the content. I feel like it's only when I connect with the mail adress which worked for the creation, that he opens et download correctly (if i download it with another account, i'm only redirected to the Sheet).
If anyone has ideas in order to help me...
Thanks for your time.
Max
Code :
```
fonction onOpen() {
const ui = SpreadsheetApp.getUi();
ui.createMenu("GED").addItem("Enregistrer le PDF ↓ ","savePDF").addToUi();
}
fonction savePDF()
{
// SÉLECTIONNEUR LA FEUILLE A SAUVEGARDE
const ss = SpreadsheetApp.getActiveSpreadsheet();
feuille const = ss.getActiveSheet();
//URL de SS ?
const ssUrl = ss.getUrl();
const sheetId=sheet.getSheetId();
const url = ssUrl.replace(/\/edit.*$/,'')
+ '/export?exportformat=pdf&format=pdf'
+ '&taille=LETTRE'
+ '&portrait=vrai'
+ '&fitw=true'
+ ' &top_margin=0.50'
+ '&bottom_margin=0.50'
+ '&marge_gauche=0.50'
+ '&
+ '&pagenum=false'
+ '&gridlines=false'
+ '&fzr=FAUX'
+ '&gid='+sheetId;
// CREER LE PDF A PARTIR DE L'URL
// var jeton = ScriptApp.getOAuthToken();
const docurl = UrlFetchApp.fetch(url);
const pdf = docurl.getAs('application/pdf');
fichier const = DriveApp.createFile(pdf);
// RÉCOLTER LES INFORMATIONS DANS LA FEUILLE POUR COMPOSER LE NOM DU DOCUMENT
const docId = feuille.getRange('B2').getValue();
const clientName = sheet.getRange('C3').getValue();
const docDate = feuille.getRange('D2').getValue();
//mise en forme de la date : mois-annee
const docDateMMYY = docDate.getMonth()+"-"+docDate. getFullYear();
// Concaténons le tout
const docName = docId+"_DEVIS_10Zaine_"+clientName+"_"+docDateMMYY ;
// RENOMMER ET COPIER LE PDF DANS LE BON DOSSIER
/*
ATTENTION IL FAUT ADAPTATEUR LE CODE AVEC L'ID DU DOSSIER DE DESTINATION
https://drive.google.com/open?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/
dossier const = DriveApp.getFolderById ("1OnsayBs90_G1NmBVbQALYNK_SmpWLWPF");
const finalFile = file.makeCopy(docName,folder);
//SUPPRIMER LE PDF ORIGINAL
file.setTrashed(true);
//RÉCUPÉRER LE LIEN
const docUrl = fichier_final.getUrl();
//ajouter l'urL dans la GED.
const sheetGed = ss.getSheetByName('GED');
sheetGed.appendRow([new Date(),docId,docUrl,docName]);
// envoyer le document au client
const clientEmail = sheet.getRange('C7').getValue();
const message = "Bonjour"+"<p>Veuillez trouver ci-joint le devis "+docName+"</p>"+"<a href='"+docUrl+"'>Cliquez ici pour ouvrir le devis.</a >" ;
MailApp.sendEmail({to:clientEmail , subject: "Votre devis "+docName, htmlBody:message}) ;
// ANNONCER LA RÉUSSITE DE CRÉATION DU DOCUMENT
const ui = SpreadsheetApp.getUi();
ui.alert('Bien joué\n\nLe devis '+ docId +' a bien été créé\nIl porte le nom : '+docName+'\n\nLe lien a été ajouté dans la GED.');
openWindow(docUrl);
}
// Ouvrir le document dans une nouvelle fenêtre :
let htmlContent = 'Le document a été créé. Cliquez ici pour l\'ouvrir'+
'<script>const thisWindowOpen = window.open("'+url+'" , "_blank" , "redimensionnable,barres de défilement,état"); </script>';
const html = HtmlService.createHtmlOutput(htmlContent)
.setHauteur(100)
.setWidth(500);
const ui = SpreadsheetApp.getUi();
ui.showModalDialog(html, "Ouverture en cours.");
}```

Categories

Resources