画面を暗くするAndroidアプリ厳選

目的

画面の明るさを最小設定より暗くみせる最小限の権限で動くAndroidアプリがほしかった.

結論

候補を次の2つに絞った.

方法

候補

まず候補はブラウザからgoogleplayを"暗く"で検索し表示された上から100個のurlを取得した.

https://play.google.com/store/apps/details?id=com.arrowsapp.nightscreen
https://play.google.com/store/apps/details?id=com.eyefilter.nightmode.bluelightfilter
https://play.google.com/store/apps/details?id=jp.ne.hardyinfinity.bluelightfilter.free
https://play.google.com/store/apps/details?id=giraffine.dimmer
https://play.google.com/store/apps/details?id=com.haxor
https://play.google.com/store/apps/details?id=info.papdt.blackblub
https://play.google.com/store/apps/details?id=hm.orz.mochi.windowdarker
https://play.google.com/store/apps/details?id=pt.bbarao.nightmode
https://play.google.com/store/apps/details?id=colorcompensation.photo.android.app.addquick
https://play.google.com/store/apps/details?id=com.mlhg.screenfilter
https://play.google.com/store/apps/details?id=com.ascendik.eyeshield
https://play.google.com/store/apps/details?id=nu.lower.brightness
https://play.google.com/store/apps/details?id=jp.kazupinklady.screenoff
https://play.google.com/store/apps/details?id=es.richardsolano.filter
https://play.google.com/store/apps/details?id=jp.codepanic.brightnessslider
https://play.google.com/store/apps/details?id=jp.co.yahoo.android.ysmarttool
https://play.google.com/store/apps/details?id=com.ruk.usastudio.usascreenbrightness
https://play.google.com/store/apps/details?id=jp.gr.java_conf.siroco.offscreen
https://play.google.com/store/apps/details?id=nightfilter.bluelightfilter.nightshift
https://play.google.com/store/apps/details?id=com.hisaxxxxxx.darknessscreen
https://play.google.com/store/apps/details?id=jp.gr.java_conf.fimyulab.brightnessclick
https://play.google.com/store/apps/details?id=filter.bluelight.bluelightfilter.ex
https://play.google.com/store/apps/details?id=biz.obake.team.touchprotector
https://play.google.com/store/apps/details?id=net.imoya.tukeppa
https://play.google.com/store/apps/details?id=com.fineapptech.owl
https://play.google.com/store/apps/details?id=com.linecorp.foodcam.android
https://play.google.com/store/apps/details?id=jp.gr.java_conf.gigavitts.litcon
https://play.google.com/store/apps/details?id=com.resensus.cloudfilter
https://play.google.com/store/apps/details?id=app.qrcode
https://play.google.com/store/apps/details?id=app.magicmirror
https://play.google.com/store/apps/details?id=jp.gr.java_conf.shimokura.BrightnessAdjuster
https://play.google.com/store/apps/details?id=jp.android.poro.privacyfilter
https://play.google.com/store/apps/details?id=com.skyclock.skyclock
https://play.google.com/store/apps/details?id=net.ailuro.android.settings.screen.brightness
https://play.google.com/store/apps/details?id=com.novtieapps.artdrawingpenideas
https://play.google.com/store/apps/details?id=jp.sisyou.kumikashi.sisnightfilter
https://play.google.com/store/apps/details?id=com.hardyinfinity.bluelightfilter.lite
https://play.google.com/store/apps/details?id=jp.kazupinklady.screenoffplus
https://play.google.com/store/apps/details?id=jp.co.sharp.android.picturemanager
https://play.google.com/store/apps/details?id=com.jojoagogogo.so
https://play.google.com/store/apps/details?id=jp.kazupinklady.bluelightprotect
https://play.google.com/store/apps/details?id=com.arara.q
https://play.google.com/store/apps/details?id=jp.kazupinklady.screenkeepplus
https://play.google.com/store/apps/details?id=com.fsilv.powerfulflashlightapp
https://play.google.com/store/apps/details?id=jp.codepanic.brightnesssliderpro
https://play.google.com/store/apps/details?id=com.planex.CameraIppatsu2
https://play.google.com/store/apps/details?id=com.kisaragi_millennium.karasawa
https://play.google.com/store/apps/details?id=jp.co.venturebank.lava.meditation
https://play.google.com/store/apps/details?id=com.ralabo.android.NightShooting
https://play.google.com/store/apps/details?id=jp.kazupinklady.hidescreenplus
https://play.google.com/store/apps/details?id=jp.kazupinklady.hidescreen
https://play.google.com/store/apps/details?id=com.naver.labs.translator
https://play.google.com/store/apps/details?id=com.adobe.adobephotoshopfix
https://play.google.com/store/apps/details?id=com.google.android.apps.wellbeing
https://play.google.com/store/apps/details?id=com.iglint.android.screenlockpro
https://play.google.com/store/apps/details?id=com.flanschifox.glimmer
https://play.google.com/store/apps/details?id=jp.kazupinklady.screenquickdimmer
https://play.google.com/store/apps/details?id=com.iwashisoft.privacyfilter
https://play.google.com/store/apps/details?id=com.espritline.sl
https://play.google.com/store/apps/details?id=com.sinyee.babybus.selfcare
https://play.google.com/store/apps/details?id=live.wallpaper.dark.black.cool.samsung
https://play.google.com/store/apps/details?id=org.stanwu.smartscreenlockpro
https://play.google.com/store/apps/details?id=com.sony.drbd.reader.other.jp
https://play.google.com/store/apps/details?id=com.asus.camera
https://play.google.com/store/apps/details?id=com.peace.SilentCamera
https://play.google.com/store/apps/details?id=com.philips.lighting.hue2
https://play.google.com/store/apps/details?id=com.knbmedia.findthemallfull
https://play.google.com/store/apps/details?id=com.google.android.apps.chromecast.app
https://play.google.com/store/apps/details?id=com.nos_network.ochaken_batt
https://play.google.com/store/apps/details?id=com.gazzapper.asteroids.vector.shooter
https://play.google.com/store/apps/details?id=com.adobe.lrmobile
https://play.google.com/store/apps/details?id=com.stefanvd.turnoffthelights
https://play.google.com/store/apps/details?id=jp.qricon.app_barcodereader
https://play.google.com/store/apps/details?id=com.amazing_create.android.andclip
https://play.google.com/store/apps/details?id=jp.happyon.android
https://play.google.com/store/apps/details?id=jp.torifuku.ondemandplayer
https://play.google.com/store/apps/details?id=com.knbmedia.findthemalldino
https://play.google.com/store/apps/details?id=jp.playpass.android.player
https://play.google.com/store/apps/details?id=com.nhnpixelcube.mummy
https://play.google.com/store/apps/details?id=com.karupyon.chikanstop
https://play.google.com/store/apps/details?id=net.hubalek.android.apps.reborn.pro
https://play.google.com/store/apps/details?id=com.soloseal.awesomealarmclock
https://play.google.com/store/apps/details?id=eu.notsobright.themes.blackgold
https://play.google.com/store/apps/details?id=com.flyersoft.moonreaderp
https://play.google.com/store/apps/details?id=jp.co.yahoo.android.sports.npb.textlive
https://play.google.com/store/apps/details?id=com.knbmedia.findthemalldinolite
https://play.google.com/store/apps/details?id=com.tappytaps.android.babymonitor3g
https://play.google.com/store/apps/details?id=com.knbmedia.findthemall
https://play.google.com/store/apps/details?id=com.azamsoft_cantos_do_canario_hd
https://play.google.com/store/apps/details?id=jp.softbank.mb.basketball
https://play.google.com/store/apps/details?id=jp.moviecam_p
https://play.google.com/store/apps/details?id=com.vito.lux
https://play.google.com/store/apps/details?id=jp.co.unbalance.android.gocsdl
https://play.google.com/store/apps/details?id=jp.nicovideo.nicobox
https://play.google.com/store/apps/details?id=jp.co.sharp.hms.smartlink
https://play.google.com/store/apps/details?id=com.square_enix.android_googleplay.ffxivcomapp_j
https://play.google.com/store/apps/details?id=com.cookpad.android.activities
https://play.google.com/store/apps/details?id=jp.co.litalico.brushinghero
https://play.google.com/store/apps/details?id=jp.co.pepperfs.android
https://play.google.com/store/apps/details?id=com.night.die.horror.excape.game

