Updated Bob's patch, which was against 1.8.1, to 1.8.3.
This fixes both RC bugs, uploading a NMU hoping it's not too late...

diff --git a/debian/changelog b/debian/changelog
index e94d50a..965efd3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+pepperflashplugin-nonfree (1.8.4) unstable; urgency=medium
+
+  [ Bob Proulx ]
+  * Patched to use Adobe upstream rather than Google.
+  * Inspired by the patch provided in Bug#833741#15 by Kristian Klausen
+    but rewritten.  Closes: #833741.
+  * Adds in 32-bit support.
+  
+  [ Yann Dirson ]
+  * Non-maintainer upload.
+  * Updated patch for 1.8.3
+
+ -- Yann Dirson <dir...@debian.org>  Sat, 14 Jan 2017 18:57:25 +0100
+
 pepperflashplugin-nonfree (1.8.3) unstable; urgency=medium
 
   * update-pepperflashplugin-nonfree:
diff --git a/debian/control b/debian/control
index 3e35edf..0e4f28d 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,6 @@ Pre-Depends: ca-certificates
 Suggests: chromium, ttf-mscorefonts-installer, ttf-dejavu, ttf-xfree86-nonfree, hal
 Conflicts: libflash-mozplugin, chromium (<< 37.0.2062.120-4)
 Description: Pepper Flash Player - browser plugin
- This package will download Chrome from Google, and unpack it to make the
+ This package will download Chrome from Adobe, and unpack it to make the
  included Pepper Flash Player available for use with Chromium.  The end user
- license agreement is available at Google.
+ license agreement is available at Adobe.
diff --git a/debian/install b/debian/install
index c4a3e4d..2b54a10 100644
--- a/debian/install
+++ b/debian/install
@@ -1,3 +1,2 @@
 update-pepperflashplugin-nonfree usr/sbin/
-pubkey-google.txt usr/lib/pepperflashplugin-nonfree/
 debian/etc/chromium.d/pepperflashplugin-nonfree etc/chromium.d/
diff --git a/debian/postinst b/debian/postinst
index 531d6dd..f7c7051 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -5,6 +5,9 @@ set -e
 case "$1" in
     configure)
 	update-pepperflashplugin-nonfree --install --fast || true
