1 //
2 // Copyright (C) 2020 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 // clang-format off
18 #include "native_bridge_support/vdso/interceptable_functions.h"
19
20 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getAlphaFlags);
21 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getAndroidBitmapFormat);
22 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getHeight);
23 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getMimeType);
24 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getWidth);
25 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_isAnimated);
26 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromAAsset);
27 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromBuffer);
28 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromFd);
29 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_decodeImage);
30 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_delete);
31 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getHeaderInfo);
32 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getMinimumStride);
33 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setAndroidBitmapFormat);
34 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setCrop);
35 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setTargetSize);
36 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setUnpremultipliedRequired);
37 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_compress);
38 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getDataSpace);
39 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getInfo);
40 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_lockPixels);
41 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_unlockPixels);
42
init_stub_library()43 static void __attribute__((constructor(0))) init_stub_library() {
44 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getAlphaFlags);
45 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getAndroidBitmapFormat);
46 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getHeight);
47 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getMimeType);
48 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getWidth);
49 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_isAnimated);
50 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromAAsset);
51 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromBuffer);
52 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromFd);
53 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_decodeImage);
54 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_delete);
55 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getHeaderInfo);
56 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getMinimumStride);
57 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setAndroidBitmapFormat);
58 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setCrop);
59 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setTargetSize);
60 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setUnpremultipliedRequired);
61 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_compress);
62 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getDataSpace);
63 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getInfo);
64 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_lockPixels);
65 INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_unlockPixels);
66 }
67 // clang-format on
68