webコンソールでこんなかんじで吐いた.

function uniq(array) {
  //https://qiita.com/piroor/items/02885998c9f76f45bfa0
  const knownElements = {};
  const uniquedArray = [];
  for (let i = 0, maxi = array.length; i < maxi; i++) {
    if (array[i] in knownElements)
      continue;
    uniquedArray.push(array[i]);
    knownElements[array[i]] = true;
  }
  return uniquedArray;
};
uniq(Array.from(document.querySelectorAll('a'))
  .map(x => x.href)
  .filter(x => RegExp('/store/apps/details').test(x)))

idやclassが難読化されていてうまく参照できない.

権限確認

各アプリに必要な権限を確認した. node上でヘッドレスchromeを用いたスクレイピングができるpuppeteerを用いるスクリプトを書いた. 短時間で雑に書いたので要素検出は内部のテキストで, ポップアップの待ち時間は固定秒とした. 次のスクリプトを実行するとurlsの順序で権限文字列の配列が標準出力に吐き出される.

const puppeteer = require('puppeteer');

const urls = [
  "https://play.google.com/store/apps/details?id=net.hubalek.android.apps.reborn.pro",
  "https://play.google.com/store/apps/details?id=com.soloseal.awesomealarmclock",
  "https://play.google.com/store/apps/details?id=eu.notsobright.themes.blackgold",
  "https://play.google.com/store/apps/details?id=com.flyersoft.moonreaderp",
  "https://play.google.com/store/apps/details?id=jp.co.yahoo.android.sports.npb.textlive",
  "https://play.google.com/store/apps/details?id=com.knbmedia.findthemalldinolite",
  "https://play.google.com/store/apps/details?id=com.tappytaps.android.babymonitor3g",
  "https://play.google.com/store/apps/details?id=com.knbmedia.findthemall",
  "https://play.google.com/store/apps/details?id=com.azamsoft_cantos_do_canario_hd",
  "https://play.google.com/store/apps/details?id=jp.softbank.mb.basketball",
  "https://play.google.com/store/apps/details?id=jp.moviecam_p",
  "https://play.google.com/store/apps/details?id=com.vito.lux",
  "https://play.google.com/store/apps/details?id=jp.co.unbalance.android.gocsdl",
  "https://play.google.com/store/apps/details?id=jp.nicovideo.nicobox",
  "https://play.google.com/store/apps/details?id=jp.co.sharp.hms.smartlink",
  "https://play.google.com/store/apps/details?id=com.square_enix.android_googleplay.ffxivcomapp_j",
  "https://play.google.com/store/apps/details?id=com.cookpad.android.activities",
  "https://play.google.com/store/apps/details?id=jp.co.litalico.brushinghero",
  "https://play.google.com/store/apps/details?id=jp.co.pepperfs.android",
  "https://play.google.com/store/apps/details?id=com.night.die.horror.excape.game"];