+	# Clean up the old Google debs as we are now using Adobe tar.gz files.
+	rm -rf /var/cache/pepperflashplugin-nonfree/*.deb
+	rm -rf /var/cache/pepperflashplugin-nonfree/latest-stable-verified.txt
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/update-pepperflashplugin-nonfree b/update-pepperflashplugin-nonfree
index 62aceb8..39784c6 100755
--- a/update-pepperflashplugin-nonfree
+++ b/update-pepperflashplugin-nonfree
@@ -17,12 +17,6 @@
 
 set -e
 
-return_0() {
-	return 0
-}
-
-trap "return_0" 0
-
 die_hard() {
 	echo "ERROR: $1" >&2
 	echo "More information might be available at:" >&2
@@ -30,7 +24,7 @@ die_hard() {
 	exit 1
 }
 
-[ `id -u` = "0" ] || die_hard "must be root"
+[ "$(id -u)" = "0" ] || die_hard "must be root"
 
 show_usage() {
 	echo "Usage:"
@@ -43,18 +37,16 @@ show_usage() {
 	exit 1
 }
 
-getopt_temp=`getopt -o iusfvq --long install,uninstall,status,fast,verbose,quiet,beta,unstable,unverified \
-	-n 'update-pepperflashplugin-nonfree' -- "$@"` || show_usage
-eval set -- "$getopt_temp" || show_usage
+getopt_temp=$(getopt -o iusfvq --long install,uninstall,status,fast,verbose,quiet \
+	-n 'update-pepperflashplugin-nonfree' -- "$@") || show_usage
+eval set -- "$getopt_temp"
 
 ACTION=none
 fast=no
 verbose=no
 quiet=no
-variant=stable
-verified=yes
 
-while [ true ]
+while [ $# -gt 0 ]
 do
 	case "$1" in
 		-i|--install)
@@ -81,18 +73,6 @@ do
 			quiet=yes
 			shift
 			;;
-		--beta)
-			variant=beta
-			shift
-			;;
-		--unstable)
-			variant=unstable
-			shift
-			;;
-		--unverified)
-			verified=no
-			shift
-			;;
 		--)
 			shift
 			break
@@ -109,106 +89,34 @@ done
 
 [ "$verbose" != "yes" ] || echo "options : $getopt_temp"
 
-latestfile=latest-$variant-verified.txt
-[ "$verified" != "no" ] || latestfile=latest-$variant.txt
-
-UNPACKDIR=`mktemp -d /tmp/pepperflashplugin-nonfree.XXXXXXXXXX` || die_hard "mktemp failed"
-echo "$UNPACKDIR" | grep -q "^/tmp/pepperflashplugin-nonfree\." || die_hard "paranoia"
-cd "$UNPACKDIR" || die_hard "cd failed"
-
-[ "$verbose" != "yes" ] || echo "temporary directory: $UNPACKDIR"
-
-do_cleanup() {
-	[ "$verbose" != "yes" ] || echo "cleaning up temporary directory $UNPACKDIR ..."
-	cd /
-	echo "$UNPACKDIR" | grep -q "^/tmp/pepperflashplugin-nonfree\." || die_hard "paranoia"
-	rm -rf "$UNPACKDIR"
-}
-
-die_hard_with_a_cleanup() {
-	return_0
-	do_cleanup
-	die_hard "$1"
-}
-
-trap "die_hard_with_a_cleanup interrupted" INT
+wgetquiet='-q'
+wgetfast='-t 3 -T 15'
+wgetprogress='-v --progress=dot:default'
+[ "$quiet" != "no" ] || wgetquiet=""
+[ "$fast" != "no" ] || wgetfast=""
+wgetoptions="$wgetquiet $wgetfast $wgetprogress"
+
+arch=""
+case $(dpkg --print-architecture) in
+	amd64)	arch="x86_64" ;;
+	i?86)	arch="i386" ;;
+	*)
+		die_hard "unsupported architectures" ;;
+esac
 
 cachedir=/var/cache/pepperflashplugin-nonfree
 
-wgetquiet=' -q '
-wgetfast='-t 3 -T 15 '
-wgetalways=' -nd -P . '
-wgetprogress=' -v --progress=dot:default '
-
-if [ "$ACTION" = "--install" -o "$ACTION" = "--status" ]
+upstream=""
+installed=""
+if [ "$ACTION" = "--install" ] || [ "$ACTION" = "--status" ]
 then
-	installed=`strings /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so 2> /dev/null | grep LNX | cut -d ' ' -f 2 | sed -e "s/,/./g"`
-
-	[ ! -f $cachedir/$latestfile ] || [ `wc -l $cachedir/$latestfile | cut -f 1 -d ' '` -eq 2 ] || rm $cachedir/$latestfile
-
-	if [ -f $cachedir/$latestfile ]
+	if [ -f /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so ]
 	then
-		chromeversion=`head -n 1 $cachedir/$latestfile`
-		flashversion=`tail -n 1 $cachedir/$latestfile`
-	else
-		chromeversion=0
-		flashversion=0
-	fi
-
-	mkdir -p var/lib/apt/lists var/cache/apt/archives etc/apt/apt.conf.d etc/apt/preferences.d
-
-	cat > apt.conf <<-EOF
-	Dir ".";
-	Dir::Etc::trusted "pubring.gpg";
-	Debug::NoLocking "true";
-	APT::Sandbox::User "root";
-	Dir::State::Status "/var/lib/dpkg/status";
-	EOF
-
-	arch=`dpkg --print-architecture`
-
-	cat > etc/apt/sources.list <<-EOF
-	deb [arch=$arch] http://dl.google.com/linux/chrome/deb/ stable main
-	EOF
-
-	gpg --quiet --no-permission-warning --homedir "etc/apt" --import /usr/lib/pepperflashplugin-nonfree/pubkey-google.txt
-
-	[ "$verbose" != "yes" ] || echo "doing apt-get update on google repository"
-	stdouterr=`APT_CONFIG=apt.conf apt-get --quiet --quiet update 2>&1 || true`
-	# If there anything other than warnings die:
-	[ -z "$(echo "$stdouterr" | grep -v "^W:")" ] || die_hard_with_a_cleanup "failed to retrieve status information from google : $stdouterr"
-	# Otherwise echo the warnings:
-	[ "$stdouterr" = "" ] || echo "WARNING: $stdouterr"
-
-	newchromeversion=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^Version: " | sed -e "s,^Version: ,,"`
-	poolfile=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^Filename: " | sed -e "s,^Filename: ,,"`
-	deburl="http://dl.google.com/linux/chrome/deb/$poolfile";
-	debfile=`echo $poolfile|sed -e "s,.*/,,"`
-	debsize=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^Size: " | sed -e "s,^Size: ,,"`
-	debsha256=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^SHA256: " | sed -e "s,^SHA256: ,,"`
-	debsha1=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^SHA1: " | sed -e "s,^SHA1: ,,"`
-	debmd5=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^MD5sum: " | sed -e "s,^MD5sum: ,,"`
-
-	if [ "$chromeversion" = "$newchromeversion" ]
-	then
-		upstream=$flashversion
-	else
-		downloadurl="http://people.debian.org/~bartm/pepperflashplugin-nonfree/$latestfile";
-		wgetoptions="$wgetquiet $wgetalways"
-		[ "$fast" != "yes" ] || wgetoptions="$wgetoptions $wgetfast"
-
-		[ "$verbose" != "yes" ] || echo "downloading $downloadurl"
-		HOME=/root wget $wgetoptions $downloadurl || die_hard_with_a_cleanup "wget failed to download $downloadurl"
-
-		[ `wc -l $latestfile | cut -f 1 -d ' '` -eq 2 ] || die_hard_with_a_cleanup "cannot use contents of $downloadurl"
-
-		mv $latestfile $cachedir
-
-		chromeversion=`head -n 1 $cachedir/$latestfile`
-		flashversion=`tail -n 1 $cachedir/$latestfile`
-
-		upstream=$flashversion
+		installed=$(strings /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so | awk '/LNX/{gsub(/,/,".");print$2}')
 	fi
