koreader / android-luajit-launcher

Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
MIT License
131 stars 85 forks source link

export device properties #383

Closed pazos closed 2 years ago

pazos commented 2 years ago

Same intent as #381 but exporting them all.

It makes possible to have very specific branches to workaround broken aosp devices, like

if android.prop.is_tolino then
    if android.prop.hardware ~= "whatever" or android.prop.model ~= "device" then
        -- stuff for all tolino devices except whatever/device
    end
end

exports manufacturer, brand, device, model, product and hardware as strings and boolean values for is_tolino and is_boyue as both brands use some non AOSP keycodes.


This change is Reviewable

pazos commented 2 years ago

Not sure what your intention is here :/

TOLINO is a catch-them all condition. It should work on all fws for all tolino devices, even on third party firmware like Ryogo-Z. It should not catch tolino devices that are not eink.

I won't plan to change that.

I'm also won't plan to change any other device check without a device owner reporting the corresponding stuff. And in that case I would add the new condition as an OR and never replace the check because that might screw things on previous devices that are already working fine.

hasezoey commented 2 years ago

Not sure what your intention is here :/ I won't plan to change that.

i though i might as well ask, because this would bring TOLINO and TOLINO_EPOS conditions (and coding style) in line with other things (like BOYUE)

as for updating the conditions on TOLINO, i though i also might as well ask to bring it in line with things like the BOYUE conditions and reduce the OR conditions because they will be similar

see https://github.com/koreader/android-luajit-launcher/blob/58cb8377c73c19542a3f3b81149c69d9e2100587/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt#L378-L381 https://github.com/koreader/android-luajit-launcher/blob/58cb8377c73c19542a3f3b81149c69d9e2100587/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt#L383-L386

https://github.com/koreader/android-luajit-launcher/blob/58cb8377c73c19542a3f3b81149c69d9e2100587/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt#L174-L175

NiLuJe commented 2 years ago

Not breaking backward compatibility with brittle crap like this unfortunately trumps coding style ;).