(async () => {
  const browser = await puppeteer.launch({headless: true, args: [
    '--no-sandbox',
    '--disable-setuid-sandbox',
    '--lang=ja,en-US;q=0.9,en;q=0.8']});
  try{
    const pages = await browser.pages();
    const page = pages[0];
    for(var u of urls){
      const auth = await fetch(page, u);
      console.log(auth);
    }
  }catch(e){
    throw e;
  }finally{
    await browser.close();
  }
})();

async function fetch(page, url){
  await page.goto(url, {waitUntil: 'domcontentloaded'});
  await page.evaluate(() => {
    Array.from(document.querySelectorAll('a'))
      .filter(x => RegExp('詳細を表示').test(x.textContent))
      .slice(-1)[0]
      .click();
  });
  await page.waitFor(4000);
  const xs = await page.evaluate(() => {
    const c =  Array.from(document.querySelectorAll('div'))
      .filter(x => RegExp('このアプリには次の権限が必要です').test(x.textContent))
      .slice(-1)[0]
      .parentNode;
    return Array.from(c.querySelectorAll('li')).map(x => x.textContent);
  });
  return xs;
}

権限が少ない順でソート

吐いてしまったものをパースするのはめんどうなので, 吐き出したものをa.txtに保存後, テキストエディタで置換し配列の配列にした. (全アプリの全権限文字列を文字列の配列の配列としテキストに) tmpは100個のurlが改行区切りで書かれた平文テキストである. urlと権限を抱き合わせソートした.

const fs = require('fs');

(function(){
  const a = fs.readFileSync('tmp', 'utf8');
  const b = fs.readFileSync('a.txt', 'utf8');
  const urls = a.split('\n').slice(0, 100);
  const ps = eval(b);
  const zip = (arr1, arr2) => arr1.map((x, i) => [x, arr2[i]]);
  const len = zip(urls, ps.map(x => x.length));
  const slen = len.sort((a, b) => a[1] - b[1]);
  for(var x of slen)
    console.log(x[1], x[0]);
})();

このスクリプトを実行し次の出力が得られた.