+	[ "$verbose" != "yes" ] || echo "getting version of upstream"
+	upstream=$(HOME=/root wget -q -O- "https://get.adobe.com/flashplayer/webservices/json/?platform_type=Linux&platform_arch=$arch&browser_dist=Chrome"; | tr , '\n' | awk -F: '/"[Vv][Ee][Rr][Ss][Ii][Oo][Nn]":/{gsub(/ *",*/,"",$2);print$2;exit}')
+	[ "$upstream" != "" ] || die_hard "failed to determine upstream version"
 fi
 
 case "$ACTION" in
@@ -216,65 +124,39 @@ case "$ACTION" in
 	--install)
 		[ "$verbose" != "yes" ] || echo "selected action = $ACTION"
 
-		[ "$upstream" != "" ] || die_hard_with_a_cleanup "failed to determine upstream version"
-
-		if [ "$installed" != "" -a "$upstream" != "" -a "$installed" = "$upstream" ]
+		if [ "$upstream" != "" ] && [ "$installed" != "" ] && [ "$upstream" = "$installed" ]
 		then
 
 			[ "$verbose" != "yes" ] || echo "upstream version $upstream is already installed"
 
 		else
-
-			if [ -f $cachedir/$debfile ]
+			cached=""
+			if [ -f /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so ] && [ -f /var/cache/pepperflashplugin-nonfree/manifest.json ]
 			then
-				cp -p $cachedir/$debfile .
+				cached=$(strings /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so | awk '/LNX/{gsub(/,/,".");print$2}')
 			fi
-	
-			if [ ! -f $debfile ]
+			if [ "$cached" != "" ] && [ "$cached" = "$upstream" ]
 			then