0 'https://play.google.com/store/apps/details?id=eu.notsobright.themes.blackgold'
1 'https://play.google.com/store/apps/details?id=com.haxor'
1 'https://play.google.com/store/apps/details?id=jp.kazupinklady.screenoff'
1 'https://play.google.com/store/apps/details?id=com.ruk.usastudio.usascreenbrightness'
1 'https://play.google.com/store/apps/details?id=jp.gr.java_conf.fimyulab.brightnessclick'
1 'https://play.google.com/store/apps/details?id=net.imoya.tukeppa'
1 'https://play.google.com/store/apps/details?id=jp.gr.java_conf.gigavitts.litcon'
1 'https://play.google.com/store/apps/details?id=jp.kazupinklady.screenquickdimmer'
2 'https://play.google.com/store/apps/details?id=net.ailuro.android.settings.screen.brightness'
2 'https://play.google.com/store/apps/details?id=jp.kazupinklady.screenoffplus'
2 'https://play.google.com/store/apps/details?id=jp.kazupinklady.bluelightprotect'
2 'https://play.google.com/store/apps/details?id=jp.kazupinklady.hidescreen'
2 'https://play.google.com/store/apps/details?id=com.night.die.horror.excape.game'
3 'https://play.google.com/store/apps/details?id=hm.orz.mochi.windowdarker'
3 'https://play.google.com/store/apps/details?id=com.mlhg.screenfilter'
3 'https://play.google.com/store/apps/details?id=com.hisaxxxxxx.darknessscreen'
3 'https://play.google.com/store/apps/details?id=biz.obake.team.touchprotector'
3 'https://play.google.com/store/apps/details?id=jp.sisyou.kumikashi.sisnightfilter'
3 'https://play.google.com/store/apps/details?id=jp.kazupinklady.screenkeepplus'
3 'https://play.google.com/store/apps/details?id=com.karupyon.chikanstop'
4 'https://play.google.com/store/apps/details?id=giraffine.dimmer'
4 'https://play.google.com/store/apps/details?id=info.papdt.blackblub'
4 'https://play.google.com/store/apps/details?id=com.jojoagogogo.so'
4 'https://play.google.com/store/apps/details?id=jp.kazupinklady.hidescreenplus'
4 'https://play.google.com/store/apps/details?id=com.iwashisoft.privacyfilter'
4 'https://play.google.com/store/apps/details?id=jp.torifuku.ondemandplayer'
4 'https://play.google.com/store/apps/details?id=jp.nicovideo.nicobox'
5 'https://play.google.com/store/apps/details?id=com.ascendik.eyeshield'
5 'https://play.google.com/store/apps/details?id=jp.gr.java_conf.siroco.offscreen'
5 'https://play.google.com/store/apps/details?id=org.stanwu.smartscreenlockpro'
5 'https://play.google.com/store/apps/details?id=jp.softbank.mb.basketball'
5 'https://play.google.com/store/apps/details?id=com.square_enix.android_googleplay.ffxivcomapp_j'
6 'https://play.google.com/store/apps/details?id=nu.lower.brightness'
6 'https://play.google.com/store/apps/details?id=jp.codepanic.brightnessslider'
6 'https://play.google.com/store/apps/details?id=jp.codepanic.brightnesssliderpro'
6 'https://play.google.com/store/apps/details?id=com.flanschifox.glimmer'
6 'https://play.google.com/store/apps/details?id=com.sinyee.babybus.selfcare'
6 'https://play.google.com/store/apps/details?id=com.gazzapper.asteroids.vector.shooter'
6 'https://play.google.com/store/apps/details?id=com.azamsoft_cantos_do_canario_hd'
6 'https://play.google.com/store/apps/details?id=jp.co.litalico.brushinghero'
7 'https://play.google.com/store/apps/details?id=com.arrowsapp.nightscreen'
7 'https://play.google.com/store/apps/details?id=es.richardsolano.filter'
7 'https://play.google.com/store/apps/details?id=filter.bluelight.bluelightfilter.ex'
7 'https://play.google.com/store/apps/details?id=jp.gr.java_conf.shimokura.BrightnessAdjuster'
7 'https://play.google.com/store/apps/details?id=com.soloseal.awesomealarmclock'
7 'https://play.google.com/store/apps/details?id=jp.moviecam_p'
8 'https://play.google.com/store/apps/details?id=pt.bbarao.nightmode'
8 'https://play.google.com/store/apps/details?id=colorcompensation.photo.android.app.addquick'
8 'https://play.google.com/store/apps/details?id=jp.android.poro.privacyfilter'
8 'https://play.google.com/store/apps/details?id=com.amazing_create.android.andclip'
9 'https://play.google.com/store/apps/details?id=jp.co.unbalance.android.gocsdl'
10 'https://play.google.com/store/apps/details?id=nightfilter.bluelightfilter.nightshift'
10 'https://play.google.com/store/apps/details?id=com.resensus.cloudfilter'
10 'https://play.google.com/store/apps/details?id=com.skyclock.skyclock'
10 'https://play.google.com/store/apps/details?id=com.novtieapps.artdrawingpenideas'
10 'https://play.google.com/store/apps/details?id=com.kisaragi_millennium.karasawa'
11 'https://play.google.com/store/apps/details?id=app.magicmirror'
11 'https://play.google.com/store/apps/details?id=com.stefanvd.turnoffthelights'
12 'https://play.google.com/store/apps/details?id=com.fsilv.powerfulflashlightapp'
12 'https://play.google.com/store/apps/details?id=com.espritline.sl'
12 'https://play.google.com/store/apps/details?id=live.wallpaper.dark.black.cool.samsung'
12 'https://play.google.com/store/apps/details?id=jp.co.yahoo.android.sports.npb.textlive'
13 'https://play.google.com/store/apps/details?id=jp.ne.hardyinfinity.bluelightfilter.free'
13 'https://play.google.com/store/apps/details?id=com.hardyinfinity.bluelightfilter.lite'
13 'https://play.google.com/store/apps/details?id=com.philips.lighting.hue2'
13 'https://play.google.com/store/apps/details?id=jp.co.pepperfs.android'
14 'https://play.google.com/store/apps/details?id=com.eyefilter.nightmode.bluelightfilter'
14 'https://play.google.com/store/apps/details?id=com.ralabo.android.NightShooting'
14 'https://play.google.com/store/apps/details?id=com.adobe.adobephotoshopfix'
14 'https://play.google.com/store/apps/details?id=com.knbmedia.findthemallfull'
14 'https://play.google.com/store/apps/details?id=com.knbmedia.findthemalldino'
14 'https://play.google.com/store/apps/details?id=com.knbmedia.findthemalldinolite'
14 'https://play.google.com/store/apps/details?id=com.knbmedia.findthemall'
15 'https://play.google.com/store/apps/details?id=app.qrcode'
15 'https://play.google.com/store/apps/details?id=com.iglint.android.screenlockpro'
15 'https://play.google.com/store/apps/details?id=com.nos_network.ochaken_batt'
15 'https://play.google.com/store/apps/details?id=jp.playpass.android.player'
15 'https://play.google.com/store/apps/details?id=com.cookpad.android.activities'
16 'https://play.google.com/store/apps/details?id=com.fineapptech.owl'
16 'https://play.google.com/store/apps/details?id=jp.co.venturebank.lava.meditation'
16 'https://play.google.com/store/apps/details?id=jp.happyon.android'
16 'https://play.google.com/store/apps/details?id=com.flyersoft.moonreaderp'
16 'https://play.google.com/store/apps/details?id=com.tappytaps.android.babymonitor3g'
17 'https://play.google.com/store/apps/details?id=com.linecorp.foodcam.android'
17 'https://play.google.com/store/apps/details?id=com.adobe.lrmobile'
18 'https://play.google.com/store/apps/details?id=com.sony.drbd.reader.other.jp'
18 'https://play.google.com/store/apps/details?id=com.peace.SilentCamera'
19 'https://play.google.com/store/apps/details?id=com.google.android.apps.wellbeing'
19 'https://play.google.com/store/apps/details?id=net.hubalek.android.apps.reborn.pro'
20 'https://play.google.com/store/apps/details?id=com.vito.lux'
21 'https://play.google.com/store/apps/details?id=com.planex.CameraIppatsu2'
21 'https://play.google.com/store/apps/details?id=com.naver.labs.translator'
21 'https://play.google.com/store/apps/details?id=jp.co.sharp.hms.smartlink'
22 'https://play.google.com/store/apps/details?id=com.arara.q'
25 'https://play.google.com/store/apps/details?id=com.nhnpixelcube.mummy'
26 'https://play.google.com/store/apps/details?id=jp.co.sharp.android.picturemanager'
26 'https://play.google.com/store/apps/details?id=com.asus.camera'
27 'https://play.google.com/store/apps/details?id=com.google.android.apps.chromecast.app'
28 'https://play.google.com/store/apps/details?id=jp.qricon.app_barcodereader'
40 'https://play.google.com/store/apps/details?id=jp.co.yahoo.android.ysmarttool'

権限が一つ以下のアプリから画面を暗くする用途に合致するアプリは

の4つだった. このうち2つは権限"modify system settings"を持っていったため除外し, 最終的に権限"draw over other apps"のみを持つ次の2つが候補として残った.

記事を書いた後に実際にインストールして使用感を確かめてみる.