-				wgetoptions="$wgetalways $wgetprogress"
-				[ "$quiet" != "yes" ] || wgetoptions="$wgetquiet $wgetalways"
-				[ "$fast" != "yes" ] || wgetoptions="$wgetoptions $wgetfast"
-				wgetoptions="$wgetoptions -O $UNPACKDIR/$debfile" # to change wget message : Saving to ...
-	
-				HOME=/root wget $wgetoptions $deburl || die_hard_with_a_cleanup "wget failed to download $deburl"
-	
-				[ `stat --format=%s $debfile` = "$debsize" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong size"
-				[ `sha256sum $debfile|sed -e "s, .*,,"` = "$debsha256" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong sha256sum"
-				[ `sha1sum $debfile|sed -e "s, .*,,"` = "$debsha1" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong sha1sum"
-				[ `md5sum $debfile|sed -e "s, .*,,"` = "$debmd5" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong md5sum"
+				[ "$verbose" != "yes" ] || echo "using /var/cache/pepperflashplugin-nonfree copies"
+				cp /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so /usr/lib/pepperflashplugin-nonfree/
+				cp /var/cache/pepperflashplugin-nonfree/manifest.json /usr/lib/pepperflashplugin-nonfree/
+			else
+				url="https://fpdownload.adobe.com/pub/flashplayer/pdc/$upstream/flash_player_ppapi_linux.$arch.tar.gz";
+				[ "$verbose" != "yes" ] || echo "downloading from $url"
+				mkdir -p /var/cache/pepperflashplugin-nonfree
+				HOME=/root wget $wgetoptions -O- "$url" | tar -xz -C /var/cache/pepperflashplugin-nonfree libpepflashplayer.so manifest.json
+				chown root:root /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so
+				chmod 644 /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so
+				chown root:root /var/cache/pepperflashplugin-nonfree/manifest.json
+				chmod 644 /var/cache/pepperflashplugin-nonfree/manifest.json
+				cached=$(strings /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so | awk '/LNX/{gsub(/,/,".");print$2}')
+				[ "$cached" = "$upstream" ] || die_hard "failed to download expected version $upstream, downloaded $cached"
+				cp /var/cache/pepperflashplugin-nonfree/libpepflashplayer.so /usr/lib/pepperflashplugin-nonfree/
+				cp /var/cache/pepperflashplugin-nonfree/manifest.json /usr/lib/pepperflashplugin-nonfree/
 			fi
-	
-			dpkg-deb -x $debfile unpackchrome
-
-			sofile=unpackchrome/opt/google/chrome/PepperFlash/libpepflashplayer.so
-			[ -e $sofile ] || sofile=unpackchrome/opt/google/chrome-unstable/PepperFlash/libpepflashplayer.so
-			[ -e $sofile ] || sofile=unpackchrome/opt/google/chrome-beta/PepperFlash/libpepflashplayer.so
-			[ -e $sofile ] || sofile=unpackchrome/opt/google/chrome/PepperFlash/libpepflashplayer.so
-
-			mv -f $sofile /usr/lib/pepperflashplugin-nonfree
-			chown root:root /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so
-			chmod 644 /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so
-
-			jsonfile=unpackchrome/opt/google/chrome/PepperFlash/manifest.json
-			[ -e $jsonfile ] || jsonfile=unpackchrome/opt/google/chrome-unstable/PepperFlash/manifest.json
-			[ -e $jsonfile ] || jsonfile=unpackchrome/opt/google/chrome-beta/PepperFlash/manifest.json
-			[ -e $jsonfile ] || jsonfile=unpackchrome/opt/google/chrome/PepperFlash/manifest.json
-
-			if [ -e $jsonfile ]
-			then
-				mv -f $jsonfile /usr/lib/pepperflashplugin-nonfree
-				chown root:root /usr/lib/pepperflashplugin-nonfree/manifest.json
-				chmod 644 /usr/lib/pepperflashplugin-nonfree/manifest.json
-			fi
-
-			mv $debfile $cachedir
 		fi
 
 		[ "$verbose" != "yes" ] || echo "end of action $ACTION"
-
-		ls -1t /var/cache/pepperflashplugin-nonfree/*.deb|tail -n +3|xargs -r rm || true
-
 		;;
 
 	--uninstall)
@@ -300,14 +182,12 @@ case "$ACTION" in
 
 	*)
 
-		do_cleanup
 		show_usage
 
 		;;
 
 esac
 
-do_cleanup
-
 [ "$verbose" != "yes" ] || echo "end of update-pepperflashplugin-nonfree"
 
+exit 0

Reply via email to